|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.MenuComponent java.awt.MenuItem soc.client.SOCHandPanel.ResourceTradeMenuItem
protected static class SOCHandPanel.ResourceTradeMenuItem
Menu item for right-click on resource square to trade with bank/port.
SOCHandPanel.ResourceTradePopupMenu
,
Serialized FormNested Class Summary |
---|
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 | |
---|---|
private SOCGame |
game
|
private static java.lang.Integer |
INT_1
|
private boolean |
shortTxt
|
private int |
tradeFrom
|
private int |
tradeNum
|
private int |
tradeTo
|
Constructor Summary | |
---|---|
SOCHandPanel.ResourceTradeMenuItem(SOCGame game,
int numFrom,
int typeFrom,
int typeTo,
boolean shortText)
Create a bank/port trade MenuItem, with text such as "Trade 2 brick for 1 wheat". |
Method Summary | |
---|---|
void |
createBankTradeRequest(SOCHandPanel hp)
Create a bank-trade-request, send to the server. |
int |
getTradeFrom()
|
int |
getTradeTo()
|
void |
setCost(int numFrom)
Update menu item text to new cost of trade. |
void |
setEnabled(boolean enable)
Enable or disable this menu item. |
Methods inherited from class java.awt.MenuItem |
---|
addActionListener, addNotify, deleteShortcut, disable, disableEvents, enable, enable, enableEvents, getAccessibleContext, getActionCommand, getActionListeners, getLabel, getListeners, getShortcut, isEnabled, paramString, processActionEvent, processEvent, removeActionListener, setActionCommand, setLabel, setShortcut |
Methods inherited from class java.awt.MenuComponent |
---|
dispatchEvent, getFont, getName, getParent, getPeer, getTreeLock, postEvent, removeNotify, setFont, setName, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final java.lang.Integer INT_1
private final SOCGame game
private int tradeFrom
private int tradeTo
private int tradeNum
private boolean shortTxt
Constructor Detail |
---|
public SOCHandPanel.ResourceTradeMenuItem(SOCGame game, int numFrom, int typeFrom, int typeTo, boolean shortText)
game
- Game reference, needed for SOCStringManager.getSpecial(SOCGame, String, Object...)
numFrom
- Number of resources to trade for 1 resourcetypeFrom
- Source resource type, as in SOCResourceConstants
.typeTo
- Target resource type, as in SOCResourceConstants
.
If typeFrom == typeTo, menuitem will be disabled.shortText
- If true, short ("For 1 wheat") vs full "Trade 2 brick for 1 wheat"Method Detail |
---|
public void setCost(int numFrom)
numFrom
- Trade this many resources;
if the number is unchanged, the text is not updated.public void setEnabled(boolean enable)
setEnabled
in class java.awt.MenuItem
public int getTradeFrom()
public int getTradeTo()
public void createBankTradeRequest(SOCHandPanel hp)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |