org.jgraph.graph.GraphModel Interface Reference

Inheritance diagram for org.jgraph.graph.GraphModel:

org.jgraph.graph.DefaultGraphModel manas.event.MyModel manas.gui.MyModel List of all members.

Public Member Functions

int getRootCount ()
Object getRootAt (int index)
int getIndexOfRoot (Object root)
boolean contains (Object node)
AttributeMap getAttributes (Object node)
Object getValue (Object node)
Object getSource (Object edge)
Object getTarget (Object edge)
boolean acceptsSource (Object edge, Object port)
boolean acceptsTarget (Object edge, Object port)
Iterator edges (Object port)
boolean isEdge (Object edge)
boolean isPort (Object port)
Object getParent (Object child)
int getIndexOfChild (Object parent, Object child)
Object getChild (Object parent, int index)
int getChildCount (Object parent)
boolean isLeaf (Object node)
void insert (Object[] roots, Map attributes, ConnectionSet cs, ParentMap pm, UndoableEdit[] e)
void remove (Object[] roots)
void edit (Map attributes, ConnectionSet cs, ParentMap pm, UndoableEdit[] e)
Map cloneCells (Object[] cells)
Object valueForCellChanged (Object cell, Object newValue)
void toBack (Object[] cells)
void toFront (Object[] cells)
void addGraphModelListener (GraphModelListener l)
void removeGraphModelListener (GraphModelListener l)
void addUndoableEditListener (UndoableEditListener listener)
void removeUndoableEditListener (UndoableEditListener listener)

Detailed Description

The interface that defines a suitable data model for a JGraph.

Version:
1.0 1/1/02
Author:
Gaudenz Alder


Member Function Documentation

boolean org.jgraph.graph.GraphModel.acceptsSource Object  edge,
Object  port
 

Returns true if port is a valid source for edge. edge and port must be objects previously obtained from this data source.

Returns:
true if port is a valid source for edge.

Implemented in manas.event.MyModel, manas.gui.MyModel, and org.jgraph.graph.DefaultGraphModel.

boolean org.jgraph.graph.GraphModel.acceptsTarget Object  edge,
Object  port
 

Returns true if port is a valid target for edge. edge and port must be objects previously obtained from this data source.

Returns:
true if port is a valid target for edge.

Implemented in manas.event.MyModel, manas.gui.MyModel, and org.jgraph.graph.DefaultGraphModel.

void org.jgraph.graph.GraphModel.addGraphModelListener GraphModelListener  l  ) 
 

Adds a listener for the GraphModelEvent posted after the model changes.

Implemented in org.jgraph.graph.DefaultGraphModel.

void org.jgraph.graph.GraphModel.addUndoableEditListener UndoableEditListener  listener  ) 
 

Adds an undo listener for notification of any changes. Undo/Redo operations performed on the UndoableEdit will cause the appropriate ModelEvent to be fired to keep the view(s) in sync with the model.

Map org.jgraph.graph.GraphModel.cloneCells Object[]  cells  ) 
 

Returns a map of (cell, clone)-pairs for all cells and their children. Special care should be taken to replace references between cells.

Implemented in org.jgraph.graph.DefaultGraphModel.

boolean org.jgraph.graph.GraphModel.contains Object  node  ) 
 

Returns true if node or one of its ancestors is in the model.

Returns:
true if node is in the model

Implemented in org.jgraph.graph.DefaultGraphModel.

Iterator org.jgraph.graph.GraphModel.edges Object  port  ) 
 

Returns an iterator of the edges connected to port. port must be a object previously obtained from this data source. This method never returns null.

Parameters:
port a port in the graph, obtained from this data source
Returns:
Iterator that represents the connected edges

Implemented in org.jgraph.graph.DefaultGraphModel.

void org.jgraph.graph.GraphModel.edit Map  attributes,
ConnectionSet  cs,
ParentMap  pm,
UndoableEdit[]  e
 

Applies the propertyMap and the connection changes to the model. The initial edits that triggered the call are considered to be part of this transaction. Notifies the model- and undo listeners of the change. Note: If only edits is non-null, the edits are directly passed to the UndoableEditListeners.

Implemented in org.jgraph.graph.DefaultGraphModel.

AttributeMap org.jgraph.graph.GraphModel.getAttributes Object  node  ) 
 

Returns a AttributeMap that represents the properties for the specified cell.

Returns:
properties of node as a Map

Implemented in org.jgraph.graph.DefaultGraphModel.

Object org.jgraph.graph.GraphModel.getChild Object  parent,
int  index
 

Returns the child of parent at index index in the parent's child array. parent must be a node previously obtained from this data source. This should not return null if index is a valid index for parent (that is index >= 0 && index < getChildCount( parent )).

Parameters:
parent a node in the tree, obtained from this data source
Returns:
the child of parent at index index

Implemented in org.jgraph.graph.DefaultGraphModel.

int org.jgraph.graph.GraphModel.getChildCount Object  parent  ) 
 

Returns the number of children of parent . Returns 0 if the node is a leaf or if it has no children. parent must be a node previously obtained from this data source.

Parameters:
parent a node in the tree, obtained from this data source
Returns:
the number of children of the node parent

Implemented in org.jgraph.graph.DefaultGraphModel.

int org.jgraph.graph.GraphModel.getIndexOfChild Object  parent,
Object  child
 

Returns the index of child in parent. If either the parent or child is null, returns -1.

Parameters:
parent a note in the tree, obtained from this data source
child the node we are interested in
Returns:
the index of the child in the parent, or -1 if either the parent or the child is null

Implemented in org.jgraph.graph.DefaultGraphModel.

int org.jgraph.graph.GraphModel.getIndexOfRoot Object  root  ) 
 

Returns the index of root in the model. If root is null, returns -1.

Parameters:
root a root in the model, obtained from this data source
Returns:
the index of the root in the model, or -1 if the parent is null

Implemented in org.jgraph.graph.DefaultGraphModel.

Object org.jgraph.graph.GraphModel.getParent Object  child  ) 
 

Returns the parent of child in the model. child must be a node previously obtained from this data source. This returns null if child is a root in the model.

Parameters:
child a node in the graph, obtained from this data source
Returns:
the parent of child

Implemented in org.jgraph.graph.DefaultGraphModel.

Object org.jgraph.graph.GraphModel.getRootAt int  index  ) 
 

Returns the root at index index in the model. This should not return null if index is a valid index for the model (that is index >= 0 && index < getRootCount()).

Returns:
the root of at index index

Implemented in org.jgraph.graph.DefaultGraphModel.

int org.jgraph.graph.GraphModel.getRootCount  ) 
 

Returns the number of roots in the model. Returns 0 if the model is empty.

Returns:
the number of roots in the model

Implemented in org.jgraph.graph.DefaultGraphModel.

Object org.jgraph.graph.GraphModel.getSource Object  edge  ) 
 

Returns the source of edge. edge must be an object previously obtained from this data source.

Returns:
Object that represents the source of edge

Implemented in org.jgraph.graph.DefaultGraphModel.

Object org.jgraph.graph.GraphModel.getTarget Object  edge  ) 
 

Returns the target of edge. edge must be an object previously obtained from this data source.

Returns:
Object that represents the target of edge

Implemented in org.jgraph.graph.DefaultGraphModel.

Object org.jgraph.graph.GraphModel.getValue Object  node  ) 
 

Returns the user object for the specified cell.

Returns:
userobject of node

Implemented in org.jgraph.graph.DefaultGraphModel.

void org.jgraph.graph.GraphModel.insert Object[]  roots,
Map  attributes,
ConnectionSet  cs,
ParentMap  pm,
UndoableEdit[]  e
 

Inserts the cells and connections into the model, and passes attributes to the views. Notifies the model- and undo listeners of the change.

Implemented in org.jgraph.graph.DefaultGraphModel.

boolean org.jgraph.graph.GraphModel.isEdge Object  edge  ) 
 

Returns true if edge is a valid edge.

Returns:
true if edge is a valid edge.

Implemented in org.jgraph.graph.DefaultGraphModel.

boolean org.jgraph.graph.GraphModel.isLeaf Object  node  ) 
 

Returns whether the specified node is a leaf node. The way the test is performed depends on the askAllowsChildren setting.

Parameters:
node the node to check
Returns:
true if the node is a leaf node

Implemented in org.jgraph.graph.DefaultGraphModel.

boolean org.jgraph.graph.GraphModel.isPort Object  port  ) 
 

Returns true if port is a valid port, possibly supporting edge connection.

Returns:
true if port is a valid port.

Implemented in org.jgraph.graph.DefaultGraphModel.

void org.jgraph.graph.GraphModel.remove Object[]  roots  ) 
 

Removes cells from the model. If removeChildren is true, the children are also removed. Notifies the model- and undo listeners of the change.

Implemented in org.jgraph.graph.DefaultGraphModel.

void org.jgraph.graph.GraphModel.removeGraphModelListener GraphModelListener  l  ) 
 

Removes a listener previously added with addGraphModelListener() .

Implemented in org.jgraph.graph.DefaultGraphModel.

void org.jgraph.graph.GraphModel.removeUndoableEditListener UndoableEditListener  listener  ) 
 

Removes an undo listener.

void org.jgraph.graph.GraphModel.toBack Object[]  cells  ) 
 

Sends cells to back.

Implemented in org.jgraph.graph.DefaultGraphModel.

void org.jgraph.graph.GraphModel.toFront Object[]  cells  ) 
 

Brings cells to front.

Implemented in org.jgraph.graph.DefaultGraphModel.

Object org.jgraph.graph.GraphModel.valueForCellChanged Object  cell,
Object  newValue
 

Messaged when the value of the cell has changed, eg from within the edit method.

Implemented in org.jgraph.graph.DefaultGraphModel.


The documentation for this interface was generated from the following file:
Generated on Sun May 28 19:13:16 2006 for Digimod by  doxygen 1.4.6-NO