|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
GUI extension of Orderable that is used for GUI input/handling and GUI order rendering.
It is recommended that toString() is not used for GUI orders, as the formatting is not as precise (or controllable) as with toFormattedString() (or using OrderFormat.format()).
Nested Class Summary | |
static class |
GUIOrder.MapInfo
Allows GUIOrder objects to ascertain information about other GUIOrders and obtain Map metadata information. |
static class |
GUIOrder.Parameter
Typesafe Enum base class for Order object parameters. |
static class |
GUIOrder.StateInfo
StateInfo is the object which is passed to GUIOrder subclasses that contains various information about the current game state. |
Field Summary | |
static java.lang.String |
BORDER_INVALID
Message indicating cannot give order due to a Border constraint. |
static java.lang.String |
CANCELED
Message displayed when order is cancelled. |
static java.lang.String |
CLICK_TO_CANCEL
Message indicating click to cancel order. |
static java.lang.String |
CLICK_TO_ISSUE
Message displayed when an order may be issued by a mouse click |
static java.lang.String |
COMPLETE
Message displayed when order entry is complete. |
static int |
LAYER_HIGHEST
Z-order layer for orders that are drawn over units |
static int |
LAYER_LOWEST
Lowest Z-order units; all other order layers drawn over this layer. |
static int |
LAYER_TYPICAL
Typical Z-order layer; drawn under units |
static java.lang.String |
NO_DISLODGED_UNIT
Message displayed when there is no dislodged unit in given location |
static java.lang.String |
NO_UNIT
Message displayed when there is no unit in given location |
static java.lang.String |
NOT_IN_PROVINCE
Message indicating that pointer is not over a province |
static java.lang.String |
NOT_OWNER
Message displayed when a power (set by setLockedPower()) does not control the given unit |
Method Summary | |
boolean |
clearLocations()
Clear all set locations. |
void |
deriveFrom(Orderable order)
Derive all fields from given Order. |
int |
getCurrentLocationNum()
Returns the current Location set point, or 0 if no Locations have been set. |
int |
getNumRequiredLocations()
Returns the number of required Location set points. |
java.lang.Object |
getParam(GUIOrder.Parameter param)
Checks if a given parameter has been set. |
boolean |
isComplete()
Returns if all Locations have been set and the order is complete. |
boolean |
isDependent()
Indicates if this order is dependent upon the state of other orders for drawing. |
void |
removeFromDOM(GUIOrder.MapInfo mapInfo)
Removes order from the DOM |
boolean |
setLocation(GUIOrder.StateInfo stateInfo,
Location location,
java.lang.StringBuffer sb)
Sets the current location. |
void |
setParam(GUIOrder.Parameter param,
java.lang.Object value)
Sets a given parameter. |
boolean |
testLocation(GUIOrder.StateInfo stateInfo,
Location location,
java.lang.StringBuffer sb)
Tests if a given location is valid. |
void |
updateDOM(GUIOrder.MapInfo mapInfo)
Updates the DOM, given the given parameters. |
Methods inherited from interface dip.order.Orderable |
determineDependencies, evaluate, getBriefName, getDefaultFormat, getFullName, getPower, getSource, getSourceUnitType, toBriefString, toFormattedString, toFullString, validate, verify |
Field Detail |
public static final int LAYER_HIGHEST
public static final int LAYER_TYPICAL
public static final int LAYER_LOWEST
public static final java.lang.String CLICK_TO_ISSUE
public static final java.lang.String NO_UNIT
public static final java.lang.String NO_DISLODGED_UNIT
public static final java.lang.String NOT_OWNER
public static final java.lang.String COMPLETE
public static final java.lang.String CANCELED
public static final java.lang.String CLICK_TO_CANCEL
public static final java.lang.String BORDER_INVALID
public static final java.lang.String NOT_IN_PROVINCE
Method Detail |
public void deriveFrom(Orderable order)
public boolean testLocation(GUIOrder.StateInfo stateInfo, Location location, java.lang.StringBuffer sb)
public boolean clearLocations()
public boolean setLocation(GUIOrder.StateInfo stateInfo, Location location, java.lang.StringBuffer sb)
public boolean isComplete()
public int getNumRequiredLocations()
public int getCurrentLocationNum()
public void setParam(GUIOrder.Parameter param, java.lang.Object value)
java.lang.IllegalArgumentException
- if the parameter or value is illegalpublic java.lang.Object getParam(GUIOrder.Parameter param)
java.lang.IllegalArgumentException
- if the parameter is illegalpublic boolean isDependent()
public void updateDOM(GUIOrder.MapInfo mapInfo)
public void removeFromDOM(GUIOrder.MapInfo mapInfo)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |