JGraph
v5.13.0.4


com.jgraph.components.labels
Class RichTextBusinessObject

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

public class RichTextBusinessObject
extends java.lang.Object
implements java.lang.Cloneable, java.io.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 JGraphpadRichTextValue.

See Also:
RichTextGraphModel, Serialized Form

Field Summary
protected  java.util.Map properties
          Holds the properties as (key, value) pairs.
static java.lang.String valueKey
          Key to use for converting this object to a string.
 
Constructor Summary
RichTextBusinessObject()
          Constructs a business object with an empty string as its value.
RichTextBusinessObject(java.lang.Object value)
          Constructs a business object with the specified value.
 
Method Summary
protected  java.lang.String chopString(java.lang.String s, int max)
          A helper method that crops string to the specified length, adding 3 dots if there were more characters.
 java.lang.Object clone()
          Returns a clone of the object.
 java.util.Map getProperties()
          Returns the properties.
 java.lang.Object getProperty(java.lang.Object key)
          Returns the property under the specified key.
 java.lang.String getTooltip()
          Hook for subclassers to create a custom tooltip for this user object.
 java.lang.Object getValue()
          Returns the value for valueKey.
 boolean isComponent()
          Returns true if the value is a component.
 boolean isRichText()
          Returns true if the value is a rich text value.
 java.lang.Object putProperty(java.lang.Object key, java.lang.Object value)
          Sets the property under the specified key.
 void setProperties(java.util.Map properties)
          Sets the properties.
 void setValue(java.lang.Object value)
          Sets the value for valueKey.
 java.lang.String toString()
          Returns the string representation of the value or an empty string if no value exists.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

valueKey

public static java.lang.String valueKey
Key to use for converting this object to a string.


properties

protected java.util.Map properties
Holds the properties as (key, value) pairs.

Constructor Detail

RichTextBusinessObject

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


RichTextBusinessObject

public RichTextBusinessObject(java.lang.Object value)
Constructs a business object with the specified value.

Parameters:
value - The value of the new object.
Method Detail

getProperties

public java.util.Map getProperties()
Returns the properties.

Returns:
Returns the properties.

setProperties

public void setProperties(java.util.Map properties)
Sets the properties.

Parameters:
properties - The properties to set.

setValue

public void setValue(java.lang.Object value)
Sets the value for valueKey.

Parameters:
value - The value to set.

getValue

public java.lang.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 java.lang.Object putProperty(java.lang.Object key,
                                    java.lang.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 java.lang.Object getProperty(java.lang.Object key)
Returns the property under the specified key.

Parameters:
key - The key of the property.
Returns:
Returns the specified property.

getTooltip

public java.lang.String getTooltip()
Hook for subclassers to create a custom tooltip for this user object. This is used in JGraphpadGraph#getToolTipForCell(Object).

Returns:
Returns a tooltip for the user object.

chopString

protected java.lang.String chopString(java.lang.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 java.lang.String toString()
Returns the string representation of the value or an empty string if no value exists.

Overrides:
toString in class java.lang.Object
Returns:
Returns the value as a string.

clone

public java.lang.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 java.lang.Object
Returns:
Returns a clone of this object.

JGraph
v5.13.0.4


Copyright (C) 2001-2009 JGraph Ltd. All rights reserved.