Package com.luciad.ogc.sld.view.gxy
Class ALcdSLDRulePainter
java.lang.Object
com.luciad.ogc.sld.view.gxy.ALcdSLDRulePainter
- All Implemented Interfaces:
ILcdCloneable
,ILcdPropertyChangeSource
,ILcdGXYLabelPainter
,ILcdGXYPainter
,Serializable
,Cloneable
- Direct Known Subclasses:
TLcdSLDRulePainter
public abstract class ALcdSLDRulePainter
extends Object
implements ILcdGXYPainter, ILcdGXYLabelPainter, Cloneable
Abstract class that contains the information to implement a painter for objects that comply to a rule.
It contains a collection of symbolizer painters and evaluator of the filter for the rule.
- See Also:
-
Field Summary
Fields inherited from interface com.luciad.view.gxy.ILcdGXYLabelPainter
DEFAULT, SELECTED
Fields inherited from interface com.luciad.view.gxy.ILcdGXYPainter
BODY, CREATING, DEFAULT, HANDLES, RESHAPING, SELECTED, SNAPS, TRANSLATING
-
Constructor Summary
ModifierConstructorDescriptionprotected
ALcdSLDRulePainter
(boolean aHasElseFilter, ALcdSLDSymbolizerPainter[] aSymbolizerPainters) Creates a rule painter with the given array of symbolizer painters.protected
ALcdSLDRulePainter
(ILcdFilter aFilterEvaluator, ALcdSLDSymbolizerPainter[] aSymbolizerPainters) Creates a rule painter with the given filter evaluator and an array of symbolizer painters. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Accepts an object when either: it passes the filter evaluator, or the filter evaluator is null, or the corresponding rule has an else filter.clone()
Calls clone of the super class and makes a deep clone of the collection of symbolizer painters.double
Returns the max scale denominator of the rule this painter is applied for.double
Returns the min scale denominator of the rule this painter is applied for.getSymbolizerPainter
(int aSymbolizerPainterIndex) Returns the painter corresponding to the symbolizer at the given index in the rule this painter implements.int
Returns the number of painter for the symbolizers of the rule this painter implements.boolean
Returns whether the rule that this painter implements had an else filter.abstract boolean
isScaleValid
(ILcdGXYView aView) Shall return whether the scale of the supplied ILcdGXYView is within the scale range of this rule painter.abstract void
paint
(Graphics aGraphics, int aPainterMode, ILcdGXYContext aGXYContext) Shall perform scale range tests and SLD rule filter tests to decide whether the object needs to be painted.abstract void
paintLabel
(Graphics aGraphics, int aLabelPainterMode, ILcdGXYContext aILcdGXYContext) Shall perform scale range tests and SLD rule filter tests to decide whether the object needs to be painted.void
setMaxScaleDenominator
(double aMaxScaleDenominator) void
setMinScaleDenominator
(double aMinScaleDenominator) Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.view.gxy.ILcdGXYLabelPainter
getLocationIndex, getObject, getPossibleLocationCount, labelBoundsSFCT, setLocationIndex, setObject
Methods inherited from interface com.luciad.view.gxy.ILcdGXYPainter
anchorPointSFCT, boundsSFCT, getCursor, getDisplayName, getObject, isTouched, setObject, snapTarget, supportSnap
Methods inherited from interface com.luciad.util.ILcdPropertyChangeSource
addPropertyChangeListener, removePropertyChangeListener
-
Constructor Details
-
ALcdSLDRulePainter
protected ALcdSLDRulePainter(ILcdFilter aFilterEvaluator, ALcdSLDSymbolizerPainter[] aSymbolizerPainters) Creates a rule painter with the given filter evaluator and an array of symbolizer painters.- Parameters:
aFilterEvaluator
- evaluates objects passed to this painter to check whether they comply to this rule.aSymbolizerPainters
- a collection of symbolizer painters implementing the style that was defined in the symbolizers for the rule this painter is created for.
-
ALcdSLDRulePainter
protected ALcdSLDRulePainter(boolean aHasElseFilter, ALcdSLDSymbolizerPainter[] aSymbolizerPainters) Creates a rule painter with the given array of symbolizer painters. The filter evaluator is assumed to be null, which amounts to either no filtering or an else filter, depending on the value of aHasElseFilter.- Parameters:
aHasElseFilter
- indicates whether this rule had an else filter.aSymbolizerPainters
- a collection of symbolizer painters implementing the style that was defined in the symbolizers for the rule this painter is created for.
-
-
Method Details
-
hasElseFilter
public boolean hasElseFilter()Returns whether the rule that this painter implements had an else filter.- Returns:
- whether the rule that this painter implements had an else filter.
-
getSymbolizerPainter
Returns the painter corresponding to the symbolizer at the given index in the rule this painter implements.- Parameters:
aSymbolizerPainterIndex
- the index of the symbolizer to retrieve a painter for.- Returns:
- the painter corresponding to the symbolizer at the given index in the rule this painter implements.
-
getSymbolizerPainterCount
public int getSymbolizerPainterCount()Returns the number of painter for the symbolizers of the rule this painter implements. This should be equal to the number of symbolizers in the rule.- Returns:
- the number of painter for the symbolizers of the rule this painter implements.
-
isScaleValid
Shall return whether the scale of the supplied ILcdGXYView is within the scale range of this rule painter. If this method returns false, none of the objects in a model need to be passed to this painter, which allows users of this painter to perform optimisations- Parameters:
aView
-- Returns:
- true if the views scale is in the range [minscale, maxscale].
-
paint
Shall perform scale range tests and SLD rule filter tests to decide whether the object needs to be painted. It should then delegate to the symbolizer painters.- Specified by:
paint
in interfaceILcdGXYPainter
- Parameters:
aGraphics
- the Graphics on which the representation of the object is paintedaPainterMode
- the mode the object is represented in (see class documentation).aGXYContext
- theILcdGXYContext
the drawing depends on.
-
paintLabel
public abstract void paintLabel(Graphics aGraphics, int aLabelPainterMode, ILcdGXYContext aILcdGXYContext) Shall perform scale range tests and SLD rule filter tests to decide whether the object needs to be painted. It should then delegate to the symbolizer painters.- Specified by:
paintLabel
in interfaceILcdGXYLabelPainter
- Parameters:
aGraphics
- theGraphics
instance on which to paint.aLabelPainterMode
- a combination of ILcdGXYLabelPainter.DEFAULT and ILcdGXYLabelPainter.SELECTED.aILcdGXYContext
- theILcdGXYContext
in which the label painting has to be performed.- See Also:
-
clone
Calls clone of the super class and makes a deep clone of the collection of symbolizer painters.- Specified by:
clone
in interfaceILcdCloneable
- Specified by:
clone
in interfaceILcdGXYLabelPainter
- Overrides:
clone
in classObject
- Returns:
- a clone with a shallow clone of the collection of symbolizer painters.
- See Also:
-
accept
Accepts an object when either:- it passes the filter evaluator, or
- the filter evaluator is null, or
- the corresponding rule has an else filter.
- Parameters:
aObject
- the object to check.- Returns:
- true when one of the above conditions is met.
-
getMinScaleDenominator
public double getMinScaleDenominator()Returns the min scale denominator of the rule this painter is applied for.- Returns:
- the min scale denominator of the rule this painter is applied for.
-
getMaxScaleDenominator
public double getMaxScaleDenominator()Returns the max scale denominator of the rule this painter is applied for.- Returns:
- Returns the max scale denominator of the rule this painter is applied for.
-
setMinScaleDenominator
public void setMinScaleDenominator(double aMinScaleDenominator) -
setMaxScaleDenominator
public void setMaxScaleDenominator(double aMaxScaleDenominator)
-