org.graffiti.session
Class EditorSession

java.lang.Object
  extended by org.graffiti.util.MutuallyReferableObject
      extended by org.graffiti.session.Session
          extended by org.graffiti.session.EditorSession
All Implemented Interfaces:
ActionListener, EventListener, ConstraintCheckerListener, MutuallyReferable

public class EditorSession
extends Session
implements ActionListener

Contains an editor session. An editor session contains a list of views, which can manipulate the graph object. It also contains the current editor mode and the selection model.

Version:
$Revision: 5768 $
See Also:
Session

Field Summary
 
Fields inherited from class org.graffiti.session.Session
activeView, animations, constraintChecker, graph, id, views
 
Constructor Summary
EditorSession()
          Constructs a new EditorSession with an empty graph instance.
EditorSession(Graph graph)
          Constructs a new EditorSession.
 
Method Summary
 void actionPerformed(ActionEvent e)
          Registrates the selected Tool as an MouseInputListener at the view.
 void addView(View view)
          Adds a new View to the inner list of views.
 URI getFileName()
          Returns the fileName of this session's graph.
 String getFileNameAsString()
          An auxillary method for quering for the string name of graph file of this session.
 String getFileNameForSaveDialog()
           
 Map<GraphElement,GraphElement> getGraphElementsMap()
          Returns the graphElementMap.
 SelectionModel getSelectionModel()
          Returns the selectionModel.
 UndoManager getUndoManager()
          Returns the undoManager for this session.
 boolean isClosing()
          Returns true, if the session is currently closing.
 void setClosing()
          Sets the closing state of this session.
 void setFileName(URI fileName)
          Sets the fileName.
 void setSelectionModel(SelectionModel selectionModel)
          Sets the selectionModel.
 
Methods inherited from class org.graffiti.session.Session
approveStartOfNewAnimation, checkFailed, close, discardActiveAnimation, getActiveAnimation, getActiveView, getClassName, getGraph, getId, getNextSessionId, getNextViewId, getViews, hasActiveAnimation, hasPassiveAnimation, hasStartedNewAnimation, isModified, removeView, setActiveAlgorithm, setActiveView, validateConstraints
 
Methods inherited from class org.graffiti.util.MutuallyReferableObject
addReference
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EditorSession

public EditorSession()
Constructs a new EditorSession with an empty graph instance.


EditorSession

public EditorSession(Graph graph)
Constructs a new EditorSession.

Parameters:
graph - the Graph object for this session.
Method Detail

setClosing

public void setClosing()
Sets the closing state of this session. This may only be done once.

Throws:
RuntimeException - DOCUMENT ME!

isClosing

public boolean isClosing()
Returns true, if the session is currently closing.

Returns:
DOCUMENT ME!

setFileName

public void setFileName(URI fileName)
Sets the fileName.

Parameters:
fileName - The fileName to set

getFileName

public URI getFileName()
Returns the fileName of this session's graph.

Returns:
the fileName of this session's graph.

getFileNameForSaveDialog

public String getFileNameForSaveDialog()

getFileNameAsString

public String getFileNameAsString()
An auxillary method for quering for the string name of graph file of this session.

Returns:
a name of the graph file as string

getGraphElementsMap

public Map<GraphElement,GraphElement> getGraphElementsMap()
Returns the graphElementMap.

Returns:
Map

setSelectionModel

public void setSelectionModel(SelectionModel selectionModel)
Sets the selectionModel.

Parameters:
selectionModel - The selectionModel to set

getSelectionModel

public SelectionModel getSelectionModel()
Returns the selectionModel.

Returns:
DOCUMENT ME!

getUndoManager

public UndoManager getUndoManager()
Returns the undoManager for this session.

Returns:
the undoManager for this session.

actionPerformed

public void actionPerformed(ActionEvent e)
Registrates the selected Tool as an MouseInputListener at the view.

Specified by:
actionPerformed in interface ActionListener
Parameters:
e - DOCUMENT ME!

addView

public void addView(View view)
Adds a new View to the inner list of views.

Overrides:
addView in class Session
Parameters:
view - a view to be added.


Generated at 2012-05-30 11:00:36 PM CEST