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 Boolean
canSymbolHaveModifier
(String symbolID, String modifier) Deprecated.static String
Gets Basic Symbol ID which is the Symbol Set + Entity Codestatic String
getBasicSymbolID2525C
(String strSymbolID) Deprecated.function will be removedstatic Point
getCMSymbolAnchorPoint
(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 String
getDateLabel
(Date time) Converts a Java Date object into a properly formatted String for W or W1.static Color
getDefaultLineColor
(String symbolID) For Control Measures, returns the default color for a symbol when it differs from the affiliation line color.static String
getEchelonText
(int echelon) Reads the Symbol ID string and returns the text that represents the echelon code.static Color
getFillColorOfAffiliation
(String symbolID) Returns the fill color for the symbol based on its affiliationstatic Color
getLineColorOfAffiliation
(String symbolID) Gets line color used if no line color has been set.static String
getStandardIdentityModifier
(String symbolID) Returns the Standard Identity Modifier based on the Symbol IDstatic float
getUnitRatioHeight
(String symbolID) Returns the height ratio for the unit specified by the symbol ID Based on Figure 4 in 2525E.static float
getUnitRatioWidth
(String symbolID) Returns the width ratio for the unit specified by the symbol ID Based on Figure 4 in 2525E.static boolean
hasDefaultFill
(String strSymbolID) Checks if a symbol should be filled by defaultstatic Boolean
Checks if the Symbol Code has FDI set.static Boolean
hasModifier
(String symbolID, String modifier) Determines if a symbol, based on it's symbol ID, can have the specified modifier/amplifier.static boolean
hasRectangleFrame
(String symbolID) static boolean
isActionPoint
(String symbolID) static Boolean
Returns true if the symbol is from an air based symbol setstatic boolean
isCBRNEvent
(String symbolID) Returns true if Symbol ID represents a chemical, biological, radiological or nuclear incident.static Boolean
isExercise
(String symbolID) Returns true if the symbol ID indicates the context is Exercisestatic boolean
isGreenProtectionGraphic
(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 boolean
isGreenProtectionGraphic
(String symbolID) Returns true if graphic is protection graphic (obstacles which render green)static boolean
Returns true if the symbol has the HQ staff indicated by the symbol IDstatic Boolean
isInstallation
(String symbolID) Returns true if the symbol is an installationstatic Boolean
Returns true if the symbol is from a land based symbol setstatic boolean
isMultiPoint
(String symbolID) Determines if the Symbol can be rendered as a multipoint graphic and not just as an iconstatic boolean
Determines if a String represents a valid numberstatic boolean
isObstacle
(String symbolID) Deprecated.static Boolean
Returns true if the symbol ID indicates the context is Realitystatic Boolean
isSimulation
(String symbolID) Returns true if the symbol ID indicates the context is Simulationstatic boolean
isSonobuoy
(String symbolID) Returns true if Symbol ID represents a Sonobuoy.static Boolean
Returns true if the symbol is from a space based symbol setstatic boolean
isSPWithSpecialModifierLayout
(String symbolID) Checks if this is a single point control measure or meteorological graphic with a unique layout.static boolean
isTacticalGraphic
(String strSymbolID) Determines if the symbol is a tactical graphicstatic Boolean
isTaskForce
(String symbolID) Returns true if the symbol ID has the task for indicatorstatic boolean
isTGSPWithSpecialModifierLayout
(String strSymbolID) Control Measures and Tactical Graphics that have labels but not with the Action Point layoutstatic boolean
Return true if symbol is from the Atmospheric, Oceanographic or Meteorological Space Symbol Sets.static String
reconcileSymbolID
(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
-Integer
from 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.
-
hasModifier(String, String)