|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.awt.MenuComponent
java.awt.MenuItem
java.awt.Menu
java.awt.PopupMenu
soc.client.SOCBoardPanel.BoardPopupMenu
This class creates a popup menu on the board, to trade or build or cancel building.
| Nested Class Summary |
| Nested classes inherited from class java.awt.PopupMenu |
java.awt.PopupMenu.AccessibleAWTPopupMenu |
| Nested classes inherited from class java.awt.Menu |
java.awt.Menu.AccessibleAWTMenu |
| Nested classes inherited from class java.awt.MenuItem |
java.awt.MenuItem.AccessibleAWTMenuItem |
| Nested classes inherited from class java.awt.MenuComponent |
java.awt.MenuComponent.AccessibleAWTMenuComponent |
| Field Summary | |
(package private) SOCBoardPanel |
bp
our parent boardpanel |
(package private) java.awt.MenuItem |
buildRoadItem
|
(package private) java.awt.MenuItem |
buildSettleItem
|
(package private) java.awt.MenuItem |
cancelBuildItem
|
private int |
cancelBuildType
|
private int |
hoverCityID
hover settlement or city node ID, or 0, at menu-show time |
private int |
hoverRoadID
hover road ID, or 0, at menu-show time |
private int |
hoverSettlementID
hover settlement or city node ID, or 0, at menu-show time |
protected boolean |
isInitialPlacement
Will this be for initial placement (send putpiece right away), or for placement during game (send build, receive gamestate, send putpiece)? |
private int |
menuPlayerID
determined at menu-show time |
private boolean |
menuPlayerIsCurrent
determined at menu-show time |
(package private) SOCHandPanel.ResourceTradePopupMenu |
portTradeSubmenu
determined at menu-show time, only over a useable port. |
(package private) java.awt.MenuItem |
upgradeCityItem
|
private boolean |
wantsCancel
determined at menu-show time |
| Fields inherited from class java.awt.PopupMenu |
|
| Fields inherited from class java.awt.Menu |
|
| Fields inherited from class java.awt.MenuItem |
|
| Fields inherited from class java.awt.MenuComponent |
|
| Constructor Summary | |
SOCBoardPanel.BoardPopupMenu(SOCBoardPanel bpanel)
create a new BoardPopupMenu on this board |
|
| Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent e)
Handling the menu items |
void |
showBuild(int x,
int y,
int hR,
int hS,
int hC)
Custom show method that finds current game status and player status. |
void |
showCancelBuild(int buildType,
int x,
int y,
int hilightAt)
Custom 'cancel' show method for when placing a road/settlement/city, giving the build/cancel options for that type of piece. |
(package private) void |
tryBuild(int ptype)
Assumes player is current, and player is non-null, when called |
(package private) void |
tryCancel()
|
| Methods inherited from class java.awt.PopupMenu |
addNotify, getAccessibleContext, 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, getParent, 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 |
SOCBoardPanel bp
java.awt.MenuItem buildRoadItem
java.awt.MenuItem buildSettleItem
java.awt.MenuItem upgradeCityItem
java.awt.MenuItem cancelBuildItem
SOCHandPanel.ResourceTradePopupMenu portTradeSubmenu
private int menuPlayerID
private boolean menuPlayerIsCurrent
private boolean wantsCancel
private int cancelBuildType
private int hoverRoadID
private int hoverSettlementID
private int hoverCityID
protected boolean isInitialPlacement
| Constructor Detail |
public SOCBoardPanel.BoardPopupMenu(SOCBoardPanel bpanel)
| Method Detail |
public void showCancelBuild(int buildType,
int x,
int y,
int hilightAt)
buildType - piece type (SOCPlayingPiece.ROAD, CITY, SETTLEMENT)x - Mouse x-positiony - Mouse y-positionhilightAt - Current hover/hilight coordinates of piece being cancelled/placed
public void showBuild(int x,
int y,
int hR,
int hS,
int hC)
x - Mouse x-positiony - Mouse y-positionhR - Hover road ID, or 0hS - Hover settle ID, or 0hC - Hover city ID, or 0public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed in interface java.awt.event.ActionListenervoid tryBuild(int ptype)
void tryCancel()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||