pl.edu.agh.cast.model.visual
Class ConnectionGroup

java.lang.Object
  extended by pl.edu.agh.cast.model.visual.ModelElement
      extended by pl.edu.agh.cast.model.visual.ConnectionGroup
All Implemented Interfaces:
java.beans.PropertyChangeListener, java.io.Serializable, java.util.EventListener, IPropertyChangeProvider, AttributeValueContainer

public class ConnectionGroup
extends ModelElement

Stores list of all connections between two nodes.

See Also:
Serialized Form

Field Summary
static java.lang.String CONNECTION_COUNT_CHANGED
          Events fired by connection group
static java.lang.String DOUBLE_CONNECTION_SOURCE_LABEL
           
static java.lang.String DOUBLE_CONNECTION_TARGET_LABEL
           
static java.lang.String LINE_COLOR
           
static java.lang.String LINE_THICKNESS
           
static java.lang.String SINGLE_CONNECTION_LABEL
           
static java.lang.String VARIABLE_THICKNESS_CONNECTION_LABEL
           
 
Fields inherited from class pl.edu.agh.cast.model.visual.ModelElement
_attributeValues, ATTRIBUTE_CHANGE
 
Constructor Summary
ConnectionGroup(Node source, Node target, ConnectionGroupAttributeManager propertyManager)
          Creates a connection group
 
Method Summary
 void addConnection(Connection connection)
           
 void addConnectionGroupToNodes()
          Adds this connection group to both nodes
 void addSourceConnection(Connection connection)
           
 void addTargetConnection(Connection connection)
           
 void copyTo(ConnectionGroup that)
           
 boolean equals(java.lang.Object obj)
          Two ConnectionGroups are equal if their sources and targets are equal.
 java.util.List<Connection> getAllConnections()
           
 AttributeManager getAttributeManager()
          Returns element's attribute manager
 int getConnectionCount()
           
 ConnectionGroupAttributeManager getPropertyManager()
           
 Node getSource()
           
 int getSourceConnectionCountFor(Node node)
           
 java.util.List<Connection> getSourceConnections()
          Deprecated. Use getSourceConnectionsFor(Node)
 java.util.List<Connection> getSourceConnectionsFor(Node node)
           
 Node getTarget()
           
 int getTargetConnectionCountFor(Node node)
           
 java.util.List<Connection> getTargetConnections()
          Deprecated. Use getTargetConnectionsFor(Node)
 java.util.List<Connection> getTargetConnectionsFor(Node node)
           
 int hashCode()
           
 boolean isBetween(Node node1, Node node2)
           
 void oldRemoveConnectionGroupFromNodes()
          Deprecated. Do not use this method to remove a connection group from a diagram. Use Diagram.removeConnection(Connection) instead.
 void removeConnection(Connection connection)
           
 void removeConnectionGroupFromNodes()
          Removes this connection group from both nodes - counterpart of addConnectionGroupToNodes()
 void removeSourceConnection(Connection connection)
           
 void removeTargetConnection(Connection connection)
           
 void setSource(Node node)
           
 void setTarget(Node node)
           
 java.lang.String toString()
           
 
Methods inherited from class pl.edu.agh.cast.model.visual.ModelElement
addPropertyChangeListener, bindToAttributeManager, copyAttributes, copyAttributeValues, firePropertyChange, getAllValues, getAttributeValue, getMid, isAttributeEditable, isAttributeSettable, isSaved, propertyChange, readResolve, removePropertyChangeListener, removePropertyValue, setAttributeValue, setAttributeValue, setMid, setSaved
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

CONNECTION_COUNT_CHANGED

public static final java.lang.String CONNECTION_COUNT_CHANGED
Events fired by connection group

See Also:
Constant Field Values

SINGLE_CONNECTION_LABEL

public static final java.lang.String SINGLE_CONNECTION_LABEL
See Also:
Constant Field Values

DOUBLE_CONNECTION_SOURCE_LABEL

public static final java.lang.String DOUBLE_CONNECTION_SOURCE_LABEL
See Also:
Constant Field Values

DOUBLE_CONNECTION_TARGET_LABEL

public static final java.lang.String DOUBLE_CONNECTION_TARGET_LABEL
See Also:
Constant Field Values

VARIABLE_THICKNESS_CONNECTION_LABEL

public static final java.lang.String VARIABLE_THICKNESS_CONNECTION_LABEL
See Also:
Constant Field Values

LINE_THICKNESS

public static final java.lang.String LINE_THICKNESS
See Also:
Constant Field Values

LINE_COLOR

public static final java.lang.String LINE_COLOR
See Also:
Constant Field Values
Constructor Detail

ConnectionGroup

public ConnectionGroup(Node source,
                       Node target,
                       ConnectionGroupAttributeManager propertyManager)
Creates a connection group

Parameters:
incoming - number of connections from target TO SOURCE
outgoing - number of connections from source TO TARGET
source -
target -
Method Detail

getConnectionCount

public int getConnectionCount()

getTargetConnectionCountFor

public int getTargetConnectionCountFor(Node node)
Returns:
number of connections from target TO SOURCE

getSourceConnectionCountFor

public int getSourceConnectionCountFor(Node node)
Returns:
number of connections from source TO TARGET

getSourceConnections

@Deprecated
public java.util.List<Connection> getSourceConnections()
Deprecated. Use getSourceConnectionsFor(Node)


getTargetConnections

@Deprecated
public java.util.List<Connection> getTargetConnections()
Deprecated. Use getTargetConnectionsFor(Node)


getSourceConnectionsFor

public java.util.List<Connection> getSourceConnectionsFor(Node node)

getTargetConnectionsFor

public java.util.List<Connection> getTargetConnectionsFor(Node node)

getAllConnections

public java.util.List<Connection> getAllConnections()

getSource

public Node getSource()

setSource

public void setSource(Node node)

getTarget

public Node getTarget()

setTarget

public void setTarget(Node node)

addSourceConnection

public void addSourceConnection(Connection connection)

addTargetConnection

public void addTargetConnection(Connection connection)

removeSourceConnection

public void removeSourceConnection(Connection connection)

removeTargetConnection

public void removeTargetConnection(Connection connection)

oldRemoveConnectionGroupFromNodes

@Deprecated
public void oldRemoveConnectionGroupFromNodes()
Deprecated. Do not use this method to remove a connection group from a diagram. Use Diagram.removeConnection(Connection) instead.

Removes this connection group from both nodes


addConnectionGroupToNodes

public void addConnectionGroupToNodes()
Adds this connection group to both nodes


removeConnectionGroupFromNodes

public void removeConnectionGroupFromNodes()
Removes this connection group from both nodes - counterpart of addConnectionGroupToNodes()


isBetween

public boolean isBetween(Node node1,
                         Node node2)

addConnection

public void addConnection(Connection connection)

removeConnection

public void removeConnection(Connection connection)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getPropertyManager

public ConnectionGroupAttributeManager getPropertyManager()

equals

public boolean equals(java.lang.Object obj)
Two ConnectionGroups are equal if their sources and targets are equal.

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

copyTo

public void copyTo(ConnectionGroup that)

getAttributeManager

public AttributeManager getAttributeManager()
Description copied from class: ModelElement
Returns element's attribute manager

Specified by:
getAttributeManager in interface AttributeValueContainer
Specified by:
getAttributeManager in class ModelElement


Copyright © 2007-2008 AGH University of Science and Technology. All Rights Reserved.