fdda.core.projects
Interface Project

All Known Implementing Classes:
Project

public interface Project

A project. A project has (currently) exactly one frame with exactly one model and corresponding graphical system. It has two states: the modelling state, where nodes and connections may be added or removed etc., and the demonstration state, where the algorithm is demonstrated.

Author:
Jörg Rüdenauer

Field Summary
static int STATE_DEMONSTRATION
          demonstration state
static int STATE_MOD
          modelling state
 
Method Summary
 void addConnection(Connection connection)
          Adds a connection to the project
 void addNode(Node node)
          Adds a node to the project
 void clear()
          Removes all nodes and connections.
 Iterator connections()
          Returns an iterator over the connections in the project.
 Algorithm getAlgorithm()
          Returns the algorithm that is currently assigned to the project.
 GraphicalSystem getGraphicalSystem()
          Returns the graphical system of the project.
 String getLocation()
          Returns the location where the project is stored, e.g. a file path
 String getName()
          Returns the name of the project.
 int getState()
          Returns the state of the project (modelling or demonstration)
 boolean isLocationKnown()
          Returns whether a storage location for the project is known.
 Iterator nodes()
          Returns an iterator over the nodes in the project.
 void removeConnection(Connection connection)
          Removes a connection from the project
 void removeNode(Node node)
          Removes a node from the project
 void setAlgorithm(Algorithm algorithm)
          Assigns an algorithm to the project.
 void setChanged(boolean changed)
          Sets whether the project was changed since the last save operation.
 void setGraphicalSystem(GraphicalSystem system)
          Sets the graphical system of the project.
 void setLocation(String location)
          Sets the location where the project is stored, e.g. a file path.
 boolean wasChanged()
          Returns whether the project was changed since the last save operation.
 

Field Detail

STATE_MOD

public static final int STATE_MOD
modelling state

See Also:
Constant Field Values

STATE_DEMONSTRATION

public static final int STATE_DEMONSTRATION
demonstration state

See Also:
Constant Field Values
Method Detail

setLocation

public void setLocation(String location)
Sets the location where the project is stored, e.g. a file path. Set to null if the location is not known or the project wasn't stored yet.

Parameters:
location - the location

getLocation

public String getLocation()
Returns the location where the project is stored, e.g. a file path

Returns:
the location (or null if it is not known).

isLocationKnown

public boolean isLocationKnown()
Returns whether a storage location for the project is known. This is not the case for projects the user has newly created.

Returns:
whether the storage location is known

getState

public int getState()
Returns the state of the project (modelling or demonstration)

Returns:
the state

getGraphicalSystem

public GraphicalSystem getGraphicalSystem()
Returns the graphical system of the project.

Returns:
the graphical system

setGraphicalSystem

public void setGraphicalSystem(GraphicalSystem system)
Sets the graphical system of the project.

Parameters:
system - the graphical system

getName

public String getName()
Returns the name of the project.

Returns:
the name

addNode

public void addNode(Node node)
Adds a node to the project

Parameters:
node - the node

removeNode

public void removeNode(Node node)
Removes a node from the project

Parameters:
node - the node

addConnection

public void addConnection(Connection connection)
Adds a connection to the project

Parameters:
connection - the connection

removeConnection

public void removeConnection(Connection connection)
Removes a connection from the project

Parameters:
connection - the connection

clear

public void clear()
Removes all nodes and connections.


nodes

public Iterator nodes()
Returns an iterator over the nodes in the project.

Returns:
iterator over the nodes

connections

public Iterator connections()
Returns an iterator over the connections in the project.

Returns:
iterator over the connections

wasChanged

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

Returns:
whether the project was changed

setChanged

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

Parameters:
changed - whether the project was changed

getAlgorithm

public Algorithm getAlgorithm()
Returns the algorithm that is currently assigned to the project.

Returns:
the algorithm

setAlgorithm

public void setAlgorithm(Algorithm algorithm)
Assigns an algorithm to the project.

Parameters:
algorithm - the algorithm


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