org.geotools.styling
Class MarkImpl

java.lang.Object
  extended by org.geotools.styling.MarkImpl
All Implemented Interfaces:
java.lang.Cloneable, Symbol, org.opengis.style.GraphicalSymbol, org.opengis.style.Mark
Direct Known Subclasses:
TextMarkImpl

public class MarkImpl
extends java.lang.Object
implements Mark, org.opengis.util.Cloneable

Default implementation of Mark.

Version:
$Id: MarkImpl.java 33898 2009-09-13 15:39:05Z jive $
Author:
Ian Turton, CCG, Johann Sorel (Geomatys)

Field Summary
 
Fields inherited from interface org.geotools.styling.Mark
MARKS_EMPTY
 
Fields inherited from interface org.geotools.styling.Symbol
SYMBOLS_EMPTY
 
Constructor Summary
MarkImpl()
          Creates a new instance of DefaultMark
MarkImpl(org.opengis.filter.FilterFactory filterFactory, ExternalMark external)
           
MarkImpl(java.lang.String name)
           
 
Method Summary
 void accept(StyleVisitor visitor)
           
 java.lang.Object accept(org.opengis.style.StyleVisitor visitor, java.lang.Object data)
           
 java.lang.Object clone()
          Creates a deep copy of the Mark.
 boolean equals(java.lang.Object oth)
          Compares this MarkImpl with another for equality.
 ExternalMarkImpl getExternalMark()
          Mark defined by an external resource.
 FillImpl getFill()
          This parameter defines which fill style to use when rendering the Mark.
 org.opengis.filter.expression.Expression getRotation()
          Getter for property rotation.
 org.opengis.filter.expression.Expression getSize()
          Getter for property size.
 StrokeImpl getStroke()
          This paramterer defines which stroke style should be used when rendering the Mark.
 org.opengis.filter.expression.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.
 int hashCode()
          The hashcode override for the MarkImpl.
 void setExternalMark(org.opengis.style.ExternalMark external)
          Mark defined by an external resource.
 void setFill(org.opengis.style.Fill fill)
          Setter for property fill.
 void setRotation(double rotation)
           
 void setRotation(org.opengis.filter.expression.Expression rotation)
           
 void setSize(org.opengis.filter.expression.Expression size)
          Size to display the mark.
 void setSize(int size)
           
 void setStroke(org.opengis.style.Stroke stroke)
          Setter for property stroke.
 void setWellKnownName(org.opengis.filter.expression.Expression wellKnownName)
          Setter for property wellKnownName.
 void setWellKnownName(java.lang.String name)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MarkImpl

public MarkImpl()
Creates a new instance of DefaultMark


MarkImpl

public MarkImpl(java.lang.String name)

MarkImpl

public MarkImpl(org.opengis.filter.FilterFactory filterFactory,
                ExternalMark external)
Method Detail

getFill

public FillImpl getFill()
This parameter defines which fill style to use when rendering the Mark.

Specified by:
getFill in interface org.opengis.style.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 org.opengis.style.Mark
Returns:
The Stroke definition to use when rendering the Mark.

getWellKnownName

public org.opengis.filter.expression.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 org.opengis.style.Mark
Returns:
The well-known name of a shape. The default value is "square".

setFill

public void setFill(org.opengis.style.Fill fill)
Setter for property fill.

Parameters:
fill - New value of property fill.

setStroke

public void setStroke(org.opengis.style.Stroke stroke)
Setter for property stroke.

Parameters:
stroke - New value of property stroke.

setSize

public void setSize(org.opengis.filter.expression.Expression size)
Description copied from interface: Mark
Size to display the mark.

If this value is not provided or is Expression.NIL then a default of 16x16 (or the natural size of the image) will be used.


setSize

public void setSize(int size)

setWellKnownName

public void setWellKnownName(org.opengis.filter.expression.Expression wellKnownName)
Setter for property wellKnownName.

Parameters:
wellKnownName - New value of property wellKnownName.

setWellKnownName

public void setWellKnownName(java.lang.String name)

setRotation

public void setRotation(org.opengis.filter.expression.Expression rotation)

setRotation

public void setRotation(double rotation)

getSize

public org.opengis.filter.expression.Expression getSize()
Getter for property size.

Returns:
Value of property size.

getRotation

public org.opengis.filter.expression.Expression getRotation()
Getter for property rotation.

Returns:
Value of property rotation.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

accept

public java.lang.Object accept(org.opengis.style.StyleVisitor visitor,
                               java.lang.Object data)
Specified by:
accept in interface org.opengis.style.Mark

accept

public void accept(StyleVisitor visitor)
Specified by:
accept in interface Symbol

clone

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

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

Overrides:
clone in class java.lang.Object
See Also:
org.geotools.styling.Mark#clone()

hashCode

public int hashCode()
The hashcode override for the MarkImpl.

Overrides:
hashCode in class java.lang.Object
Returns:
the Hashcode.

equals

public boolean equals(java.lang.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 java.lang.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
Mark defined by an external resource.

Specified by:
getExternalMark in interface org.opengis.style.Mark
Returns:
ExternalMark or null if WellKNownName is being used

setExternalMark

public void setExternalMark(org.opengis.style.ExternalMark external)
Description copied from interface: Mark
Mark defined by an external resource.

Parameters:
external - Indicate an mark defined by an external resource


Copyright © 1996-2010 Geotools. All Rights Reserved.