NASA World Wind

gov.nasa.worldwind.symbology.milstd2525.graphics
Class DefaultLabelLayouts

java.lang.Object
  extended by gov.nasa.worldwind.symbology.milstd2525.graphics.DefaultLabelLayouts

public class DefaultLabelLayouts
extends Object

Object to provide default label layouts for MIL-STD-2525C tactical point graphics. The layout is used to arrange text modifiers around the icon.


Field Summary
protected  Map<String,List<TacticalGraphicSymbol.LabelLayout>> layouts
          Map to hold layouts.
 
Constructor Summary
DefaultLabelLayouts()
          Create the map and populate it with the default layouts.
 
Method Summary
protected  void addLayout(List<TacticalGraphicSymbol.LabelLayout> layoutList, String key, Offset... offsets)
          Add a layout to a layout map, possibly replacing an existing layout.
protected  List<TacticalGraphicSymbol.LabelLayout> createLayout(String key, Offset offset, Offset hotspot)
          Create a simple layout map and populate it with one key value pair.
 List<TacticalGraphicSymbol.LabelLayout> get(String sidc)
          Indicates the layout for a particular type of graphic.
protected  void populateMap()
          Populate the map with the default layouts.
protected  void putAll(List<TacticalGraphicSymbol.LabelLayout> value, String... keys)
          Map one value to many keys.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

layouts

protected Map<String,List<TacticalGraphicSymbol.LabelLayout>> layouts
Map to hold layouts.

Constructor Detail

DefaultLabelLayouts

public DefaultLabelLayouts()
Create the map and populate it with the default layouts.

Method Detail

addLayout

protected void addLayout(List<TacticalGraphicSymbol.LabelLayout> layoutList,
                         String key,
                         Offset... offsets)
Add a layout to a layout map, possibly replacing an existing layout.

Parameters:
layoutList - List to which to add an entry.
key - Modifier key.
offsets - List of offsets from which to create one or more LabelLayout objects. The offsets are specified in pairs: first the image offset and then the label offset. If multiple pairs are provided, then multiple LabelLayouts will be created and added to the map.
Throws:
IllegalArgumentException - if offsets does not have even length.

createLayout

protected List<TacticalGraphicSymbol.LabelLayout> createLayout(String key,
                                                               Offset offset,
                                                               Offset hotspot)
Create a simple layout map and populate it with one key value pair.

Parameters:
key - Modifier key.
offset - Offset within the image at which to place the label.
hotspot - Offset within the label to align with the label point in the image.
Returns:
New map, populated with one entry for the key/value pair specified in the parameters.

get

public List<TacticalGraphicSymbol.LabelLayout> get(String sidc)
Indicates the layout for a particular type of graphic.

Parameters:
sidc - Symbol code of the graphic.
Returns:
Map that represents the label layout. The keys indicate the modifier key (unique designation, additional info, etc.). The values are lists of LabelLayout. Most modifiers will only specify a single layout, but some graphics support multiple instances of the same modifier, in which case the list will contain multiple layouts.

populateMap

protected void populateMap()
Populate the map with the default layouts.


putAll

protected void putAll(List<TacticalGraphicSymbol.LabelLayout> value,
                      String... keys)
Map one value to many keys.

Parameters:
value - Value to add.
keys - Keys that map to the value.

NASA World Wind