org.tigris.gef.base
Class Diagram

java.lang.Object
  extended by org.tigris.gef.base.Diagram
All Implemented Interfaces:
java.io.Serializable, java.util.EventListener, GraphListener

public class Diagram
extends java.lang.Object
implements java.io.Serializable, GraphListener

A diagram is just combination of a GraphModel, a Layer, and a title. The GraphModel stores the connected graph representation, without any graphics. The Layer stores all the Figs.

See Also:
Serialized Form

Field Summary
protected  java.lang.String _comments
           
protected  java.lang.String _name
           
protected  ToolBar _toolBar
           
static java.lang.String NAME_KEY
          The bean property name denoting the diagram's name.
static java.lang.String SCALE_KEY
          The bean property name denoting the scale factor.
 
Constructor Summary
Diagram()
           
Diagram(java.lang.String name)
           
Diagram(java.lang.String name, GraphModel graphModel)
           
Diagram(java.lang.String name, GraphModel graphModel, LayerPerspective layer)
           
 
Method Summary
 void add(Fig f)
           
 void addPropertyChangeListener(java.beans.PropertyChangeListener l)
           
 void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener l)
           
 void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
           
 void bringForward(Fig f)
           
 void bringToFront(Fig f)
           
 int countContained(java.util.List owners)
           
 void edgeAdded(GraphEvent e)
           
 void edgeRemoved(GraphEvent e)
           
 java.util.Enumeration elements()
           
 java.util.Enumeration elementsIn(java.awt.Rectangle r)
           
 void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
           
 void fireVetoableChange(java.lang.String propertyName, boolean oldValue, boolean newValue)
           
 void fireVetoableChange(java.lang.String propertyName, int oldValue, int newValue)
           
 void fireVetoableChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
           
 java.lang.String getClassAndModelID()
          USED BY SVG.tee
 java.lang.String getComments()
           
 java.util.Collection getEdges(java.util.Collection edges)
          Get all the figs that are edges.
 GraphController getGraphController()
           
 GraphModel getGraphModel()
           
 LayerPerspective getLayer()
           
 java.lang.String getName()
          USED BY SVG.tee
 java.util.Collection getNodes(java.util.Collection nodes)
          Get all the figs that are a node.
 double getScale()
           
 boolean getShowSingleMultiplicity()
           
 ToolBar getToolBar()
           
 void graphChanged(GraphEvent e)
           
 Fig hit(java.awt.Rectangle r)
           
 void initialize(java.lang.Object owner)
           
protected  void initToolBar()
           
 void nodeAdded(GraphEvent e)
           
 void nodeRemoved(GraphEvent e)
           
 void postLoad()
           
 void postSave()
           
 void preSave()
           
 Fig presentationFor(java.lang.Object obj)
           
 void remove()
           
 void remove(Fig f)
           
 void removeAll(Fig f)
           
 void removePropertyChangeListener(java.beans.PropertyChangeListener l)
           
 void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener l)
           
 void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
           
 void reorder(Fig f, int function)
           
 void sendBackward(Fig f)
           
 void sendToBack(Fig f)
           
 void setComments(java.lang.String c)
           
 void setGraphModel(GraphModel gm)
           
 void setLayer(LayerPerspective layer)
           
 void setName(java.lang.String name)
           
 void setScale(double scale)
           
 void setShowSingleMultiplicity(boolean enable)
           
 void setToolBar(ToolBar tb)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_name

protected java.lang.String _name

_comments

protected java.lang.String _comments

_toolBar

protected transient ToolBar _toolBar

SCALE_KEY

public static final java.lang.String SCALE_KEY
The bean property name denoting the scale factor. Value is a Double in range [0, 1]

See Also:
Constant Field Values

NAME_KEY

public static final java.lang.String NAME_KEY
The bean property name denoting the diagram's name. Value is a String.

See Also:
Constant Field Values
Constructor Detail

Diagram

public Diagram()

Diagram

public Diagram(java.lang.String name)

Diagram

public Diagram(java.lang.String name,
               GraphModel graphModel)

Diagram

public Diagram(java.lang.String name,
               GraphModel graphModel,
               LayerPerspective layer)
Method Detail

initToolBar

protected void initToolBar()

initialize

public void initialize(java.lang.Object owner)

getToolBar

public ToolBar getToolBar()

setToolBar

public void setToolBar(ToolBar tb)

getComments

public java.lang.String getComments()

setComments

public void setComments(java.lang.String c)
                 throws java.beans.PropertyVetoException
Throws:
java.beans.PropertyVetoException

getName

public java.lang.String getName()
USED BY SVG.tee


setName

public void setName(java.lang.String name)
             throws java.beans.PropertyVetoException
Throws:
java.beans.PropertyVetoException

setShowSingleMultiplicity

public void setShowSingleMultiplicity(boolean enable)

getShowSingleMultiplicity

public boolean getShowSingleMultiplicity()

getScale

public double getScale()

setScale

public void setScale(double scale)

getClassAndModelID

public java.lang.String getClassAndModelID()
USED BY SVG.tee


getGraphModel

public GraphModel getGraphModel()

setGraphModel

public void setGraphModel(GraphModel gm)

getGraphController

public GraphController getGraphController()

getLayer

public LayerPerspective getLayer()

setLayer

public void setLayer(LayerPerspective layer)

countContained

public int countContained(java.util.List owners)

getNodes

public java.util.Collection getNodes(java.util.Collection nodes)
Get all the figs that are a node.

Parameters:
nodes - the collection in which to place the nodes or null if a new collection should be created
Returns:
the nodes

getEdges

public java.util.Collection getEdges(java.util.Collection edges)
Get all the figs that are edges.

Parameters:
edges - the collection in which to place the edges or null if a new collection should be created
Returns:
the edges

add

public void add(Fig f)

remove

public void remove(Fig f)

removeAll

public void removeAll(Fig f)

elements

public java.util.Enumeration elements()

hit

public Fig hit(java.awt.Rectangle r)

elementsIn

public java.util.Enumeration elementsIn(java.awt.Rectangle r)

presentationFor

public Fig presentationFor(java.lang.Object obj)

sendToBack

public void sendToBack(Fig f)

bringForward

public void bringForward(Fig f)

sendBackward

public void sendBackward(Fig f)

bringToFront

public void bringToFront(Fig f)

reorder

public void reorder(Fig f,
                    int function)

nodeAdded

public void nodeAdded(GraphEvent e)
Specified by:
nodeAdded in interface GraphListener

edgeAdded

public void edgeAdded(GraphEvent e)
Specified by:
edgeAdded in interface GraphListener

nodeRemoved

public void nodeRemoved(GraphEvent e)
Specified by:
nodeRemoved in interface GraphListener

edgeRemoved

public void edgeRemoved(GraphEvent e)
Specified by:
edgeRemoved in interface GraphListener

graphChanged

public void graphChanged(GraphEvent e)
Specified by:
graphChanged in interface GraphListener

preSave

public void preSave()

postSave

public void postSave()

postLoad

public void postLoad()

addVetoableChangeListener

public void addVetoableChangeListener(java.beans.VetoableChangeListener listener)

removeVetoableChangeListener

public void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)

fireVetoableChange

public void fireVetoableChange(java.lang.String propertyName,
                               boolean oldValue,
                               boolean newValue)
                        throws java.beans.PropertyVetoException
Throws:
java.beans.PropertyVetoException

fireVetoableChange

public void fireVetoableChange(java.lang.String propertyName,
                               int oldValue,
                               int newValue)
                        throws java.beans.PropertyVetoException
Throws:
java.beans.PropertyVetoException

fireVetoableChange

public void fireVetoableChange(java.lang.String propertyName,
                               java.lang.Object oldValue,
                               java.lang.Object newValue)
                        throws java.beans.PropertyVetoException
Throws:
java.beans.PropertyVetoException

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener l)

addPropertyChangeListener

public void addPropertyChangeListener(java.lang.String propertyName,
                                      java.beans.PropertyChangeListener l)

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener l)

removePropertyChangeListener

public void removePropertyChangeListener(java.lang.String propertyName,
                                         java.beans.PropertyChangeListener l)

firePropertyChange

public void firePropertyChange(java.lang.String propertyName,
                               java.lang.Object oldValue,
                               java.lang.Object newValue)

remove

public void remove()