dip.gui.map
Class MapRenderer2

java.lang.Object
  extended bydip.gui.map.MapRenderer2
Direct Known Subclasses:
DefaultMapRenderer2

public abstract class MapRenderer2
extends java.lang.Object

Base class for the new MapRenderer.

Implementation notes: remember to always synchronize around the renderQueue object.


Field Summary
protected  org.w3c.dom.svg.SVGDocument doc
           
static java.lang.String KEY_INFLUENCE_MODE
          Key for getSettings():
static java.lang.String KEY_LABELS
          Key for getSettings():
static java.lang.String KEY_SHOW_DISLODGED_UNITS
          Key for getSettings():
static java.lang.String KEY_SHOW_MAP
          Key for getSettings():
static java.lang.String KEY_SHOW_ORDERS_FOR_POWERS
          Key for getSettings():
static java.lang.String KEY_SHOW_SUPPLY_CENTERS
          Key for getSettings():
static java.lang.String KEY_SHOW_UNITS
          Key for getSettings():
static java.lang.String KEY_SHOW_UNORDERED
          Key for getSettings():
protected  MapPanel mapPanel
           
protected  dip.gui.map.MapRenderer2.CFPropertyListener propListener
           
protected  org.apache.batik.swing.JSVGCanvas svgCanvas
           
static java.lang.String VALUE_LABELS_BRIEF
          Value returned from getSettings():
static java.lang.String VALUE_LABELS_FULL
          Value returned from getSettings():
static java.lang.String VALUE_LABELS_NONE
          Value returned from getSettings():
 
Constructor Summary
MapRenderer2(MapPanel mp)
          Default Constructor JSVGCanvas and SVGDocument of MapPanel must not be null
 
Method Summary
protected  void clearAndExecute(RenderCommandFactory.RenderCommand rc1, RenderCommandFactory.RenderCommand rc2)
          Prevents any enqueued RenderCommands from being executed.
 void close()
          Clean up any resources used by the MapRenderer.
protected abstract  void displayablePowersChanged(Power[] powers)
          Called when the displayable powers have changed
 void execRenderCommand(RenderCommandFactory.RenderCommand rc)
          Execute a RenderCommand.
 ClientFrame getClientFrame()
          Convenience method
abstract  Location getLocation(java.lang.String id)
          Get a location that corresponds to an ID
abstract  MapMetadata getMapMetadata()
          Get the MapMetadata object
abstract  RenderCommandFactory getRenderCommandFactory()
          Get the RenderCommandFactory
abstract  java.lang.Object getRenderSetting(java.lang.Object key)
          Get a setting (as defined by the KEY_ constants)
 org.apache.batik.util.RunnableQueue getRunnableQueue()
          Gets the Runnable Queue for the canvas.
abstract  java.lang.String getSymbolName(Unit.Type unitType)
          Get the Symbol Name for the given unit type
protected abstract  void multipleOrdersCreated(GUIOrder[] orders)
          Called when multiple orders have been added from the order list
protected abstract  void multipleOrdersDeleted(GUIOrder[] orders)
          Called when multiple orders have been deleted from the order list
protected abstract  void orderCreated(GUIOrder order)
          Called when an order has been added to the order list
protected abstract  void orderDeleted(GUIOrder order)
          Called when an order has been deleted from the order list
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY_LABELS

public static final java.lang.String KEY_LABELS
Key for getSettings():

See Also:
Constant Field Values

KEY_SHOW_SUPPLY_CENTERS

public static final java.lang.String KEY_SHOW_SUPPLY_CENTERS
Key for getSettings():

See Also:
Constant Field Values

KEY_SHOW_UNITS

public static final java.lang.String KEY_SHOW_UNITS
Key for getSettings():

See Also:
Constant Field Values

KEY_SHOW_DISLODGED_UNITS

public static final java.lang.String KEY_SHOW_DISLODGED_UNITS
Key for getSettings():

See Also:
Constant Field Values

KEY_SHOW_UNORDERED

public static final java.lang.String KEY_SHOW_UNORDERED
Key for getSettings():

See Also:
Constant Field Values

KEY_SHOW_ORDERS_FOR_POWERS

public static final java.lang.String KEY_SHOW_ORDERS_FOR_POWERS
Key for getSettings():

See Also:
Constant Field Values

KEY_INFLUENCE_MODE

public static final java.lang.String KEY_INFLUENCE_MODE
Key for getSettings():

See Also:
Constant Field Values

KEY_SHOW_MAP

public static final java.lang.String KEY_SHOW_MAP
Key for getSettings():

See Also:
Constant Field Values

VALUE_LABELS_NONE

public static final java.lang.String VALUE_LABELS_NONE
Value returned from getSettings():

See Also:
Constant Field Values

VALUE_LABELS_FULL

public static final java.lang.String VALUE_LABELS_FULL
Value returned from getSettings():

See Also:
Constant Field Values

VALUE_LABELS_BRIEF

public static final java.lang.String VALUE_LABELS_BRIEF
Value returned from getSettings():

See Also:
Constant Field Values

mapPanel

protected final MapPanel mapPanel

propListener

protected dip.gui.map.MapRenderer2.CFPropertyListener propListener

svgCanvas

protected final org.apache.batik.swing.JSVGCanvas svgCanvas

doc

protected final org.w3c.dom.svg.SVGDocument doc
Constructor Detail

MapRenderer2

public MapRenderer2(MapPanel mp)
             throws MapException
Default Constructor JSVGCanvas and SVGDocument of MapPanel must not be null

Method Detail

getClientFrame

public final ClientFrame getClientFrame()
Convenience method


getRunnableQueue

public final org.apache.batik.util.RunnableQueue getRunnableQueue()
Gets the Runnable Queue for the canvas. Return null if this cannot be done (e.g., we are exiting).


getRenderSetting

public abstract java.lang.Object getRenderSetting(java.lang.Object key)
Get a setting (as defined by the KEY_ constants)


execRenderCommand

public void execRenderCommand(RenderCommandFactory.RenderCommand rc)
Execute a RenderCommand. No commands are executed until the TurnState has been set.


close

public void close()
Clean up any resources used by the MapRenderer.


getRenderCommandFactory

public abstract RenderCommandFactory getRenderCommandFactory()
Get the RenderCommandFactory


getMapMetadata

public abstract MapMetadata getMapMetadata()
Get the MapMetadata object


getSymbolName

public abstract java.lang.String getSymbolName(Unit.Type unitType)
Get the Symbol Name for the given unit type


getLocation

public abstract Location getLocation(java.lang.String id)
Get a location that corresponds to an ID


orderDeleted

protected abstract void orderDeleted(GUIOrder order)
Called when an order has been deleted from the order list


orderCreated

protected abstract void orderCreated(GUIOrder order)
Called when an order has been added to the order list


multipleOrdersDeleted

protected abstract void multipleOrdersDeleted(GUIOrder[] orders)
Called when multiple orders have been deleted from the order list


multipleOrdersCreated

protected abstract void multipleOrdersCreated(GUIOrder[] orders)
Called when multiple orders have been added from the order list


displayablePowersChanged

protected abstract void displayablePowersChanged(Power[] powers)
Called when the displayable powers have changed


clearAndExecute

protected void clearAndExecute(RenderCommandFactory.RenderCommand rc1,
                               RenderCommandFactory.RenderCommand rc2)
Prevents any enqueued RenderCommands from being executed. If a command is currently executing, it is not affected. Adds the given commands (or none, if null) to the queue.



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