public class SimpleLabelStyle extends AbstractStyle implements ILabelStyle
Modifier and Type | Class and Description |
---|---|
static class |
SimpleLabelStyle.RegisterPersistence |
Modifier and Type | Field and Description |
---|---|
static String |
SIMPLE_LABEL_STYLE_PERSISTENCE_NAME |
STYLE_PERSISTENCE_DEFINITION_NAME
Constructor and Description |
---|
SimpleLabelStyle() |
Modifier and Type | Method and Description |
---|---|
void |
addTextFieldArea(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(Graphics2D g,
Rectangle r)
Useful to render the symbol inside the TOC, or inside little
rectangles.
|
void |
drawOutline(Graphics2D g,
Rectangle r)
Used to show an outline of the style to graphically show its properties.
|
IBackgroundFileStyle |
getBackgroundFileStyle() |
String |
getClassName() |
int |
getFieldCount() |
Point2D |
getMarkerPoint()
Returns the position of the point labeled by this label in percent units relative
to the label bounds.
|
Dimension |
getSize() |
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(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,
Rectangle2D rect)
Sets a TextFieldArea using its index.
|
void |
setTextFields(String[] texts)
Sets the texts that will appear in the label.
|
clone, getDescription, setDescription
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDescription, setDescription
public static final String SIMPLE_LABEL_STYLE_PERSISTENCE_NAME
public int getFieldCount()
getFieldCount
in interface ILabelStyle
public void setTextFields(String[] texts)
ILabelStyle
setTextFields
in interface ILabelStyle
public boolean isSuitableFor(ISymbol symbol)
IStyle
isSuitableFor
in interface IStyle
symbol
- ISymbolpublic String getClassName()
public Rectangle2D[] getTextBounds()
ILabelStyle
getTextBounds
in interface ILabelStyle
public void drawInsideRectangle(Graphics2D g, Rectangle r) throws SymbolDrawingException
IStyle
drawInsideRectangle
in interface IStyle
g
- Graphics2Dr
- RectangleSymbolDrawingException
public Dimension getSize()
getSize
in interface ILabelStyle
public Point2D getMarkerPoint()
ILabelStyle
getMarkerPoint
in interface ILabelStyle
public void setMarkerPoint(Point2D p) throws IllegalArgumentException
ILabelStyle
setMarkerPoint
in interface ILabelStyle
IllegalArgumentException
- if the point coordinates are >0.0 or <1.0public void drawOutline(Graphics2D g, Rectangle r) throws SymbolDrawingException
IStyle
drawOutline
in interface IStyle
SymbolDrawingException
public void setTextFieldArea(int index, Rectangle2D rect)
ILabelStyle
setTextFieldArea
in interface ILabelStyle
public void addTextFieldArea(Rectangle2D rect)
ILabelStyle
addTextFieldArea
in interface ILabelStyle
public void deleteTextFieldArea(int index)
ILabelStyle
deleteTextFieldArea
in interface ILabelStyle
public void setSize(double width, double height)
ILabelStyle
setSize
in interface ILabelStyle
public IBackgroundFileStyle getBackgroundFileStyle()
getBackgroundFileStyle
in interface ILabelStyle
public void setBackgroundFileStyle(IBackgroundFileStyle bg)
setBackgroundFileStyle
in interface ILabelStyle
public void loadFromState(PersistentState state) throws PersistenceException
Persistent
loadFromState
in interface Persistent
loadFromState
in class AbstractStyle
PersistenceException
public void saveToState(PersistentState state) throws PersistenceException
Persistent
saveToState
in interface Persistent
saveToState
in class AbstractStyle
PersistenceException