Class TLcdAPP6AObjectCustomizer

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

public class TLcdAPP6AObjectCustomizer extends JPanel implements Customizer, PropertyChangeListener
A customizer for ILcdEditableAPP6ACoded 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: TLcdAPP6AObjectCustomizer.AFFILIATION_CUSTOMIZER
  • Status property: TLcdAPP6AObjectCustomizer.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 APP-6 API:

  • If the object is of type TLcdEditableAPP6AObject, the symbology standard is retrieved through TLcdEditableAPP6AObject.getAPP6Standard(),
  • For all other implementations of ILcdEditableAPP6ACoded, the symbology standard is based upon the boolean System property com.luciad.symbology.app6a.app6b.
Please refer to the sample code for more fine-grained and customizable GUI components.

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 ILcdAPP6ACoded.sUniqueDesignation.
      See Also:
    • TEXT_MODIFIER_HIGHER_FORMATION_CUSTOMIZER

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

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

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

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

      public static final int TEXT_MODIFIER_QUANTITY_OF_EQUIPMENT_CUSTOMIZER
      Identifier for the customizer of ILcdAPP6ACoded.sQuantityOfEquipment.
      See Also:
    • TEXT_MODIFIER_REINFORCED_OR_REDUCED_CUSTOMIZER

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

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

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

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

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

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

      public static final int TEXT_MODIFIER_TYPE_OF_EQUIPMENT_CUSTOMIZER
      Identifier for the customizer of ILcdAPP6ACoded.sTypeOfEquipment.
      See Also:
    • TEXT_MODIFIER_ALTITUDE_DEPTH_CUSTOMIZER

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

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

      public static final int TEXT_MODIFIER_EFFECTIVE_TIME_CUSTOMIZER
      Identifier for the customizer of ILcdAPP6ACoded.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_APP6A_CODE_CHANGED

      public static final String PROPERTY_APP6A_CODE_CHANGED
      When the APP-6A code is changed in the customizer, a PROPERTY_APP6A_CODE_CHANGED event is passed to the property change listeners.
      See Also:
    • PROPERTY_APP6A_HIERARCHY_CHANGED

      public static final String PROPERTY_APP6A_HIERARCHY_CHANGED
      When the APP-6A hierarchy is changed in the customizer, a PROPERTY_APP6A_HIERARCHY_CHANGED event is passed to the property change listeners.
      See Also:
    • PROPERTY_APP6A_STYLE_CHANGED

      public static final String PROPERTY_APP6A_STYLE_CHANGED
      When the APP-6A style (the outlining property) is changed in the customizer a PROPERTY_APP6A_STYLE_CHANGED event is passed to the property change listeners.
      See Also:
    • PROPERTY_APP6A_TEXT_MODIFIERS_CHANGED

      public static final String PROPERTY_APP6A_TEXT_MODIFIERS_CHANGED
      When one or more text modifiers are changed in the customizer, a PROPERTY_APP6A_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

    • TLcdAPP6AObjectCustomizer

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

      public TLcdAPP6AObjectCustomizer(boolean aEnablePointFilter)
      Creates a new TLcdAPP6AObjectCustomizer 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
    • TLcdAPP6AObjectCustomizer

      public TLcdAPP6AObjectCustomizer(ILcdFilter aFilter)
      Creates a new TLcdAPP6AObjectCustomizer 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.
    • TLcdAPP6AObjectCustomizer

      public TLcdAPP6AObjectCustomizer(ILcdStringTranslator aStringTranslator)
      Creates a new TLcdAPP6AObjectCustomizer 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.
    • TLcdAPP6AObjectCustomizer

      public TLcdAPP6AObjectCustomizer(boolean aEnablePointFilter, ILcdStringTranslator aStringTranslator)
      Creates a new TLcdAPP6AObjectCustomizer 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.
    • TLcdAPP6AObjectCustomizer

      public TLcdAPP6AObjectCustomizer(ILcdFilter aFilter, TLcdAPP6AObjectCustomizer.FilterType aFilterType, ILcdStringTranslator aStringTranslator)
      Creates a new TLcdAPP6AObjectCustomizer 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 TLcdAPP6AObjectCustomizer(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.
    • TLcdAPP6AObjectCustomizer

      public TLcdAPP6AObjectCustomizer(ILcdFilter aFilter, ILcdStringTranslator aStringTranslator)
      Creates a new TLcdAPP6AObjectCustomizer 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 TLcdAPP6AObjectCustomizer(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 ILcdEditableAPP6ACoded. To be able to use style-related customizers, it should also implement the ILcdAPP6AStyled interface,
      Specified by:
      setObject in interface Customizer
      Parameters:
      aObject - The object to customize. This should be an instance of ILcdEditableAPP6ACoded and optionally also an instance of ILcdAPP6AStyled.
      Throws:
      IllegalArgumentException - when the supplied object is null, doesn't implement ILcdEditableAPP6ACoded or isn't a valid APP-6 code.
    • getObject

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

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

      public void propertyChange(PropertyChangeEvent aEvent)
      Specified by:
      propertyChange in interface PropertyChangeListener
    • 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 TLcdAPP6AObjectCustomizer instance.
      • This TLcdAPP6AObjectCustomizer 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