org.graffiti.graphics
Class LabelAttribute

java.lang.Object
  extended by org.graffiti.attributes.AbstractAttribute
      extended by org.graffiti.attributes.AbstractCollectionAttribute
          extended by org.graffiti.attributes.HashMapAttribute
              extended by org.graffiti.graphics.LabelAttribute
All Implemented Interfaces:
Attribute, CollectionAttribute, DeepCopy, GraphicAttributeConstants, Displayable<Object>
Direct Known Subclasses:
EdgeLabelAttribute, NodeLabelAttribute

public class LabelAttribute
extends HashMapAttribute
implements GraphicAttributeConstants

Contains the graphic attribute label

Version:
$Revision: 5768 $

Field Summary
protected  StringAttribute font
          Holds font of label text.
protected  IntegerAttribute fontSize
          Holds the size of the font
protected  StringAttribute label
          Holds the name of the label.
protected  DoubleAttribute maxWidth
          Holds the maximum width of the label.
protected  ColorAttribute textcolor
          Holds color of label text.
 
Fields inherited from class org.graffiti.attributes.AbstractCollectionAttribute
attributes
 
Fields inherited from class org.graffiti.attributes.AbstractAttribute
id
 
Fields inherited from interface org.graffiti.graphics.GraphicAttributeConstants
ABSOLUTE_X_OFFSET, ABSOLUTE_Y_OFFSET, ALIGNMENT, ALIGNMENT_SEGMENT, ALIGNMENT_X, ALIGNMENT_Y, ARROWHEAD, ARROWSHAPE_CLASSNAME, ARROWTAIL, BEND, BENDS, BENDS_PATH, BGIMAGE, BGIMAGE_PATH, BLUE, BOTTOM_INSIDE, BOTTOM_OUTSIDE, CENTERED, CIRCLE_CENTER, CIRCLE_CENTER_PATH, CIRCLE_CLASSNAME, CIRCLE_LINE_SEGMENTATION_CLASSNAME, CIRCLE_LINE_SEGMENTATION_SHAPE, COMMON, COORD_PATH, COORDINATE, COORDX_PATH, COORDY_PATH, COORDZ_PATH, CUBICSPLINE, CUBICSPLINE_CLASSNAME, DEFAULT_CAP, DEFAULT_EDGE_FILLCOLOR, DEFAULT_EDGE_FRAMECOLOR, DEFAULT_EDGE_FRAMETHICKNESS, DEFAULT_EDGE_THICKNESS, DEFAULT_FONT_SIZE, DEFAULT_GRAPHIC_ELEMENT_FRAMECOLOR, DEFAULT_GRAPHIC_ELEMENT_FRAMETHICKNESS, DEFAULT_JOIN, DEFAULT_MAX_WIDTH, DEFAULT_MITER, DEFAULT_NODE_FILLCOLOR, DEFAULT_NODE_FRAMECOLOR, DEFAULT_NODE_FRAMETHICKNESS, DEFAULT_NODE_SHAPE, DEFAULT_NODE_SIZE, DEPTH, DEPTH_PATH, DIM_PATH, DIMENSION, DIMH_PATH, DIMW_PATH, DOCKING, DOCKING_PATH, EDGE, ELLIPSE_CLASSNAME, END_ANGLE, FILLCOLOR, FILLCOLOR_PATH, FONT, FONT_SIZE, FRAMECOLOR, FRAMETHICKNESS, FRAMETHICKNESS_PATH, GRAPHICS, GREEN, GRID, GRID_PATH, HEIGHT, IMAGE, IN, INTRA_LEVEL_CLASSNAME, LABEL, LABEL_ATTRIBUTE_PATH, LABEL_DISTANCE, LEFT_INSIDE, LEFT_OUTSIDE, LEVEL, LINE_POINT_PATH, LINEMODE, LINEMODE_PATH, LINETYPE, LINEWIDTH_PATH, MAX_WIDTH, MAXIMIZE, NAME, NEARSOURCE, NEARTARGET, NODE, OFFSET, OPAC, OUT, OUTLINE_PATH, POLYCLOSED_CLASSNAME, POLYLINE, POLYLINE_CLASSNAME, PORT, PORTS, PORTS_PATH, POSITION, QUAD_CURVE_EDGE_SHAPE, RECTANGLE_CLASSNAME, RED, REF, RELATIVE_ALIGNMENT, RELATIVE_X_OFFSET, RELATIVE_Y_OFFSET, RIGHT_INSIDE, RIGHT_OUTSIDE, ROTATION, SHAPE, SHAPE_DESC_PATH, SHAPE_PATH, SHAPEDESCRIPTION, SMOOTH_CLASSNAME, SMOOTH_LINE_EDGE_SHAPE, SMOOTHLINE, SOURCE, SPIRAL_CLASSNAME, SQUARESPLINE, SQUARESPLINE_CLASSNAME, START_ANGLE, STRAIGHT_LINE_EDGE_SHAPE, STRAIGHTLINE, STRAIGHTLINE_CLASSNAME, TARGET, TEXTCOLOR, THICKNESS, THICKNESS_PATH, TILED, TOP_INSIDE, TOP_OUTSIDE, WIDTH, X, Y, Z
 
Fields inherited from interface org.graffiti.attributes.Attribute
SEPARATOR
 
Constructor Summary
LabelAttribute(String id)
          Constructor for Label.
LabelAttribute(String id, String l)
          Constructor for Label.
LabelAttribute(String id, StringAttribute l, PositionAttribute p, StringAttribute a, StringAttribute f, ColorAttribute tc)
          Constructor for Label.
LabelAttribute(String id, String l, PositionAttribute p, String a, String f, Color tc)
          Constructor for Label.
LabelAttribute(String id, String l, PositionAttribute p, String a, String f, ColorAttribute tc)
          Constructor for Label.
 
Method Summary
 Object copy()
          Returns a deep copy of this object.
 String getFont()
          Returns the 'font'-value of the encapsulated label.
 int getFontSize()
          Returns the font size.
 double getHeight()
          The height of this Label, prior to rotation.
 String getLabel()
          Returns the 'label'-value of the encapsulated label.
 double getMaxWidth()
          Returns the maximum width.
 ColorAttribute getTextcolor()
          Returns the 'textcolor'-value of the encapsulated label.
 double getWidth()
          The width of this LabelAttribute prior to rotation.
 void setCollection(Map<String,Attribute> attrs)
          Sets the collection of attributes contained within this CollectionAttribute
 void setFont(String f)
          Sets the 'font'-value of the encapsulated label.
 void setFontSize(int size)
          Sets the font size.
 void setLabel(String l)
          Sets the 'label'-value.
 void setMaxWidth(double maxWidth)
          Sets the maximum width.
 void setTextcolor(CollectionAttribute tc)
          Set the 'textcolor'-value.
 
Methods inherited from class org.graffiti.attributes.HashMapAttribute
doSetValue, getCollection, setDefaultValue
 
Methods inherited from class org.graffiti.attributes.AbstractCollectionAttribute
add, add, containsAttribute, getAttributable, getAttribute, getValue, isEmpty, remove, remove, setAttributable, toString, toXMLString
 
Methods inherited from class org.graffiti.attributes.AbstractAttribute
callPostAttributeAdded, callPostAttributeChanged, callPostAttributeRemoved, callPreAttributeAdded, callPreAttributeChanged, callPreAttributeRemoved, getDescription, getId, getName, getParent, getPath, getSpaces, getStandardXML, setDescription, setParent, setValue, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.graffiti.attributes.CollectionAttribute
add, add, containsAttribute, getAttribute, isEmpty, remove, remove, setAttributable
 
Methods inherited from interface org.graffiti.attributes.Attribute
getAttributable, getId, getParent, getPath, getValue, setParent, setValue, toString
 
Methods inherited from interface org.graffiti.plugin.Displayable
getDescription, getName, setDescription, toXMLString
 

Field Detail

textcolor

protected ColorAttribute textcolor
Holds color of label text.


font

protected StringAttribute font
Holds font of label text.


label

protected StringAttribute label
Holds the name of the label.


fontSize

protected IntegerAttribute fontSize
Holds the size of the font


maxWidth

protected DoubleAttribute maxWidth
Holds the maximum width of the label.

Constructor Detail

LabelAttribute

public LabelAttribute(String id)
Constructor for Label.

Parameters:
id - the id of the attribute.

LabelAttribute

public LabelAttribute(String id,
                      String l)
Constructor for Label.

Parameters:
id - the id of the attribute.
l - the label-value of the attribute.

LabelAttribute

public LabelAttribute(String id,
                      String l,
                      PositionAttribute p,
                      String a,
                      String f,
                      ColorAttribute tc)
Constructor for Label.

Parameters:
id - the id of the attribute.
l - the label-value of the attribute.
p - the position-value of the attribute.
a - the alignment-value of the attribute.
f - the font-value of the attribute.
tc - the textcolor-value of the attribute.

LabelAttribute

public LabelAttribute(String id,
                      StringAttribute l,
                      PositionAttribute p,
                      StringAttribute a,
                      StringAttribute f,
                      ColorAttribute tc)
Constructor for Label.

Parameters:
id - the id of the attribute.
l - the label-value of the attribute.
p - the position-value of the attribute.
a - the alignment-value of the attribute.
f - the font-value of the attribute.
tc - the textcolor-value of the attribute.

LabelAttribute

public LabelAttribute(String id,
                      String l,
                      PositionAttribute p,
                      String a,
                      String f,
                      Color tc)
Constructor for Label.

Parameters:
id - the id of the attribute.
l - the label-value of the attribute.
p - the position-value of the attribute.
a - the alignment-value of the attribute.
f - the font-value of the attribute.
tc - the textcolor-value of the attribute.
Method Detail

setCollection

public void setCollection(Map<String,Attribute> attrs)
Sets the collection of attributes contained within this CollectionAttribute

Specified by:
setCollection in interface CollectionAttribute
Overrides:
setCollection in class HashMapAttribute
Parameters:
attrs - the map that contains all attributes.
Throws:
IllegalArgumentException - DOCUMENT ME!

setFont

public void setFont(String f)
Sets the 'font'-value of the encapsulated label.

Parameters:
f - the 'font'-value to be set.

getFont

public String getFont()
Returns the 'font'-value of the encapsulated label.

Returns:
the 'font'-value of the encapsulated label.

setFontSize

public void setFontSize(int size)
Sets the font size.

Parameters:
size - the font size to set.

getFontSize

public int getFontSize()
Returns the font size.

Returns:
the font size.

setMaxWidth

public void setMaxWidth(double maxWidth)
Sets the maximum width.

Parameters:
maxWidth - the maximum width to set.

getMaxWidth

public double getMaxWidth()
Returns the maximum width.

Returns:
the maximum width.

getWidth

public double getWidth()
The width of this LabelAttribute prior to rotation.

Returns:
The width of label prior to rotation.

getHeight

public double getHeight()
The height of this Label, prior to rotation.

Returns:
The height of the LabelAttribute prior to rotation.

setLabel

public void setLabel(String l)
Sets the 'label'-value.

Parameters:
l - the 'label'-value to be set.

getLabel

public String getLabel()
Returns the 'label'-value of the encapsulated label.

Returns:
the 'label'-value of the encapsulated label.

setTextcolor

public void setTextcolor(CollectionAttribute tc)
Set the 'textcolor'-value.

Parameters:
tc - the 'textcolor'-value to be set.

getTextcolor

public ColorAttribute getTextcolor()
Returns the 'textcolor'-value of the encapsulated label.

Returns:
the 'textcolor'-value of the encapsulated label.

copy

public Object copy()
Returns a deep copy of this object.

Specified by:
copy in interface DeepCopy
Overrides:
copy in class HashMapAttribute
Returns:
A deep copy of this object.


Generated at 2012-05-30 11:00:36 PM CEST