Class RichTextGraphModel
java.lang.Object
javax.swing.undo.UndoableEditSupport
org.jgraph.graph.DefaultGraphModel
com.jgraph.components.labels.RichTextGraphModel
- All Implemented Interfaces:
Serializable, GraphModel
GraphModel that supports cloning of
and
handles custom entries in nested maps to add/change/remove properties for
business object (using the model's insert and edit methods).
invalid reference
JGraphpadBusinessObject
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class DefaultGraphModel
DefaultGraphModel.EmptyIterator, DefaultGraphModel.GraphModelEdit, DefaultGraphModel.GraphModelLayerEdit -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ObjectDefines the EMPTY_VALUE constant to be used in nested maps in order to remove properties from business objects.Fields inherited from class DefaultGraphModel
asksAllowsChildren, attributes, emptyIterator, listenerList, removeEmptyGroups, roots, transAddedCells, transEditAttrs, transEditCS, transEditPM, transRemovedCells, updateLevelFields inherited from class UndoableEditSupport
compoundEdit, listeners, realSource -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new empty graph model.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. -
Method Summary
Modifier and TypeMethodDescriptionbooleanacceptsSource(Object edge, Object port) Returnstrueifportis a valid source foredge.booleanacceptsTarget(Object edge, Object port) Returnstrueifportis a valid target foredge.protected ObjectcloneUserObject(Object userObject) Extends the parent implementation to support cloning of.invalid reference
JGraphpadBusinessObjectprotected MaphandleAttributes(Map attributes) Extends the parent implementation to support changing properties onby adding a map for the business object to the nested map which is passed to an insert or edit call.invalid reference
JGraphpadBusinessObjectvalueForCellChanged(Object cell, Object newValue) Extends the parent implementation to support changing the value on.invalid reference
JGraphpadBusinessObjectMethods inherited from class DefaultGraphModel
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, updateTransactionMethods inherited from class UndoableEditSupport
_postEdit, addUndoableEditListener, createCompoundEdit, getUndoableEditListeners, postEdit, removeUndoableEditListener, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface GraphModel
addUndoableEditListener, removeUndoableEditListener
-
Field Details
-
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
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
Description copied from class:DefaultGraphModelReturnstrueifportis a valid source foredge. edge and port must be objects previously obtained from this data source.- Specified by:
acceptsSourcein interfaceGraphModel- Overrides:
acceptsSourcein classDefaultGraphModel- Returns:
trueifportis a valid source foredge.
-
acceptsTarget
Description copied from class:DefaultGraphModelReturnstrueifportis a valid target foredge. edge and port must be objects previously obtained from this data source.- Specified by:
acceptsTargetin interfaceGraphModel- Overrides:
acceptsTargetin classDefaultGraphModel- Returns:
trueifportis a valid target foredge.
-
cloneUserObject
Extends the parent implementation to support cloning of.invalid reference
JGraphpadBusinessObject- Overrides:
cloneUserObjectin classDefaultGraphModel- Parameters:
userObject- The user object to be cloned.- Returns:
- Returns the cloned user object.
-
valueForCellChanged
Extends the parent implementation to support changing the value on. This implementation supports setting the value to String,invalid reference
JGraphpadBusinessObjector Map. If the new value is a map the complete properties of the user object are replaced with the specified map.invalid reference
JGraphpadRichTextValue- Specified by:
valueForCellChangedin interfaceGraphModel- Overrides:
valueForCellChangedin classDefaultGraphModel- 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
Extends the parent implementation to support changing properties onby adding a map for the business object to the nested map which is passed to an insert or edit call. The specialinvalid reference
JGraphpadBusinessObjectVALUE_EMPTYis used to remove a property from a business object.- Overrides:
handleAttributesin classDefaultGraphModel- Parameters:
attributes- The attributes to be processed.- Returns:
- Returns the attributes used to undo the change.
-