dip.gui.order
Interface GUIOrder

All Superinterfaces:
Orderable
All Known Implementing Classes:
GUIBuild, GUIConvoy, GUIDefineState, GUIDisband, GUIHold, GUIMove, GUIMoveExplicit, GUIRemove, GUIRetreat, GUISupport, GUIWaive

public interface GUIOrder
extends Orderable

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

LAYER_HIGHEST

public static final int LAYER_HIGHEST
Z-order layer for orders that are drawn over units

See Also:
Constant Field Values

LAYER_TYPICAL

public static final int LAYER_TYPICAL
Typical Z-order layer; drawn under units

See Also:
Constant Field Values

LAYER_LOWEST

public static final int LAYER_LOWEST
Lowest Z-order units; all other order layers drawn over this layer.

See Also:
Constant Field Values

CLICK_TO_ISSUE

public static final java.lang.String CLICK_TO_ISSUE
Message displayed when an order may be issued by a mouse click

See Also:
Constant Field Values

NO_UNIT

public static final java.lang.String NO_UNIT
Message displayed when there is no unit in given location

See Also:
Constant Field Values

NO_DISLODGED_UNIT

public static final java.lang.String NO_DISLODGED_UNIT
Message displayed when there is no dislodged unit in given location

See Also:
Constant Field Values

NOT_OWNER

public static final java.lang.String NOT_OWNER
Message displayed when a power (set by setLockedPower()) does not control the given unit

See Also:
Constant Field Values

COMPLETE

public static final java.lang.String COMPLETE
Message displayed when order entry is complete.

See Also:
Constant Field Values

CANCELED

public static final java.lang.String CANCELED
Message displayed when order is cancelled.

See Also:
Constant Field Values

CLICK_TO_CANCEL

public static final java.lang.String CLICK_TO_CANCEL
Message indicating click to cancel order.

See Also:
Constant Field Values

BORDER_INVALID

public static final java.lang.String BORDER_INVALID
Message indicating cannot give order due to a Border constraint.

See Also:
Constant Field Values

NOT_IN_PROVINCE

public static final java.lang.String NOT_IN_PROVINCE
Message indicating that pointer is not over a province

See Also:
Constant Field Values
Method Detail

deriveFrom

public void deriveFrom(Orderable order)
Derive all fields from given Order. Sets completion flag.


testLocation

public boolean testLocation(GUIOrder.StateInfo stateInfo,
                            Location location,
                            java.lang.StringBuffer sb)
Tests if a given location is valid. Returns validity, and appends valid/invalid message to StringBuffer.


clearLocations

public boolean clearLocations()
Clear all set locations. If no locations have been set, this has no effect.


setLocation

public boolean setLocation(GUIOrder.StateInfo stateInfo,
                           Location location,
                           java.lang.StringBuffer sb)
Sets the current location. Otherwise similar to testLocation.


isComplete

public boolean isComplete()
Returns if all Locations have been set and the order is complete.


getNumRequiredLocations

public int getNumRequiredLocations()
Returns the number of required Location set points.


getCurrentLocationNum

public int getCurrentLocationNum()
Returns the current Location set point, or 0 if no Locations have been set.


setParam

public void setParam(GUIOrder.Parameter param,
                     java.lang.Object value)
Sets a given parameter. Throws an IllegalArgumentException if the parameter or value is illegal.

Throws:
java.lang.IllegalArgumentException - if the parameter or value is illegal

getParam

public java.lang.Object getParam(GUIOrder.Parameter param)
Checks if a given parameter has been set.

Returns:
set parameter, or null if no parameter has been set.
Throws:
java.lang.IllegalArgumentException - if the parameter is illegal

isDependent

public boolean isDependent()
Indicates if this order is dependent upon the state of other orders for drawing.


updateDOM

public void updateDOM(GUIOrder.MapInfo mapInfo)
Updates the DOM, given the given parameters. Adds if appropriate.


removeFromDOM

public void removeFromDOM(GUIOrder.MapInfo mapInfo)
Removes order from the DOM



Copyright 2002-2004 Zachary DelProposto / jDip Development Team. All Rights Reserved.