Revision: 3561
Author: jfuerth
Date: Thu May 27 08:31:55 2010
Log: RESOLVED - bug 1515: Side Scrolling on mice that support them maps to
zooming in and out
http://trillian.sqlpower.ca/bugzilla/show_bug.cgi?id=1515
http://code.google.com/p/power-architect/source/detail?r=3561
Modified:
/trunk/src/main/java/ca/sqlpower/architect/swingui/PlayPen.java
/trunk/src/main/java/ca/sqlpower/architect/swingui/olap/OLAPEditSession.java
/trunk/src/main/java/ca/sqlpower/architect/swingui/olap/OLAPPlayPenFactory.java
=======================================
--- /trunk/src/main/java/ca/sqlpower/architect/swingui/PlayPen.java Thu May
20 14:57:45 2010
+++ /trunk/src/main/java/ca/sqlpower/architect/swingui/PlayPen.java Thu May
27 08:31:55 2010
@@ -53,8 +53,6 @@
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
-import java.awt.event.MouseWheelEvent;
-import java.awt.event.MouseWheelListener;
import java.awt.font.FontRenderContext;
import java.awt.geom.AffineTransform;
import java.awt.image.BufferedImage;
@@ -646,7 +644,6 @@
ppMouseListener = new PPMouseListener();
this.addMouseListener(ppMouseListener);
this.addMouseMotionListener(ppMouseListener);
- this.addMouseWheelListener(ppMouseListener);
cursorManager = new CursorManager(this);
dgl = new TablePaneDragGestureListener();
@@ -1009,17 +1006,6 @@
return ppScrollPane;
}
- /**
- * Sets the scrollPane that will be scrolled when the mouse wheel is
moved
- * for this PlayPen.
- *
- * @param ppScrollPane
- * The scrollPane to be scrolled when the mouse wheel is
moved
- */
- public void setScrollPane(Component ppScrollPane){
- this.ppScrollPane = ppScrollPane;
- }
-
/**
* Modifies the given point p in model space to apparent position in
screen
* space.
@@ -2405,7 +2391,7 @@
* rubber band selection and popup menu triggering.
*/
protected class PPMouseListener
- implements MouseListener, MouseMotionListener,
MouseWheelListener {
+ implements MouseListener, MouseMotionListener {
/**
@@ -2552,22 +2538,6 @@
}
}
}
-
- public void mouseWheelMoved(MouseWheelEvent e) {
- if ( (e.getModifiersEx() & InputEvent.SHIFT_DOWN_MASK)
!= 0 ) {
- if ( e.getWheelRotation() > 0 ) {
-
getMouseZoomInAction().actionPerformed(null);
- }
- else {
-
getMouseZoomOutAction().actionPerformed(null);
- }
- }
- else {
- MouseWheelListener[] ml =
getScrollPane().getMouseWheelListeners();
- for ( MouseWheelListener m : ml )
- m.mouseWheelMoved(e);
- }
- }
}
public Rectangle getRubberBand() {
=======================================
---
/trunk/src/main/java/ca/sqlpower/architect/swingui/olap/OLAPEditSession.java
Wed Apr 21 09:00:48 2010
+++
/trunk/src/main/java/ca/sqlpower/architect/swingui/olap/OLAPEditSession.java
Thu May 27 08:31:55 2010
@@ -300,7 +300,6 @@
frame.setJMenuBar(swingSession.getArchitectFrame().createNewMenuBar());
}
- OLAPPlayPenFactory.setupOLAPMouseWheelActions(pp, this);
OLAPPlayPenFactory.setupOLAPKeyboardActions(pp, this);
undoManager.rememberPosition();
=======================================
---
/trunk/src/main/java/ca/sqlpower/architect/swingui/olap/OLAPPlayPenFactory.java
Tue May 25 13:03:30 2010
+++
/trunk/src/main/java/ca/sqlpower/architect/swingui/olap/OLAPPlayPenFactory.java
Thu May 27 08:31:55 2010
@@ -182,25 +182,8 @@
im.put((KeyStroke)
oSession.getCreateLevelAction().getValue(Action.ACCELERATOR_KEY), "NEW
LEVEL"); //$NON-NLS-1$
am.put("NEW LEVEL", oSession.getCreateLevelAction()); //$NON-NLS-1$
-}
-
- /**
- * Sets up scroll wheel actions on the playpen. This is done
- * separately because the wheelMouseMoved event requires the scroll
pane be
- * built before it can work. The ZoomIn and ZoomOut actions also need a
- * playpen before the actions can be created.
- *
- * @param pp
- * The playpen to register the mouse wheel actions on.
- * @param oSession
- * The session pp belongs to, also the session that owns the
- * actions to register and ScrollPane.
- */
- public static void setupOLAPMouseWheelActions(PlayPen pp,
OLAPEditSession oSession) {
- pp.setMouseZoomInAction(oSession.getZoomInAction());
- pp.setMouseZoomOutAction(oSession.getZoomOutAction());
- pp.setScrollPane(oSession.getPPScrollPane());
- }
+ }
+
/**
* An instance of this OLAPChildListener will listen to tree model
structural
* changes.