public interface ISymbol extends Persistent, IPrintable, Cloneable
Modifier and Type | Field and Description |
---|---|
static Color |
SELECTION_COLOR |
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.
|
Color |
getColor()
Returns the
Color to use to render the 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 |
getOnePointRgb()
Returns the rgb of the symbol when it is drawn like a point.
|
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.
|
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 |
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 |
setColor(Color color)
Sets the
Color to use to render the symbol. |
void |
setDescription(String desc)
Sets the description of this symbol
|
loadFromState, saveToState
print
static final Color SELECTION_COLOR
ISymbol getSymbolForSelection()
void draw(Graphics2D g, AffineTransform affineTransform, Geometry geom, Feature f, Cancellable cancel)
g
- affineTransform
- shp
- cancel
- TODOvoid 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.
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.
ViewPort
- viewPortShape
- shpint
- dpifloat[]
- distances, the array of floats where to store the distances in x and y axisboolean isOneDotOrPixel(Geometry geom, double[] positionOfDotOrPixel, ViewPort viewPort, int dpi)
geom
- positionOfDotOrPixel
- (out) filled with pixel or dot locationviewPort
- dpi
- int getOnePointRgb()
String getDescription()
boolean isShapeVisible()
void setDescription(String desc)
desc,
- a string with the descriptionISymbol.getDescription();
int getSymbolType()
boolean isSuitableFor(Geometry geom)
geom
- void drawInsideRectangle(Graphics2D g, AffineTransform scaleInstance, Rectangle r, PrintAttributes properties) throws SymbolDrawingException
scaleInstance
- r
- properties
- TODOg2
- SymbolDrawingException
- TODOColor getColor()
Color
to use to render the symbol.
- Color
to use to render the symbol