|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.levigo.jadice.swing.tool.Tool com.levigo.jadice.swing.pageview.PanTool
public class PanTool
A tool supporting panning (moving the visible area) using the mouse. Panning is performed upon
all mouse motion events during which the modifier state matches the one set with
setActivationModifiers(int)
(this defaults to the left mouse button).
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.levigo.jadice.swing.tool.Tool |
---|
Tool.ActivationRequest |
Field Summary |
---|
Fields inherited from class com.levigo.jadice.swing.tool.Tool |
---|
DEFAULT_PRIORITY, MAX_PRIORITY, MIN_PRIORITY |
Constructor Summary | |
---|---|
PanTool()
|
Method Summary | |
---|---|
protected Tool.ActivationRequest |
getActivationFeedback(MouseEditEvent e)
Provide feedback for the user about what would happen, if the mouse were pressed at the current location. |
int |
getActivationModifiers()
Get the mask of modifier keys (Shift, Control, Alt etc.) and mouse buttons (left, right etc.) to be used to activate this tool. |
protected Tool.ActivationRequest |
getActivationRequestForMousePressed(MouseEditEvent e)
Return the auto-activation request for this this tool in response to the given mouse press. |
protected int |
getDispatchPriority()
Return the dispatch priority for this tool. |
protected void |
handleEditEvent(boolean isActive,
EditEvent e)
Handle the given EditEvent . |
protected void |
handleMouseDragged(MouseEditEvent e,
boolean isActive)
Invoked when a mouse button is pressed on a component and then dragged. |
protected void |
handleMousePressed(MouseEditEvent e,
boolean isActive)
Invoked when a mouse button has been pressed on a component. |
protected void |
handleMouseReleased(MouseEditEvent e,
boolean isActive)
Invoked when a mouse button has been released on a component. |
boolean |
isUseIdlePanModeCursor()
|
void |
setActivationModifiers(int activationModifiers)
Set the mask of modifier keys (Shift, Control, Alt etc.) and mouse buttons (left, right etc.) to be used to activate this tool. |
void |
setUseIdlePanModeCursor(boolean useIdlePanModeCursor)
Set whether to use the pan mode cursor ( Cursor.HAND_CURSOR when idle, i.e. |
Methods inherited from class com.levigo.jadice.swing.tool.Tool |
---|
contribute, getActivationRequest, getActivationRequestForKeyPressed, getActivationRequestForMouseDragged, getCursor, getManager, getRenderPriority, handleKeyPressed, handleKeyReleased, handleKeyTyped, handleMouseClicked, handleMouseEntered, handleMouseExited, handleMouseMoved, handleMouseWheelMoved, propagatePropertyChange, render, setActive, setCursor, setEnabled, setManager, setStatusFeedback |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PanTool()
Method Detail |
---|
protected int getDispatchPriority()
Tool
Tool.MIN_PRIORITY
...Tool.MAX_PRIORITY
.
The default priority is equal to Tool.MAX_PRIORITY
minus the render priority.
getDispatchPriority
in class Tool
protected void handleEditEvent(boolean isActive, EditEvent e)
Tool
EditEvent
. This method dispatches the edit event to the individual
handleXYZ()
-Methods. However, implementors may want and are allowed to override
this method in order to perform standard handling tasks common to all types of events.
handleEditEvent
in class Tool
isActive
- whether this tool is currently activee
- the eventprotected void handleMousePressed(MouseEditEvent e, boolean isActive)
Tool
handleMousePressed
in class Tool
isActive
- whether this tool is currently activeprotected Tool.ActivationRequest getActivationFeedback(MouseEditEvent e)
Tool
MouseEvent.MOUSE_MOVED
events. If this
method returns null
no feedback is provided at all.
The activation request returned from this method is the same object that is used during
Tool.getActivationRequestForKeyPressed(KeyEditEvent)
to signal the auto-activation
candidacy.
This method should only return an activation request if it will actually candidate for
auto-activation later on using Tool.getActivationRequestForMousePressed(MouseEditEvent)
or
Tool.getActivationRequestForMouseDragged(MouseEditEvent)
.
getActivationFeedback
in class Tool
protected Tool.ActivationRequest getActivationRequestForMousePressed(MouseEditEvent e)
Tool
Tool.ActivationRequest
, it becomes eligible for auto-activation.
However, the final decision about which tool will actually be activated is up to the
ToolActivationPolicy
used be the tool manager.
getActivationRequestForMousePressed
in class Tool
e
- the KeyEditEvent
Tool.ActivationRequest
or null
if the tool does not seek to be
auto-activated at this time.protected void handleMouseDragged(MouseEditEvent e, boolean isActive)
Tool
MOUSE_DRAGGED
events will continue to be delivered to the component where the drag
originated until the mouse button is released (regardless of whether the mouse position is
within the bounds of the component).
Due to platform-dependent Drag&Drop implementations, MOUSE_DRAGGED
events may
not be delivered during a native Drag&Drop operation.
handleMouseDragged
in class Tool
isActive
- whether this tool is currently activeprotected void handleMouseReleased(MouseEditEvent e, boolean isActive)
Tool
handleMouseReleased
in class Tool
isActive
- whether this tool is currently activepublic void setActivationModifiers(int activationModifiers)
InputEvent.getModifiersEx()
, i.e. it must use the InputEvent
constants
containing _DOWN_
in their name.
Default: use just the left mouse button.
setActivationModifiers
in interface ModifierActivated
ModifierActivated.setActivationModifiers(int)
public int getActivationModifiers()
getActivationModifiers
in interface ModifierActivated
ModifierActivated.setActivationModifiers(int)
public void setUseIdlePanModeCursor(boolean useIdlePanModeCursor)
Cursor.HAND_CURSOR
when idle, i.e. while the
button is not pressed, but a buttom press would initiate the pan mode. If true
,
the pan mode cursor is shown in idle mode, if false
it is still shown, but only
during the active panning gesture.
The default is false
.
useIdlePanModeCursor
- public boolean isUseIdlePanModeCursor()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |