Package armyc2.c2sd.renderer.utilities
Class SymbolUtilities
java.lang.Object
armyc2.c2sd.renderer.utilities.SymbolUtilities
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancanSymbolHaveModifier(String symbolID, int tgModifier) Checks if a tactical graphic has the passed modifier.static booleancanSymbolHaveModifier(String symbolID, int tgModifier, int symStd) Checks if a tactical graphic has the passed modifier.static booleancanUnitHaveModifier(String symbolID, int unitModifier) static StringcolorToHexString(Color color, Boolean withAlpha) static chargetAffiliation(String strSymbolID) static StringgetBasicSymbolID(String strSymbolID) static StringgetBasicSymbolIDStrict(String strSymbolID) Only for renderer use.static ColorgetColorFromHexString(String hexValue) static StringgetDateLabel(Date time) converts a Java Date object into a properly formated String for W or W1static StringgetEchelon(String strSymbolID) static StringgetEchelonText(String echelon) Reads the Symbol ID string and returns the text that represents the echelon code.static ColorgetFillColorOfAffiliation(String symbolID) Is the fill color used if no fill color has been set.static ColorgetFillColorOfWeather(String symbolID) Only for single points at the momentstatic ColorgetLineColorOfAffiliation(String symbolID) Gets line color used if no line color has been set.static ColorgetLineColorOfWeather(String symbolID) static Stringstatic StringgetSymbolModifier(String strSymbolID) Deprecated.9/6/2013static StringgetTGFillSymbolCode(String strSymbolID) static StringgetUnitAffiliationModifier(String symbolID, int symStd) static BooleanhasAMmodifierRadius(String symbolID) static BooleanhasAMmodifierRadius(String symbolID, int symStd) static BooleanhasAMmodifierWidth(String symbolID) static BooleanhasAMmodifierWidth(String symbolID, int symStd) static BooleanhasANmodifier(String symbolID) static BooleanhasANmodifier(String symbolID, int symStd) static booleanhasDefaultFill(String strSymbolID) static booleanhasDirectionOfMovement(String symbolID, int symStd) checks symbol code to see if graphic has a DOM (Q) modifierstatic booleanhasInstallationModifier(String strSymbolID) has an 'H' in the 11th position Any symbol can have this character added to make it an installation.static BooleanhasModifier(String symbolID, int modifier) static BooleanhasModifier(String symbolID, int modifier, int symStd) static BooleanhasValidAffiliation(String SymbolID) Returns true if the SymbolID has a valid Affiliation (2nd character)static BooleanhasValidBattleDimension(String SymbolID) Returns true if the SymbolID has a valid BattleDimension (3rd character) "Category" for tactical graphicsstatic BooleanhasValidCodingScheme(String symbolID) static BooleanhasValidCountryCode(String symbolID) static BooleanhasValidStatus(String SymbolID) Returns true if the SymbolID has a valid Status (4th character)static StringhierarchyToSymbolID(String strHierarchy) Deprecated.- Not all symbols have a hierarchy anymorestatic booleanis3dAirspace(String symbolID) static Booleanis3dGraphic(String symbolID) Just checks the symbolID if it could be rendered in 3D.static BooleanisAirTrack(String strSymbolID) Returns true if Symbol is an Air Trackstatic booleanisBasicShape(String symbolID) static booleanisCheckPoint(String strSymbolID) static booleanisCriticalPoint(String strSymbolID) static booleanisDeconPoint(String strSymbolID) static booleanisEchelonGraphic(String strSymbolID, int symStd) Deprecated.static booleandetermines if an symbol code represents an EMS (Emergency Management Symbol).static booleanisEMSEquipment(String strSymbolID) determines if an EMS symbol (a symbol code that starts with 'E') Is an equipment type.static booleanisEMSIncident(String strSymbolID) Determines if a symbol is an EMS Incidentstatic booleanisEMSInstallation(String strSymbolID) Determines if a symbol is an EMS Installationstatic booleanisEMSNaturalEvent(String strSymbolID) Determines if a symbol is an EMS Natural Eventstatic booleanisEquipment(String strSymbolID) static booleanstatic booleanisFeintDummy(String strSymbolID) static booleanisFeintDummyInstallation(String strSymbolID) static booleanstatic booleanisInstallation(String strSymbolID) static booleanstatic booleanSymbols that don't exist outside of MCS or units that are no longer supported like those from the SASO Proposal.static booleanSymbols that don't exist outside of MCSstatic booleanisMobility(String strSymbolID) Symbol has a mobility modifierstatic booleanisMobilityWheeled(String strSymbolID) static booleanstatic booleanstatic booleanDetermines if a String represents a valid numberstatic booleanisObstacle(String strSymbolID) static booleanstatic booleanstatic booleanSymbols from the SASO Proposal.static booleanisSeaSurface(String strSymbolID) static booleanstatic booleanstatic booleanisSonobuoy(String strSymbolID) static booleanstatic booleanisSubSurface(String strSymbolID) static booleanisTacticalGraphic(String strSymbolID) Determines if the symbol is a tactical graphicstatic BooleanReturns true if Symbol is a Targetstatic booleanisTaskForce(String strSymbolID) static booleanisTGSPWithFill(String strSymbolID) Is tactical graphic with fillstatic booleanisTGSPWithIntegralText(String strSymbolID) Is a single point tactical graphic that has integral text (like the NBC single points)static booleanisTGSPWithSpecialModifierLayout(String strSymbolID) There's a handful of single point tactical graphics with unique modifier positions.static booleanisTGWithControlPoints(String strSymbolID, int symStd) returns true if the symbol code represents a symbol that has control pointsstatic booleanstatic booleanisWarfighting(String strSymbolID) Determines if symbols is a warfighting symbol.static booleanDetermines if the symbol is a weather graphicstatic booleanisWeatherSPWithFill(String symbolID) static StringreconcileSymbolID(String symbolID) static StringreconcileSymbolID(String symbolID, boolean isMultiPoint) static StringsetAffiliation(String strSymbolID, String strAffiliationID) static StringsetEchelon(String strSymbolID, String strEchelon) static StringDeprecated.static StringsetSymbolModifier(String strSymbolID, String symbolModifierID) Deprecated.
-
Constructor Details
-
SymbolUtilities
public SymbolUtilities()
-
-
Method Details
-
getBasicSymbolID
- Parameters:
strSymbolID- - IN - A 15 character MilStd code- Returns:
- A properly formated basic symbol ID
-
getBasicSymbolIDStrict
Only for renderer use. Please use getBasicSymbolID.- Parameters:
strSymbolID-- Returns:
-
reconcileSymbolID
-
reconcileSymbolID
-
hasValidStatus
Returns true if the SymbolID has a valid Status (4th character)- Parameters:
SymbolID-- Returns:
-
hasValidAffiliation
Returns true if the SymbolID has a valid Affiliation (2nd character)- Parameters:
SymbolID-- Returns:
-
hasValidCodingScheme
-
hasValidBattleDimension
Returns true if the SymbolID has a valid BattleDimension (3rd character) "Category" for tactical graphics- Parameters:
SymbolID- 15 character String- Returns:
-
hasValidCountryCode
-
getDateLabel
converts a Java Date object into a properly formated String for W or W1- Parameters:
time-- Returns:
-
canUnitHaveModifier
- Parameters:
symbolID-unitModifier-- Returns:
-
hasModifier
-
hasModifier
- Parameters:
symbolID-modifier- - from the constants ModifiersUnits or ModifiersTGsymStd- - 0=2525B, 1=2525C. Constants available in RendererSettings.- Returns:
-
canSymbolHaveModifier
Checks if a tactical graphic has the passed modifier.- Parameters:
symbolID- - symbolID of Tactical GraphictgModifier- - ModifiersTG.AN_AZIMUTH- Returns:
-
canSymbolHaveModifier
Checks if a tactical graphic has the passed modifier.- Parameters:
symbolID- - symbolID of Tactical GraphictgModifier- - ModifiersTG.AN_AZIMUTHsymStd- - like RendererSettings.Symbology_2525C- Returns:
-
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.- Parameters:
symbolID-- Returns:
-
getFillColorOfAffiliation
Is the fill color used if no fill color has been set. The color is specified based on the affiliation of the symbol and whether it is a unit or not.- Parameters:
symbolID-- Returns:
-
getLineColorOfWeather
-
getFillColorOfWeather
Only for single points at the moment- Parameters:
symbolID-- Returns:
-
hierarchyToSymbolID
Deprecated.- Not all symbols have a hierarchy anymore- Parameters:
strHierarchy- - IN - A MilStd hierarchy- Returns:
- A properly formated basic symbol ID
-
isTacticalGraphic
Determines if the symbol is a tactical graphic- Parameters:
strSymbolID-- Returns:
- true if symbol starts with "G", or is a weather graphic, or a bridge graphic
-
isBasicShape
-
isWarfighting
Determines if symbols is a warfighting symbol.- Parameters:
strSymbolID-- Returns:
- True if code starts with "O", "S", or "I". (or "E" in 2525C)
-
isWeather
Determines if the symbol is a weather graphic- Parameters:
strSymbolID-- Returns:
- true if symbolID starts with a "W"
-
isNumber
Determines if a String represents a valid number- Parameters:
text-- Returns:
- "1.56" == true, "1ab" == false
-
colorToHexString
-
getColorFromHexString
- Parameters:
hexValue- - String representing hex value (formatted "0xRRGGBB" i.e. "0xFFFFFF") OR formatted "0xAARRGGBB" i.e. "0x00FFFFFF" for a color with an alpha value I will also put up with "RRGGBB" and "AARRGGBB" without the starting "0x"- Returns:
-
isMCSSpecificTacticalGraphic
Symbols that don't exist outside of MCS- Parameters:
sd-- Returns:
-
is3dAirspace
-
isMCSSpecificForceElement
Symbols that don't exist outside of MCS or units that are no longer supported like those from the SASO Proposal.- Parameters:
ud-- Returns:
-
is3dGraphic
Just checks the symbolID if it could be rendered in 3D. Does not check for needed modifiers.- Parameters:
symbolID-- Returns:
-
isSASO
Symbols from the SASO Proposal. Most were replaced by the USAS 13-14 update or 2525C.- Parameters:
sd-- Returns:
-
isCheckPoint
-
isCriticalPoint
- Parameters:
strSymbolID- - IN - Symbol Id we are checking to see if it is a critical point- Returns:
- True if the graphic is a critical point, false otherwise.
-
isRoute
- Parameters:
strSymbolID- - IN - Symbol Id we are checking to see if it is a route- Returns:
- True if the graphic is a route, false otherwise.
-
isRoad
- Parameters:
strSymbolID- - IN - Symbol Id we are checking to see if it is a road- Returns:
- True if the graphic is a road, false otherwise.
-
isJWARN
- Parameters:
strSymbolID- - IN - Symbol Id we are checking to see if it is a JWARN graphic- Returns:
- True if the graphic is a JWARN symbol, false otherwise.
-
isMOOTW
- Parameters:
strSymbolID- - IN - Symbol Id we are checking to see if it is a MOOTW graphic- Returns:
- True if the graphic is a MOOTW symbol in the MIL-STD 2525B or STBOPS in 2525C, false otherwise.
-
isSTBOPS
- Parameters:
strSymbolID- - IN - Symbol Id we are checking to see if it is a isStabilityOperations graphic- Returns:
- True if the graphic is a MOOTW symbol in the MIL-STD 2525B or STBOPS in 2525C, false otherwise.
-
isEvent
- Parameters:
strSymbolID- - IN - Symbol Id we are checking to see if it is a MOOTW graphic- Returns:
- True if the graphic is a MOOTW symbol in the MIL-STD 2525B, false otherwise.
-
isHQ
- Parameters:
strSymbolID- - IN - Symbol Id we are checking to see if it is a HQ- Returns:
- True if the graphic is a HQ symbol in the MIL-STD 2525B, false otherwise.
-
isTaskForce
- Parameters:
strSymbolID- - IN - Symbol Id we are checking to see if it contains task force- Returns:
- Returns true if the symbol id contains task force, false otherwise.
-
isFeintDummy
- Parameters:
strSymbolID- - IN - Symbol Id we are checking to see if it contains feint dummy- Returns:
- Returns true if the symbol id contains FeintDummy, false otherwise.
-
isMobilityWheeled
- Parameters:
strSymbolID- - IN - Symbol Id we are checking to see if it is a Wheeled Mobility- Returns:
- True if the graphic (equipment only) is a Wheeled Mobility in the MIL-STD 2525B, false otherwise.
-
isMobility
Symbol has a mobility modifier- Parameters:
strSymbolID-- Returns:
-
isTarget
Returns true if Symbol is a Target- Parameters:
strSymbolID-- Returns:
-
isAirTrack
Returns true if Symbol is an Air Track- Parameters:
strSymbolID-- Returns:
-
isObstacle
- Parameters:
strSymbolID- - IN - Symbol Id we are checking to see if it is an Obstacle- Returns:
- True if the graphic is an Obstacle in the MIL-STD 2525B, false otherwise.
-
isDeconPoint
- Parameters:
strSymbolID- - IN - Symbol Id we are checking to see if it is a Decon Point- Returns:
- True if the graphic is a Decon Point in the MIL-STD 2525B, false otherwise.
-
isEchelonGraphic
Deprecated.- Parameters:
strSymbolID- - IN - A basic MilStd2525B symbolIDsymStd- RendererSettings.Symbology_2525C- Returns:
- True if the graphic displays an echelon, false if it ignores the echelon field
-
getEchelonText
Reads the Symbol ID string and returns the text that represents the echelon code.- Parameters:
echelon-- Returns:
-
isUnit
- Parameters:
strSymbolID- - IN - SymbolID we are checking on- Returns:
- True if the graphic is a unit in the MIL-STD 2525B or is a special operation forces unit, false otherwise.
-
isNBC
- Parameters:
strSymbolID- - IN - SymbolID we are checking on- Returns:
- True if the graphic is a NBC in the MIL-STD 2525B, false otherwise.
-
isTGWithControlPoints
returns true if the symbol code represents a symbol that has control points- Parameters:
symStd- RendererSettings.Symbology_2525CstrSymbolID-- Returns:
-
isTGSPWithSpecialModifierLayout
There's a handful of single point tactical graphics with unique modifier positions.- Parameters:
strSymbolID-- Returns:
-
isTGSPWithIntegralText
Is a single point tactical graphic that has integral text (like the NBC single points)- Parameters:
strSymbolID-- Returns:
-
isTGSPWithFill
Is tactical graphic with fill- Parameters:
strSymbolID-- Returns:
-
hasDefaultFill
-
getTGFillSymbolCode
- Parameters:
strSymbolID-- Returns:
-
isWeatherSPWithFill
-
isSOF
- Parameters:
strSymbolID- - IN - SymbolID we are checking on- Returns:
- True if the graphic is a SOF in the MIL-STD 2525B, false otherwise.
-
isSonobuoy
- Parameters:
strSymbolID- - IN - Symbol Id we are checking to see if it is a Sonobuoy Point- Returns:
- True if the graphic is a Decon Point in the MIL-STD 2525B, false otherwise.
-
isSeaSurface
- Parameters:
strSymbolID- - IN - SymbolID we are checking on- Returns:
- True if the graphic is a seasurface in the MIL-STD 2525B, false otherwise.
-
isSubSurface
- Parameters:
strSymbolID- - IN - SymbolID we are checking on- Returns:
- True if the graphic is a subsurface in the MIL-STD 2525B, false otherwise.
-
isEquipment
- Parameters:
strSymbolID- - IN - A MilStd2525B symbolID- Returns:
- True if symbol is Equipment, false otherwise.
-
isEMSEquipment
determines if an EMS symbol (a symbol code that starts with 'E') Is an equipment type. There is no logical pattern to EMS equipment symbol codes so all we can do is check against a list of codes.- Parameters:
strSymbolID-- Returns:
-
isEMS
determines if an symbol code represents an EMS (Emergency Management Symbol). Returns true only for those that start with 'E'- Returns:
-
isEMSNaturalEvent
Determines if a symbol is an EMS Natural Event- Parameters:
strSymbolID-- Returns:
-
isEMSIncident
Determines if a symbol is an EMS Incident- Parameters:
strSymbolID-- Returns:
-
isEMSInstallation
Determines if a symbol is an EMS Installation- Parameters:
strSymbolID-- Returns:
-
isInstallation
- Parameters:
strSymbolID- - IN - A MilStd2525B symbolID- Returns:
- True if symbol is an Installation, false otherwise.
-
isSIGINT
- Parameters:
strSymbolID- - IN - A MilStd2525B symbolID- Returns:
- True if symbol is a Signals Intelligence, false otherwise.
-
isFeintDummyInstallation
- Parameters:
strSymbolID- - IN - A MilStd2525B symbolID- Returns:
- True if symbol has a feint dummy installation modifier, false otherwise.
-
hasInstallationModifier
has an 'H' in the 11th position Any symbol can have this character added to make it an installation.- Parameters:
strSymbolID-- Returns:
-
getAffiliation
- Parameters:
strSymbolID- - IN - Symbol Id we want the affiliation of- Returns:
- The affiliation of the Symbol Id that was passed in.
-
getStatus
- Parameters:
strSymbolID- - IN - 15 char symbol code.- Returns:
- The status of the Symbol Id that was passed in.
-
getEchelon
- Parameters:
strSymbolID- - IN - 15 char symbol code.- Returns:
- The echelon of the Symbol Id that was passed in.
-
getSymbolModifier
Deprecated.9/6/2013- Parameters:
strSymbolID- - IN - A valid 15 char MilStd2525B code.- Returns:
- The enumeration indicating which symbol modifier is turned on.
-
getUnitAffiliationModifier
-
hasDirectionOfMovement
checks symbol code to see if graphic has a DOM (Q) modifier- Parameters:
symbolID-symStd- RendererSettings.Symbology_2525C- Returns:
-
hasAMmodifierWidth
-
hasAMmodifierWidth
-
hasANmodifier
-
hasANmodifier
-
hasAMmodifierRadius
-
hasAMmodifierRadius
-
setAffiliation
- Parameters:
strSymbolID- - IN - A 15 character symbol IDstrSymbolID- - IN - The affiliation we want to change the ID to.- Returns:
- A string with the affiliation changed to affiliationID
-
setEchelon
- Parameters:
strSymbolID- - IN - A 15 character symbol IDstrSymbolID- - IN - A string representing the echelon we want to change the ID to. The case of the string does not matter, it can be upper or lower. The string is the name of the echelon and can be of the following choices: Null, //- Team, Crew, //A Squad, //B Section, //C Platoon, Detachment //D Company, Battery, Troop //E Battalion, Squadron, //F Regiment, Group, //G Brigade, //H Division, //I Corps, Mef, //J Army, //K Army Group, Front, //L Region //M- Returns:
- A symbol ID with the echelon changed to echelonID
-
setStatus
Deprecated.- Parameters:
strSymbolID- - IN - A 15 character symbol IDstrStatusID- - IN - The status we want to change the ID to. "present", "planned", "anticipated", "plannedanticipated"- Returns:
- A string with the status changed to statusID
-
setSymbolModifier
Deprecated.- Parameters:
strSymbolID- - IN - A 15 character symbol IDsymbolModifierID- - IN - The symbolModifier we want to change the ID to.- Returns:
- A symbol ID with the symbolModifier changed to symbolModifierID
-