Class LabelAttribute

All Implemented Interfaces:
Comparable<Object>, Attribute, CollectionAttribute, DeepCopy, GraphicAttributeConstants, Displayable
Direct Known Subclasses:
EdgeLabelAttribute, NodeLabelAttribute

public abstract class LabelAttribute
extends HashMapAttribute
implements GraphicAttributeConstants
Contains the graphic attribute label
Version:
$Revision: 1.19 $
  • Constructor Details

    • LabelAttribute

      public LabelAttribute()
    • 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.
  • Method Details

    • setLastComponentHeight

      public void setLastComponentHeight​(int height)
    • getLastComponentHeight

      public int getLastComponentHeight()
    • setLastComponentWidth

      public void setLastComponentWidth​(int width)
    • getLastComponentWidth

      public int getLastComponentWidth()
    • setLastLabel

      public void setLastLabel​(JLabel lastLabel)
    • add

      public void add​(Attribute a, boolean inform) throws AttributeExistsException, FieldAlreadySetException
      Description copied from class: AbstractCollectionAttribute
      Adds a given attribute to the collection. Only informs the ListenerManager about the addition when inform is set to true.
      Specified by:
      add in interface CollectionAttribute
      Overrides:
      add in class AbstractCollectionAttribute
      Parameters:
      a - the new attribute to add to the list.
      inform - when true, ListenerManager gets informed otherwise not
      Throws:
      AttributeExistsException - if there is already an attribute with the id of a.
      FieldAlreadySetException - thrown if Attribute a already has a parent or attributable associated with it.
    • add

      Description copied from class: AbstractCollectionAttribute
      Adds a given attribute to the collection. Informs the ListenerManager about the addition.
      Specified by:
      add in interface CollectionAttribute
      Overrides:
      add in class AbstractCollectionAttribute
      Parameters:
      a - the new attribute to add to the list.
      Throws:
      AttributeExistsException - if there is already an attribute with the id of a.
      FieldAlreadySetException - thrown if Attribute a already has a parent or attributable associated with it.
    • setAlignment

      public void setAlignment​(String a)
    • getAlignment

      public String getAlignment()
    • getAlignmentText

      public String getAlignmentText()
    • setFontName

      public void setFontName​(String f)
    • getFontName

      public String getFontName()
    • setFontStyle

      public void setFontStyle​(String fs)
    • getFontStyle

      public String getFontStyle()
    • getFontStyleJava

      public int getFontStyleJava()
    • setFontSize

      public void setFontSize​(int fs)
    • getFontSize

      public int getFontSize()
    • 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​(String tc)
      Set the 'textcolor'-value.
      Parameters:
      tc - the 'textcolor'-value to be set.
    • setTextcolor

      public void setTextcolor​(Color c)
    • getTextcolor

      public Color getTextcolor()
      Returns the 'textcolor'-value of the encapsulated label.
      Returns:
      the 'textcolor'-value of the encapsulated label.
    • getUseDropShadow

      public boolean getUseDropShadow()
    • getLabelFrameSetting

      public LabelFrameSetting getLabelFrameSetting()
    • getShadowOffX

      public int getShadowOffX()
    • getShadowOffY

      public int getShadowOffY()
    • getShadowTextColor

      public Color getShadowTextColor()
    • wordWrap

      public void wordWrap()
    • getLabelOffset

      public Vector2d getLabelOffset()
      Get the relative offset of label position from center of a node. Offset is relative to node width/height; (0, 0) center of node, (-1, -1) top-left corner of node, (1, -1) top-right corner of node, (1, 1) bottom-right corner of node, (-1, 1) bottom-left corner of node.
      Returns:
      relative offset of label position from center of a node
    • setLabelOffset

      public void setLabelOffset​(double offsetX, double offsetY)
      Set the relative offset of label position from center of a node. Offset is relative to node width/height; (0, 0) center of node, (-1, -1) top-left corner of node, (1, -1) top-right corner of node, (1, 1) bottom-right corner of node, (-1, 1) bottom-left corner of node.
      Parameters:
      offsetX - horizontal offset of label position from center of a node
      offsetY - vertical offset of label position from center of a node