dip.gui.order
Class GUIMove

java.lang.Object
  extended bydip.order.Order
      extended bydip.order.Move
          extended bydip.gui.order.GUIMove
All Implemented Interfaces:
GUIOrder, Orderable, java.io.Serializable

public class GUIMove
extends Move
implements GUIOrder

GUIOrder subclass of Move order.

Note that GUIMove fully supports moves with explicit convoy routes, but their GUI entry is not supported.

See Also:
Serialized Form

Nested Class Summary
protected static class GUIMove.MoveParameter
          Typesafe Enumerated Parameter class for setting optional Move parameters.
 
Nested classes inherited from class dip.gui.order.GUIOrder
GUIOrder.MapInfo, GUIOrder.Parameter, GUIOrder.StateInfo
 
Field Summary
static GUIMove.MoveParameter BY_CONVOY
          Optional.
 
Fields inherited from class dip.order.Move
_fmtIsAdjWithConvoy, _hasLandRoute, _isAdjWithPossibleConvoy, _isConvoyIntent, _isViaConvoy, convoyRoutes, dest
 
Fields inherited from class dip.order.Order
ORD_VAL_BORDER, power, src, srcUnitType
 
Fields inherited from interface dip.gui.order.GUIOrder
BORDER_INVALID, CANCELED, CLICK_TO_CANCEL, CLICK_TO_ISSUE, COMPLETE, LAYER_HIGHEST, LAYER_LOWEST, LAYER_TYPICAL, NO_DISLODGED_UNIT, NO_UNIT, NOT_IN_PROVINCE, NOT_OWNER
 
Constructor Summary
protected GUIMove()
          Creates a GUIMove
protected GUIMove(Power power, Location source, Unit.Type srcUnitType, Location dest, boolean isConvoying)
          Creates a GUIMove
protected GUIMove(Power power, Location src, Unit.Type srcUnitType, Location dest, java.util.List routes)
          Creates a GUIMove
protected GUIMove(Power power, Location src, Unit.Type srcUnitType, Location dest, Province[] convoyRoute)
          Creates a GUIMove
 
Method Summary
 boolean clearLocations()
          Clear all set locations.
 void deriveFrom(Orderable order)
          This only accepts Move orders.
 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)
          Get optional Move parameters.
 boolean isComplete()
          Returns if all Locations have been set and the order is complete.
 boolean isDependent()
          We are dependent on the presence of Support orders for certain drawing parameters.
 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 optional Move parameters.
 boolean testLocation(GUIOrder.StateInfo stateInfo, Location location, java.lang.StringBuffer sb)
          Tests if a given location is valid.
 void updateDOM(GUIOrder.MapInfo mapInfo)
          Draws a line with an arrow.
 
Methods inherited from class dip.order.Move
determineDependencies, equals, evaluate, formatConvoyRoute, formatConvoyRoute, getBriefName, getConvoyRoute, getConvoyRoutes, getDefaultFormat, getDest, getFullName, isAdjWithPossibleConvoy, isConvoying, isConvoyIntent, isViaConvoy, toBriefString, toFullString, validate, validateTheoreticalConvoyRoute, verify
 
Methods inherited from class dip.order.Order
addSupportsOfAndMovesToSource, appendBrief, appendFull, checkPower, checkSeasonAdjustment, checkSeasonMovement, checkSeasonRetreat, getPower, getSource, getSourceUnitType, getValidatedUnitType, toFormattedString, toString, validate
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface dip.order.Orderable
determineDependencies, evaluate, getBriefName, getDefaultFormat, getFullName, getPower, getSource, getSourceUnitType, toBriefString, toFormattedString, toFullString, validate, verify
 

Field Detail

BY_CONVOY

public static final transient GUIMove.MoveParameter BY_CONVOY
Optional. Sets this Move to be by convoy. Value must be a Boolean object (Boolean.TRUE or Boolean.FALSE)

Constructor Detail

GUIMove

protected GUIMove()
Creates a GUIMove


GUIMove

protected GUIMove(Power power,
                  Location source,
                  Unit.Type srcUnitType,
                  Location dest,
                  boolean isConvoying)
Creates a GUIMove


GUIMove

protected GUIMove(Power power,
                  Location src,
                  Unit.Type srcUnitType,
                  Location dest,
                  Province[] convoyRoute)
Creates a GUIMove


GUIMove

protected GUIMove(Power power,
                  Location src,
                  Unit.Type srcUnitType,
                  Location dest,
                  java.util.List routes)
Creates a GUIMove

Method Detail

deriveFrom

public void deriveFrom(Orderable order)
This only accepts Move orders. All others will throw an IllegalArgumentException.

Specified by:
deriveFrom in interface GUIOrder

testLocation

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

Specified by:
testLocation in interface GUIOrder

clearLocations

public boolean clearLocations()
Description copied from interface: GUIOrder
Clear all set locations. If no locations have been set, this has no effect.

Specified by:
clearLocations in interface GUIOrder

setLocation

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

Specified by:
setLocation in interface GUIOrder

isComplete

public boolean isComplete()
Description copied from interface: GUIOrder
Returns if all Locations have been set and the order is complete.

Specified by:
isComplete in interface GUIOrder

getNumRequiredLocations

public int getNumRequiredLocations()
Description copied from interface: GUIOrder
Returns the number of required Location set points.

Specified by:
getNumRequiredLocations in interface GUIOrder

getCurrentLocationNum

public int getCurrentLocationNum()
Description copied from interface: GUIOrder
Returns the current Location set point, or 0 if no Locations have been set.

Specified by:
getCurrentLocationNum in interface GUIOrder

setParam

public void setParam(GUIOrder.Parameter param,
                     java.lang.Object value)
Sets optional Move parameters.

Specified by:
setParam in interface GUIOrder

getParam

public java.lang.Object getParam(GUIOrder.Parameter param)
Get optional Move parameters.

Specified by:
getParam in interface GUIOrder
Returns:
set parameter, or null if no parameter has been set.

removeFromDOM

public void removeFromDOM(GUIOrder.MapInfo mapInfo)
Description copied from interface: GUIOrder
Removes order from the DOM

Specified by:
removeFromDOM in interface GUIOrder

updateDOM

public void updateDOM(GUIOrder.MapInfo mapInfo)
Draws a line with an arrow.

Specified by:
updateDOM in interface GUIOrder

isDependent

public boolean isDependent()
We are dependent on the presence of Support orders for certain drawing parameters.

Specified by:
isDependent in interface GUIOrder


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