Package com.kheops.jmap.client.tools
Class ToolPanListener
java.lang.Object
com.kheops.jmap.client.tools.ToolPanListener
- All Implemented Interfaces:
KSchedulerClient,MouseListener,MouseMotionListener,EventListener
public class ToolPanListener
extends Object
implements MouseMotionListener, MouseListener, KSchedulerClient
This tool verifies if the cursor is placed on one of the extremities of the view and verifies if the cursor
is left there for the specified delay value, if it is, it pans the view in the cursor position direction.
To use this tool, you simply create a new instance, and call the start() method. The start will add the
ToolPanListener as a MouseListener and MouseMotionListener one the ViewManager and start the scheduler to
handle the delay.(the time it takes for the view to pan when the cursor is over one of the view borders)
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionToolPanListener(ViewManager viewManager) This creates a new instance of ToolPanListener with the default step and delay values.ToolPanListener(ViewManager viewManager, int delay, int step) This creates a new instance of ToolPanListener using the specified step and delay values. -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidvoidvoidvoidvoidvoidschCallback(int jobId) This method is called when it is notify by the schedulervoidstart()Starts the ToolPanListener; adds itself as listener, and starts the scheduler.voidstop()
-
Field Details
-
DELAY
protected static int DELAY -
STEP
protected static int STEP
-
-
Constructor Details
-
ToolPanListener
This creates a new instance of ToolPanListener with the default step and delay values. NOTE: the method start() needs to be called explicitly for this tool to function- Parameters:
viewManager-
-
ToolPanListener
This creates a new instance of ToolPanListener using the specified step and delay values. NOTE: the method start() needs to be called explicitly for this tool to function- Parameters:
viewManager-delay- the delay in ms before the pan when the cursor is placed in a view extremetystep- the pan distance
-
-
Method Details
-
start
public void start()Starts the ToolPanListener; adds itself as listener, and starts the scheduler. -
stop
public void stop() -
mouseDragged
- Specified by:
mouseDraggedin interfaceMouseMotionListener
-
mouseMoved
- Specified by:
mouseMovedin interfaceMouseMotionListener
-
schCallback
public void schCallback(int jobId) This method is called when it is notify by the scheduler- Specified by:
schCallbackin interfaceKSchedulerClient- Parameters:
jobId- the corresponding job id- See Also:
-
mouseClicked
- Specified by:
mouseClickedin interfaceMouseListener
-
mouseEntered
- Specified by:
mouseEnteredin interfaceMouseListener
-
mouseExited
- Specified by:
mouseExitedin interfaceMouseListener
-
mousePressed
- Specified by:
mousePressedin interfaceMouseListener
-
mouseReleased
- Specified by:
mouseReleasedin interfaceMouseListener
-