Package org.geotools.api.style
Interface ExternalGraphic
-
- All Superinterfaces:
GraphicalSymbol
,Symbol
- All Known Implementing Classes:
ExternalGraphicImpl
public interface ExternalGraphic extends GraphicalSymbol, Symbol
Points to an external file that contains an image of some kind, such as a CGM, JPG, or SVG.- Since:
- GeoAPI 2.2
- Author:
- Open Geospatial Consortium, Johann Sorel (Geomatys), Chris Dillard (SYS Technologies)
-
-
Field Summary
Fields Modifier and Type Field Description static ExternalGraphic[]
EXTERNAL_GRAPHICS_EMPTY
-
Fields inherited from interface GraphicalSymbol
SYMBOLS_EMPTY
-
Fields inherited from interface Symbol
SYMBOLS_EMPTY
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Object
accept(TraversingStyleVisitor visitor, Object extraData)
calls the visit method of a StyleVisitorCollection<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 inInterpolate
.Map<String,Object>
getCustomProperties()
Custom user supplied properties available when working with an external graphic.String
getFormat()
Returns the mime type of the onlineResource/InlineContentIcon
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.String
getURI()
Returns the un-parsed URI for the mark (useful if the uri is using transformations or relative locations)void
setCustomProperties(Map<String,Object> properties)
Custom properties; renderer may consult these values when drawing graphic.void
setFormat(String format)
Provides the format of the external graphic.void
setLocation(URL url)
Provides the URL for where the external graphic resource can be located.void
setURI(String uri)
Converts a URI in a string to the location URL
-
-
-
Field Detail
-
EXTERNAL_GRAPHICS_EMPTY
static final ExternalGraphic[] EXTERNAL_GRAPHICS_EMPTY
-
-
Method Detail
-
getOnlineResource
OnLineResource getOnlineResource()
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 theInlineContent
property is set.- Returns:
- OnlineResource
-
getInlineContent
Icon getInlineContent()
Returns the InlineContent that comprise the image. This overrides theOnlineResource
property, if it is set.
-
getFormat
String getFormat()
Returns the mime type of the onlineResource/InlineContent- Returns:
- mime type
-
getColorReplacements
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 inInterpolate
.
-
accept
Object accept(TraversingStyleVisitor visitor, Object extraData)
calls the visit method of a StyleVisitor- Parameters:
visitor
- the style visitor
-
setURI
void setURI(String uri)
Converts a URI in a string to the location URL- Parameters:
uri
- the uri of the external graphic
-
getURI
String getURI()
Returns the un-parsed URI for the mark (useful if the uri is using transformations or relative locations)
-
getLocation
URL getLocation() throws MalformedURLException
Provides the URL for where the external graphic resource can be located.This method will be replaced by getOnlineResource().getLinkage() in 2.6.x
- Returns:
- The URL of the ExternalGraphic
- Throws:
MalformedURLException
- If the url held in the ExternalGraphic is malformed.
-
setLocation
void setLocation(URL url)
Provides the URL for where the external graphic resource can be located.- Parameters:
url
- The URL of the ExternalGraphic
-
setFormat
void setFormat(String format)
Provides the format of the external graphic.- Parameters:
format
- The format of the external graphic. Reported as its MIME type in a String object.
-
setCustomProperties
void setCustomProperties(Map<String,Object> properties)
Custom properties; renderer may consult these values when drawing graphic.
-
-