Class SymbolUtilities

java.lang.Object
armyc2.c5isr.renderer.utilities.SymbolUtilities

public class SymbolUtilities extends Object
Has various utility functions for prcessing the symbol code. See SymbolID for additional functions related to parsing the symbol code.
  • Constructor Details

  • Method Details

    • isNumber

      public static boolean isNumber(String text)
      Determines if a String represents a valid number
      Parameters:
      text - String
      Returns:
      "1.56" == true, "1ab" == false
    • getDateLabel

      public static String getDateLabel(Date time)
      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.
      Parameters:
      time - Date
      Returns:
      String
    • hasModifier

      public static Boolean hasModifier(String symbolID, String modifier)
      Determines if a symbol, based on it's symbol ID, can have the specified modifier/amplifier.
      Parameters:
      symbolID - 30 Character String
      modifier - Modifiers
      Returns:
      Boolean
    • getBasicSymbolID

      public static String getBasicSymbolID(String id)
      Gets Basic Symbol ID which is the Symbol Set + Entity Code
      Parameters:
      id - 30 Character String
      Returns:
      8 character String (Symbol Set + Entity Code)
    • getBasicSymbolID2525C

      public static String getBasicSymbolID2525C(String strSymbolID)
      Deprecated.
      function will be removed
      Gets the basic Symbol ID for a 2525C symbol S*F*GPU---***** G*G*GPP---****X
      Parameters:
      strSymbolID - 15 Character String
      Returns:
      15 Character String
    • reconcileSymbolID

      public static String reconcileSymbolID(String symbolID)
      Attempts to resolve a bad symbol ID into a value that can be found in MSLookup. If it fails, it will return the symbol code for a invalid symbol which is displayed as an inverted question mark (110098000010000000000000000000)
      Parameters:
      symbolID - 30 character String
      Returns:
      30 character String representing the resolved symbol ID.
    • getLineColorOfAffiliation

      public static Color getLineColorOfAffiliation(String symbolID)
      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 - 30 character String
      Returns:
      Color
    • getDefaultLineColor

      public static Color getDefaultLineColor(String symbolID)
      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 from getLineColorOfAffiliation(java.lang.String)
      Parameters:
      symbolID - 30 Character String
      Returns:
      Color
    • hasDefaultFill

      public static boolean hasDefaultFill(String strSymbolID)
      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

      public static boolean isTacticalGraphic(String strSymbolID)
      Determines if the symbol is a tactical graphic
      Parameters:
      strSymbolID - 30 Character String
      Returns:
      true if symbol set is 25 (control measure), or is a weather graphic
    • isMultiPoint

      public static boolean isMultiPoint(String symbolID)
      Determines if the Symbol can be rendered as a multipoint graphic and not just as an icon
      Parameters:
      symbolID - 30 Character String
      Returns:
      Boolean
    • isActionPoint

      public static boolean isActionPoint(String symbolID)
    • isTGSPWithSpecialModifierLayout

      public static boolean isTGSPWithSpecialModifierLayout(String strSymbolID)
      Control Measures and Tactical Graphics that have labels but not with the Action Point layout
      Parameters:
      strSymbolID - 30 Character String
      Returns:
      Boolean + @deprecated see isSPWithSpecialModifierLayout(String)
    • getFillColorOfAffiliation

      public static Color getFillColorOfAffiliation(String symbolID)
      Returns the fill color for the symbol based on its affiliation
      Parameters:
      symbolID - 30 Character String
      Returns:
      Color
    • canSymbolHaveModifier

      public static Boolean canSymbolHaveModifier(String symbolID, String modifier)
      Parameters:
      symbolID - 30 Character String
      modifier - Modifiers
      Returns:
      Boolean
    • hasFDI

      public static Boolean hasFDI(String symbolID)
      Checks if the Symbol Code has FDI set. Does not check if the symbol can have an FDI.
      Parameters:
      symbolID - 30 Character String
      Returns:
      Boolean
    • isGreenProtectionGraphic

      public static 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 == 25
      Parameters:
      entity - Integer
      entityType - Integer
      entitySubtype - Integer
      Returns:
      Boolean
    • isGreenProtectionGraphic

      public static boolean isGreenProtectionGraphic(String symbolID)
      Returns true if graphic is protection graphic (obstacles which render green)
      Parameters:
      symbolID - 30 Character String
      Returns:
      Boolean
    • isCBRNEvent

      public static boolean isCBRNEvent(String symbolID)
      Returns true if Symbol ID represents a chemical, biological, radiological or nuclear incident.
      Parameters:
      symbolID - 30 Character String
      Returns:
      Boolean
    • isSonobuoy

      public static boolean isSonobuoy(String symbolID)
      Returns true if Symbol ID represents a Sonobuoy.
      Parameters:
      symbolID - 30 Character String
      Returns:
      Boolean
    • isObstacle

      public static boolean isObstacle(String symbolID)
      Obstacles are generally required to have a green line color
      Parameters:
      symbolID - 30 Character String
      Returns:
      Boolean
    • isWeather

      public static boolean isWeather(String symbolID)
      Return true if symbol is from the Atmospheric, Oceanographic or Meteorological Space Symbol Sets.
      Parameters:
      symbolID - 30 Character String
      Returns:
      Boolean
    • isHQ

      public static boolean isHQ(String symbolID)
      Returns true if the symbol has the HQ staff indicated by the symbol ID
      Parameters:
      symbolID - 30 Character String
      Returns:
      Boolean
    • isSPWithSpecialModifierLayout

      public static boolean isSPWithSpecialModifierLayout(String symbolID)
      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
      Parameters:
      symbolID - 30 Character String
      Returns:
      Boolean
    • getCMSymbolAnchorPoint

      public static 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.
      Parameters:
      symbolID - 30 Character String
      bounds - RectF representing the bound of the core symbol in the image.
      Returns:
      Point representing the point in the image that is the anchor point of the symbol.
    • isInstallation

      public static Boolean isInstallation(String symbolID)
      Returns true if the symbol is an installation
      Parameters:
      symbolID - 30 Character String
      Returns:
      Boolean
    • isAir

      public static Boolean isAir(String symbolID)
      Returns true if the symbol is from an air based symbol set
      Parameters:
      symbolID - 30 Character String
      Returns:
      Boolean
    • isSpace

      public static Boolean isSpace(String symbolID)
      Returns true if the symbol is from a space based symbol set
      Parameters:
      symbolID - 30 Character String
      Returns:
      Boolean
    • isLand

      public static Boolean isLand(String symbolID)
      Returns true if the symbol is from a land based symbol set
      Parameters:
      symbolID - 30 Character String
      Returns:
      Boolean
    • isTaskForce

      public static Boolean isTaskForce(String symbolID)
      Returns true if the symbol ID has the task for indicator
      Parameters:
      symbolID - 30 Character String
      Returns:
      Boolean
    • isReality

      public static Boolean isReality(String symbolID)
      Returns true if the symbol ID indicates the context is Reality
      Parameters:
      symbolID - 30 Character String
      Returns:
      Boolean
    • isExercise

      public static Boolean isExercise(String symbolID)
      Returns true if the symbol ID indicates the context is Exercise
      Parameters:
      symbolID - 30 Character String
      Returns:
      Boolean
    • isSimulation

      public static Boolean isSimulation(String symbolID)
      Returns true if the symbol ID indicates the context is Simulation
      Parameters:
      symbolID - 30 Character String
      Returns:
      Boolean
    • getEchelonText

      public static String getEchelonText(int echelon)
      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 See SymbolID.getAmplifierDescriptor(String)
      Returns:
      String (23 (Army) would be "XXXX")
    • getStandardIdentityModifier

      public static String getStandardIdentityModifier(String symbolID)
      Returns the Standard Identity Modifier based on the Symbol ID
      Parameters:
      symbolID - 30 Character String
      Returns:
      String
    • hasRectangleFrame

      public static boolean hasRectangleFrame(String symbolID)
      Parameters:
      symbolID -
      Returns:
    • getUnitRatioHeight

      public static float getUnitRatioHeight(String symbolID)
      Returns the height ratio for the unit specified by the symbol ID Based on Figure 4 in 2525E.
      Parameters:
      symbolID - 30 Character String
      Returns:
      Float
    • getUnitRatioWidth

      public static float getUnitRatioWidth(String symbolID)
      Returns the width ratio for the unit specified by the symbol ID Based on Figure 4 in 2525E.
      Parameters:
      symbolID - 30 Character String
      Returns:
      Float