public class SimpleTextSymbol extends AbstractSymbol implements ITextSymbol, ISimpleTextSymbol
| Modifier and Type | Class and Description |
|---|---|
static class |
SimpleTextSymbol.RegisterPersistence |
static class |
SimpleTextSymbol.RegisterSymbol |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
SIMPLE_TEXT_SYMBOL_PERSISTENCE_DEFINITION_NAME |
SYMBOL_PERSISTENCE_DEFINITION_NAMESYMBOL_NAME, SYMBOL_STYLE_ALIGNMENT_CENTERED, SYMBOL_STYLE_ALIGNMENT_JUSTIFY, SYMBOL_STYLE_ALIGNMENT_LEFT, SYMBOL_STYLE_ALIGNMENT_RIGHTSELECTION_COLORPAPER, WORLD| Constructor and Description |
|---|
SimpleTextSymbol() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
clone()
Creates a copy of the object.
|
void |
draw(java.awt.Graphics2D g,
java.awt.geom.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(java.awt.Graphics2D g,
java.awt.geom.AffineTransform scaleInstance,
java.awt.Rectangle r,
PrintAttributes properties)
Useful to render the symbol inside the TOC, or inside little
rectangles.
|
java.awt.Rectangle |
getBounds() |
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).
|
java.lang.String |
getClassName() |
java.awt.Color |
getColor()
Returns the
Color to use to render the symbol. |
java.awt.Font |
getFont()
Returns the currently set font.
|
java.awt.Color |
getHaloColor() |
float |
getHaloWidth() |
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.
|
double |
getRotation() |
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.
|
java.lang.String |
getText()
Returns the text contained by this symbol
|
java.awt.Color |
getTextColor()
Returns the currently color set to be applied to the text
|
Geometry |
getTextWrappingShape(Point p)
Returns an Geometry which represents a rectangle containing the text in
screen units.
|
boolean |
isAutoresizeEnabled() |
boolean |
isDrawWithHalo() |
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(java.awt.Graphics2D g,
java.awt.geom.AffineTransform at,
Geometry geom,
PrintAttributes properties) |
void |
saveToState(PersistentState state)
Saves the internal state of the object on the provided
PersistentState object.
|
void |
setAutoresizeEnabled(boolean autoresizeFlag) |
void |
setCartographicSize(double cartographicSize,
Geometry geom)
Sets the size of the cartographic element in pixels.
|
void |
setColor(java.awt.Color color)
Sets the
Color to use to render the symbol. |
void |
setDrawWithHalo(boolean drawWithHalo) |
void |
setFont(java.awt.Font font)
Establishes the font that will be used to render this ITextSymbol.
|
void |
setFontSize(double size)
Sets the font size currently set to this symbol
|
void |
setHaloColor(java.awt.Color co) |
void |
setHaloWidth(float haloWidth) |
void |
setRotation(double rotation)
Defines the angle of rotation for the text that composes the symbol
|
void |
setText(java.lang.String text)
Sets the text to be rendered by this symbol
|
void |
setTextColor(java.awt.Color color)
Sets the color of the text
|
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).
|
cloneForSelection, equals, getDescription, getID, getReferenceSystem, getUnit, isOneDotOrPixel, isShapeVisible, setDescription, setID, setIsShapeVisible, setReferenceSystem, setUnitfinalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDescription, isOneDotOrPixel, isShapeVisible, setDescriptionpublic static final java.lang.String SIMPLE_TEXT_SYMBOL_PERSISTENCE_DEFINITION_NAME
public void draw(java.awt.Graphics2D g,
java.awt.geom.AffineTransform affineTransform,
Geometry geom,
Feature feature,
Cancellable cancel)
ISymbolpublic void drawInsideRectangle(java.awt.Graphics2D g,
java.awt.geom.AffineTransform scaleInstance,
java.awt.Rectangle r,
PrintAttributes properties)
throws SymbolDrawingException
ISymboldrawInsideRectangle in interface ISymbolproperties - TODOSymbolDrawingException - TODOpublic int getOnePointRgb()
ISymbolgetOnePointRgb in interface ISymbolpublic 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 ISymbolpublic ISymbol getSymbolForSelection()
ISymbolgetSymbolForSelection in interface ISymbolpublic int getSymbolType()
ISymbolgetSymbolType in interface ISymbolpublic boolean isSuitableFor(Geometry geom)
ISymbolisSuitableFor in interface ISymbolpublic java.lang.String getClassName()
public void print(java.awt.Graphics2D g,
java.awt.geom.AffineTransform at,
Geometry geom,
PrintAttributes properties)
print in interface IPrintablepublic java.lang.String getText()
ITextSymbolgetText in interface ITextSymbolpublic java.awt.Font getFont()
ITextSymbolgetFont in interface ITextSymbolpublic java.awt.Color getTextColor()
ITextSymbolgetTextColor in interface ITextSymbolpublic void setText(java.lang.String text)
ITextSymbolsetText in interface ITextSymbolpublic void setFont(java.awt.Font font)
ITextSymbolsetFont in interface ITextSymbolpublic void setTextColor(java.awt.Color color)
ITextSymbolsetTextColor in interface ITextSymbolpublic java.awt.Color getColor()
ISymbolColor to use to render the symbol.public void setColor(java.awt.Color color)
ISymbolColor to use to render the symbol.public void setFontSize(double size)
ITextSymbolsetFontSize in interface ITextSymbolpublic double getRotation()
getRotation in interface ISimpleTextSymbolpublic void setRotation(double rotation)
setRotation in interface ISimpleTextSymbolrotation - public Geometry getTextWrappingShape(Point p)
getTextWrappingShape in interface ITextSymbolp - target locationpublic java.awt.Rectangle getBounds()
getBounds in interface ITextSymbolpublic void setCartographicSize(double cartographicSize,
Geometry geom)
CartographicSupportsetCartographicSize in interface CartographicSupportpublic double toCartographicSize(ViewPort viewPort, double dpi, Geometry geom)
CartographicSupporttoCartographicSize in interface CartographicSupportpublic double getCartographicSize(ViewPort viewPort, double dpi, Geometry geom)
CartographicSupportgetCartographicSize in interface CartographicSupportpublic boolean isAutoresizeEnabled()
isAutoresizeEnabled in interface ITextSymbolpublic void setAutoresizeEnabled(boolean autoresizeFlag)
setAutoresizeEnabled in interface ITextSymbolpublic java.lang.Object clone()
throws java.lang.CloneNotSupportedException
Cloneableclone in class AbstractSymboljava.lang.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
PersistentloadFromState in interface PersistentloadFromState in class AbstractSymbolPersistenceExceptionpublic void saveToState(PersistentState state) throws PersistenceException
PersistentsaveToState in interface PersistentsaveToState in class AbstractSymbolPersistenceExceptionpublic java.awt.Color getHaloColor()
getHaloColor in interface ITextSymbolpublic void setHaloColor(java.awt.Color co)
setHaloColor in interface ITextSymbolpublic float getHaloWidth()
getHaloWidth in interface ITextSymbolpublic void setHaloWidth(float haloWidth)
setHaloWidth in interface ITextSymbolpublic boolean isDrawWithHalo()
isDrawWithHalo in interface ITextSymbolpublic void setDrawWithHalo(boolean drawWithHalo)
setDrawWithHalo in interface ITextSymbol