public class MultiShapeSymbol extends Object implements ILineSymbol, IMarkerSymbol, IFillSymbol, IMultiShapeSymbol
Modifier and Type | Class and Description |
---|---|
static class |
MultiShapeSymbol.RegisterPersistence |
static class |
MultiShapeSymbol.RegisterSymbol |
Modifier and Type | Field and Description |
---|---|
static String |
MULTI_SHAPE_SYMBOL_PERSISTENCE_DEFINITION_NAME |
static String |
SYMBOL_NAME |
CIRCLE_STYLE, CROSS_STYLE, DIAMOND_STYLE, SQUARE_STYLE, STAR_STYLE, TRIANGLE_STYLE, VERTICAL_LINE_STYLE, X_STYLE
SELECTION_COLOR
PAPER, WORLD
Constructor and Description |
---|
MultiShapeSymbol() |
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Creates a copy of the object.
|
void |
draw(Graphics2D g,
AffineTransform affineTransform,
Geometry geom,
Feature feature,
Cancellable cancel)
Used when a symbol is going to be drawn.The method to do
it will depend on the derived version of the symbol.
|
void |
drawInsideRectangle(Graphics2D g,
AffineTransform scaleInstance,
Rectangle r,
PrintAttributes properties)
Useful to render the symbol inside the TOC, or inside little
rectangles.
|
int |
getAlpha()
Obtains the transparency of the line symbol
|
double |
getCartographicSize(ViewPort viewPort,
double dpi,
Geometry geom)
Gets the size (in pixels) of the cartographic element according
to the current rendering context (output dpi, map scale, map units) and the
symbol cartgraphic settings (unit, size, and unit reference system).
|
Color |
getColor()
Returns the color of the line symbol
|
String |
getDescription()
The description is a human-readable text used to label it when show in a symbol menu or something like that.
|
int |
getFillAlpha()
Obtains the transparency of the fill symbol
|
Color |
getFillColor() |
IFillSymbol |
getFillSymbol() |
Color |
getLineColor() |
ILineStyle |
getLineStyle()
Obtains the style of the line symbol.
|
ILineSymbol |
getLineSymbol() |
double |
getLineWidth()
Returns the width of the line symbol
|
IMarkerSymbol |
getMarkerSymbol() |
IMask |
getMask() |
Point2D |
getOffset()
Gets the offset for a marker symbol
|
int |
getOnePointRgb()
Returns the rgb of the symbol when it is drawn like a point.
|
ILineSymbol |
getOutline()
Obtains the ILineSymbol interface of the outline
|
void |
getPixExtentPlus(Geometry geom,
float[] distances,
ViewPort viewPort,
int dpi)
Returns the distance between the shape's bounding box and the
symbol-that-represents-this-shape's bounding box in a two-length-float
array passed as parameter.
|
int |
getReferenceSystem()
Returns the Reference System used to draw the elements of the image.
|
double |
getRotation()
Returns the rotation (in radians, counter-clockwise) of the marker symbol
|
double |
getSize()
Obtains the size of a marker symbol
|
ISymbol |
getSymbolForSelection()
Returns the derived version of the symbol that will be used to draw the
feature when it is selected.
|
int |
getSymbolType()
The use of this method -and its mechanism- is being valorated.
|
int |
getUnit()
Returns the unit used to express measures.
|
boolean |
hasFill() |
boolean |
hasOutline() |
boolean |
isOneDotOrPixel(Geometry geom,
double[] positionOfDotOrPixel,
ViewPort viewPort,
int dpi)
Informs that the geometry will be represented with that symbol in just one pixel or dot
|
boolean |
isShapeVisible()
Tells whether the shape of the symbol will be drawn or not.
|
boolean |
isSuitableFor(Geometry geom)
True if this symbol is ok for the geometry.
|
void |
loadFromState(PersistentState state)
Set the state of the object from the state passed as parameter.
|
void |
print(Graphics2D g,
AffineTransform at,
Geometry geom,
PrintAttributes properties) |
void |
saveToState(PersistentState state)
Saves the internal state of the object on the provided
PersistentState object.
|
void |
setAlpha(int outlineAlpha)
Defines the transparency of a line symbol.
|
void |
setCartographicSize(double cartographicSize,
Geometry geom)
Sets the size of the cartographic element in pixels.
|
void |
setColor(Color color)
Sets the
Color to use to render the symbol. |
void |
setDescription(String desc)
Sets the description of this symbol
|
void |
setFillColor(Color color)
Sets the color that will be used to draw the filling pattern of this symbol.
|
void |
setFillSymbol(IFillSymbol fillFillSymbol) |
void |
setHasFill(boolean hasFill) |
void |
setHasOutline(boolean hasOutline) |
void |
setLineColor(Color color)
Sets the color for a line symbol
|
void |
setLineStyle(ILineStyle lineStyle)
Defines the style of the line symbol to be used.
|
void |
setLineSymbol(ILineSymbol lineSymbol) |
void |
setLineWidth(double width)
Sets the width of the line symbol.
|
void |
setMarkerSymbol(IMarkerSymbol markerSymbol) |
void |
setMask(IMask mask)
Defines a mask for the symbol
|
void |
setOffset(Point2D offset)
Establishes the offset currently set for the marker symbol.
|
void |
setOutline(ILineSymbol outline)
Sets the color of the outline.
|
void |
setReferenceSystem(int system)
Sets the Reference System that defines how this units have to be
handled.
|
void |
setRotation(double rotation)
Sets the rotation of the marker symbol
|
void |
setSize(double size)
Sets the size of marker symbol
|
void |
setUnit(int unitIndex)
Defines the unit used to express measures.
|
double |
toCartographicSize(ViewPort viewPort,
double dpi,
Geometry geom)
Computes and sets the size (in pixels) of the cartographic element according
to the current rendering context (output dpi, map scale, map units) and the
symbol cartgraphic settings (unit, size, and unit reference system).
|
public static final String MULTI_SHAPE_SYMBOL_PERSISTENCE_DEFINITION_NAME
public static final String SYMBOL_NAME
public Color getLineColor()
public void setLineColor(Color color)
ILineSymbol
setLineColor
in interface ILineSymbol
public ILineStyle getLineStyle()
ILineSymbol
getLineStyle
in interface ILineSymbol
public void setLineStyle(ILineStyle lineStyle)
ILineSymbol
setLineStyle
in interface ILineSymbol
public void setLineWidth(double width)
ILineSymbol
setLineWidth
in interface ILineSymbol
public double getLineWidth()
ILineSymbol
getLineWidth
in interface ILineSymbol
public int getAlpha()
ILineSymbol
getAlpha
in interface ILineSymbol
public void setAlpha(int outlineAlpha)
ILineSymbol
setAlpha
in interface ILineSymbol
setAlpha
in interface IMarkerSymbol
public ISymbol getSymbolForSelection()
ISymbol
getSymbolForSelection
in interface ISymbol
public void draw(Graphics2D g, AffineTransform affineTransform, Geometry geom, Feature feature, Cancellable cancel)
ISymbol
public boolean isOneDotOrPixel(Geometry geom, double[] positionOfDotOrPixel, ViewPort viewPort, int dpi)
ISymbol
isOneDotOrPixel
in interface ISymbol
positionOfDotOrPixel
- (out) filled with pixel or dot locationpublic void getPixExtentPlus(Geometry geom, float[] distances, ViewPort viewPort, int dpi)
ISymbol
Returns the distance between the shape's bounding box and the
symbol-that-represents-this-shape's bounding box in a two-length-float
array passed as parameter.
After this method returns, the float array passed will contain two values
representing the amount of pixels separating each of the X (first element)
and Y (second element) axes.
This distance maybe dependent on:
And in any other case, if the unit of the symbol is pixels or the symbol is not even an instance of CartographicSupport, the returning values are only defined by the symbol and are not calculated.
getPixExtentPlus
in interface ISymbol
public int getOnePointRgb()
ISymbol
getOnePointRgb
in interface ISymbol
getOnePointRgb
in interface IFillSymbol
public String getDescription()
ISymbol
getDescription
in interface ISymbol
public boolean isShapeVisible()
ISymbol
isShapeVisible
in interface ISymbol
public void setDescription(String desc)
ISymbol
setDescription
in interface ISymbol
ISymbol.getDescription();
public int getSymbolType()
ISymbol
getSymbolType
in interface ISymbol
public boolean isSuitableFor(Geometry geom)
ISymbol
isSuitableFor
in interface ISymbol
isSuitableFor
in interface IFillSymbol
public void drawInsideRectangle(Graphics2D g, AffineTransform scaleInstance, Rectangle r, PrintAttributes properties) throws SymbolDrawingException
ISymbol
drawInsideRectangle
in interface ISymbol
properties
- TODOSymbolDrawingException
- TODOpublic void print(Graphics2D g, AffineTransform at, Geometry geom, PrintAttributes properties)
print
in interface IPrintable
public double getRotation()
IMarkerSymbol
getRotation
in interface IMarkerSymbol
public void setRotation(double rotation)
IMarkerSymbol
setRotation
in interface IMarkerSymbol
public Point2D getOffset()
IMarkerSymbol
getOffset
in interface IMarkerSymbol
public void setOffset(Point2D offset)
IMarkerSymbol
setOffset
in interface IMarkerSymbol
public double getSize()
IMarkerSymbol
getSize
in interface IMarkerSymbol
public void setSize(double size)
IMarkerSymbol
setSize
in interface IMarkerSymbol
public Color getColor()
ILineSymbol
getColor
in interface ISymbol
getColor
in interface ILineSymbol
getColor
in interface IMarkerSymbol
public void setColor(Color color)
ISymbol
Color
to use to render the symbol.setColor
in interface ISymbol
setColor
in interface IMarkerSymbol
color
- to render the symbolpublic void setFillColor(Color color)
IFillSymbol
setFillColor
in interface IFillSymbol
public void setOutline(ILineSymbol outline)
IFillSymbol
setOutline
in interface IFillSymbol
public Color getFillColor()
getFillColor
in interface IFillSymbol
public ILineSymbol getOutline()
IFillSymbol
getOutline
in interface IFillSymbol
public int getFillAlpha()
IFillSymbol
getFillAlpha
in interface IFillSymbol
public IMask getMask()
getMask
in interface IMarkerSymbol
public void setUnit(int unitIndex)
CartographicSupport
setUnit
in interface CartographicSupport
public int getUnit()
CartographicSupport
getUnit
in interface CartographicSupport
public void setMask(IMask mask)
IMarkerSymbol
setMask
in interface IMarkerSymbol
public int getReferenceSystem()
CartographicSupport
The elements have to be scaled to pixel when the image is bein drawn in
order to compose the map. The elements of the map may define its size in
other units than pixel.
CartographicSupport enables the elements to define the size in
measure units but these units may refer to different reference system. Two
kinds of Reference Systems are allowed in this context: CartographicSupport.WORLD,
and CartographicSupport.PAPER.
Depending on which Reference System is used the unit used by this element
refers to distances in the real world (then they are map's CRS-dependant)
or screen or printer output (then they are output DPI-dependant)
In case the unit used is pixel then the reference system does not
have any effect since the source unit is the same than the target unit.
getReferenceSystem
in interface CartographicSupport
public void setReferenceSystem(int system)
CartographicSupport
setReferenceSystem
in interface CartographicSupport
public double toCartographicSize(ViewPort viewPort, double dpi, Geometry geom)
CartographicSupport
toCartographicSize
in interface CartographicSupport
public void setCartographicSize(double cartographicSize, Geometry geom)
CartographicSupport
setCartographicSize
in interface CartographicSupport
public double getCartographicSize(ViewPort viewPort, double dpi, Geometry geom)
CartographicSupport
getCartographicSize
in interface CartographicSupport
public IMarkerSymbol getMarkerSymbol()
getMarkerSymbol
in interface IMultiShapeSymbol
public ILineSymbol getLineSymbol()
getLineSymbol
in interface IMultiShapeSymbol
public IFillSymbol getFillSymbol()
getFillSymbol
in interface IMultiShapeSymbol
public void setMarkerSymbol(IMarkerSymbol markerSymbol)
setMarkerSymbol
in interface IMultiShapeSymbol
public void setLineSymbol(ILineSymbol lineSymbol)
setLineSymbol
in interface IMultiShapeSymbol
public void setFillSymbol(IFillSymbol fillFillSymbol)
setFillSymbol
in interface IMultiShapeSymbol
public boolean hasFill()
hasFill
in interface IFillSymbol
public void setHasFill(boolean hasFill)
setHasFill
in interface IFillSymbol
public boolean hasOutline()
hasOutline
in interface IFillSymbol
public void setHasOutline(boolean hasOutline)
setHasOutline
in interface IFillSymbol
public Object clone() throws CloneNotSupportedException
Cloneable
clone
in class Object
CloneNotSupportedException
- if the instance of the object cannot
be cloned. As this is extending Cloneable
so
its sure it implements it, so this exception may be used for problems
on specific object instances.Object#clone()}.
public void loadFromState(PersistentState state) throws PersistenceException
Persistent
loadFromState
in interface Persistent
PersistenceException
public void saveToState(PersistentState state) throws PersistenceException
Persistent
saveToState
in interface Persistent
PersistenceException