public class SimpleLabelStyle extends AbstractStyle implements ILabelStyle
| Modifier and Type | Class and Description |
|---|---|
static class |
SimpleLabelStyle.RegisterPersistence |
CartographicSupport.CartographicContext| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
SIMPLE_LABEL_STYLE_PERSISTENCE_NAME |
LOGGER, STYLE_PERSISTENCE_DEFINITION_NAMEPAPER, WORLD| Constructor and Description |
|---|
SimpleLabelStyle() |
| Modifier and Type | Method and Description |
|---|---|
void |
addTextFieldArea(java.awt.geom.Rectangle2D rect)
Adds a new TextFieldArea with an specific size which is defined as a rectangle.
|
void |
deleteTextFieldArea(int index)
Delete the TextFieldArea specified by its index.
|
void |
drawInsideRectangle(java.awt.Graphics2D g,
java.awt.Rectangle r)
Useful to render the symbol inside the TOC, or inside little
rectangles.
|
void |
drawOutline(java.awt.Graphics2D g,
java.awt.Rectangle r)
Used to show an outline of the style to graphically show its properties.
|
IBackgroundFileStyle |
getBackgroundFileStyle() |
java.lang.String |
getClassName() |
int |
getFieldCount() |
java.awt.geom.Point2D |
getMarkerPoint()
Returns the position of the point labeled by this label in percent units relative
to the label bounds.
|
java.awt.Dimension |
getSize() |
java.awt.geom.Rectangle2D[] |
getTextBounds()
Returns an array of rectangles defining the text boxes where text is
placed.
|
boolean |
isSuitableFor(ISymbol symbol)
True if this symbol is ok for the style or class.
|
void |
loadFromState(PersistentState state)
Set the state of the object from the state passed as parameter.
|
void |
saveToState(PersistentState state)
Saves the internal state of the object on the provided
PersistentState object.
|
void |
setBackgroundFileStyle(IBackgroundFileStyle bg) |
void |
setMarkerPoint(java.awt.geom.Point2D p)
Sets the position of the point labeled by this in percent units relative to the
label bounds
|
void |
setSize(double width,
double height)
Sets the size for a laber and stablishes an unit scale factor to not change
too much its content
|
void |
setTextFieldArea(int index,
java.awt.geom.Rectangle2D rect)
Sets a TextFieldArea using its index.
|
void |
setTextFields(java.lang.String[] texts)
Sets the texts that will appear in the label.
|
clone, getDescription, setDescriptioncopyCartographicContext, getCartographicContext, getReferenceSystem, getUnit, isInPixels, setCartographicContext, setCartographicContext, setCartographicContext, setCartographicContext, setCartographicContext, setReferenceSystem, setUnit, toCartographicUnitsequals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDescription, setDescriptionclone, cloneQuietly, cloneQuietlycopyCartographicContextpublic static final java.lang.String SIMPLE_LABEL_STYLE_PERSISTENCE_NAME
public int getFieldCount()
getFieldCount in interface ILabelStylepublic void setTextFields(java.lang.String[] texts)
ILabelStylesetTextFields in interface ILabelStylepublic boolean isSuitableFor(ISymbol symbol)
IStyleisSuitableFor in interface IStylesymbol - ISymbolpublic java.lang.String getClassName()
public java.awt.geom.Rectangle2D[] getTextBounds()
ILabelStylegetTextBounds in interface ILabelStylepublic void drawInsideRectangle(java.awt.Graphics2D g,
java.awt.Rectangle r)
throws SymbolDrawingException
IStyledrawInsideRectangle in interface IStyleg - Graphics2Dr - RectangleSymbolDrawingExceptionpublic java.awt.Dimension getSize()
getSize in interface ILabelStylepublic java.awt.geom.Point2D getMarkerPoint()
ILabelStylegetMarkerPoint in interface ILabelStylepublic void setMarkerPoint(java.awt.geom.Point2D p)
throws java.lang.IllegalArgumentException
ILabelStylesetMarkerPoint in interface ILabelStylejava.lang.IllegalArgumentException - if the point coordinates are >0.0 or <1.0public void drawOutline(java.awt.Graphics2D g,
java.awt.Rectangle r)
throws SymbolDrawingException
IStyledrawOutline in interface IStyleSymbolDrawingExceptionpublic void setTextFieldArea(int index,
java.awt.geom.Rectangle2D rect)
ILabelStylesetTextFieldArea in interface ILabelStylepublic void addTextFieldArea(java.awt.geom.Rectangle2D rect)
ILabelStyleaddTextFieldArea in interface ILabelStylepublic void deleteTextFieldArea(int index)
ILabelStyledeleteTextFieldArea in interface ILabelStylepublic void setSize(double width,
double height)
ILabelStylesetSize in interface ILabelStylepublic IBackgroundFileStyle getBackgroundFileStyle()
getBackgroundFileStyle in interface ILabelStylepublic void setBackgroundFileStyle(IBackgroundFileStyle bg)
setBackgroundFileStyle in interface ILabelStylepublic void loadFromState(PersistentState state) throws PersistenceException
PersistentloadFromState in interface PersistentloadFromState in class AbstractStylePersistenceExceptionpublic void saveToState(PersistentState state) throws PersistenceException
PersistentsaveToState in interface PersistentsaveToState in class AbstractStylePersistenceException