Package org.apache.batik.swing.gvt
Class AbstractPanInteractor
- java.lang.Object
-
- org.apache.batik.swing.gvt.InteractorAdapter
-
- org.apache.batik.swing.gvt.AbstractPanInteractor
-
- All Implemented Interfaces:
java.awt.event.KeyListener
,java.awt.event.MouseListener
,java.awt.event.MouseMotionListener
,java.util.EventListener
,Interactor
public abstract class AbstractPanInteractor extends InteractorAdapter
This class represents a pan interactor. To use it, just redefine theInteractorAdapter.startInteraction(java.awt.event.InputEvent)
method.
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
finished
Whether the interactor has finished.static java.awt.Cursor
PAN_CURSOR
The cursor for panning.protected java.awt.Cursor
previousCursor
To store the previous cursor.protected int
xCurrent
The mouse x current position.protected int
xStart
The mouse x start position.protected int
yCurrent
The mouse y current position.protected int
yStart
The mouse y start position.
-
Constructor Summary
Constructors Constructor Description AbstractPanInteractor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
endInteraction()
Tells whether the interactor has finished.void
mouseDragged(java.awt.event.MouseEvent e)
Invoked when a mouse button is pressed on a component and then dragged.void
mouseExited(java.awt.event.MouseEvent e)
Invoked when the mouse exits a component.void
mousePressed(java.awt.event.MouseEvent e)
Invoked when a mouse button has been pressed on a component.void
mouseReleased(java.awt.event.MouseEvent e)
Invoked when a mouse button has been released on a component.-
Methods inherited from class org.apache.batik.swing.gvt.InteractorAdapter
keyPressed, keyReleased, keyTyped, mouseClicked, mouseEntered, mouseMoved, startInteraction
-
-
-
-
Field Detail
-
PAN_CURSOR
public static final java.awt.Cursor PAN_CURSOR
The cursor for panning.
-
finished
protected boolean finished
Whether the interactor has finished.
-
xStart
protected int xStart
The mouse x start position.
-
yStart
protected int yStart
The mouse y start position.
-
xCurrent
protected int xCurrent
The mouse x current position.
-
yCurrent
protected int yCurrent
The mouse y current position.
-
previousCursor
protected java.awt.Cursor previousCursor
To store the previous cursor.
-
-
Method Detail
-
endInteraction
public boolean endInteraction()
Tells whether the interactor has finished.- Specified by:
endInteraction
in interfaceInteractor
- Overrides:
endInteraction
in classInteractorAdapter
-
mousePressed
public void mousePressed(java.awt.event.MouseEvent e)
Invoked when a mouse button has been pressed on a component.- Specified by:
mousePressed
in interfacejava.awt.event.MouseListener
- Overrides:
mousePressed
in classInteractorAdapter
-
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent e)
Invoked when a mouse button has been released on a component.- Specified by:
mouseReleased
in interfacejava.awt.event.MouseListener
- Overrides:
mouseReleased
in classInteractorAdapter
-
mouseExited
public void mouseExited(java.awt.event.MouseEvent e)
Invoked when the mouse exits a component.- Specified by:
mouseExited
in interfacejava.awt.event.MouseListener
- Overrides:
mouseExited
in classInteractorAdapter
-
mouseDragged
public void mouseDragged(java.awt.event.MouseEvent e)
Invoked when a mouse button is pressed on a component and then dragged. Mouse drag events will continue to be delivered to the component where the first originated until the mouse button is released (regardless of whether the mouse position is within the bounds of the component).- Specified by:
mouseDragged
in interfacejava.awt.event.MouseMotionListener
- Overrides:
mouseDragged
in classInteractorAdapter
-
-