Package org.graffiti.session
Class Session
java.lang.Object
org.graffiti.session.Session
- All Implemented Interfaces:
ConstraintCheckerListener
- Direct Known Subclasses:
EditorSession
public class Session extends Object implements ConstraintCheckerListener
Contains a session. A session consists of a
org.graffiti.graph.Graph and a list of corresponding
org.graffiti.plugin.view.Views. Every Session
contains a GraphConstraintChecker which checks the constraints
defined by the current mode.-
Constructor Summary
-
Method Summary
Modifier and Type Method Description voidaddView(View view)Adds a new View to the inner list of views.voidchangeActiveMode(Mode activeMode)Changes the active mode of this session.voidcheckFailed(String msg)Handles the failed constraint check.voidclose()Closes this session.ModegetActiveMode()Returns the mode that is active in this session.ViewgetActiveView()Returns the activeView.StringgetClassName(Algorithm algorithm)Returns the class name of the specified algorithm.GraphgetGraph()Returns the graph of this session.List<View>getViews()Returns the list of views in the manager.booleanisModified()Returnstrue, if the graph in this session has been modified.voidpluginAdded(GenericPlugin plugin, PluginDescription desc)Called by the plugin manager, iff a plugin has been added.voidremoveView(View view)Removes the given view from this session.voidsetActiveView(View activeView)Sets the activeView.StringtoString()
-
Constructor Details
-
Session
public Session()Constructs a new session instance with an empty graph and the corresponding constraint checker. -
Session
Constructs a new session instance with the given graph.- Parameters:
graph- the graph to be used for this session.
-
-
Method Details
-
getActiveMode
Returns the mode that is active in this session.- Returns:
- the mode active in this session.
-
setActiveView
Sets the activeView.- Parameters:
activeView- The activeView to set
-
getActiveView
Returns the activeView.- Returns:
- View
-
getClassName
Returns the class name of the specified algorithm. Using theInstanceLoaderan instance of thisAlgorithmcan be created.- Parameters:
algorithm- theAlgorithmof which to get the class name.- Returns:
- the class name of the specified algorithm.
- Throws:
RuntimeException- DOCUMENT ME!
-
getGraph
Returns the graph of this session.- Returns:
- the graph of this session.
-
isModified
public boolean isModified()Returnstrue, if the graph in this session has been modified.- Returns:
- True, if the graph has been modified. False, if not.
-
getViews
Returns the list of views in the manager.- Returns:
- the list of views in the manager.
-
addView
Adds a new View to the inner list of views.- Parameters:
view- a view to be added.
-
changeActiveMode
Changes the active mode of this session.- Parameters:
activeMode- the new active mode.
-
checkFailed
Handles the failed constraint check.- Specified by:
checkFailedin interfaceConstraintCheckerListener- Parameters:
msg- tells details about the unsatisfied constraints.
-
close
public void close()Closes this session. Closes all the views of this session. -
pluginAdded
Called by the plugin manager, iff a plugin has been added.- Parameters:
plugin- the added plugin.desc- the description of the new plugin.
-
removeView
Removes the given view from this session.- Parameters:
view- the view to be removed from this session.- Throws:
IllegalArgumentException- DOCUMENT ME!
-
toString
-