fdda.graphics
Interface GraphicalSystem

All Known Implementing Classes:
GraphicalSystem

public interface GraphicalSystem

A graphical system, consisting (at this level of abstraction) of nodes, lines and (while in demo mode) messages.

Author:
Jörg Rüdenauer

Method Summary
 void addLine(Line line)
          Adds a line to the system.
 void addMessage(Message message)
          Adds a message to the system
 void addNode(Node node)
          Adds a node to the system.
 void clear()
          Removes all nodes and all lines from the system.
 void clearMessages()
          Removes all messages from the system
 Collection getAllMessages()
          Returns all messages in the system.
 Component getElementAt(double x, double y)
          Returns the 'topmost' component at a certain point.
 Rectangle2D getEnclosingRectangle()
          Returns a rectangle that just encloses all components in the system.
 Component getMovableComponents()
          Returns all movable components in the graphical system.
 Component getMovableComponentsInArea(Area area)
          Returns all movable components that lie in the specified area.
 Project getProject()
          Returns the project which includes this graphical system.
 void recalculateShapes()
          Recalculates the shapes of all components in the system.
 void removeLine(Line line)
          Removes a line from the system.
 void removeMessage(Message message)
          Removes a message from the system
 void removeNode(Node node)
          Removes a node from the system.
 void setChanged(boolean changed)
          Sets whether the system was changed since the last save operation.
 void setProject(Project project)
          Sets the project which includes this graphical system.
 boolean wasChanged()
          Returns whether the graphical system was changed since the last save operation.
 

Method Detail

addNode

public void addNode(Node node)
Adds a node to the system. No checks for doubles are performed.

Parameters:
node - the node

removeNode

public void removeNode(Node node)
Removes a node from the system. If the node doesn't exist, nothing happens.

Parameters:
node - the node

addLine

public void addLine(Line line)
Adds a line to the system. No checks for doubles are performed.

Parameters:
line - the line

removeLine

public void removeLine(Line line)
Removes a line from the system. If the line doesn't exist, nothing happens.

Parameters:
line - the line

clear

public void clear()
Removes all nodes and all lines from the system.


getElementAt

public Component getElementAt(double x,
                              double y)
Returns the 'topmost' component at a certain point. Lines are always 'higher' than nodes; otherwise components are higher if they were added later.

Parameters:
x - the x coordinate of the point
y - the y coordinate of the point
Returns:
the topmost component at the point - or null, if no component is currently at that point

getMovableComponentsInArea

public Component getMovableComponentsInArea(Area area)
Returns all movable components that lie in the specified area. They need not lie completely inside, only touching is enough.

Parameters:
area - the area
Returns:
all movable components in the area

getMovableComponents

public Component getMovableComponents()
Returns all movable components in the graphical system.

Returns:
all movable components

getEnclosingRectangle

public Rectangle2D getEnclosingRectangle()
Returns a rectangle that just encloses all components in the system.

Returns:
an enclosing rectangle

recalculateShapes

public void recalculateShapes()
Recalculates the shapes of all components in the system.


wasChanged

public boolean wasChanged()
Returns whether the graphical system was changed since the last save operation.

Returns:
whether the system was changed

setChanged

public void setChanged(boolean changed)
Sets whether the system was changed since the last save operation.

Parameters:
changed - whether the system was changed

getProject

public Project getProject()
Returns the project which includes this graphical system.

Returns:
the project

setProject

public void setProject(Project project)
Sets the project which includes this graphical system.

Parameters:
project - the project

addMessage

public void addMessage(Message message)
Adds a message to the system

Parameters:
message - the message

removeMessage

public void removeMessage(Message message)
Removes a message from the system

Parameters:
message - the message

clearMessages

public void clearMessages()
Removes all messages from the system


getAllMessages

public Collection getAllMessages()
Returns all messages in the system. The returned Collection is not modifiable (read only).

Returns:
all messsages in the system


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