public class SmartTextSymbol extends AbstractSymbol implements ISimpleTextSymbol
AbstractSymbol.RegisterPersistence
CartographicSupport.CartographicContext
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
SMART_TEXT_SYMBOL_PERSISTENCE_DEFINITION_NAME |
LOGGER, SYMBOL_PERSISTENCE_DEFINITION_NAME
SYMBOL_NAME, SYMBOL_STYLE_ALIGNMENT_CENTERED, SYMBOL_STYLE_ALIGNMENT_JUSTIFY, SYMBOL_STYLE_ALIGNMENT_LEFT, SYMBOL_STYLE_ALIGNMENT_RIGHT
SELECTION_COLOR
PAPER, 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, setIsShapeVisible
copyCartographicContext, getCartographicContext, getReferenceSystem, getUnit, isInPixels, setCartographicContext, setCartographicContext, setCartographicContext, setCartographicContext, setCartographicContext, setReferenceSystem, setUnit, toCartographicUnits
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDescription, getFeature, getID, getSymbolForSelection, isShapeVisible, setDescription, setFeature, setID
cloneQuietly, cloneQuietly
copyCartographicContext, copyCartographicContext, getCartographicContext, getReferenceSystem, getUnit, setCartographicContext, setCartographicContext, setCartographicContext, setCartographicContext, setCartographicContext, setReferenceSystem, setUnit, toCartographicUnits
public 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 ISymbol
draw
in class AbstractSymbol
cancel
- 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()
ISymbol
getSymbolType
in interface ISymbol
public boolean isSuitableFor(Geometry geom)
ISymbol
isSuitableFor
in interface ISymbol
public Geometry getSampleGeometry(java.awt.Rectangle r)
public void drawInsideRectangle(java.awt.Graphics2D g, java.awt.geom.AffineTransform scaleInstance, java.awt.Rectangle r) throws SymbolDrawingException
ISymbol
drawInsideRectangle
in interface ISymbol
drawInsideRectangle
in class AbstractSymbol
SymbolDrawingException
- TODOpublic void setText(java.lang.String txt)
ITextSymbol
setText
in interface ITextSymbol
public java.lang.String getText()
ITextSymbol
getText
in interface ITextSymbol
public 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()
ISymbol
getSymbolForSelection
in interface ISymbol
getSymbolForSelection
in class AbstractSymbol
public boolean isOneDotOrPixel(Geometry geom, double[] positionOfDotOrPixel, ViewPort viewPort, int dpi)
public java.awt.Color getColor()
ISymbol
Color
to use to render the symbol.public void setColor(java.awt.Color color)
ISymbol
Color
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 IPrintable
print
in class AbstractSymbol
public void setFont(java.awt.Font fnt)
ITextSymbol
setFont
in interface ITextSymbol
public java.awt.Font getFont()
ITextSymbol
getFont
in interface ITextSymbol
public java.awt.Color getTextColor()
ITextSymbol
getTextColor
in interface ITextSymbol
public void setTextColor(java.awt.Color color)
ITextSymbol
setTextColor
in interface ITextSymbol
public void setFontSize(double d)
ITextSymbol
setFontSize
in interface ITextSymbol
public Geometry getTextWrappingShape(Point p)
ITextSymbol
getTextWrappingShape
in interface ITextSymbol
p
- target locationpublic java.awt.Rectangle getBounds()
getBounds
in interface ITextSymbol
public double getRotation()
getRotation
in interface ISimpleTextSymbol
public void setRotation(double rot)
ISimpleTextSymbol
setRotation
in interface ISimpleTextSymbol
public void setAutoresizeEnabled(boolean ar)
setAutoresizeEnabled
in interface ITextSymbol
public boolean isAutoresizeEnabled()
isAutoresizeEnabled
in interface ITextSymbol
public java.awt.Color getHaloColor()
getHaloColor
in interface ITextSymbol
public void setHaloColor(java.awt.Color co)
setHaloColor
in interface ITextSymbol
public float getHaloWidth()
getHaloWidth
in interface ITextSymbol
public void setHaloWidth(float w)
setHaloWidth
in interface ITextSymbol
public boolean isDrawWithHalo()
isDrawWithHalo
in interface ITextSymbol
public void setDrawWithHalo(boolean h)
setDrawWithHalo
in interface ITextSymbol
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
Cloneable
clone
in class AbstractSymbol
java.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
Persistent
loadFromState
in interface Persistent
loadFromState
in class AbstractSymbol
PersistenceException
public void saveToState(PersistentState state) throws PersistenceException
Persistent
saveToState
in interface Persistent
saveToState
in class AbstractSymbol
PersistenceException