Package com.luciad.ais.symbology.icao
Class TLcdICAODefaultSymbolProvider
java.lang.Object
com.luciad.ais.symbology.icao.TLcdICAODefaultSymbolProvider
- All Implemented Interfaces:
ILcdObjectIconProvider
This class returns, for each kind of
AIS
object, 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, ifisPaintVectorIcons()
returns true.
getColor()
)
and the size property (getIconSize()
) for custom icons.
This label painter evaluates its expressions using an instance of TLcdDataObjectExpressionLanguage
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canGetIcon
(Object aObject) Returns whether an icon can be returned for the given object.getColor()
Returns the color that is used for the icons in this provider.Returns an icon that can be used as representation for the given object.int
Returns the size of the icons in this symbol provider.getVectorIcon
(Object aObject) Returns a vector-based icon for the given object.boolean
Returns a boolean indicating whether this symbolProvider should return vector icons or not.void
Sets the color to be used for the icons in this provider.void
setDefaultIcon
(ILcdIcon aIcon) 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
setNavaidTypeExpression
(String aExpression) Specifies the expression that evaluates to the navaid's type.void
setNavaidTypeIndex
(int aIndex) Deprecated.void
setPaintVectorIcons
(boolean aPaintVectorIcons) Specifies whether this symbolProvider should return vector icons or not.
-
Constructor Details
-
TLcdICAODefaultSymbolProvider
public TLcdICAODefaultSymbolProvider()
-
-
Method Details
-
getIcon
Returns an icon that can be used as representation for the given object. A predefined icon is available for the following objects:ILcdAerodrome
objects: a separate icon is available for airports (aerodrome typeTLcdAerodromeType.AIRPORT or
TLcdAerodromeType.AIRPORT_HELIPORT
) and for heliports (aerodrome typeTLcdAerodromeType.HELIPORT
), seeILcdAerodrome.getAerodromeType()
;ILcdHelipad
objects;ILcdWayPoint
objects;ILcdDME
objects;ILcdMarker
objects;ILcdGlidePath
objects;ILcdLocalizer
objects;ILcdNDB
objects;ILcdTACAN
objects;ILcdVOR
objects: a separate icon is available for VORs with navaid typeTLcdNavaidType.VOR_DME
,TLcdNavaidType.VORTAC
orTLcdNavaidType.VOR
. This functionality requires that the navaid type index is set throughsetNavaidTypeIndex(int)
. If this index is not set, the same icon is used for all VORs;ILcdParachuteJumpArea
objects;ILcdAirspace
objects;ILcdArrestingGear
objects;ILcdObstacle
objects: a separate icon is available for lighted and unlighted obstacles (seeILcdObstacle.isLighted()
);ILcdLocationBasedService
objects.
- Specified by:
getIcon
in interfaceILcdObjectIconProvider
- 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 generalILcdIcon
that can be set throughsetDefaultIcon(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
Returns whether an icon can be returned for the given object. BecausegetIcon(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 interfaceILcdObjectIconProvider
- Parameters:
aObject
- the object to check whether an icon can be provided for it.- Returns:
- true in all cases.
-
getVectorIcon
Returns a vector-based icon for the given object. A predefined icon is available for a set of domain objects: seegetIcon(Object)
for a list.- Parameters:
aObject
- the domain object.- Returns:
- a vector-based icon for the given object. If no icon can be found,
a default icon is returned (see
setDefaultIcon(com.luciad.gui.ILcdIcon)
).
-
setDefaultIcon
Sets the default icon to be used when no icon can be found for a particular object.- Parameters:
aIcon
- anILcdIcon
that will be used as default.
-
setColor
Sets the color to be used for the icons in this provider.- Parameters:
aColor
- aColor
-
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, thegetIcon
method will return an instance of theTLcdAWTImageIcon
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, thegetIcon
method will return an instance of theTLcdAWTImageIcon
class (except for the default icon, which can be set throughsetDefaultIcon(ILcdIcon)
. By default, this property istrue
, indicating that vector icons are used.- Parameters:
aPaintVectorIcons
- a boolean indicating whether this symbol provider should return vector icons or not.- See Also:
setNavaidTypeExpression(String)