public class RichTextGraphModel extends DefaultGraphModel
JGraphpadBusinessObject
and
handles custom entries in nested maps to add/change/remove properties for
business object (using the model's insert and edit methods).DefaultGraphModel.EmptyIterator, DefaultGraphModel.GraphModelEdit, DefaultGraphModel.GraphModelLayerEdit
Modifier and Type | Field and Description |
---|---|
static java.lang.Object |
VALUE_EMPTY
Defines the EMPTY_VALUE constant to be used in nested maps in order to
remove properties from business objects.
|
asksAllowsChildren, attributes, emptyIterator, listenerList, removeEmptyGroups, roots, transAddedCells, transEditAttrs, transEditCS, transEditPM, transRemovedCells, updateLevel
Constructor and Description |
---|
RichTextGraphModel()
Constructs a new empty graph model.
|
RichTextGraphModel(java.util.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.
|
Modifier and Type | Method and Description |
---|---|
boolean |
acceptsSource(java.lang.Object edge,
java.lang.Object port)
Returns
true if port is a valid source for
edge . |
boolean |
acceptsTarget(java.lang.Object edge,
java.lang.Object port)
Returns
true if port is a valid target for
edge . |
protected java.lang.Object |
cloneUserObject(java.lang.Object userObject)
Extends the parent implementation to support cloning of
JGraphpadBusinessObject . |
protected java.util.Map |
handleAttributes(java.util.Map attributes)
Extends the parent implementation to support changing properties on
JGraphpadBusinessObject by adding a map for the business object
to the nested map which is passed to an insert or edit call. |
java.lang.Object |
valueForCellChanged(java.lang.Object cell,
java.lang.Object newValue)
Extends the parent implementation to support changing the value on
JGraphpadBusinessObject . |
addGraphModelListener, beginUpdate, cellsChanged, cloneCell, cloneCell, cloneCell, cloneCells, connect, contains, containsEdgeBetween, createEdit, createLayerEdit, createRemoveEdit, edges, edit, edit, endUpdate, execute, fireGraphChanged, getAll, getAttributes, getAttributes, getChild, getChildCount, getConnectionSet, getDescendants, getEdges, getEdges, getEdgesBetween, getGraphModelListeners, getIncomingEdges, getIndexOfChild, getIndexOfRoot, getOpposite, getOutgoingEdges, getParent, getRootAt, getRootCount, getRoots, getRoots, getRoots, getRootsAsCollection, getSource, getSourceVertex, getTarget, getTargetVertex, getTopmostCells, getUpdateLevel, getUserObject, getValue, handleConnection, handleConnectionSet, handleInsert, handleParentMap, handleRemove, hasAncestorIn, insert, isEdge, isGroup, isLeaf, isPort, isRemoveEmptyGroups, isVertex, order, remove, removeGraphModelListener, setParent, setRemoveEmptyGroups, setSourcePort, setTargetPort, toBack, toFront, updateTransaction
_postEdit, addUndoableEditListener, createCompoundEdit, getUndoableEditListeners, postEdit, removeUndoableEditListener, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addUndoableEditListener, removeUndoableEditListener
public static final java.lang.Object VALUE_EMPTY
public RichTextGraphModel()
public RichTextGraphModel(java.util.List roots, AttributeMap attributes, ConnectionSet cs)
roots
- The roots to be inserted into the model.attributes
- The model's attributes.cs
- The connections to be established.public boolean acceptsSource(java.lang.Object edge, java.lang.Object port)
DefaultGraphModel
true
if port
is a valid source for
edge
. edge and port must be objects
previously obtained from this data source.acceptsSource
in interface GraphModel
acceptsSource
in class DefaultGraphModel
true
if port
is a valid source for
edge
.public boolean acceptsTarget(java.lang.Object edge, java.lang.Object port)
DefaultGraphModel
true
if port
is a valid target for
edge
. edge and port must be objects
previously obtained from this data source.acceptsTarget
in interface GraphModel
acceptsTarget
in class DefaultGraphModel
true
if port
is a valid target for
edge
.protected java.lang.Object cloneUserObject(java.lang.Object userObject)
JGraphpadBusinessObject
.cloneUserObject
in class DefaultGraphModel
userObject
- The user object to be cloned.public java.lang.Object valueForCellChanged(java.lang.Object cell, java.lang.Object newValue)
JGraphpadBusinessObject
. This implementation supports setting
the value to String, JGraphpadRichTextValue
or Map. If the new
value is a map the complete properties of the user object are replaced
with the specified map.valueForCellChanged
in interface GraphModel
valueForCellChanged
in class DefaultGraphModel
cell
- The cell to change the value for.newValue
- The new value to use for the cell.protected java.util.Map handleAttributes(java.util.Map attributes)
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.handleAttributes
in class DefaultGraphModel
attributes
- The attributes to be processed.Copyright (C) 2001-2009 JGraph Ltd. All rights reserved.