Package org.geotools.renderer.style
Class MarkStyle2D
- Object
-
- Style
-
- Style2D
-
- LineStyle2D
-
- PolygonStyle2D
-
- MarkStyle2D
-
- All Implemented Interfaces:
Cloneable,PointStyle2D
public class MarkStyle2D extends PolygonStyle2D implements PointStyle2D
Style to represent points as small filled and stroked shapes- Author:
- Andrea Aime
-
-
Field Summary
-
Fields inherited from class PolygonStyle2D
fill, fillComposite, graphicFill
-
Fields inherited from class LineStyle2D
contour, contourComposite, perpendicularOffset, stroke
-
-
Constructor Summary
Constructors Constructor Description MarkStyle2D()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description floatgetAnchorPointX()The point symbol x anchor, between 0 and 1, defaults to 0.5floatgetAnchorPointY()The point symbol y anchor, between 0 and 1, defaults to 0.5CompositegetComposite()Returns the composite for this point symbolfloatgetDisplacementX()The point symbol x displacementfloatgetDisplacementY()The point symbol y displacementdoublegetRotation()Returns the shape rotation, in radiansShapegetShape()Returns the shape to be used to render the markdoublegetSize()Returns the size of the shape, in pixelsShapegetTransformedShape(float x, float y)Returns a shape that can be used to draw the mark at the x, y coordinates with appropriated rotation and size (according to the current style)ShapegetTransformedShape(float x, float y, float baseRotation, float rotation)Returns a shape that can be used to draw the mark at the x, y coordinates with appropriated rotation and size (according to the current style)static booleanisMaxMarkSizeEnabled()voidsetAnchorPointX(float anchorPointX)Sets the point symbol x anchor, between 0 and 1voidsetAnchorPointY(float anchorPointY)Sets the point symbol y anchor, between 0 and 1voidsetComposite(Composite composite)Sets the composite for this point symbolvoidsetDisplacementX(float displacementX)Sets the point symbol x displacementvoidsetDisplacementY(float displacementY)Sets the point symbol y displacementstatic voidsetMaxMarkSizeEnabled(boolean useMaxMarkSize)When true makes the mark scale itself to size using the max between the original width and height, otherwise it defaults to the mark height (which has been the original behavior of this class)voidsetRotation(double f)Sets the shape rotation, in radiansvoidsetShape(Shape shape)Sets the shape to be used to render the markvoidsetSize(double i)Sets the size of the shape, in pixelsStringtoString()Returns a string representation of this style.-
Methods inherited from class PolygonStyle2D
getFill, getFillComposite, getGraphicFill, setFill, setFillComposite, setGraphicFill
-
Methods inherited from class LineStyle2D
getContour, getContourComposite, getGraphicStroke, getPerpendicularOffset, getStroke, setContour, setContourComposite, setGraphicStroke, setPerpendicularOffset, setStroke
-
Methods inherited from class Style
clone, getMaxScale, getMinScale, isScaleInRange, setMinMaxScale
-
-
-
-
Method Detail
-
getRotation
public double getRotation()
Returns the shape rotation, in radians- Specified by:
getRotationin interfacePointStyle2D- Returns:
- shape rotation, in radians
-
getShape
public Shape getShape()
Returns the shape to be used to render the mark
-
getTransformedShape
public Shape getTransformedShape(float x, float y)
Returns a shape that can be used to draw the mark at the x, y coordinates with appropriated rotation and size (according to the current style)- Parameters:
x- the x coordinate where the mark will be drawny- the y coordinate where the mark will be drawn- Returns:
- a shape that can be used to draw the mark
-
getTransformedShape
public Shape getTransformedShape(float x, float y, float baseRotation, float rotation)
Returns a shape that can be used to draw the mark at the x, y coordinates with appropriated rotation and size (according to the current style)- Parameters:
x- the x coordinate where the mark will be drawny- the y coordinate where the mark will be drawnbaseRotation- a custom rotation that will be applied before offsetsrotation- the mark rotation- Returns:
- a shape that can be used to draw the mark
-
getSize
public double getSize()
Returns the size of the shape, in pixels
-
setRotation
public void setRotation(double f)
Sets the shape rotation, in radians- Specified by:
setRotationin interfacePointStyle2D
-
setShape
public void setShape(Shape shape)
Sets the shape to be used to render the mark
-
setSize
public void setSize(double i)
Sets the size of the shape, in pixels
-
toString
public String toString()
Returns a string representation of this style.- Overrides:
toStringin classPolygonStyle2D
-
isMaxMarkSizeEnabled
public static boolean isMaxMarkSizeEnabled()
-
setMaxMarkSizeEnabled
public static void setMaxMarkSizeEnabled(boolean useMaxMarkSize)
When true makes the mark scale itself to size using the max between the original width and height, otherwise it defaults to the mark height (which has been the original behavior of this class)- Since:
- 2.7.3
-
getDisplacementX
public float getDisplacementX()
Description copied from interface:PointStyle2DThe point symbol x displacement- Specified by:
getDisplacementXin interfacePointStyle2D
-
setDisplacementX
public void setDisplacementX(float displacementX)
Description copied from interface:PointStyle2DSets the point symbol x displacement- Specified by:
setDisplacementXin interfacePointStyle2D
-
getDisplacementY
public float getDisplacementY()
Description copied from interface:PointStyle2DThe point symbol y displacement- Specified by:
getDisplacementYin interfacePointStyle2D
-
setDisplacementY
public void setDisplacementY(float displacementY)
Description copied from interface:PointStyle2DSets the point symbol y displacement- Specified by:
setDisplacementYin interfacePointStyle2D
-
getAnchorPointX
public float getAnchorPointX()
Description copied from interface:PointStyle2DThe point symbol x anchor, between 0 and 1, defaults to 0.5- Specified by:
getAnchorPointXin interfacePointStyle2D
-
setAnchorPointX
public void setAnchorPointX(float anchorPointX)
Description copied from interface:PointStyle2DSets the point symbol x anchor, between 0 and 1- Specified by:
setAnchorPointXin interfacePointStyle2D
-
getAnchorPointY
public float getAnchorPointY()
Description copied from interface:PointStyle2DThe point symbol y anchor, between 0 and 1, defaults to 0.5- Specified by:
getAnchorPointYin interfacePointStyle2D
-
setAnchorPointY
public void setAnchorPointY(float anchorPointY)
Description copied from interface:PointStyle2DSets the point symbol y anchor, between 0 and 1- Specified by:
setAnchorPointYin interfacePointStyle2D
-
getComposite
public Composite getComposite()
Description copied from interface:PointStyle2DReturns the composite for this point symbol- Specified by:
getCompositein interfacePointStyle2D
-
setComposite
public void setComposite(Composite composite)
Description copied from interface:PointStyle2DSets the composite for this point symbol- Specified by:
setCompositein interfacePointStyle2D
-
-