|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Graphic
A Graphic is a "graphical symbol" with an inherent shape, color(s), and possibly size.
A "graphic" can very informally be defined as "a little picture" and can be
of either a raster or vector graphic source type. The term graphic is used
since the term "symbol" is similar to "symbolizer" which is used in a
difference context in SLD. The graphical symbol to display can be provided
either as an external graphical resource or as a Mark.
Multiple external URLs and marks can be referenced with the proviso that
they all provide equivalent graphics in different formats. The 'hot spot'
to use for positioning the rendering at a point must either be inherent
from the external format or be defined to be the "central point" of the
graphic.
The details of this object are taken from the OGC Styled-Layer Descriptor Report (OGC 02-070) version 1.0.0.:
<xsd:element name="Graphic">
<xsd:annotation>
<xsd:documentation>
A "Graphic" specifies or refers to a "graphic symbol" with inherent
shape, size, and coloring.
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:element ref="sld:ExternalGraphic"/>
<xsd:element ref="sld:Mark"/>
</xsd:choice>
<xsd:sequence>
<xsd:element ref="sld:Opacity" minOccurs="0"/>
<xsd:element ref="sld:Size" minOccurs="0"/>
<xsd:element ref="sld:Rotation" minOccurs="0"/>
</xsd:sequence>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
Renderers can ue this information when displaying styled features, though it must be remembered that not all renderers will be able to fully represent strokes as set out by this interface. For example, opacity may not be supported.
Notes:
modules/library/api (gt-api.jar)
Field Summary | |
---|---|
static Graphic |
DEFAULT
A default Graphic instance. |
static Graphic |
NULL
Indicates an absense of graphic. |
Method Summary | |
---|---|
void |
accept(StyleVisitor visitor)
accepts a StyleVisitor - used by xmlencoder and other packages which need to walk the style tree |
void |
addExternalGraphic(ExternalGraphic externalGraphic)
Deprecated. Please use graphicalSymbols().add( externalGraphic ) |
void |
addMark(Mark mark)
Deprecated. Please use grpahicSymbols().add( Mark ) |
void |
addSymbol(Symbol symbol)
Deprecated. symbolizers and underneath classes are immutable |
AnchorPoint |
getAnchorPoint()
Location inside of the Graphic (or Label) to position the main-geometry point. |
Displacement |
getDisplacement()
|
ExternalGraphic[] |
getExternalGraphics()
Deprecated. this method is replaced by a set : graphicalSymbols |
Expression |
getGap()
|
String |
getGeometryPropertyName()
Getter for property geometryPropertyName. |
Expression |
getInitialGap()
|
Mark[] |
getMarks()
Deprecated. Please use graphicalSymbols() |
Expression |
getOpacity()
This specifies the level of translucency to use when rendering the graphic. |
Expression |
getRotation()
This parameter defines the rotation of a graphic in the clockwise direction about its centre point in decimal degrees. |
Expression |
getSize()
This paramteter gives the absolute size of the graphic in pixels encoded as a floating point number. |
Symbol[] |
getSymbols()
Deprecated. Please use graphicalSymbols |
List<GraphicalSymbol> |
graphicalSymbols()
List of all symbols used to represent this graphic. |
void |
setAnchorPoint(AnchorPoint anchorPoint)
Anchor point (expressed as an x/y percentage of the graphic size). |
void |
setDisplacement(Displacement offset)
|
void |
setExternalGraphics(ExternalGraphic[] externalGraphics)
Deprecated. Please use graphicalSymbols().clear(); and graphicalSymbols().addAll( externalGraphics ) |
void |
setGap(Expression gap)
|
void |
setGeometryPropertyName(String geometryPropertyName)
Setter for property geometryPropertyName. |
void |
setInitialGap(Expression initialGap)
|
void |
setMarks(Mark[] marks)
Deprecated. Please use graphicSymbols().addAll() |
void |
setOpacity(Expression opacity)
|
void |
setRotation(Expression rotation)
|
void |
setSize(Expression size)
|
void |
setSymbols(Symbol[] symbols)
Deprecated. symbolizers and underneath classes will be immutable in 2.6.x |
Methods inherited from interface GraphicLegend |
---|
accept |
Methods inherited from interface GraphicFill |
---|
accept |
Methods inherited from interface GraphicStroke |
---|
accept |
Field Detail |
---|
static final Graphic DEFAULT
For some attributes the standard does not define a default, so a reasonable value is supplied.
static final Graphic NULL
This value is used to indicate that the Graphics based opperation should be skipped. Aka this is used by Stroke.Stroke as place holders for GRAPHIC_FILL and GRAPHIC_STROKE.
Method Detail |
---|
List<GraphicalSymbol> graphicalSymbols()
graphicalSymbols
in interface Graphic
ExternalGraphic[] getExternalGraphics()
void setExternalGraphics(ExternalGraphic[] externalGraphics)
externalGraphics
- void addExternalGraphic(ExternalGraphic externalGraphic)
Mark[] getMarks()
void setMarks(Mark[] marks)
void addMark(Mark mark)
Symbol[] getSymbols()
@Deprecated void setSymbols(Symbol[] symbols)
@Deprecated void addSymbol(Symbol symbol)
AnchorPoint getAnchorPoint()
The coordinates are provided as 0.0 to 1.0 range amounting to a percentage of the graphic width/height. So the default of 0.5/0.5 indicates that the graphic would be centered.
Please keep in mind that a system may shuffel things around a bit in order to prevent graphics from overlapping (so this AnchorPoint is only a hint about how things should be if there is enough room).
getAnchorPoint
in interface Graphic
void setAnchorPoint(AnchorPoint anchorPoint)
anchorPoint
- Expression getOpacity()
getOpacity
in interface Graphic
void setOpacity(Expression opacity)
opacity
- opacity between 0 and 1Expression getSize()
The default size of an image format (such as GIFD) is the inherent size of the image. The default size of a format without an inherent size (such as SVG) is defined to be 16 pixels in height and the corresponding aspect in width. If a size is specified, the height of the graphic will be scaled to that size and the corresponding aspect will be used for the width.
getSize
in interface Graphic
void setSize(Expression size)
size
- Size of graphicDisplacement getDisplacement()
getDisplacement
in interface Graphic
void setDisplacement(Displacement offset)
offset
- Amount to offset graphicExpression getRotation()
getRotation
in interface Graphic
void setRotation(Expression rotation)
rotation
- String getGeometryPropertyName()
void setGeometryPropertyName(String geometryPropertyName)
geometryPropertyName
- New value of property geometryPropertyName.Expression getGap()
getGap
in interface GraphicStroke
void setGap(Expression gap)
Expression getInitialGap()
getInitialGap
in interface GraphicStroke
void setInitialGap(Expression initialGap)
void accept(StyleVisitor visitor)
visitor
- - the visitor object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |