Class DefaultLabelLayouts
- java.lang.Object
-
- gov.nasa.worldwind.symbology.milstd2525.graphics.DefaultLabelLayouts
-
public class DefaultLabelLayouts extends java.lang.ObjectObject 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
Fields Modifier and Type Field Description protected java.util.Map<java.lang.String,java.util.List<TacticalGraphicSymbol.LabelLayout>>layoutsMap to hold layouts.
-
Constructor Summary
Constructors Constructor Description DefaultLabelLayouts()Create the map and populate it with the default layouts.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddLayout(java.util.List<TacticalGraphicSymbol.LabelLayout> layoutList, java.lang.String key, Offset... offsets)Add a layout to a layout map, possibly replacing an existing layout.protected java.util.List<TacticalGraphicSymbol.LabelLayout>createLayout(java.lang.String key, Offset offset, Offset hotspot)Create a simple layout map and populate it with one key value pair.java.util.List<TacticalGraphicSymbol.LabelLayout>get(java.lang.String sidc)Indicates the layout for a particular type of graphic.protected voidpopulateMap()Populate the map with the default layouts.protected voidputAll(java.util.List<TacticalGraphicSymbol.LabelLayout> value, java.lang.String... keys)Map one value to many keys.
-
-
-
Field Detail
-
layouts
protected java.util.Map<java.lang.String,java.util.List<TacticalGraphicSymbol.LabelLayout>> layouts
Map to hold layouts.
-
-
Method Detail
-
get
public java.util.List<TacticalGraphicSymbol.LabelLayout> get(java.lang.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.
-
createLayout
protected java.util.List<TacticalGraphicSymbol.LabelLayout> createLayout(java.lang.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.
-
addLayout
protected void addLayout(java.util.List<TacticalGraphicSymbol.LabelLayout> layoutList, java.lang.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:
java.lang.IllegalArgumentException- if offsets does not have even length.
-
putAll
protected void putAll(java.util.List<TacticalGraphicSymbol.LabelLayout> value, java.lang.String... keys)
Map one value to many keys.- Parameters:
value- Value to add.keys- Keys that map to the value.
-
-