Class RichTextBusinessObject

java.lang.Object
com.jgraph.components.labels.RichTextBusinessObject
All Implemented Interfaces:
Serializable, Cloneable

public class RichTextBusinessObject extends Object implements Cloneable, Serializable
User object with a dynamic set of properties in a hashtable. The property under valueKey is used in toString() to represent the object as a string. This object supports values of type
invalid reference
JGraphpadRichTextValue
.
See Also:
  • Field Details

    • valueKey

      public static String valueKey
      Key to use for converting this object to a string.
    • properties

      protected Map properties
      Holds the properties as (key, value) pairs.
  • Constructor Details

    • RichTextBusinessObject

      public RichTextBusinessObject()
      Constructs a business object with an empty string as its value.
    • RichTextBusinessObject

      public RichTextBusinessObject(Object value)
      Constructs a business object with the specified value.
      Parameters:
      value - The value of the new object.
  • Method Details

    • getProperties

      public Map getProperties()
      Returns the properties.
      Returns:
      Returns the properties.
    • setProperties

      public void setProperties(Map properties)
      Sets the properties.
      Parameters:
      properties - The properties to set.
    • setValue

      public void setValue(Object value)
      Sets the value for valueKey.
      Parameters:
      value - The value to set.
    • getValue

      public Object getValue()
      Returns the value for valueKey.
      Returns:
      Returns the value.
    • isRichText

      public boolean isRichText()
      Returns true if the value is a rich text value.
      Returns:
      Returns true if value is rich text.
    • isComponent

      public boolean isComponent()
      Returns true if the value is a component.
      Returns:
      Returns true if value is a component.
    • putProperty

      public Object putProperty(Object key, Object value)
      Sets the property under the specified key.
      Parameters:
      key - They key of the property.
      value - The value of the property.
      Returns:
      Returns the previous value.
    • getProperty

      public Object getProperty(Object key)
      Returns the property under the specified key.
      Parameters:
      key - The key of the property.
      Returns:
      Returns the specified property.
    • getTooltip

      public String getTooltip()
      Hook for subclassers to create a custom tooltip for this user object. This is used in
      invalid reference
      JGraphpadGraph#getToolTipForCell(Object)
      .
      Returns:
      Returns a tooltip for the user object.
    • chopString

      protected String chopString(String s, int max)
      A helper method that crops string to the specified length, adding 3 dots if there were more characters.
      Returns:
      The chopped string.
    • toString

      public String toString()
      Returns the string representation of the value or an empty string if no value exists.
      Overrides:
      toString in class Object
      Returns:
      Returns the value as a string.
    • clone

      public Object clone()
      Returns a clone of the object. Note: The properties are not cloned, only a clone of the containing map is used. As a special case, if the user object is a JSlider or a JTree then a new instance will be put in place of the old instance.
      Overrides:
      clone in class Object
      Returns:
      Returns a clone of this object.