public class MilStd2525GraphicFactory extends java.lang.Object implements TacticalGraphicFactory
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.String,java.lang.Class> |
classMap
Map to associate MIL-STD-2525C function codes with implementation classes.
|
Constructor and Description |
---|
MilStd2525GraphicFactory()
Create a new factory.
|
Modifier and Type | Method and Description |
---|---|
TacticalCircle |
createCircle(java.lang.String sidc,
Position center,
double radius,
AVList modifiers)
Create a circular graphic.
|
MilStd2525TacticalGraphic |
createGraphic(java.lang.String sidc,
java.lang.Iterable<? extends Position> positions,
AVList modifiers)
Create a tactical graphic positioned by more than one control point.
|
TacticalPoint |
createPoint(java.lang.String sidc,
Position position,
AVList params)
Create a tactical graphic positioned by a single control point.
|
TacticalQuad |
createQuad(java.lang.String sidc,
java.lang.Iterable<? extends Position> positions,
AVList modifiers)
Create a graphic with four sides.
|
TacticalRoute |
createRoute(java.lang.String sidc,
java.lang.Iterable<? extends TacticalPoint> controlPoints,
AVList modifiers)
Create a route graphic.
|
protected java.lang.Class |
getClassForCode(SymbolCode symbolCode)
Get the implementation class that implements a particular graphic.
|
boolean |
isSupported(java.lang.String sidc)
Determines if this factory can create a graphic for a given symbol identifier.
|
protected void |
mapClass(java.lang.Class clazz,
java.util.List<java.lang.String> ids)
Associate an implementation class with one or more symbol identifiers.
|
protected void |
populateClassMap()
Populate the map that maps function IDs to implementation classes.
|
void |
setImplementationClass(java.lang.String sidc,
java.lang.Class clazz)
Specifies the class that the factory will instantiate for a given symbol identifier.
|
protected void |
setModifiers(TacticalGraphic graphic,
AVList props) |
protected java.util.Map<java.lang.String,java.lang.Class> classMap
public TacticalCircle createCircle(java.lang.String sidc, Position center, double radius, AVList modifiers)
createCircle
in interface TacticalGraphicFactory
sidc
- Identifier for the symbol within its symbol set.center
- The position of the center of the circle.radius
- The radius of the circle, in meters.modifiers
- Modifiers to apply to the graphic.null
if no graphic can be
created for the given symbol identifier.public MilStd2525TacticalGraphic createGraphic(java.lang.String sidc, java.lang.Iterable<? extends Position> positions, AVList modifiers)
createCircle
)
are provided for convenience, and may be used to specific categories of graphics.createGraphic
in interface TacticalGraphicFactory
sidc
- MIL-STD-2525 symbol identification code (SIDC).positions
- Control points to use to place the graphic. How many points are required depends on the
type of graphic.modifiers
- Modifiers to apply to the graphic.null
if no graphic can
be created for the given symbol identifier.public TacticalPoint createPoint(java.lang.String sidc, Position position, AVList params)
createPoint
in interface TacticalGraphicFactory
sidc
- MIL-STD-2525 symbol identification code (SIDC).position
- Control point to use to place the graphic.params
- Modifiers to apply to the graphic.null
if no graphic can
be created for the given symbol identifier.public TacticalQuad createQuad(java.lang.String sidc, java.lang.Iterable<? extends Position> positions, AVList modifiers)
createQuad
in interface TacticalGraphicFactory
sidc
- Identifier for the symbol within its symbol set.positions
- Control points to use to place the graphic. How many points are required depends on the
type of graphic.modifiers
- Modifiers to apply to the graphic.null
if no graphic can be
created for the given symbol identifier.public TacticalRoute createRoute(java.lang.String sidc, java.lang.Iterable<? extends TacticalPoint> controlPoints, AVList modifiers)
createRoute
in interface TacticalGraphicFactory
sidc
- Identifier for the symbol within its symbol set.controlPoints
- Graphics to place at the points along the route.modifiers
- Modifiers to apply to the graphic.null
if no graphic can be
created for the given symbol identifier.protected java.lang.Class getClassForCode(SymbolCode symbolCode)
symbolCode
- Parsed SIDC that identifies the graphic.null
if no implementation class is found.public boolean isSupported(java.lang.String sidc)
isSupported
in interface TacticalGraphicFactory
sidc
- An identifier for a symbol within the symbol set.protected void mapClass(java.lang.Class clazz, java.util.List<java.lang.String> ids)
clazz
- Class that implements one or more tactical graphics.ids
- Masked symbol IDs of the graphics implemented by clazz
.protected void populateClassMap()
public void setImplementationClass(java.lang.String sidc, java.lang.Class clazz)
sidc
- Masked symbol identifier.clazz
- Implementation class. This class must have a constructor that accepts a string argument.SymbolCode.toMaskedString()
protected void setModifiers(TacticalGraphic graphic, AVList props)