public class TLcdS52GXYCatalogueLayer extends TLcdGXYLayer
A layer that adds support for the specific rendering requirements of S-57 catalogues.
This layer provides support for the following features:
In addition, this layer will take into account which areas of the view have already been painted in the higher levels, reducing the number of cells that need to be painted (and thus loaded) in the lower levels.
This class uses S-57-specific objects, and should only be used for the visualization of S-57 models.
Note: in versions prior to V2013.1, the layer could only handle the
ordered models (see TLcdS52ProductConfiguration#createOrderedModelDecoder
and the ECDIS developer guide). As of V2013.1, it is no longer needed to order the models
before passing them to the layer. The layer can now handle both ordered as well as non-ordered
models. The
TLcdLayer.getModel()
method will always return the model which was set on the layer.
PLACED_LABELS
Constructor and Description |
---|
TLcdS52GXYCatalogueLayer(ILcdModel aS57Catalogue,
List<ILcdInterval> aLevelScaleRanges)
Deprecated.
Use the constructor with a S-52 display settings object instead.
|
TLcdS52GXYCatalogueLayer(ILcdModel aS57Catalogue,
TLcdS52DisplaySettings aDisplaySettings)
Creates a new catalogue layer list which will be initialized with the given model.
|
Modifier and Type | Method and Description |
---|---|
int |
applyOnInteract(ILcdFunction aFunction,
Rectangle aBounds,
boolean aStrictInteract,
ILcdGXYView aGXYView)
Applies the function to (at the least) all objects that are contained (partially or completely) in the bounds of the view.
|
TLcdS52DisplaySettings |
getDisplaySettings()
Returns the S-52 display settings object, defining how the S-57 data will be rendered.
|
ILcdS52Symbology |
getS52Symbology()
Returns the S-52 symbology that is used by this layer list.
|
Color |
getUnderscaleIndicationColor()
Returns the underscale indication color.
|
boolean |
isPaintChartBoundaries()
Returns whether to paint the chart boundaries.
|
boolean |
isPaintOverscaleIndication()
Returns whether to paint the overscale indication.
|
boolean |
isPaintUnderscaleIndication()
Returns whether to paint the underscale indication.
|
protected void |
paintFromOverlaps(Graphics aGraphics,
int aMode,
ILcd2DBoundsIndexedModel a2DBoundsIndexedModel,
ILcdGXYContext aGXYContext)
Paints the objects in the passed model by applying a painting function
to all
Object of the ILcd2DBoundsIndexedModel that interact
with the view clip. |
void |
setFilter(ILcdFilter aFilter)
Sets the
ILcdFilter to filter the Object on this
ILcdLayer . |
void |
setMultileveledObjectVisibilityCalculations(boolean aEnabled)
Disables certain optimizations to avoid painting elements obscured by more-detailed cells.
|
void |
setPaintChartBoundaries(boolean aPaintChartBoundaries)
Flag indicating whether to paint the chart boundaries.
|
void |
setPaintOverscaleIndication(boolean aPaintOverscaleIndication)
Flag indicating whether to paint the overscale indication.
|
void |
setPaintUnderscaleIndication(boolean aPaintUnderscaleIndication)
Flag indicating whether to paint the underscale indication.
|
void |
setS52Symbology(ILcdS52Symbology s52Symbology)
Sets the symbology that is required for painting.
|
void |
setUnderscaleIndicationColor(Color aUnderscaleIndicationColor)
Sets the color in which to paint the underscale indication.
|
applyOnInteract, applyOnInteract, applyOnInteractLabels, asFactory, create, getBounds, getGXYEditor, getGXYEditorProvider, getGXYLabelEditor, getGXYLabelEditorProvider, getGXYLabelingAlgorithm, getGXYLabelingAlgorithmProvider, getGXYLabelPainter, getGXYLabelPainterProvider, getGXYLayerLabelPainter, getGXYPainter, getGXYPainterProvider, getGXYPainterProviderArray, getGXYPainters, getGXYPen, getIcon, getInteractMargin, getLabelLocations, getLabelMapScaleRange, getLabelScaleRange, getMapScaleRange, getMinimumObjectSizeForPainting, getModelElementComparator, getModelQueryConfiguration, getModelXYWorldTransfoClass, getPaintLabelsScaleRatioInterval, getScaleRange, isEditableSupported, isLabeled, isLabeledSupported, isLabelsEditable, isLabelsEditableSupported, isPaintFromOverlaps, isSelectionLabeled, isStopPainting, isTraceOn, modeToString, paint, paintFromModel, setClassTraceOn, setGXYEditorProvider, setGXYLabelEditorProvider, setGXYLabelingAlgorithmProvider, setGXYLabelPainterProvider, setGXYLayerLabelPainter, setGXYPainterProvider, setGXYPainterProviderArray, setGXYPen, setIcon, setInteractMargin, setLabeled, setLabelLocations, setLabelMapScaleRange, setLabelScaleRange, setLabelsEditable, setMapScaleRange, setMinimumObjectSizeForPainting, setModel, setModelElementComparator, setModelQueryConfiguration, setModelXYWorldTransfoClass, setPaintFromOverlaps, setPaintLabelsScaleRatioInterval, setScaleRange, setSelectionLabeled, setTraceOn, setVisible, startPainting, stopPainting
addPropertyChangeListener, addSelectionListener, clearSelection, fireCollectedSelectionChanges, firePropertyChangeEvent, getFilter, getLabel, getModel, getSelectionCount, invalidate, isEditable, isSelectable, isSelectableSupported, isSelected, isVisible, removePropertyChangeListener, removeSelectionListener, selectedObjects, selectObject, selectObjects, setEditable, setLabel, setSelectable, setSelectableSupported, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
clearSelection, fireCollectedSelectionChanges, getLabel, getModel, isEditable, isSelectable, isSelectableSupported, isVisible, selectObject, setEditable, setLabel, setSelectable
addSelectionListener, getSelectedObjects, getSelectionCount, isSelected, removeSelectionListener, selectedObjects
addPropertyChangeListener, removePropertyChangeListener
public TLcdS52GXYCatalogueLayer(ILcdModel aS57Catalogue, List<ILcdInterval> aLevelScaleRanges)
ILcdModelContainer
.aS57Catalogue
- the model list to set on this layer list.aLevelScaleRanges
- a list of scale ranges for the different ENC levels. The value at
index 0 is the scale range for ENC level 1 (Overview 0), the value at
index 1 the scale range for ENC level 2 (General), and so on. The
maximum scale for each
interval should be Double.POSITIVE_INFINITY (that is, a level can
never become hidden by
zooming in, unless it is covered by a more detailed level), other
maximum scales values
are ignored.public TLcdS52GXYCatalogueLayer(ILcdModel aS57Catalogue, TLcdS52DisplaySettings aDisplaySettings)
ILcdModelContainer
.aS57Catalogue
- the model list to set on this layer list.aDisplaySettings
- the S-52 display settings to be used.public void setFilter(ILcdFilter aFilter)
TLcdGXYLayer
Sets the ILcdFilter
to filter the Object
on this
ILcdLayer
. Operations on this layer will only be applied to objects of the model
that pass the filter. This includes painting, labeling, selection, editing, ...
If the filter implements ILcdChangeSource
, the layer will listen to changes in the filter to
keep, for example, the selection up to date.
Setting a null
filter, lets all objects pass for rendering. By default the filter is null
.
The filtering performed by this filter is done inside the JVM, after the
data has been queried from the model and been passed to the layer.
Use the TLcdGXYLayer.setModelQueryConfiguration(TLcdModelQueryConfiguration)
if you
have filters which should be evaluated on the model side.
For example when using a database model, this would allow the database to do the filtering.
setFilter
in class TLcdGXYLayer
aFilter
- the filter that accepts only those objects that should be taken into account.TLcdLayer.getFilter()
public void setMultileveledObjectVisibilityCalculations(boolean aEnabled)
public TLcdS52DisplaySettings getDisplaySettings()
public void setS52Symbology(ILcdS52Symbology s52Symbology)
s52Symbology
- the S-52 symbology to be used.public ILcdS52Symbology getS52Symbology()
public void setPaintChartBoundaries(boolean aPaintChartBoundaries)
aPaintChartBoundaries
- flag indicating whether to paint the chart boundaries.public boolean isPaintChartBoundaries()
public void setPaintOverscaleIndication(boolean aPaintOverscaleIndication)
aPaintOverscaleIndication
- flag indicating whether to paint the overscale indication.public boolean isPaintOverscaleIndication()
public void setPaintUnderscaleIndication(boolean aPaintUnderscaleIndication)
aPaintUnderscaleIndication
- flag indicating whether to paint the underscale indication.public boolean isPaintUnderscaleIndication()
public void setUnderscaleIndicationColor(Color aUnderscaleIndicationColor)
aUnderscaleIndicationColor
- the color in which to paint the underscale indication.public Color getUnderscaleIndicationColor()
protected void paintFromOverlaps(Graphics aGraphics, int aMode, ILcd2DBoundsIndexedModel a2DBoundsIndexedModel, ILcdGXYContext aGXYContext)
TLcdGXYLayer
Object
of the ILcd2DBoundsIndexedModel
that interact
with the view clip.
The paint order is determined by the model.paintFromOverlaps
in class TLcdGXYLayer
aGraphics
- the graphics to paint onaMode
- see ILcdGXYLayer.paint
.a2DBoundsIndexedModel
- the model to paintaGXYContext
- the ILcdGXYContext
to consider for painting.public int applyOnInteract(ILcdFunction aFunction, Rectangle aBounds, boolean aStrictInteract, ILcdGXYView aGXYView)
TLcdGXYLayer
The function shall be applied successively to all objects in the bounds as long as the function returns
true
for an object. This allows developers to indicate a stop condition. Note that the order in
which the objects are passed to the function is not specified.
When strict interaction is required, only objects whose representation lies within the given bounds, completely or partially, are candidates to be passed to the function. An object whose representation does not interact with the bounds should not be passed to the function. Applying non strict interaction can be useful to avoid heavy computations to determine whether an objects representation lies within the bounds.
This method behaves similar to the paint method, and as such is allowed to omit small or invisible objects for performance reasons.
Objects smaller than the set minimum object size may be omitted.
applyOnInteract
in interface ILcdGXYLayer
applyOnInteract
in class TLcdGXYLayer
aFunction
- the function to apply. When the function returns false, no more objects should be passed to
the function.aBounds
- all objects who lie partially or completely in this area in the view are candidates to be passed to
the function.aStrictInteract
- if true
, the ILcdFunction
shall be applied only to the objects
interacting with the given bounds. When false is passed, other objects may be taken into account too.
When applying the function to an object consumes less time than checking whether an objects representation
interacts with the bounds, non-strict interaction is generally faster.aGXYView
- the view in whose bounds the objects representations should be in order to be passed to the
function.