Package armyc2.c5isr.renderer.utilities
Class SymbolUtilities
java.lang.Object
armyc2.c5isr.renderer.utilities.SymbolUtilities
Has various utility functions for prcessing the symbol code.
See
SymbolID for additional functions related to parsing the symbol code.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BooleancanSymbolHaveModifier(String symbolID, String modifier) Deprecated.static StringGets Basic Symbol ID which is the Symbol Set + Entity Codestatic StringgetBasicSymbolID2525C(String strSymbolID) Deprecated.function will be removedstatic PointgetCMSymbolAnchorPoint(String symbolID, RectF bounds) Gets the anchor point for single point Control Measure as the anchor point isn't always they center of the symbol.static StringgetDateLabel(Date time) Converts a Java Date object into a properly formatted String for W or W1.static ColorgetDefaultLineColor(String symbolID) For Control Measures, returns the default color for a symbol when it differs from the affiliation line color.static StringgetEchelonText(int echelon) Reads the Symbol ID string and returns the text that represents the echelon code.static ColorgetFillColorOfAffiliation(String symbolID) Returns the fill color for the symbol based on its affiliationstatic ColorgetLineColorOfAffiliation(String symbolID) Gets line color used if no line color has been set.static StringgetStandardIdentityModifier(String symbolID) Returns the Standard Identity Modifier based on the Symbol IDstatic floatgetUnitRatioHeight(String symbolID) Returns the height ratio for the unit specified by the symbol ID Based on Figure 4 in 2525E.static floatgetUnitRatioWidth(String symbolID) Returns the width ratio for the unit specified by the symbol ID Based on Figure 4 in 2525E.static booleanhasDefaultFill(String strSymbolID) Checks if a symbol should be filled by defaultstatic BooleanChecks if the Symbol Code has FDI set.static BooleanhasModifier(String symbolID, String modifier) Determines if a symbol, based on it's symbol ID, can have the specified modifier/amplifier.static booleanhasRectangleFrame(String symbolID) static booleanisActionPoint(String symbolID) static BooleanReturns true if the symbol is from an air based symbol setstatic booleanisBasicShape(int linetype) static booleanisCBRNEvent(String symbolID) Returns true if Symbol ID represents a chemical, biological, radiological or nuclear incident.static BooleanisExercise(String symbolID) Returns true if the symbol ID indicates the context is Exercisestatic booleanisGreenProtectionGraphic(int entity, int entityType, int entitySubtype) Returns true if graphic is protection graphic (obstacles which render green) Assumes control measure symbol code where SS == 25static booleanisGreenProtectionGraphic(String symbolID) Returns true if graphic is protection graphic (obstacles which render green)static booleanReturns true if the symbol has the HQ staff indicated by the symbol IDstatic BooleanisInstallation(String symbolID) Returns true if the symbol is an installationstatic BooleanReturns true if the symbol is from a land based symbol setstatic booleanisMultiPoint(String symbolID) Determines if the Symbol can be rendered as a multipoint graphic and not just as an iconstatic booleanDetermines if a String represents a valid numberstatic booleanisObstacle(String symbolID) Deprecated.static BooleanReturns true if the symbol ID indicates the context is Realitystatic BooleanisSimulation(String symbolID) Returns true if the symbol ID indicates the context is Simulationstatic booleanisSonobuoy(String symbolID) Returns true if Symbol ID represents a Sonobuoy.static BooleanReturns true if the symbol is from a space based symbol setstatic booleanisSPWithSpecialModifierLayout(String symbolID) Checks if this is a single point control measure or meteorological graphic with a unique layout.static booleanisTacticalGraphic(String strSymbolID) Determines if the symbol is a tactical graphicstatic BooleanisTaskForce(String symbolID) Returns true if the symbol ID has the task for indicatorstatic booleanisTGSPWithSpecialModifierLayout(String strSymbolID) Control Measures and Tactical Graphics that have labels but not with the Action Point layoutstatic booleanReturn true if symbol is from the Atmospheric, Oceanographic or Meteorological Space Symbol Sets.static StringreconcileSymbolID(String symbolID) Attempts to resolve a bad symbol ID into a value that can be found inMSLookup.
-
Constructor Details
-
SymbolUtilities
public SymbolUtilities()
-
-
Method Details
-
isNumber
Determines if a String represents a valid number- Parameters:
text-String- Returns:
- "1.56" == true, "1ab" == false
-
getDateLabel
Converts a Java Date object into a properly formatted String for W or W1. DDHHMMSSZMONYYYY Field W: D = day, H = hour, M = minute, S = second, Z = Greenwich or local time, MON= month and Y = year. -
hasModifier
Determines if a symbol, based on it's symbol ID, can have the specified modifier/amplifier. -
getBasicSymbolID
Gets Basic Symbol ID which is the Symbol Set + Entity Code -
getBasicSymbolID2525C
Deprecated.function will be removedGets the basic Symbol ID for a 2525C symbol S*F*GPU---***** G*G*GPP---****X -
reconcileSymbolID
Attempts to resolve a bad symbol ID into a value that can be found inMSLookup. If it fails, it will return the symbol code for a invalid symbol which is displayed as an inverted question mark (110098000010000000000000000000) -
getLineColorOfAffiliation
Gets line color used if no line color has been set. The color is specified based on the affiliation of the symbol and whether it is a unit or not. -
getDefaultLineColor
For Control Measures, returns the default color for a symbol when it differs from the affiliation line color. If there is no default color, returns the value fromgetLineColorOfAffiliation(java.lang.String) -
hasDefaultFill
Checks if a symbol should be filled by default- Parameters:
strSymbolID- The 20 digit representation of the 2525D symbol- Returns:
- true if there is a default fill
-
isTacticalGraphic
Determines if the symbol is a tactical graphic- Parameters:
strSymbolID- 30 CharacterString- Returns:
- true if symbol set is 25 (control measure), or is a weather graphic
-
isMultiPoint
Determines if the Symbol can be rendered as a multipoint graphic and not just as an icon -
isActionPoint
-
isTGSPWithSpecialModifierLayout
Control Measures and Tactical Graphics that have labels but not with the Action Point layout- Parameters:
strSymbolID- 30 CharacterString- Returns:
Boolean+ @deprecated seeisSPWithSpecialModifierLayout(String)
-
getFillColorOfAffiliation
Returns the fill color for the symbol based on its affiliation -
canSymbolHaveModifier
Deprecated. -
hasFDI
Checks if the Symbol Code has FDI set. Does not check if the symbol can have an FDI. -
isGreenProtectionGraphic
Returns true if graphic is protection graphic (obstacles which render green) Assumes control measure symbol code where SS == 25 -
isGreenProtectionGraphic
Returns true if graphic is protection graphic (obstacles which render green) -
isCBRNEvent
Returns true if Symbol ID represents a chemical, biological, radiological or nuclear incident. -
isSonobuoy
Returns true if Symbol ID represents a Sonobuoy. -
isObstacle
Deprecated.Obstacles are generally required to have a green line color -
isWeather
Return true if symbol is from the Atmospheric, Oceanographic or Meteorological Space Symbol Sets. -
isHQ
Returns true if the symbol has the HQ staff indicated by the symbol ID -
isSPWithSpecialModifierLayout
Checks if this is a single point control measure or meteorological graphic with a unique layout. Basically anything that's not an action point style graphic with modifiers -
getCMSymbolAnchorPoint
Gets the anchor point for single point Control Measure as the anchor point isn't always they center of the symbol. -
isInstallation
Returns true if the symbol is an installation -
isAir
Returns true if the symbol is from an air based symbol set -
isSpace
Returns true if the symbol is from a space based symbol set -
isLand
Returns true if the symbol is from a land based symbol set -
isTaskForce
Returns true if the symbol ID has the task for indicator -
isReality
Returns true if the symbol ID indicates the context is Reality -
isExercise
Returns true if the symbol ID indicates the context is Exercise -
isSimulation
Returns true if the symbol ID indicates the context is Simulation -
getEchelonText
Reads the Symbol ID string and returns the text that represents the echelon code.- Parameters:
echelon-Integerfrom positions 9-10 in the symbol ID SeeSymbolID.getAmplifierDescriptor(String)- Returns:
String(23 (Army) would be "XXXX")
-
getStandardIdentityModifier
Returns the Standard Identity Modifier based on the Symbol ID -
hasRectangleFrame
- Parameters:
symbolID-- Returns:
-
getUnitRatioHeight
Returns the height ratio for the unit specified by the symbol ID Based on Figure 4 in 2525E. -
getUnitRatioWidth
Returns the width ratio for the unit specified by the symbol ID Based on Figure 4 in 2525E. -
isBasicShape
- Parameters:
linetype- the line type- Returns:
- true if the line is a basic shape
-
hasModifier(String, String)