Class TLcdAIXM51SymbolProvider

java.lang.Object
com.luciad.format.aixm51.view.gxy.TLcdAIXM51SymbolProvider
All Implemented Interfaces:
ILcdObjectIconProvider

public class TLcdAIXM51SymbolProvider extends Object implements ILcdObjectIconProvider
This class returns, for a set of AIXM 5.1 objects, the symbol used to paint the object on a map according to ICAO guidelines.

The user can specify whether he/she wants to use vector icons or image icons, through the method setPaintVectorIcons(boolean). Image icons are lazy loaded: image icons never requested are not precomputed as an image.

This class uses a set of predefined icons (see getIcon(Object) for a list), but it is possible to extend this class with other icons. This can be done in two ways, depending on the type of the new icons:

  • by overriding getIcon(Object): this is the preferable approach when the icons are image-based.
  • by overriding getVectorIcon(Object): this is the preferable approach when the icons are vector-based. The icons returned by this method are automatically cached in an image icon, if isPaintVectorIcons() returns true.
Please note that extensions should take into account the color property (getColor()) and the size property (getIconSize()) for custom icons.
Since:
10.0
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an empty instance of a symbol provider
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    canGetIcon(Object aObject)
    Returns whether an icon can be returned for the given object.
    Returns the color that is used for the icons in this provider.
    getIcon(Object aObject)
    Returns an icon that can be used as representation for the given object.
    int
    Returns the size of the icons in this symbol provider.
    boolean
    Returns a boolean indicating whether this symbolProvider should return vector icons or not.
    void
    setColor(Color aColor)
    Sets the color to be used for the icons in this provider.
    void
    Sets the default icon to be used when no icon can be found for a particular object.
    void
    setIconSize(int aSize)
    Sets the size of the icons in this symbol provider.
    void
    setPaintVectorIcons(boolean aPaintVectorIcons)
    Specifies whether this symbolProvider should return vector icons or not.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TLcdAIXM51SymbolProvider

      public TLcdAIXM51SymbolProvider()

      Creates an empty instance of a symbol provider

  • Method Details

    • getIcon

      public ILcdIcon getIcon(Object aObject)
      Returns an icon that can be used as representation for the given object.

      A predefined icon is available for the following objects:

      • AIXM 5.1 AirportHeliportTimeSliceType: a separate icon is available for airports (AirportHeliport type "AD" or "AH") and for heliports (AirportHeliport type "HP"),
      • AIXM 5.1 DesignatedPointTimeSliceType,
      • AIXM 5.1 VORTimeSliceType,
      • AIXM 5.1 DMETimeSliceType,
      • AIXM 5.1 NDBTimeSliceType,
      • AIXM 5.1 TACANTimeSliceType,
      • AIXM 5.1 NavaidTimeSliceType,
      • AIXM 5.1 VerticalStructureTimeSliceType,
      • AIXM 5.1 PassengerServiceTimeSliceType,
      • AIXM 5.1 AirportSuppliesServiceTimeSliceType,
      Specified by:
      getIcon in interface ILcdObjectIconProvider
      Parameters:
      aObject - the domain object.
      Returns:
      an icon that can be used as representation for the given object. If no icon can be found or if the supplied object is null, a default icon is returned (see setDefaultIcon(com.luciad.gui.ILcdIcon)).
    • setIconSize

      public void setIconSize(int aSize)
      Sets the size of the icons in this symbol provider.

      Note that this is a potential expensive operation when image icons are used, since such icons need to be recomputed when the size is changed.

      This setting is applied to all icons except for the default icon, which is a general ILcdIcon that can be set through setDefaultIcon(ILcdIcon).

      By default, an icon size of 17 pixels is used.

      Parameters:
      aSize - the size of the icons in this symbol provider.
    • getIconSize

      public int getIconSize()
      Returns the size of the icons in this symbol provider.
      Returns:
      the size of the icons in this symbol provider.
      See Also:
    • canGetIcon

      public boolean canGetIcon(Object aObject)
      Returns whether an icon can be returned for the given object.

      Because getIcon(Object) returns a default icon when no icon can be found or when the given object is null, this method always returns true.

      Specified by:
      canGetIcon in interface ILcdObjectIconProvider
      Parameters:
      aObject - the object to check whether an icon can be provided for it.
      Returns:
      true in all cases.
    • setDefaultIcon

      public void setDefaultIcon(ILcdIcon aIcon)

      Sets the default icon to be used when no icon can be found for a particular object.

      This default icon is used generally, both in vector mode and in non-vector mode

      Parameters:
      aIcon - an ILcdIcon that will be used as default.
    • setColor

      public void setColor(Color aColor)
      Sets the color to be used for the icons in this provider.
      Parameters:
      aColor - a Color
    • getColor

      public Color getColor()
      Returns the color that is used for the icons in this provider.
      Returns:
      the color that is used for the icons in this provider.
    • isPaintVectorIcons

      public boolean isPaintVectorIcons()
      Returns a boolean indicating whether this symbolProvider should return vector icons or not.

      If the return value is false, the getIcon method will return an instance of the TLcdAWTImageIcon class.

      Returns:
      a boolean indicating whether this symbolProvider should return vector icons or not
      See Also:
    • setPaintVectorIcons

      public void setPaintVectorIcons(boolean aPaintVectorIcons)
      Specifies whether this symbolProvider should return vector icons or not.

      If this property is set to false, the getIcon method will return an instance of the TLcdAWTImageIcon class (except for the default icon, which can be set through setDefaultIcon(ILcdIcon).

      By default, this property is true, indicating that vector icons are used.

      Parameters:
      aPaintVectorIcons - a boolean indicating whether this symbol provider should return vector icons or not.
      See Also: