fdda.graphics
Interface Line

All Superinterfaces:
Cloneable, Component, PropertyHolder, WorkingPart
All Known Implementing Classes:
Line

public interface Line
extends Component, WorkingPart, PropertyHolder

A line in the system. Each line corresponds to a connection in the model. The most prominent point of a line is its starting point, but the 'move' operation actually moves both the start and the end point.

Author:
Jörg Rüdenauer

Field Summary
 
Fields inherited from interface fdda.graphics.Component
SEL_ALL, SEL_EQUALS, SEL_MOVABLES, SEL_NOTHING
 
Method Summary
 Color getColor()
          Returns the color of the line.
 Connection getConnection()
          Returns the connection that is symbolized by this line.
 double getEndX()
          Returns the x coordinate of the end point of the line
 double getEndY()
          Returns the y coordinate of the end point of the line
 double getLength()
          Returns the length of the line
 double getMessageDistancePerCycle()
          Returns the distance a message proceeds along the line in one cycle.
 boolean isDirected()
          Returns whether the line is directed.
 void moveEndPoint(double xOffset, double yOffset)
          Moves the end point of the line
 void moveStartPoint(double xOffset, double yOffset)
          Moves the start point of the line.
 void setColor(Color color)
          Sets the color of the line.
 void setConnection(Connection connection)
          Sets the connection that is symbolized by this line.
 void setDirected(boolean directed)
          Sets whether the line is directed.
 void setEndXY(double x, double y)
          Sets the end point of the line
 
Methods inherited from interface fdda.graphics.Component
clone, deselect, getGraphicalSystem, getShape, getX, getY, isMovable, isSelected, move, recalculateShape, select, selectableWith, setGraphicalSystem, setXY, visit
 
Methods inherited from interface fdda.graphics.WorkingPart
isWorking, setWorking
 
Methods inherited from interface fdda.model.PropertyHolder
addProperty, addPropertyListener, changeProperty, firePropertyChanged, getProperties, getProperty, removeProperty, removePropertyListener
 

Method Detail

getEndX

public double getEndX()
Returns the x coordinate of the end point of the line

Returns:
the x coordinate of the end point of the line

getEndY

public double getEndY()
Returns the y coordinate of the end point of the line

Returns:
the y coordinate of the end point of the line

getLength

public double getLength()
Returns the length of the line

Returns:
the length of the line

setEndXY

public void setEndXY(double x,
                     double y)
Sets the end point of the line

Parameters:
x - the x coordinate
y - the y coordinate

moveStartPoint

public void moveStartPoint(double xOffset,
                           double yOffset)
Moves the start point of the line.

Parameters:
xOffset - the x offset
yOffset - the y offset

moveEndPoint

public void moveEndPoint(double xOffset,
                         double yOffset)
Moves the end point of the line

Parameters:
xOffset - the x offset
yOffset - the y offset

getColor

public Color getColor()
Returns the color of the line.

Returns:
the color of the line

setColor

public void setColor(Color color)
Sets the color of the line. May be ignored by the implementation.

Parameters:
color - the color

isDirected

public boolean isDirected()
Returns whether the line is directed. A directed line corresponds to a connection which can transfer messages only in one direction.

Returns:
whether the line is directed

setDirected

public void setDirected(boolean directed)
Sets whether the line is directed.

Parameters:
directed - whether the line is directed

getConnection

public Connection getConnection()
Returns the connection that is symbolized by this line.

Returns:
the connection

setConnection

public void setConnection(Connection connection)
Sets the connection that is symbolized by this line.

Parameters:
connection - the connection

getMessageDistancePerCycle

public double getMessageDistancePerCycle()
Returns the distance a message proceeds along the line in one cycle.

Returns:
distance / cycle -- i.e. message speed


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