Class RichTextGraphModel

All Implemented Interfaces:
Serializable, GraphModel

public class RichTextGraphModel extends DefaultGraphModel
GraphModel that supports cloning of
invalid reference
JGraphpadBusinessObject
and handles custom entries in nested maps to add/change/remove properties for business object (using the model's insert and edit methods).
See Also:
  • Field Details

    • VALUE_EMPTY

      public static final Object VALUE_EMPTY
      Defines the EMPTY_VALUE constant to be used in nested maps in order to remove properties from business objects.
  • Constructor Details

    • RichTextGraphModel

      public RichTextGraphModel()
      Constructs a new empty graph model.
    • RichTextGraphModel

      public RichTextGraphModel(List roots, AttributeMap attributes, ConnectionSet cs)
      Constructs a new graph model using the specified root cells and attributes (for the model) and establishes the connections defined in the specified connection set between the cells.
      Parameters:
      roots - The roots to be inserted into the model.
      attributes - The model's attributes.
      cs - The connections to be established.
  • Method Details

    • acceptsSource

      public boolean acceptsSource(Object edge, Object port)
      Description copied from class: DefaultGraphModel
      Returns true if port is a valid source for edge. edge and port must be objects previously obtained from this data source.
      Specified by:
      acceptsSource in interface GraphModel
      Overrides:
      acceptsSource in class DefaultGraphModel
      Returns:
      true if port is a valid source for edge.
    • acceptsTarget

      public boolean acceptsTarget(Object edge, Object port)
      Description copied from class: DefaultGraphModel
      Returns true if port is a valid target for edge. edge and port must be objects previously obtained from this data source.
      Specified by:
      acceptsTarget in interface GraphModel
      Overrides:
      acceptsTarget in class DefaultGraphModel
      Returns:
      true if port is a valid target for edge.
    • cloneUserObject

      protected Object cloneUserObject(Object userObject)
      Extends the parent implementation to support cloning of
      invalid reference
      JGraphpadBusinessObject
      .
      Overrides:
      cloneUserObject in class DefaultGraphModel
      Parameters:
      userObject - The user object to be cloned.
      Returns:
      Returns the cloned user object.
    • valueForCellChanged

      public Object valueForCellChanged(Object cell, Object newValue)
      Extends the parent implementation to support changing the value on
      invalid reference
      JGraphpadBusinessObject
      . This implementation supports setting the value to String,
      invalid reference
      JGraphpadRichTextValue
      or Map. If the new value is a map the complete properties of the user object are replaced with the specified map.
      Specified by:
      valueForCellChanged in interface GraphModel
      Overrides:
      valueForCellChanged in class DefaultGraphModel
      Parameters:
      cell - The cell to change the value for.
      newValue - The new value to use for the cell.
      Returns:
      Returns the old value of the cell.
    • handleAttributes

      protected Map handleAttributes(Map attributes)
      Extends the parent implementation to support changing properties on
      invalid reference
      JGraphpadBusinessObject
      by adding a map for the business object to the nested map which is passed to an insert or edit call. The special VALUE_EMPTY is used to remove a property from a business object.
      Overrides:
      handleAttributes in class DefaultGraphModel
      Parameters:
      attributes - The attributes to be processed.
      Returns:
      Returns the attributes used to undo the change.