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 Details

    • DELAY

      protected static int DELAY
    • STEP

      protected static int STEP
  • Constructor Details

    • ToolPanListener

      public ToolPanListener(ViewManager viewManager)
      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

      public ToolPanListener(ViewManager viewManager, int delay, int step)
      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 extremety
      step - the pan distance
  • Method Details