|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.umd.cs.piccolo.event.PBasicInputEventHandler
edu.umd.cs.piccolo.event.PDragSequenceEventHandler
edu.umd.cs.piccolo.event.PZoomEventHandler
public class PZoomEventHandler
ZoomEventhandler provides event handlers for basic zooming of the canvas view with the right (third) button. The interaction is that the initial mouse press defines the zoom anchor point, and then moving the mouse to the right zooms with a speed proportional to the amount the mouse is moved to the right of the anchor point. Similarly, if the mouse is moved to the left, the the view is zoomed out.
On a Mac with its single mouse button one may wish to change the standard right mouse button zooming behavior. This can be easily done with the PInputEventFilter. For example to zoom with button one and shift you would do this:
zoomEventHandler.getEventFilter().setAndMask(InputEvent.BUTTON1_MASK |
InputEvent.SHIFT_MASK);
Constructor Summary | |
---|---|
PZoomEventHandler()
Creates a new zoom handler. |
Method Summary | |
---|---|
protected void |
dragActivityFirstStep(PInputEvent aEvent)
Override this method to get notified when the drag activity starts stepping. |
protected void |
dragActivityStep(PInputEvent aEvent)
During a drag sequence an activity is scheduled that runs continuously while the drag sequence is active. |
double |
getMaxScale()
Returns the maximum view magnification factor that this event handler is bound by. |
double |
getMinScale()
Returns the minimum view magnification factor that this event handler is bound by. |
protected java.lang.String |
paramString()
Returns a string representing the state of this node. |
void |
setMaxScale(double maxScale)
Sets the maximum view magnification factor that this event handler is bound by. |
void |
setMinScale(double minScale)
Sets the minimum view magnification factor that this event handler is bound by. |
Methods inherited from class edu.umd.cs.piccolo.event.PDragSequenceEventHandler |
---|
drag, dragActivityFinalStep, endDrag, getDragActivity, getMinDragStartDistance, getMousePressedCanvasPoint, isDragging, mouseDragged, mousePressed, mouseReleased, setIsDragging, setMinDragStartDistance, shouldStartDragInteraction, startDrag, startDragActivity, stopDragActivity |
Methods inherited from class edu.umd.cs.piccolo.event.PBasicInputEventHandler |
---|
acceptsEvent, getEventFilter, keyboardFocusGained, keyboardFocusLost, keyPressed, keyReleased, keyTyped, mouseClicked, mouseEntered, mouseExited, mouseMoved, mouseWheelRotated, mouseWheelRotatedByBlock, processEvent, setEventFilter, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PZoomEventHandler()
Method Detail |
---|
public double getMinScale()
public void setMinScale(double minScale)
minScale
is larger than
the current scale.
minScale
- the minimum scale, must not be negative.public double getMaxScale()
public void setMaxScale(double maxScale)
maxScale
is smaller than
the current scale. Use Double.MAX_VALUE to specify the largest possible scale.
maxScale
- the maximum scale, must not be negative.protected void dragActivityFirstStep(PInputEvent aEvent)
PDragSequenceEventHandler
dragActivityFirstStep
in class PDragSequenceEventHandler
protected void dragActivityStep(PInputEvent aEvent)
PDragSequenceEventHandler
dragActivityStep
in class PDragSequenceEventHandler
protected java.lang.String paramString()
null
.
paramString
in class PDragSequenceEventHandler
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |