Package com.luciad.format.s52.gxy
Class TLcdS52GXYPainterProvider
java.lang.Object
com.luciad.format.s52.gxy.TLcdS52GXYPainterProvider
- All Implemented Interfaces:
ILcdCloneable
,ILcdGXYLabelPainterProvider
,ILcdGXYPainterProvider
,Serializable
,Cloneable
public class TLcdS52GXYPainterProvider
extends Object
implements ILcdGXYPainterProvider, ILcdGXYLabelPainterProvider
This
ILcdGXYPainterProvider
paints S-57 geometries
according to the S-52 standard.
Before the painter provider can be used, an object class map, an attribute
class map, an attribute class description map and a symbology have to be set.
Some additional display settings can be specified:
- Display categories (default = standard),
- Symbol types for points and areas (default = simplified point symbols and plain area boundaries),
- Color preference (default = day bright color),
- Safety contour (default = 30m),
- Shallow contour (default = 2m),
- Deep contour (default = 30m),
- Two shades (default = true),
- Shallow pattern (default = false),
- Display of soundings (default = false),
- Display of text (default = false).
- Display meta data (default = false).
- See Also:
-
Constructor Summary
ConstructorDescriptionCreates a newTLcdS52GXYPainterProvider
, initialized with default S-52 display settings.TLcdS52GXYPainterProvider
(TLcdS52DisplaySettings aDisplaySettings) Creates a newTLcdS52GXYPainterProvider
, initialized with the given S-52 display settings. -
Method Summary
Modifier and TypeMethodDescriptionclone()
RedefinesObject.clone
to make it public.int
Returns the style type for painting areas.int
Returns the color preference.double
Returns the deep contour.int
Returns the display category that will be painted.Returns the S-52 display settings object, defining how the S-57 data will be rendered.getGXYLabelPainter
(Object aObject) Finds anILcdGXYLabelPainter
that can be used to label the object passed.getGXYPainter
(Object aObject) Finds anILcdGXYPainter
that can be used to paint or locate the object passed.int
Returns the style type for painting points.Returns the conditional symbology.Returns the symbology.Returns the attribute class description map.Returns the attribute class map.Returns the object class map.double
Returns the safety contour.double
Returns the safety depth.double
Returns the shallow contour.boolean
Returns if anti-aliasing is enabled.boolean
Returns whether light sector lines should be displayed full length.boolean
Returnstrue
if S-57 meta data objects are displayed,false
otherwise.boolean
Returns whether soundings should be displayed.boolean
Returns whether text should be displayed.boolean
isDisplayTextGroup
(int aTextGroup) boolean
Returns true if the option 'shallow pattern' is enabled.boolean
Returns true if the option 'show isolated dangers in shallow water' is enabled.boolean
Returns true if the option 'two shades' is enabled.boolean
Returns whether abbreviations are used for the rendering of texts.boolean
Returns whether to use the national language text labels instead of the default (international) labels.boolean
Returns whether caching is used when painting this painter's object.void
setAntiAliased
(boolean aAntiAliased) Enable or disable anti-aliasing.void
setAreaBoundarySymbolType
(int aAreaBoundarySymbolType) Sets the style type for painting areas.void
setColorType
(int aColorType) Sets the color preference.void
setDeepContour
(double aDeepContour) Sets the deep contour.void
setDisplayCategory
(int aDisplayCategory) Sets the display category that will be painted.void
setDisplayFullLengthLightSectorLines
(boolean aDisplayFullLengthLightSectorLines) Sets whether light sector lines should be displayed full length.void
setDisplayMetaData
(boolean aDisplayMetaData) Sets whether S-57 meta data objects (object class 300 - 312) should be displayed or not.void
setDisplaySoundings
(boolean aDisplaySoundings) Sets whether soundings should be displayed.void
setDisplayText
(boolean aDisplayText) Sets whether text should be displayed.void
setDisplayTextGroup
(int aTextGroup, boolean aDisplayTextGroup) Sets whether the given text group should be displayed or not.void
setPointSymbolType
(int aPointSymbolType) Sets the style type for painting points.void
setS52ConditionalSymbology
(ILcdS52ConditionalSymbology aS52ConditionalSymbology) Sets the conditional symbology.void
setS52Symbology
(ILcdS52Symbology aS52Symbology) Sets the symbology that is required for painting.void
Sets the attribute class description map that is required for painting.void
setS57AttributeClassMap
(ILcdS57AttributeClassMap aS57AttributeClassMap) Sets the attribute class map that is required for painting.void
setS57ObjectClassMap
(ILcdS57ObjectClassMap aS57ObjectClassMap) Sets the object class map that is required for painting.void
setSafetyContour
(double aSafetyContour) Sets the safety contour.void
setSafetyDepth
(double aSafetyDepth) Sets the safety depth.void
setShallowContour
(double aShallowContour) Sets the shallow contour.void
setShallowPattern
(boolean aShallowPattern) Enables/disables the option 'shallow pattern'.void
setShowIsolatedDangersInShallowWater
(boolean aShowIsolatedDangers) Enables/disables the option 'show isolated dangers in shallow water'.void
setTwoShades
(boolean aTwoShades) Enables/disables the option 'two shades'.void
setUseAbbreviations
(boolean aUseAbbreviations) Sets whether abbreviations should be used for the rendering of texts.void
setUseNationalLanguage
(boolean aUseNationalLanguage) Sets whether to use national language text labels.void
setUsePaintCache
(boolean aPaintCache) Turns caching of the representation of the object on or off.
-
Constructor Details
-
TLcdS52GXYPainterProvider
public TLcdS52GXYPainterProvider()Creates a newTLcdS52GXYPainterProvider
, initialized with default S-52 display settings. -
TLcdS52GXYPainterProvider
Creates a newTLcdS52GXYPainterProvider
, initialized with the given S-52 display settings.- Parameters:
aDisplaySettings
- the S-52 display settings to be used for rendering S-57 data.
-
-
Method Details
-
getDisplaySettings
Returns the S-52 display settings object, defining how the S-57 data will be rendered.- Returns:
- the S-52 display settings object, defining how the S-57 data will be rendered.
-
setS57ObjectClassMap
Sets the object class map that is required for painting. It must be set before using the painter provider. -
getS57ObjectClassMap
Returns the object class map. -
setS57AttributeClassMap
Sets the attribute class map that is required for painting. It must be set before using the painter provider. -
getS57AttributeClassMap
Returns the attribute class map. -
setS57AttributeClassDescriptionMap
Sets the attribute class description map that is required for painting. It must be set before using the painter provider. -
getS57AttributeClassDescriptionMap
Returns the attribute class description map. -
setS52Symbology
Sets the symbology that is required for painting. It must be set before using the painter provider. -
getS52Symbology
Returns the symbology. -
setS52ConditionalSymbology
Sets the conditional symbology. A default implementation is set by default. -
getS52ConditionalSymbology
Returns the conditional symbology. -
getDisplayCategory
public int getDisplayCategory()Returns the display category that will be painted. -
setDisplayCategory
public void setDisplayCategory(int aDisplayCategory) Sets the display category that will be painted. Any lower categories will be painted as well, soSTANDARD
includesDISPLAYBASE
, andOTHER
includes all categories.- Parameters:
aDisplayCategory
-ILcdS52Style.DISPLAYBASE
,ILcdS52Style.STANDARD
, orILcdS52Style.OTHER
.
-
getPointSymbolType
public int getPointSymbolType()Returns the style type for painting points. -
setPointSymbolType
public void setPointSymbolType(int aPointSymbolType) Sets the style type for painting points.- Parameters:
aPointSymbolType
-ILcdS52Symbology.PAPER_CHART_POINT_SYMBOLS
orILcdS52Symbology.SIMPLIFIED_POINT_SYMBOLS
.
-
getAreaBoundarySymbolType
public int getAreaBoundarySymbolType()Returns the style type for painting areas. -
setAreaBoundarySymbolType
public void setAreaBoundarySymbolType(int aAreaBoundarySymbolType) Sets the style type for painting areas.- Parameters:
aAreaBoundarySymbolType
-ILcdS52Symbology.PLAIN_AREA_BOUNDARY_SYMBOLS
, orILcdS52Symbology.SYMBOLIZED_AREA_BOUNDARY_SYMBOLS
.
-
getColorType
public int getColorType()Returns the color preference. -
setColorType
public void setColorType(int aColorType) Sets the color preference.- Parameters:
aColorType
-ILcdS52Symbology.DAY_BRIGHT_COLORS
,ILcdS52Symbology.DAY_WHITE_BACK_COLORS
,ILcdS52Symbology.DAY_BLACK_BACK_COLORS
,ILcdS52Symbology.DUSK_COLORS
, orILcdS52Symbology.NIGHT_COLORS
.
-
getSafetyDepth
public double getSafetyDepth()Returns the safety depth. -
setSafetyDepth
public void setSafetyDepth(double aSafetyDepth) Sets the safety depth. -
getSafetyContour
public double getSafetyContour()Returns the safety contour. -
setSafetyContour
public void setSafetyContour(double aSafetyContour) Sets the safety contour. -
getShallowContour
public double getShallowContour()Returns the shallow contour. -
setShallowContour
public void setShallowContour(double aShallowContour) Sets the shallow contour. -
getDeepContour
public double getDeepContour()Returns the deep contour. -
setDeepContour
public void setDeepContour(double aDeepContour) Sets the deep contour. -
isTwoShades
public boolean isTwoShades()Returns true if the option 'two shades' is enabled. -
setTwoShades
public void setTwoShades(boolean aTwoShades) Enables/disables the option 'two shades'. -
isShallowPattern
public boolean isShallowPattern()Returns true if the option 'shallow pattern' is enabled. -
setShallowPattern
public void setShallowPattern(boolean aShallowPattern) Enables/disables the option 'shallow pattern'. -
isShowIsolatedDangersInShallowWater
public boolean isShowIsolatedDangersInShallowWater()Returns true if the option 'show isolated dangers in shallow water' is enabled. -
setShowIsolatedDangersInShallowWater
public void setShowIsolatedDangersInShallowWater(boolean aShowIsolatedDangers) Enables/disables the option 'show isolated dangers in shallow water'. -
isDisplaySoundings
public boolean isDisplaySoundings()Returns whether soundings should be displayed. -
setDisplaySoundings
public void setDisplaySoundings(boolean aDisplaySoundings) Sets whether soundings should be displayed. -
isDisplayFullLengthLightSectorLines
public boolean isDisplayFullLengthLightSectorLines()Returns whether light sector lines should be displayed full length. -
setDisplayFullLengthLightSectorLines
public void setDisplayFullLengthLightSectorLines(boolean aDisplayFullLengthLightSectorLines) Sets whether light sector lines should be displayed full length. If not, light sector lines will be drawn with the default length (25 mm on screen). -
isDisplayText
public boolean isDisplayText()Returns whether text should be displayed. -
setDisplayText
public void setDisplayText(boolean aDisplayText) Sets whether text should be displayed. ThesetDisplayTextGroup
method gives a more fine-grained control of which of the text labels should be visible. -
isDisplayTextGroup
public boolean isDisplayTextGroup(int aTextGroup) -
setDisplayTextGroup
public void setDisplayTextGroup(int aTextGroup, boolean aDisplayTextGroup) Sets whether the given text group should be displayed or not. By default, all text groups are enabled. Note that both the general text display flag, set bysetDisplayText
, and the text group display flag should be enabled for a text group to be visible.- Parameters:
aTextGroup
-aDisplayTextGroup
-
-
isDisplayMetaData
public boolean isDisplayMetaData()Returnstrue
if S-57 meta data objects are displayed,false
otherwise.- Returns:
true
if S-57 meta data objects are displayed,false
otherwise.
-
setDisplayMetaData
public void setDisplayMetaData(boolean aDisplayMetaData) Sets whether S-57 meta data objects (object class 300 - 312) should be displayed or not. By default, meta data are not displayed. S-52 does not provide visualization for all meta data objects that exist.- Parameters:
aDisplayMetaData
- boolean indicating whether meta data should be displayed or not.
-
isUseAbbreviations
public boolean isUseAbbreviations()Returns whether abbreviations are used for the rendering of texts. -
setUseAbbreviations
public void setUseAbbreviations(boolean aUseAbbreviations) Sets whether abbreviations should be used for the rendering of texts. This flag has currently only impact on NATSUR values. -
setUsePaintCache
public void setUsePaintCache(boolean aPaintCache) Turns caching of the representation of the object on or off. Caching reduces the time to paint an object but requires more memory. By default, caching is turned on.- Parameters:
aPaintCache
- A flag indicating whether to use caching when painting an object.- See Also:
-
isUsePaintCache
public boolean isUsePaintCache()Returns whether caching is used when painting this painter's object.- Returns:
true
if caching is used to paint this painter's object,false
otherwise.- See Also:
-
isUseNationalLanguage
public boolean isUseNationalLanguage()Returns whether to use the national language text labels instead of the default (international) labels. If no text is available in the national language, the international name will automatically be used as a fallback.- Returns:
true
if national language labels are used,false
otherwise. The default isfalse
.
-
setUseNationalLanguage
public void setUseNationalLanguage(boolean aUseNationalLanguage) Sets whether to use national language text labels. Iffalse
, the international name will be used (default).- Parameters:
aUseNationalLanguage
-true
if national language labels should be used,false
otherwise.
-
setAntiAliased
public void setAntiAliased(boolean aAntiAliased) Enable or disable anti-aliasing. By default, anti-aliasing is enabled.- Parameters:
aAntiAliased
- true to enable anti-aliasing.- Since:
- 2017.0
- See Also:
-
isAntiAliased
public boolean isAntiAliased()Returns if anti-aliasing is enabled.- Returns:
- if anti-aliasing is enabled.
- Since:
- 2017.0
- See Also:
-
getGXYPainter
Description copied from interface:ILcdGXYPainterProvider
Finds anILcdGXYPainter
that can be used to paint or locate the object passed.The painter provider is responsible for setting the object to the painter before returning the painter. An implementation should therefore have the following structure:
public ILcdGXYPainter getGXYPainter(Object aObject) { ILcdGXYPainter painter = ... // find the painter for the object if (painter != null) { painter.setObject(aObject); } return painter; }
- Specified by:
getGXYPainter
in interfaceILcdGXYPainterProvider
- Parameters:
aObject
- the object to find a painter for- Returns:
- a painter that can be used to paint or locate the object; or null if no painter could be found for the given object, or the object could not be set on the retrieved painter.
-
getGXYLabelPainter
Description copied from interface:ILcdGXYLabelPainterProvider
Finds anILcdGXYLabelPainter
that can be used to label the object passed.The label painter provider is responsible for setting the object to the label painter before returning the label painter. An implementation should therefore have the following structure:
public ILcdGXYLabelPainter getGXYLabelPainter(Object aObject) { ILcdGXYLabelPainter labelPainter = ... // find the label painter for the object if (labelPainter != null) { labelPainter.setObject(aObject); } return labelPainter; }
- Specified by:
getGXYLabelPainter
in interfaceILcdGXYLabelPainterProvider
- Parameters:
aObject
- the object to find a label painter for- Returns:
- a label painter that can be used to label the object; or null if no label painter could be found for the given object, or the object could not be set on the retrieved label painter.
-
clone
Description copied from interface:ILcdGXYPainterProvider
RedefinesObject.clone
to make it public.- Specified by:
clone
in interfaceILcdCloneable
- Specified by:
clone
in interfaceILcdGXYLabelPainterProvider
- Specified by:
clone
in interfaceILcdGXYPainterProvider
- Overrides:
clone
in classObject
- Returns:
- a clone of this painter provider.
- See Also:
-