gumbo.visualize.data
Class EdgeModel

java.lang.Object
  |
  +--gumbo.util.AbstractDisposable
        |
        +--gumbo.visualize.data.DataModel
              |
              +--gumbo.visualize.data.PartModel
                    |
                    +--gumbo.visualize.data.EdgeModel
All Implemented Interfaces:
Disposable, java.io.Serializable

public class EdgeModel
extends PartModel

A part model representing a data relationship between two or more (possibly identical) vertex models in a whole model (a hyper-edge). Edge models do not connect to vertex models per se. Instead, the ends of an edge connect to port models, which may be a vertex or a port in a vertex. For an edge model to exist in a tree model, all ends must be connected to a port model (orphan and dangling edges are not allowed).

In the part model tree, an edge model is a leaf. Edge end connections are maintained as a list of tree leaf node delegates, with one delegate per edge end. By definition, the list will contain at least two delegates. By convention, for a two end directed edge, the first end (INDEX_HEAD_END) is the head (to a port) and the second one (INDEX_TAIL_END) is the tail (from a port).

Version:
$Revision: 1.19 $
Author:
Jon Barrilleaux (jonb@jmbaai.com) of JMB and Associates Inc.
See Also:
Serialized Form

Field Summary
static int INDEX_HEAD_END
          Port list index of the head end (to a port) of a two ended directed edge.
static int INDEX_TAIL_END
          Port list index of the tail end (from a port) of a two ended directed edge.
static Group TYPES
          A singleton immutable group containing the type (Class) of this class.
 
Constructor Summary
EdgeModel(java.lang.Object clientId, java.lang.Object clientData)
          Creates a new instance.
 
Method Summary
protected  void checkParentPartModel(DataModel parent)
          Safely returns if a part model can be set as the parent in this model's part model tree.
 int getConnectionCount()
          Gets the number of ports connected to this edge.
 java.util.List getPortModels()
          Gets an immutable view of the port models connected to the ordered ends of this edge model.
protected  void implDispose()
          Disconnectes port models, and then disposes this model.
 
Methods inherited from class gumbo.visualize.data.PartModel
addPartModel, checkAddPartModel, checkRootPartModel, findPartModelRoot, findPartModelSubs, findPartModelSupers, getPartModelChildren, getPartModelParent, removePartModel
 
Methods inherited from class gumbo.visualize.data.DataModel
getClientData, getClientId, initDataModel, setClientData
 
Methods inherited from class gumbo.util.AbstractDisposable
dispose, isDisposed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INDEX_TAIL_END

public static final int INDEX_TAIL_END
Port list index of the tail end (from a port) of a two ended directed edge.

See Also:
Constant Field Values

INDEX_HEAD_END

public static final int INDEX_HEAD_END
Port list index of the head end (to a port) of a two ended directed edge.

See Also:
Constant Field Values

TYPES

public static final Group TYPES
A singleton immutable group containing the type (Class) of this class. Supports both Set and List views.

Constructor Detail

EdgeModel

public EdgeModel(java.lang.Object clientId,
                 java.lang.Object clientData)
Creates a new instance.

Parameters:
clientId - See DataModel. Null if none, in which case the client ID defaults to this object.
clientData - See DataModel. Null if none.
Method Detail

getPortModels

public java.util.List getPortModels()
Gets an immutable view of the port models connected to the ordered ends of this edge model. Duplicates will occur if multiple ends of the edge are connected to the same port.

Returns:
The view (PortModel). Never null.
Throws:
java.lang.IllegalStateException - This model is not in a tree.

getConnectionCount

public int getConnectionCount()
Gets the number of ports connected to this edge.

Returns:
Connection count.
Throws:
java.lang.IllegalStateException - This model is not in a tree.

checkParentPartModel

protected void checkParentPartModel(DataModel parent)
Safely returns if a part model can be set as the parent in this model's part model tree. To be valid, this model must not be disposed, this model must not be in a part model tree (have a part model root), and the parent must be a WholeModel. Override to add further qualifications.

Overrides:
checkParentPartModel in class PartModel
Throws:
java.lang.IllegalStateException - This object has been disposed.
java.lang.IllegalArgumentException - Parent must be a WholeModel.

implDispose

protected void implDispose()
Disconnectes port models, and then disposes this model.

Overrides:
implDispose in class PartModel