com.jgraph.example.fastgraph
Class FastGraphModel

java.lang.Object
  extended by javax.swing.undo.UndoableEditSupport
      extended by org.jgraph.graph.DefaultGraphModel
          extended by com.jgraph.example.fastgraph.FastGraphModel
All Implemented Interfaces:
java.io.Serializable, org.jgraph.graph.GraphModel

public class FastGraphModel
extends org.jgraph.graph.DefaultGraphModel

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jgraph.graph.DefaultGraphModel
org.jgraph.graph.DefaultGraphModel.EmptyIterator, org.jgraph.graph.DefaultGraphModel.GraphModelEdit, org.jgraph.graph.DefaultGraphModel.GraphModelLayerEdit
 
Constructor Summary
FastGraphModel()
           
 
Method Summary
 boolean acceptsSource(java.lang.Object edge, java.lang.Object port)
           
 boolean acceptsTarget(java.lang.Object edge, java.lang.Object port)
           
 void edit(java.util.Map attributes, org.jgraph.graph.ConnectionSet cs, org.jgraph.graph.ParentMap pm, javax.swing.undo.UndoableEdit[] edits)
           
 void insert(java.lang.Object[] roots, java.util.Map attributes, org.jgraph.graph.ConnectionSet cs, org.jgraph.graph.ParentMap pm, javax.swing.undo.UndoableEdit[] edits)
          Extends DefaultGraphModel insert method to check for large changes and sets the undoDisabled flag to true.
 
Methods inherited from class org.jgraph.graph.DefaultGraphModel
addGraphModelListener, beginUpdate, cellsChanged, cloneCell, cloneCell, cloneCells, contains, containsEdgeBetween, edges, edit, endUpdate, execute, 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, hasAncestorIn, isEdge, isGroup, isLeaf, isPort, isRemoveEmptyGroups, isVertex, order, remove, removeGraphModelListener, setRemoveEmptyGroups, setSourcePort, setTargetPort, toBack, toFront, valueForCellChanged
 
Methods inherited from class javax.swing.undo.UndoableEditSupport
addUndoableEditListener, getUndoableEditListeners, postEdit, removeUndoableEditListener, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jgraph.graph.GraphModel
addUndoableEditListener, removeUndoableEditListener
 

Constructor Detail

FastGraphModel

public FastGraphModel()
Method Detail

acceptsSource

public boolean acceptsSource(java.lang.Object edge,
                             java.lang.Object port)
Specified by:
acceptsSource in interface org.jgraph.graph.GraphModel
Overrides:
acceptsSource in class org.jgraph.graph.DefaultGraphModel

acceptsTarget

public boolean acceptsTarget(java.lang.Object edge,
                             java.lang.Object port)
Specified by:
acceptsTarget in interface org.jgraph.graph.GraphModel
Overrides:
acceptsTarget in class org.jgraph.graph.DefaultGraphModel

insert

public void insert(java.lang.Object[] roots,
                   java.util.Map attributes,
                   org.jgraph.graph.ConnectionSet cs,
                   org.jgraph.graph.ParentMap pm,
                   javax.swing.undo.UndoableEdit[] edits)
Extends DefaultGraphModel insert method to check for large changes and sets the undoDisabled flag to true. Disabling the undo provides large performance and memory footprint advantages on huge inserts.

Specified by:
insert in interface org.jgraph.graph.GraphModel
Overrides:
insert in class org.jgraph.graph.DefaultGraphModel

edit

public void edit(java.util.Map attributes,
                 org.jgraph.graph.ConnectionSet cs,
                 org.jgraph.graph.ParentMap pm,
                 javax.swing.undo.UndoableEdit[] edits)
Specified by:
edit in interface org.jgraph.graph.GraphModel
Overrides:
edit in class org.jgraph.graph.DefaultGraphModel