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).
Method Summary |
javax.swing.JPopupMenu |
getGoodsMenu(GoodsLabel goodsLabel)
|
javax.swing.JPopupMenu |
getUnitMenu(UnitLabel unitLabel)
|
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. |
Methods inherited from class java.awt.event.MouseAdapter |
mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mouseReleased, mouseWheelMoved |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DragListener
public DragListener(FreeColPanel parentPanel)
- The constructor to use.
- Parameters:
parentPanel
- The layered pane that contains the components to which
a DragListener might be attached.
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 interface java.awt.event.MouseListener
- Overrides:
mousePressed
in class java.awt.event.MouseAdapter
- Parameters:
e
- The event that holds the information about the mouse click.
getUnitMenu
public javax.swing.JPopupMenu getUnitMenu(UnitLabel unitLabel)
getGoodsMenu
public javax.swing.JPopupMenu getGoodsMenu(GoodsLabel goodsLabel)