org.geotools.styling
Class ExternalGraphicImpl

Object
  extended by ExternalGraphicImpl
All Implemented Interfaces:
Cloneable, Symbol, ExternalGraphic, GraphicalSymbol

public class ExternalGraphicImpl
extends Object
implements ExternalGraphic, Symbol, Cloneable

DOCUMENT ME!

Author:
Ian Turton, CCG

Field Summary
 
Fields inherited from interface ExternalGraphic
EXTERNAL_GRAPHICS_EMPTY
 
Fields inherited from interface Symbol
SYMBOLS_EMPTY
 
Constructor Summary
ExternalGraphicImpl()
           
ExternalGraphicImpl(Icon icon, Collection<ColorReplacement> replaces, OnLineResource source)
           
 
Method Summary
 void accept(StyleVisitor visitor)
           
 Object accept(StyleVisitor visitor, Object data)
          calls the visit method of a StyleVisitor
 Object clone()
          Returns a clone of the ExternalGraphic
 Set<ColorReplacement> colorReplacements()
           
 boolean equals(Object oth)
          Compares this ExternalGraphi with another.
 Collection<ColorReplacement> getColorReplacements()
          The ColorReplacement element, which may occur multiple times, allows to replace a color in the ExternalGraphic, the color specified in the OriginalColor sub-element, by another color as a result of a recode function as defined in Interpolate .
 Map<String,Object> getCustomProperties()
          Custom user supplied properties available when working with an external graphic.
 String getFormat()
          Provides the format of the external graphic.
 Icon getInlineContent()
          Returns the InlineContent that comprise the image.
 URL getLocation()
          Provides the URL for where the external graphic resource can be located.
 OnLineResource getOnlineResource()
          Returns a OnlineResource to a file (perhaps a local file) that contains an image.
 int hashCode()
          Generates a hashcode for the ExternalGraphic
 void setCustomProperties(Map<String,Object> list)
          Custom properties; renderer may consult these values when drawing graphic.
 void setFormat(String format)
          Setter for property Format.
 void setInlineContent(Icon inlineContent)
           
 void setLocation(URL location)
          Setter for property location.
 void setOnlineResource(OnLineResource online)
           
 void setURI(String uri)
          Deprecated. 
 
Methods inherited from class Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExternalGraphicImpl

public ExternalGraphicImpl()

ExternalGraphicImpl

public ExternalGraphicImpl(Icon icon,
                           Collection<ColorReplacement> replaces,
                           OnLineResource source)
Method Detail

setURI

@Deprecated
public void setURI(String uri)
Deprecated. 

Description copied from interface: ExternalGraphic
Converts a URI in a string to the location URL

Parameters:
uri - the uri of the external graphic

getFormat

public String getFormat()
Provides the format of the external graphic.

Specified by:
getFormat in interface ExternalGraphic
Returns:
The format of the external graphic. Reported as its MIME type in a String object.

getLocation

public URL getLocation()
                throws MalformedURLException
Provides the URL for where the external graphic resource can be located.

Returns:
The URL of the ExternalGraphic
Throws:
MalformedURLException - If unable to represent external graphic as a URL

setFormat

public void setFormat(String format)
Setter for property Format.

Parameters:
format - New value of property Format.

setLocation

public void setLocation(URL location)
Setter for property location.

Parameters:
location - New value of property location.

accept

public Object accept(StyleVisitor visitor,
                     Object data)
Description copied from interface: ExternalGraphic
calls the visit method of a StyleVisitor

Specified by:
accept in interface ExternalGraphic
Parameters:
visitor - the style visitor

accept

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

clone

public Object clone()
Returns a clone of the ExternalGraphic

Overrides:
clone in class Object
Returns:
A copy of this object.
See Also:
org.geotools.styling.ExternalGraphic#clone()

hashCode

public int hashCode()
Generates a hashcode for the ExternalGraphic

Overrides:
hashCode in class Object
Returns:
The hash code.

equals

public boolean equals(Object oth)
Compares this ExternalGraphi with another.

Two external graphics are equal if they have the same uri and format.

Overrides:
equals in class Object
Parameters:
oth - The other External graphic.
Returns:
True if this and the other external graphic are equal.

getCustomProperties

public Map<String,Object> getCustomProperties()
Description copied from interface: ExternalGraphic
Custom user supplied properties available when working with an external graphic.

Returns:
properties

setCustomProperties

public void setCustomProperties(Map<String,Object> list)
Description copied from interface: ExternalGraphic
Custom properties; renderer may consult these values when drawing graphic.

The default GeoTools renderer uses the following:


getOnlineResource

public OnLineResource getOnlineResource()
Description copied from interface: ExternalGraphic
Returns a OnlineResource to a file (perhaps a local file) that contains an image. This can be null if the image is already loaded locally and the InlineContent property is set.

Specified by:
getOnlineResource in interface ExternalGraphic
Returns:
OnlineResource

setOnlineResource

public void setOnlineResource(OnLineResource online)

getInlineContent

public Icon getInlineContent()
Description copied from interface: ExternalGraphic
Returns the InlineContent that comprise the image. This overrides the OnlineResource property, if it is set.

Specified by:
getInlineContent in interface ExternalGraphic
Returns:

setInlineContent

public void setInlineContent(Icon inlineContent)

getColorReplacements

public Collection<ColorReplacement> getColorReplacements()
Description copied from interface: ExternalGraphic
The ColorReplacement element, which may occur multiple times, allows to replace a color in the ExternalGraphic, the color specified in the OriginalColor sub-element, by another color as a result of a recode function as defined in Interpolate .

Specified by:
getColorReplacements in interface ExternalGraphic

colorReplacements

public Set<ColorReplacement> colorReplacements()


Copyright © 1996-2014 Geotools. All Rights Reserved.