soc.client
Class SOCHandPanel.ResourceTradePopupMenu

java.lang.Object
  extended by java.awt.MenuComponent
      extended by java.awt.MenuItem
          extended by java.awt.Menu
              extended by java.awt.PopupMenu
                  extended by soc.client.SOCHandPanel.ResourceTradePopupMenu
All Implemented Interfaces:
java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible
Direct Known Subclasses:
SOCBoardPanel.ResourceTradeAllMenu, SOCHandPanel.ResourceTradeTypeMenu
Enclosing class:
SOCHandPanel

abstract static class SOCHandPanel.ResourceTradePopupMenu
extends java.awt.PopupMenu

Menu for right-click on resource square to trade with bank/port.

Author:
Jeremy D Monin
See Also:
SOCHandPanel.ResourceTradeTypeMenu, SOCBoardPanel.ResourceTradeAllMenu

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.PopupMenu
java.awt.PopupMenu.AccessibleAWTPopupMenu
 
Nested classes/interfaces inherited from class java.awt.Menu
java.awt.Menu.AccessibleAWTMenu
 
Nested classes/interfaces inherited from class java.awt.MenuItem
java.awt.MenuItem.AccessibleAWTMenuItem
 
Nested classes/interfaces inherited from class java.awt.MenuComponent
java.awt.MenuComponent.AccessibleAWTMenuComponent
 
Field Summary
protected  SOCHandPanel hpan
           
 
Constructor Summary
protected SOCHandPanel.ResourceTradePopupMenu(SOCHandPanel hp, java.lang.String title)
           
 
Method Summary
abstract  void destroy()
          Cleanup, for removing this menu.
abstract  void setEnabledIfCanTrade(boolean itemsOnly)
          Enable or disable based on gamestate and player's resources.
abstract  void show(int x, int y)
          Show menu at this position.
 
Methods inherited from class java.awt.PopupMenu
addNotify, getAccessibleContext, getParent, show
 
Methods inherited from class java.awt.Menu
add, add, addSeparator, countItems, getItem, getItemCount, insert, insert, insertSeparator, isTearOff, paramString, remove, remove, removeAll, removeNotify
 
Methods inherited from class java.awt.MenuItem
addActionListener, deleteShortcut, disable, disableEvents, enable, enable, enableEvents, getActionCommand, getActionListeners, getLabel, getListeners, getShortcut, isEnabled, processActionEvent, processEvent, removeActionListener, setActionCommand, setEnabled, setLabel, setShortcut
 
Methods inherited from class java.awt.MenuComponent
dispatchEvent, getFont, getName, getPeer, getTreeLock, postEvent, setFont, setName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

hpan

protected SOCHandPanel hpan
Constructor Detail

SOCHandPanel.ResourceTradePopupMenu

protected SOCHandPanel.ResourceTradePopupMenu(SOCHandPanel hp,
                                              java.lang.String title)
Method Detail

show

public abstract void show(int x,
                          int y)
Show menu at this position. Before showing, enable or disable based on gamestate and player's resources.

Parameters:
x - Mouse x-position relative to colorsquare
y - Mouse y-position relative to colorsquare
See Also:
setEnabledIfCanTrade(boolean)

setEnabledIfCanTrade

public abstract void setEnabledIfCanTrade(boolean itemsOnly)
Enable or disable based on gamestate and player's resources.

Parameters:
itemsOnly - If true, enable/disable items, instead of the menu itself.

destroy

public abstract void destroy()
Cleanup, for removing this menu.