Class MarkImpl

Object
MarkImpl
All Implemented Interfaces:
Cloneable, GraphicalSymbol, Mark, Symbol, Cloneable

public class MarkImpl extends Object implements Mark, Cloneable, Symbol
Default implementation of Mark.
Author:
Ian Turton, CCG, Johann Sorel (Geomatys)
  • Constructor Details

    • MarkImpl

      public MarkImpl()
      Creates a new instance of DefaultMark
    • MarkImpl

      public MarkImpl(String name)
    • MarkImpl

      public MarkImpl(FilterFactory filterFactory, ExternalMark external)
  • Method Details

    • getFill

      public FillImpl getFill()
      This parameter defines which fill style to use when rendering the Mark.
      Specified by:
      getFill in interface Mark
      Returns:
      the Fill definition to use when rendering the Mark.
    • getStroke

      public StrokeImpl getStroke()
      This paramterer defines which stroke style should be used when rendering the Mark.
      Specified by:
      getStroke in interface Mark
      Returns:
      The Stroke definition to use when rendering the Mark.
    • getWellKnownName

      public Expression getWellKnownName()
      This parameter gives the well-known name of the shape of the mark.
      Allowed names include at least "square", "circle", "triangle", "star", "cross" and "x" though renderers may draw a different symbol instead if they don't have a shape for all of these.
      Specified by:
      getWellKnownName in interface Mark
      Returns:
      The well-known name of a shape. The default value is "square".
    • setFill

      public void setFill(Fill fill)
      Setter for property fill.
      Specified by:
      setFill in interface Mark
      Parameters:
      fill - New value of property fill.
    • setStroke

      public void setStroke(Stroke stroke)
      Setter for property stroke.
      Specified by:
      setStroke in interface Mark
      Parameters:
      stroke - New value of property stroke.
    • setWellKnownName

      public void setWellKnownName(Expression wellKnownName)
      Setter for property wellKnownName.
      Specified by:
      setWellKnownName in interface Mark
      Parameters:
      wellKnownName - New value of property wellKnownName.
    • setWellKnownName

      public void setWellKnownName(String name)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • accept

      public Object accept(TraversingStyleVisitor visitor, Object data)
      Specified by:
      accept in interface Mark
    • accept

      public void accept(StyleVisitor visitor)
      Description copied from interface: Mark
      calls the visit method of a StyleVisitor
      Specified by:
      accept in interface GraphicalSymbol
      Specified by:
      accept in interface Mark
      Specified by:
      accept in interface Symbol
      Parameters:
      visitor - the style visitor
    • clone

      public Object clone()
      Creates a deep copy of the Mark.

      Only the fill and stroke are cloned since Expressions should be immutable.

      Specified by:
      clone in interface Cloneable
      Overrides:
      clone in class Object
      Returns:
      A copy of this object.
      See Also:
    • hashCode

      public int hashCode()
      The hashcode override for the MarkImpl.
      Overrides:
      hashCode in class Object
      Returns:
      the Hashcode.
    • equals

      public boolean equals(Object oth)
      Compares this MarkImpl with another for equality.

      Two MarkImpls are equal if they have the same well Known Name, the same size and rotation and the same stroke and fill.

      Overrides:
      equals in class Object
      Parameters:
      oth - The Other MarkImpl to compare with.
      Returns:
      True if this and oth are equal.
    • getExternalMark

      public ExternalMarkImpl getExternalMark()
      Description copied from interface: Mark
      The alternative to a WellKnownName is an external mark format. See ExternalMark for details.

      Both WellKnowName and ExternalMark cannot be set, but both can be null. If none are set then the default square symbol is used.

      Specified by:
      getExternalMark in interface Mark
      Returns:
      ExternalMark or null
    • setExternalMark

      public void setExternalMark(ExternalMark external)
      Description copied from interface: Mark
      Mark defined by an external resource.
      Specified by:
      setExternalMark in interface Mark
      Parameters:
      external - Indicate an mark defined by an external resource