public class ChartSymbol extends AbstractSymbol implements IChartSymbol
Modifier and Type | Class and Description |
---|---|
static class |
ChartSymbol.RegisterPersistence |
static class |
ChartSymbol.RegisterSymbol |
Modifier and Type | Field and Description |
---|---|
protected ChartService |
cs |
protected static String |
FIELD_CHARTSERVICE |
protected static String |
FIELD_SYMBOL_FOR_SELECTION |
SYMBOL_PERSISTENCE_DEFINITION_NAME
SIZEFIELD, SIZEFIXED, SIZESUM, 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 |
---|
ChartSymbol() |
Modifier and Type | Method and Description |
---|---|
void |
draw(Graphics2D g,
AffineTransform affineTransform,
Geometry geom,
Feature f,
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.
|
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).
|
ChartService |
getChart() |
Color |
getColor()
Returns the color of the marker symbol.
|
int |
getFillAlpha()
Obtains the transparency of the fill symbol
|
Color |
getFillColor() |
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.
|
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.
|
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 |
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 |
set3D(boolean b)
Sets if the chart is in three dimensions.
|
void |
setAlpha(int alpha)
Defines the transparency of a line symbol.
|
void |
setCartographicSize(double cartographicSize,
Geometry geom)
Sets the size of the cartographic element in pixels.
|
void |
setChart(ChartService theChart)
Sets the ChartService of this symbol.
|
void |
setChartService(ChartService cs) |
void |
setColor(Color color)
Establishes a color for the marker symbol
|
void |
setFillColor(Color color)
Sets the color that will be used to draw the filling pattern of this symbol.
|
void |
setHasFill(boolean hasFill) |
void |
setHasOutline(boolean hasOutline) |
void |
setMask(IMask mask)
Defines a mask for the symbol
|
void |
setOffset(Point2D offset)
Establishes the offset currently set for the marker symbol.
|
void |
setOnlySelection(boolean onlySelection)
Sets if draw diagrams only by selection.
|
void |
setOutline(ILineSymbol outline)
Sets the color of the outline.
|
void |
setOutlineColor(Color color)
Sets the color of outline.
|
void |
setOutlineShow(boolean b)
Sets if the outline is draw.
|
void |
setOutlineWidth(int width)
Sets the width of outline.
|
void |
setRotation(double rotation)
Sets the rotation of the marker symbol
|
void |
setSections(String[] names,
Color[] colors)
Sets the field names and color to draw the different parts of chart.
|
void |
setSize(double size)
Sets the size of symbol.
|
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).
|
clone, cloneForSelection, equals, getDescription, getID, getReferenceSystem, getUnit, isShapeVisible, setDescription, setID, setIsShapeVisible, setReferenceSystem, setUnit
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDescription, isShapeVisible, setDescription
getReferenceSystem, getUnit, setReferenceSystem, setUnit
protected static final String FIELD_SYMBOL_FOR_SELECTION
protected static final String FIELD_CHARTSERVICE
protected ChartService cs
public ISymbol getSymbolForSelection()
ISymbol
getSymbolForSelection
in interface ISymbol
public void setChartService(ChartService cs)
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 setAlpha(int alpha)
IMarkerSymbol
setAlpha
in interface IMarkerSymbol
public IMask getMask()
getMask
in interface IMarkerSymbol
public void setMask(IMask mask)
IMarkerSymbol
setMask
in interface IMarkerSymbol
public void draw(Graphics2D g, AffineTransform affineTransform, Geometry geom, Feature f, Cancellable cancel)
ISymbol
public 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 boolean isOneDotOrPixel(Geometry geom, double[] positionOfDotOrPixel, ViewPort viewPort, int dpi)
ISymbol
isOneDotOrPixel
in interface ISymbol
isOneDotOrPixel
in class AbstractSymbol
positionOfDotOrPixel
- (out) filled with pixel or dot locationpublic int getOnePointRgb()
ISymbol
getOnePointRgb
in interface ISymbol
getOnePointRgb
in interface IFillSymbol
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 saveToState(PersistentState state) throws PersistenceException
Persistent
saveToState
in interface Persistent
saveToState
in class AbstractSymbol
PersistenceException
public void loadFromState(PersistentState state) throws PersistenceException
Persistent
loadFromState
in interface Persistent
loadFromState
in class AbstractSymbol
PersistenceException
public void print(Graphics2D g, AffineTransform at, Geometry geom, PrintAttributes properties)
print
in interface IPrintable
public void setSections(String[] names, Color[] colors)
IChartSymbol
setSections
in interface IChartSymbol
public void setSize(double size)
IChartSymbol
setSize
in interface IChartSymbol
setSize
in interface IMarkerSymbol
size
- of symbol.public void set3D(boolean b)
IChartSymbol
set3D
in interface IChartSymbol
public void setOutlineColor(Color color)
IChartSymbol
setOutlineColor
in interface IChartSymbol
public void setOutlineShow(boolean b)
IChartSymbol
setOutlineShow
in interface IChartSymbol
public void setOutlineWidth(int width)
IChartSymbol
setOutlineWidth
in interface IChartSymbol
public void setChart(ChartService theChart)
IChartSymbol
setChart
in interface IChartSymbol
public ChartService getChart()
getChart
in interface IChartSymbol
public void setOnlySelection(boolean onlySelection)
IChartSymbol
setOnlySelection
in interface IChartSymbol
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 Color getColor()
IMarkerSymbol
getColor
in interface ISymbol
getColor
in interface IMarkerSymbol
public void setColor(Color color)
IMarkerSymbol
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 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