Class TLcdMS2525bObjectCustomizer

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.luciad.symbology.milstd2525b.view.swing.TLcdMS2525bObjectCustomizer
All Implemented Interfaces:
ImageObserver, MenuContainer, Customizer, PropertyChangeListener, Serializable, EventListener, Accessible

public class TLcdMS2525bObjectCustomizer extends JPanel implements Customizer, PropertyChangeListener
A customizer for ILcdEditableMS2525bCoded instances.

By default, it contains functionality to customize/view the following properties of a symbol: hierarchy, affiliation, echelon, order of battle, status, country, display options and text modifiers. For each property, a separate child customizer is used; these customizers are marked by a unique ID:

  • Affiliation property: TLcdMS2525bObjectCustomizer.AFFILIATION_CUSTOMIZER
  • Status property: TLcdMS2525bObjectCustomizer.STATUS_CUSTOMIZER
  • ...

This customizer can be adapted: child customizers can be removed/replaced and the layout can be customized. The following methods can be overridden to achieve this:

  • createCustomizer(int aID): this method is used to create a particular child customizer (based on its unique ID). It is invoked for all available ID's.
  • insertCustomizers(int aID[], Customizer aCustomizer[]): this method is used to build the layout of this general customizer, based on which child customizers are present. It is invoked after all createCustomizer(int aID) calls.

This customizer implementation automatically adapts to the symbology standard used for the set object, according to the following general rules applied by the Luciad MIL-STD 2525 API:

  • If the object is of type TLcdEditableMS2525bObject, the symbology standard is retrieved through TLcdEditableMS2525bObject.getMS2525Standard(),
  • For all other implementations of ILcdEditableMS2525bCoded, the symbology standard is based upon the boolean System property com.luciad.symbology.milstd2525b.ms2525c.

See Also:
  • Field Details

    • AFFILIATION_CUSTOMIZER

      public static final int AFFILIATION_CUSTOMIZER
      Identifier for the affiliation customizer.
      See Also:
    • STATUS_CUSTOMIZER

      public static final int STATUS_CUSTOMIZER
      Identifier for the status customizer.
      See Also:
    • COUNTRY_CUSTOMIZER

      public static final int COUNTRY_CUSTOMIZER
      Identifier for the country customizer.
      See Also:
    • ORDEROFBATTLE_CUSTOMIZER

      public static final int ORDEROFBATTLE_CUSTOMIZER
      Identifier for the order of battle customizer.
      See Also:
    • DISPLAY_OPTION_CUSTOMIZER

      public static final int DISPLAY_OPTION_CUSTOMIZER
      Identifier for the display option customizer.
      See Also:
    • INFORMATION_CUSTOMIZER

      public static final int INFORMATION_CUSTOMIZER
      Identifier for the customizer that displays the symbology code.
      See Also:
    • PREVIEW_CUSTOMIZER

      public static final int PREVIEW_CUSTOMIZER
      Identifier for the customizer that displays a preview of the symbol.
      See Also:
    • ECHELON_CUSTOMIZER

      public static final int ECHELON_CUSTOMIZER
      Identifier for the echelon customizer.
      See Also:
    • HIERARCHY_CUSTOMIZER

      public static final int HIERARCHY_CUSTOMIZER
      Identifier for the hierarchy customizer.
      See Also:
    • TEXT_MODIFIER_UNIQUE_DESIGNATION_CUSTOMIZER

      public static final int TEXT_MODIFIER_UNIQUE_DESIGNATION_CUSTOMIZER
      Identifier for the customizer of ILcdMS2525bCoded.sUniqueDesignation.
      See Also:
    • TEXT_MODIFIER_HIGHER_FORMATION_CUSTOMIZER

      public static final int TEXT_MODIFIER_HIGHER_FORMATION_CUSTOMIZER
      Identifier for the customizer of ILcdMS2525bCoded.sHigherFormation.
      See Also:
    • TEXT_MODIFIER_DATE_TIME_GROUP_CUSTOMIZER

      public static final int TEXT_MODIFIER_DATE_TIME_GROUP_CUSTOMIZER
      Identifier for the customizer of ILcdMS2525bCoded.sDateTimeGroup.
      See Also:
    • TEXT_MODIFIER_STAFF_COMMENTS_CUSTOMIZER

      public static final int TEXT_MODIFIER_STAFF_COMMENTS_CUSTOMIZER
      Identifier for the customizer of ILcdMS2525bCoded.sStaffComments.
      See Also:
    • TEXT_MODIFIER_ADDITIONAL_INFORMATION_CUSTOMIZER

      public static final int TEXT_MODIFIER_ADDITIONAL_INFORMATION_CUSTOMIZER
      Identifier for the customizer of ILcdMS2525bCoded.sAdditionalInformation.
      See Also:
    • TEXT_MODIFIER_QUANTITY_CUSTOMIZER

      public static final int TEXT_MODIFIER_QUANTITY_CUSTOMIZER
      Identifier for the customizer of ILcdMS2525bCoded.sQuantity.
      See Also:
    • TEXT_MODIFIER_REINFORCED_OR_REDUCED_CUSTOMIZER

      public static final int TEXT_MODIFIER_REINFORCED_OR_REDUCED_CUSTOMIZER
      Identifier for the customizer of ILcdMS2525bCoded.sReinforcedOrReduced.
      See Also:
    • TEXT_MODIFIER_EVALUATION_RATING_CUSTOMIZER

      public static final int TEXT_MODIFIER_EVALUATION_RATING_CUSTOMIZER
      Identifier for the customizer of ILcdMS2525bCoded.sEvaluationRating.
      See Also:
    • TEXT_MODIFIER_COMBAT_EFFECTIVENESS_CUSTOMIZER

      public static final int TEXT_MODIFIER_COMBAT_EFFECTIVENESS_CUSTOMIZER
      Identifier for the customizer of ILcdMS2525bCoded.sCombatEffectiveness.
      See Also:
    • TEXT_MODIFIER_SIGNATURE_EQUIPMENT_CUSTOMIZER

      public static final int TEXT_MODIFIER_SIGNATURE_EQUIPMENT_CUSTOMIZER
      Identifier for the customizer of ILcdMS2525bCoded.sSignatureEquipment.
      See Also:
    • TEXT_MODIFIER_IFFSIF_CUSTOMIZER

      public static final int TEXT_MODIFIER_IFFSIF_CUSTOMIZER
      Identifier for the customizer of ILcdMS2525bCoded.sIFFSIF.
      See Also:
    • TEXT_MODIFIER_MOVEMENT_DIRECTION_CUSTOMIZER

      public static final int TEXT_MODIFIER_MOVEMENT_DIRECTION_CUSTOMIZER
      Identifier for the customizer of ILcdMS2525bCoded.sMovementDirection.
      See Also:
    • TEXT_MODIFIER_TYPE_CUSTOMIZER

      public static final int TEXT_MODIFIER_TYPE_CUSTOMIZER
      Identifier for the customizer of ILcdMS2525bCoded.sTypeLabel.
      See Also:
    • TEXT_MODIFIER_ALTITUDE_DEPTH_CUSTOMIZER

      public static final int TEXT_MODIFIER_ALTITUDE_DEPTH_CUSTOMIZER
      Identifier for the customizer of ILcdMS2525bCoded.sAltitudeDepth.
      See Also:
    • TEXT_MODIFIER_SPEED_CUSTOMIZER

      public static final int TEXT_MODIFIER_SPEED_CUSTOMIZER
      Identifier for the customizer of ILcdMS2525bCoded.sSpeedLabel.
      See Also:
    • TEXT_MODIFIER_EFFECTIVE_TIME_CUSTOMIZER

      public static final int TEXT_MODIFIER_EFFECTIVE_TIME_CUSTOMIZER
      Identifier for the customizer of ILcdMS2525bCoded.sEffectiveTime.
      See Also:
    • PROPERTY_SELECTION_OK

      public static final String PROPERTY_SELECTION_OK
      When the selection in the customizer is valid, a PROPERTY_SELECTION_OK event is passed to the property change listeners
      See Also:
    • PROPERTY_MS2525B_CODE_CHANGED

      public static final String PROPERTY_MS2525B_CODE_CHANGED
      When the MS2525b code is changed in the customizer a PROPERTY_MS2525B_CODE_CHANGED event is passed to the property change listeners
      See Also:
    • PROPERTY_MS2525B_HIERARCHY_CHANGED

      public static final String PROPERTY_MS2525B_HIERARCHY_CHANGED
      When the MS2525b hierarchy is changed in the customizer, a PROPERTY_MS2525B_HIERARCHY_CHANGED event is passed to the property change listeners.
      See Also:
    • PROPERTY_MS2525B_STYLE_CHANGED

      public static final String PROPERTY_MS2525B_STYLE_CHANGED
      When the MS2525b style (the outlining property) is changed in the customizer a PROPERTY_MS2525B_STYLE_CHANGED event is passed to the property change listeners
      See Also:
    • PROPERTY_MS2525B_TEXT_MODIFIERS_CHANGED

      public static final String PROPERTY_MS2525B_TEXT_MODIFIERS_CHANGED
      When one or more text modifiers are changed in the customizer a PROPERTY_MS2525B_TEXT_MODIFIERS_CHANGED event is passed to the property change listeners. Since more than one modifier might have changed, no old or new values are provided in the change event.
      See Also:
  • Constructor Details

    • TLcdMS2525bObjectCustomizer

      public TLcdMS2525bObjectCustomizer()
      Creates a new TLcdMS2525bObjectCustomizer object.
    • TLcdMS2525bObjectCustomizer

      public TLcdMS2525bObjectCustomizer(boolean aEnablePointFilter)
      Creates a new TLcdMS2525bObjectCustomizer object optionally enabled with a hierarchy filter that only allows to use point-based symbology.
      Parameters:
      aEnablePointFilter - whether a hierarchy filter should be enabled that only allows to use point-based symbology
    • TLcdMS2525bObjectCustomizer

      public TLcdMS2525bObjectCustomizer(ILcdFilter aFilter)
      Creates a new TLcdMS2525bObjectCustomizer object with a hierarchy filter. The filter determines which symbols should be available in the customizer.
      Parameters:
      aFilter - An ILcdFilter instance that determines which symbols should be available in the hierarchy tree. The objects that the filter will receive are of type String, representing the hierarchy of a particular symbol (e.g. "1.X.1.1"). If null, no filter will be used.
    • TLcdMS2525bObjectCustomizer

      public TLcdMS2525bObjectCustomizer(ILcdStringTranslator aStringTranslator)
      Creates a new TLcdMS2525bObjectCustomizer object with an ILcdStringTranslator. This ILcdStringTranslator can be used for translating the text from the labels that are present in the user interface.

      The translate(String) method in ILcdStringTranslator will be invoked for the following String objects:

      • Affiliation
      • Status
      • Country
      • Order of battle
      • Frame
      • Fill
      • Icon
      • Echelon
      • Domains
      • Name
      • Name of superior
      • Date/time
      • Chief's commentary
      • Complementary information
      • Number
      • Reinforcement
      • Evaluation rating
      • Combat efficiency
      • Signature
      • IFF/SIF
      • Movement direction/azimuth
      • Type
      • Altitude/depth
      • Speed
      • Effective date/time
      • Graphics
      • Text
      Parameters:
      aStringTranslator - an ILcdStringTranslator for translating text. If null, no translator will be used.
    • TLcdMS2525bObjectCustomizer

      public TLcdMS2525bObjectCustomizer(boolean aEnablePointFilter, ILcdStringTranslator aStringTranslator)
      Creates a new TLcdMS2525bObjectCustomizer object optionally enabled with a hierarchy filter that only allows to use point-based symbology, and an ILcdStringTranslator. The ILcdStringTranslator can be used for translating the text from the labels that are present in the user interface.
      Parameters:
      aEnablePointFilter - whether a hierarchy filter should be enabled that only allows to use point-based symbology
      aStringTranslator - an ILcdStringTranslator for translating text. If null, no translator will be used.
    • TLcdMS2525bObjectCustomizer

      public TLcdMS2525bObjectCustomizer(ILcdFilter aFilter, TLcdMS2525bObjectCustomizer.FilterType aFilterType, ILcdStringTranslator aStringTranslator)
      Creates a new TLcdMS2525bObjectCustomizer object with a hierarchy filter and an ILcdStringTranslator. The filter determines which symbols should be available in the customizer. The ILcdStringTranslator can be used for translating the text from the labels that are present in the user interface. See TLcdMS2525bObjectCustomizer(ILcdStringTranslator) for a list of values for which the translator will be used.
      Parameters:
      aFilter - An ILcdFilter instance that determines which symbols should be available in the hierarchy tree. The objects that the filter will receive are of type String, representing the hierarchy or text representation of a particular symbol (e.g. "1.X.1.1" or "WO-DIDID---L---") according to aFilterType. If null, no filter will be used.
      aFilterType - determines the type of the filter. Hierarchy or SIDC
      aStringTranslator - an ILcdStringTranslator for translating text. If null, no translator will be used.
    • TLcdMS2525bObjectCustomizer

      public TLcdMS2525bObjectCustomizer(ILcdFilter aFilter, ILcdStringTranslator aStringTranslator)
      Creates a new TLcdMS2525bObjectCustomizer object with a hierarchy filter and an ILcdStringTranslator. The filter determines which symbols should be available in the customizer. The ILcdStringTranslator can be used for translating the text from the labels that are present in the user interface. See TLcdMS2525bObjectCustomizer(ILcdStringTranslator) for a list of values for which the translator will be used.
      Parameters:
      aFilter - An ILcdFilter instance that determines which symbols should be available in the hierarchy tree. The objects that the filter will receive are of type String, representing the hierarchy of a particular symbol (e.g. "1.X.1.1"). If null, no filter will be used.
      aStringTranslator - an ILcdStringTranslator for translating text. If null, no translator will be used.
  • Method Details

    • setEnabled

      public void setEnabled(boolean aEnabled)
      Overrides:
      setEnabled in class JComponent
    • setObject

      public void setObject(Object aObject)
      The object to customize. This should be an instance of ILcdEditableMS2525bCoded. To be able to use style-related customizers, it should also implement the ILcdMS2525bStyled interface,
      Specified by:
      setObject in interface Customizer
      Parameters:
      aObject - The object to customize. This should be an instance of ILcdEditableMS2525bCoded and optionally also an instance of ILcdMS2525bStyled.
      Throws:
      IllegalArgumentException - when the supplied object is null, doesn't implement ILcdEditableMS2525bCoded or isn't a valid MIL-STD 2525b code.
    • propertyChange

      public void propertyChange(PropertyChangeEvent aEvent)
      Specified by:
      propertyChange in interface PropertyChangeListener
    • getObject

      public Object getObject()
      Returns the object that is currently set to this customizer. This is always an implementation of ILcdEditableMS2525bCoded.
    • isSelectionOk

      public boolean isSelectionOk()
      Returns true when the current selection in the customizer is valid.
    • createCustomizer

      protected Customizer createCustomizer(int aID)
      Creates a child customizer for the property that is identified by the given ID. The possible ID's are the static integer members of this class ending with CUSTOMIZER.

      This method can be overridden to create an own customizer for the given ID or to prevent its default customizer from being displayed by returning null.

      Each customizer that is not null should comply with the following conditions:

      • The customizer should implement (next to the Customizer interface) the PropertyChangeListener interface.
      • The customizer should inherit fom JComponent, as it will be displayed in the GUI.
      • The customizer should be registered as a property change listener on this TLcdMS2525bObjectCustomizer instance.
      • This TLcdMS2525bObjectCustomizer instance should be registered as a property change listener on the customizer.
      Parameters:
      aID - The unique ID of a customizable property.
      Returns:
      A customizer for the property that is identified by the aID argument.
    • insertCustomizers

      protected void insertCustomizers(int[] aID, Customizer[] aCustomizer)
      Inserts and layouts the given child customizers into this customizer.

      This method can be overridden to implement a custom layout. The given Customizer array contains all the child customizers that are created using createCustomizer(int) and that are not null. These customizers are also JComponent extensions. The integer array contains the corresponding identifiers.

      Parameters:
      aID - The corresponding identifiers for the customizer array aCustomizer.
      aCustomizer - The child customizers that must be layouted in this general customizer. Each customizer is also a JComponent.
      See Also:
    • getHierarchyFilter

      protected ILcdFilter getHierarchyFilter()
      Returns the filter that is to be used in the hierarchy customizer. The tree will only show symbols passing the filter. The objects that the filter will receive are of type String, representing the hierarchy of a particular symbol (e.g. "1.X.1.1").
      Returns:
      the filter that is to be used in the hierarchy customizer, or null if no filter is used
    • getSIDCFilter

      protected ILcdFilter getSIDCFilter()
      Returns the filter that is to be used in the customizer. The tree will only show symbols passing the filter. The objects that the filter will receive are of type String, representing the SIDC of a particular symbol
      Returns:
      the filter that is to be used in the customizer, or null if no filter is used