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).
| Methods inherited from class java.awt.event.MouseAdapter |
mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mouseReleased, mouseWheelMoved |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
parentPanel
private final FreeColPanel parentPanel
canvas
private final Canvas canvas
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)
addCarrierItems
private boolean addCarrierItems(UnitLabel unitLabel,
javax.swing.JPopupMenu menu)
addWorkItems
private boolean addWorkItems(UnitLabel unitLabel,
javax.swing.JPopupMenu menu)
addEducationItems
private boolean addEducationItems(UnitLabel unitLabel,
javax.swing.JPopupMenu menu)
addCommandItems
private boolean addCommandItems(UnitLabel unitLabel,
javax.swing.JPopupMenu menu)
addEquipmentItems
private boolean addEquipmentItems(UnitLabel unitLabel,
javax.swing.JPopupMenu menu)
getGoodsMenu
public javax.swing.JPopupMenu getGoodsMenu(GoodsLabel goodsLabel)