Package net.sf.freecol.client.gui.panel
Class DragListener
- java.lang.Object
-
- java.awt.event.MouseAdapter
-
- net.sf.freecol.client.gui.panel.DragListener
-
- All Implemented Interfaces:
java.awt.event.MouseListener
,java.awt.event.MouseMotionListener
,java.awt.event.MouseWheelListener
,java.util.EventListener
public final class DragListener extends java.awt.event.MouseAdapter
A DragListener should be attached to Swing components that have a TransferHandler attached. The DragListener will make sure that the Swing component to which it is attached is draggable (moveable to be precise).
-
-
Field Summary
Fields Modifier and Type Field Description private FreeColClient
freeColClient
The enclosing client.private static java.util.logging.Logger
logger
private static int
maxWindowHeight
The maximum numbers of pixels of the user's screen height before triggering the small flag.private FreeColPanel
parentPanel
The panel within which the drag occurs.private static boolean
small
Whether the user's screen height is smaller than the maximum height allowedprivate static int
windowHeight
The user's screen height.private boolean
windows
Enable windows workaround.
-
Constructor Summary
Constructors Constructor Description DragListener(FreeColClient freeColClient, FreeColPanel parentPanel)
The constructor to use.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
mousePressed(java.awt.event.MouseEvent e)
Gets called when the mouse was pressed on a Swing component that has this object as a MouseListener.
-
-
-
Field Detail
-
logger
private static final java.util.logging.Logger logger
-
maxWindowHeight
private static final int maxWindowHeight
The maximum numbers of pixels of the user's screen height before triggering the small flag.- See Also:
- Constant Field Values
-
windowHeight
private static final int windowHeight
The user's screen height.
-
small
private static final boolean small
Whether the user's screen height is smaller than the maximum height allowed
-
windows
private final boolean windows
Enable windows workaround.
-
freeColClient
private final FreeColClient freeColClient
The enclosing client.
-
parentPanel
private final FreeColPanel parentPanel
The panel within which the drag occurs.
-
-
Constructor Detail
-
DragListener
public DragListener(FreeColClient freeColClient, FreeColPanel parentPanel)
The constructor to use.- Parameters:
freeColClient
- TheFreeColClient
for the game.parentPanel
- The layered pane that contains the components to which a DragListener might be attached.
-
-
Method Detail
-
mousePressed
public void mousePressed(java.awt.event.MouseEvent e)
Gets called when the mouse was pressed on a Swing component that has this object as a MouseListener.- Specified by:
mousePressed
in interfacejava.awt.event.MouseListener
- Overrides:
mousePressed
in classjava.awt.event.MouseAdapter
- Parameters:
e
- The event that holds the information about the mouse click.
-
-