fdda.model
Interface Connection

All Superinterfaces:
PropertyHolder, WorkingPart
All Known Implementing Classes:
Connection

public interface Connection
extends PropertyHolder, WorkingPart

A connection between two nodes. It can be either directed - allowing messages to pass only in one direction - or undirected. It has a graphical representation. A connection has some properties and may be not working.

Author:
Jörg Rüdenauer
See Also:
Line

Field Summary
static String DIRECTED_PROPERTY_NAME
          the name of the property that determines whether the connection is directed
static String SPEED_PROPERTY_NAME
          the name of the property that determines the speed of the connection
 
Fields inherited from interface fdda.model.WorkingPart
WORKING_PROPERTY_NAME
 
Method Summary
 Node getEndNode()
          Returns the node where the connection ends.
 Line getGraphicalRepresentation()
          Returns the graphical representation of the connection
 int getNr()
          Returns the internal number of the connection, which is unique.
 double getSpeed()
          Returns the speed of the connection.
 Node getStartNode()
          Returns the node where the connection starts.
 boolean isDirected()
          Returns whether the connection is directed
 void setDirected(boolean directed)
          Specifies whether the connection is directed.
 
Methods inherited from interface fdda.model.PropertyHolder
addProperty, addPropertyListener, changeProperty, firePropertyChanged, getProperties, getProperty, removeProperty, removePropertyListener
 
Methods inherited from interface fdda.model.WorkingPart
isWorking, setWorking
 

Field Detail

DIRECTED_PROPERTY_NAME

public static final String DIRECTED_PROPERTY_NAME
the name of the property that determines whether the connection is directed

See Also:
Constant Field Values

SPEED_PROPERTY_NAME

public static final String SPEED_PROPERTY_NAME
the name of the property that determines the speed of the connection

See Also:
Constant Field Values
Method Detail

getStartNode

public Node getStartNode()
Returns the node where the connection starts. (Even undirected connections have a 'start' and an 'end' node).

Returns:
the start node of the connection

getEndNode

public Node getEndNode()
Returns the node where the connection ends. (Even undirected connections have a 'start' and an 'end' node).

Returns:
the end node of the connection

getGraphicalRepresentation

public Line getGraphicalRepresentation()
Returns the graphical representation of the connection

Returns:
the graphical representation

isDirected

public boolean isDirected()
Returns whether the connection is directed

Returns:
whether the connection is directed

setDirected

public void setDirected(boolean directed)
Specifies whether the connection is directed. Changes the corresponding property.

Parameters:
directed - whether the connection shall be directed

getNr

public int getNr()
Returns the internal number of the connection, which is unique.

Returns:
the internal number

getSpeed

public double getSpeed()
Returns the speed of the connection. The usual speed is 1.0, 2.0 would be two times as fast, 0.0 would be no speed at all, etc.

Returns:
the speed of the connection


API documentation for FDDA version 0.9. Generated on 17/02/2004 14:12.