|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.awt.MenuComponent
java.awt.MenuItem
soc.client.SOCHandPanel.ResourceTradeMenuItem
Menu item for right-click on resource square to trade with bank/port.
SOCHandPanel.ResourceTradePopupMenu,
Serialized Form| Nested Class Summary |
| 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 | |
private boolean |
shortTxt
|
private int |
tradeFrom
|
private int |
tradeNum
|
private int |
tradeTo
|
| Fields inherited from class java.awt.MenuItem |
|
| Fields inherited from class java.awt.MenuComponent |
|
| Constructor Summary | |
SOCHandPanel.ResourceTradeMenuItem(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. |
static java.lang.String |
typeName(int rtype)
Get the resource type name for this resource type number, such as "clay" or "ore". |
| 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 int tradeFrom
private int tradeTo
private int tradeNum
private boolean shortTxt
| Constructor Detail |
public SOCHandPanel.ResourceTradeMenuItem(int numFrom,
int typeFrom,
int typeTo,
boolean shortText)
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)
public int getTradeFrom()
public int getTradeTo()
public void createBankTradeRequest(SOCHandPanel hp)
public static java.lang.String typeName(int rtype)
rtype - Resource type, as in SOCResourceConstants.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||