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:
  • 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

      public ALcdSLDSymbolizerPainter getSymbolizerPainter(int aSymbolizerPainterIndex)
      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

      public abstract boolean isScaleValid(ILcdGXYView aView)
      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

      public 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. It should then delegate to the symbolizer painters.
      Specified by:
      paint in interface ILcdGXYPainter
      Parameters:
      aGraphics - the Graphics on which the representation of the object is painted
      aPainterMode - the mode the object is represented in (see class documentation).
      aGXYContext - the ILcdGXYContext 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 interface ILcdGXYLabelPainter
      Parameters:
      aGraphics - the Graphics instance on which to paint.
      aLabelPainterMode - a combination of ILcdGXYLabelPainter.DEFAULT and ILcdGXYLabelPainter.SELECTED.
      aILcdGXYContext - the ILcdGXYContext in which the label painting has to be performed.
      See Also:
    • clone

      public Object clone()
      Calls clone of the super class and makes a deep clone of the collection of symbolizer painters.
      Specified by:
      clone in interface ILcdCloneable
      Specified by:
      clone in interface ILcdGXYLabelPainter
      Overrides:
      clone in class Object
      Returns:
      a clone with a shallow clone of the collection of symbolizer painters.
      See Also:
    • accept

      public boolean accept(Object aObject)
      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)