public class SmartTextSymbol extends AbstractSymbol implements ISimpleTextSymbol
AbstractSymbol.RegisterPersistenceCartographicSupport.CartographicContext| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
SMART_TEXT_SYMBOL_PERSISTENCE_DEFINITION_NAME |
LOGGER, 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 |
|---|
SmartTextSymbol() |
SmartTextSymbol(ITextSymbol sym,
IPlacementConstraints constraints) |
| 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 f,
Cancellable cancel)
Draws the text according.
|
void |
draw(java.awt.Graphics2D g,
java.awt.geom.AffineTransform affineTransform,
Geometry geom,
Feature f,
Cancellable cancel,
java.awt.Rectangle r) |
void |
drawInsideRectangle(java.awt.Graphics2D g,
java.awt.geom.AffineTransform scaleInstance,
java.awt.Rectangle r)
Useful to render the symbol inside the TOC, or inside little
rectangles.
|
java.awt.Rectangle |
getBounds() |
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() |
void |
getPixExtentPlus(Geometry shp,
float[] distances,
ViewPort viewPort,
int dpi) |
double |
getRotation() |
Geometry |
getSampleGeometry(java.awt.Rectangle r) |
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)
Computes a Geometry wrapping the text to be applied
|
boolean |
isAutoresizeEnabled() |
boolean |
isDrawWithHalo() |
boolean |
isOneDotOrPixel(Geometry geom,
double[] positionOfDotOrPixel,
ViewPort viewPort,
int dpi) |
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) |
static void |
registerPersistent() |
void |
saveToState(PersistentState state)
Saves the internal state of the object on the provided
PersistentState object.
|
void |
setAlignment(int alignment) |
void |
setAutoresizeEnabled(boolean ar) |
void |
setCharacterSpacing(double charSpacing) |
void |
setColor(java.awt.Color color)
Sets the
Color to use to render the symbol. |
void |
setDrawWithHalo(boolean h) |
void |
setFont(java.awt.Font fnt)
Establishes the font that will be used to render this ITextSymbol.
|
void |
setFontSize(double d)
Sets the font size currently set to this symbol
|
void |
setHaloColor(java.awt.Color co) |
void |
setHaloWidth(float w) |
void |
setKerning(boolean kerning) |
void |
setMargin(double margin) |
void |
setRightToLeft(boolean rightToLeft) |
void |
setRotation(double rot)
Defines the angle of rotation for the text that composes the symbol
|
void |
setText(java.lang.String txt)
Sets the text to be rendered by this symbol
|
void |
setTextColor(java.awt.Color color)
Sets the color of the text
|
void |
setWordSpacing(double wordSpacing) |
cloneForSelection, cloneForSelection, equals, getDescription, getFeature, getID, getRequiredFeatureAttributeNames, getSymbolForSelection, isShapeVisible, setDescription, setFeature, setID, setIsShapeVisiblecopyCartographicContext, getCartographicContext, getReferenceSystem, getUnit, isInPixels, setCartographicContext, setCartographicContext, setCartographicContext, setCartographicContext, setCartographicContext, setReferenceSystem, setUnit, toCartographicUnitsfinalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDescription, getFeature, getID, getSymbolForSelection, isShapeVisible, setDescription, setFeature, setIDcloneQuietly, cloneQuietlycopyCartographicContext, copyCartographicContext, getCartographicContext, getReferenceSystem, getUnit, setCartographicContext, setCartographicContext, setCartographicContext, setCartographicContext, setCartographicContext, setReferenceSystem, setUnit, toCartographicUnitspublic static final java.lang.String SMART_TEXT_SYMBOL_PERSISTENCE_DEFINITION_NAME
public SmartTextSymbol(ITextSymbol sym, IPlacementConstraints constraints)
public SmartTextSymbol()
public void draw(java.awt.Graphics2D g,
java.awt.geom.AffineTransform affineTransform,
Geometry geom,
Feature f,
Cancellable cancel)
draw in interface ISymboldraw in class AbstractSymbolcancel - TODOpublic void draw(java.awt.Graphics2D g,
java.awt.geom.AffineTransform affineTransform,
Geometry geom,
Feature f,
Cancellable cancel,
java.awt.Rectangle r)
public void getPixExtentPlus(Geometry shp, float[] distances, ViewPort viewPort, int dpi)
public int getOnePointRgb()
public int getSymbolType()
ISymbolgetSymbolType in interface ISymbolpublic boolean isSuitableFor(Geometry geom)
ISymbolisSuitableFor in interface ISymbolpublic Geometry getSampleGeometry(java.awt.Rectangle r)
public void drawInsideRectangle(java.awt.Graphics2D g,
java.awt.geom.AffineTransform scaleInstance,
java.awt.Rectangle r)
throws SymbolDrawingException
ISymboldrawInsideRectangle in interface ISymboldrawInsideRectangle in class AbstractSymbolSymbolDrawingException - TODOpublic void setText(java.lang.String txt)
ITextSymbolsetText in interface ITextSymbolpublic java.lang.String getText()
ITextSymbolgetText in interface ITextSymbolpublic void setCharacterSpacing(double charSpacing)
public void setWordSpacing(double wordSpacing)
public void setAlignment(int alignment)
public void setKerning(boolean kerning)
public void setMargin(double margin)
public void setRightToLeft(boolean rightToLeft)
public ISymbol getSymbolForSelection()
ISymbolgetSymbolForSelection in interface ISymbolgetSymbolForSelection in class AbstractSymbolpublic boolean isOneDotOrPixel(Geometry geom, double[] positionOfDotOrPixel, ViewPort viewPort, int dpi)
public 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 print(java.awt.Graphics2D g,
java.awt.geom.AffineTransform at,
Geometry geom,
PrintAttributes properties)
print in interface IPrintableprint in class AbstractSymbolpublic void setFont(java.awt.Font fnt)
ITextSymbolsetFont in interface ITextSymbolpublic java.awt.Font getFont()
ITextSymbolgetFont in interface ITextSymbolpublic java.awt.Color getTextColor()
ITextSymbolgetTextColor in interface ITextSymbolpublic void setTextColor(java.awt.Color color)
ITextSymbolsetTextColor in interface ITextSymbolpublic void setFontSize(double d)
ITextSymbolsetFontSize in interface ITextSymbolpublic Geometry getTextWrappingShape(Point p)
ITextSymbolgetTextWrappingShape in interface ITextSymbolp - target locationpublic java.awt.Rectangle getBounds()
getBounds in interface ITextSymbolpublic double getRotation()
getRotation in interface ISimpleTextSymbolpublic void setRotation(double rot)
ISimpleTextSymbolsetRotation in interface ISimpleTextSymbolpublic void setAutoresizeEnabled(boolean ar)
setAutoresizeEnabled in interface ITextSymbolpublic boolean isAutoresizeEnabled()
isAutoresizeEnabled in interface ITextSymbolpublic 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 w)
setHaloWidth in interface ITextSymbolpublic boolean isDrawWithHalo()
isDrawWithHalo in interface ITextSymbolpublic void setDrawWithHalo(boolean h)
setDrawWithHalo 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 static void registerPersistent()
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 AbstractSymbolPersistenceException