public class TLcdICAODefaultSymbolProvider extends Object implements ILcdObjectIconProvider
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:
getIcon(Object)
: this is the preferable approach
when the icons are image-based.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.getColor()
)
and the size property (getIconSize()
) for custom icons.
This label painter evaluates its expressions using an instance of TLcdDataObjectExpressionLanguage
.Constructor and Description |
---|
TLcdICAODefaultSymbolProvider() |
Modifier and Type | Method and Description |
---|---|
boolean |
canGetIcon(Object aObject)
Returns whether an icon can be returned for the given object.
|
Color |
getColor()
Returns the color that is used for the icons in this provider.
|
ILcdIcon |
getIcon(Object aObject)
Returns an icon that can be used as representation for the given object.
|
int |
getIconSize()
Returns the size of the icons in this symbol provider.
|
ILcdIcon |
getVectorIcon(Object aObject)
Returns a vector-based icon for the given object.
|
boolean |
isPaintVectorIcons()
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 |
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.
|
@Deprecated public void setNavaidTypeIndex(int aIndex)
setNavaidTypeExpression(String)
-1
(default value),
this feature is used to make a distinction between the graphical representation of a VOR,
a VOR-DME and a VORTAC object. If the value is -1
, the default VOR icon is used for all
VOR objects.aIndex
- the index of the navaid type feature.public void setNavaidTypeExpression(String aExpression)
null
(default value), this property is used to make a
distinction between the graphical representation of a VOR, a VOR-DME and a
VORTAC object. If the value is null
, the default VOR icon is
used for all VOR objects.aExpression
- the navaid type expression.public ILcdIcon getIcon(Object aObject)
ILcdAerodrome
objects: a separate icon is available for airports (aerodrome type
TLcdAerodromeType.AIRPORT or TLcdAerodromeType.AIRPORT_HELIPORT
) and for
heliports (aerodrome type TLcdAerodromeType.HELIPORT
), see
ILcdAerodrome.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 type
TLcdNavaidType.VOR_DME
, TLcdNavaidType.VORTAC
or
TLcdNavaidType.VOR
. This functionality requires that the navaid type index
is set through setNavaidTypeIndex(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
(see ILcdObstacle.isLighted()
);ILcdLocationBasedService
objects.getIcon
in interface ILcdObjectIconProvider
aObject
- the domain object.setDefaultIcon(com.luciad.gui.ILcdIcon)
).public void setIconSize(int aSize)
ILcdIcon
that can be set through
setDefaultIcon(ILcdIcon)
.
By default, an icon size of 17 pixels is used.aSize
- the size of the icons in this symbol provider.public int getIconSize()
setIconSize(int)
public boolean canGetIcon(Object aObject)
getIcon(Object)
returns a default icon when no icon can be found
or when the given object is null, this method always returns true.canGetIcon
in interface ILcdObjectIconProvider
aObject
- the object to check whether an icon can be provided for it.public ILcdIcon getVectorIcon(Object aObject)
getIcon(Object)
for a list.aObject
- the domain object.setDefaultIcon(com.luciad.gui.ILcdIcon)
).public void setDefaultIcon(ILcdIcon aIcon)
aIcon
- an ILcdIcon
that will be used as default.public void setColor(Color aColor)
aColor
- a Color
public Color getColor()
public boolean isPaintVectorIcons()
getIcon
method will return an
instance of the TLcdAWTImageIcon
class.setPaintVectorIcons(boolean)
public void setPaintVectorIcons(boolean aPaintVectorIcons)
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.aPaintVectorIcons
- a boolean indicating whether this symbol provider should
return vector icons or not.isPaintVectorIcons()