Class MenuDisplayer
java.lang.Object
java.awt.event.MouseAdapter
VASSAL.build.module.map.MenuDisplayer
- All Implemented Interfaces:
MouseListener
,MouseMotionListener
,MouseWheelListener
,EventListener
,Buildable
-
Field Summary
Modifier and TypeFieldDescriptionprotected Map
static final Font
Deprecated, for removal: This API element is subject to removal in a future version.protected PieceFinder
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a child component.void
Adds this component to its parent.void
Build the object from the XML representation of the Buildablestatic JPopupMenu
createPopup
(GamePiece target) static JPopupMenu
createPopup
(GamePiece target, boolean global) protected PieceFinder
Return aPieceFinder
instance that will select aGamePiece
whose menu will be displayed when the user clicks on the mapgetBuildElement
(Document doc) protected static String
getMenuText
(KeyCommand keyCommand) boolean
Is this component a reqired component within its parent?boolean
isUnique()
Does this component need to be unique within it's parent?protected static JMenuItem
makeMenuItem
(KeyCommand keyCommand) protected void
protected void
maybePopup
(MouseEvent e, boolean specialLaunchAllowed) void
void
Methods inherited from class java.awt.event.MouseAdapter
mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mouseWheelMoved
-
Field Details
-
POPUP_MENU_FONT
Deprecated, for removal: This API element is subject to removal in a future version. -
map
-
targetSelector
-
-
Constructor Details
-
MenuDisplayer
public MenuDisplayer()
-
-
Method Details
-
addTo
Description copied from interface:Buildable
Adds this component to its parent. In order to make Buildable objects extensible, the child is responsible for adding itself to the parent. That way, Buildable subcomponents can be defined in an extension package without needing to modify the containing class. -
createTargetSelector
Return aPieceFinder
instance that will select aGamePiece
whose menu will be displayed when the user clicks on the map- Returns:
-
add
Description copied from interface:Buildable
Adds a child component. Both this method andBuildable.addTo(VASSAL.build.Buildable)
are invoked when adding a child to a parent -
getBuildElement
- Specified by:
getBuildElement
in interfaceBuildable
- Parameters:
doc
- XML file- Returns:
- an XML element from which this component can be built
-
build
-
getMenuText
-
makeMenuItem
-
createPopup
-
createPopup
- Parameters:
target
-global
- If true, then apply the KeyCommands globally, i.e. to all selected pieces- Returns:
-
mousePressed
- Specified by:
mousePressed
in interfaceMouseListener
- Overrides:
mousePressed
in classMouseAdapter
-
mouseReleased
- Specified by:
mouseReleased
in interfaceMouseListener
- Overrides:
mouseReleased
in classMouseAdapter
-
maybePopup
-
maybePopup
-
isMandatory
public boolean isMandatory()Description copied from interface:Buildable
Is this component a reqired component within its parent?- Specified by:
isMandatory
in interfaceBuildable
- Returns:
- true if component is mandatory
-
isUnique
-