Package org.graffiti.session
Class EditorSession
java.lang.Object
org.graffiti.session.Session
org.graffiti.session.EditorSession
- All Implemented Interfaces:
ActionListener
,EventListener
,ConstraintCheckerListener
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: 1.18.4.1 $
- See Also:
Session
-
Constructor Summary
Constructors Constructor Description EditorSession()
Constructs a newEditorSession
with an empty graph instance.EditorSession(Graph graph)
Constructs a newEditorSession
. -
Method Summary
Modifier and Type Method Description void
actionPerformed(ActionEvent e)
Registrates the selectedTool
as anMouseInputListener
at the view.String
getFileName()
Get just the file name excluding the pathString
getFileNameFull()
Returns the full fileName including path of this session's graph.String
getFileTypeDescription()
Returns a file type description which can be used to choose an appropriate output serializer independent of the file extension.Map<GraphElement,GraphElement>
getGraphElementsMap()
Returns the graphElementMap.SelectionModel
getSelectionModel()
Returns the selectionModel.UndoManager
getUndoManager()
Returns the undoManager for this session.String
getWorkSessionFilePath()
boolean
isClosing()
Returnstrue
, if the session is currently closing.boolean
isSaved()
void
setClosing()
Sets the closing state of this session.void
setFileName(String fileName)
Sets the fileName.void
setFileTypeDescription(String fileTypeDescription)
Sets a file type description which can be used to choose an appropriate output serializer independent of the file extension.void
setSelectionModel(SelectionModel selectionModel)
Sets the selectionModel.Methods inherited from class org.graffiti.session.Session
addView, changeActiveMode, checkFailed, close, getActiveMode, getActiveView, getClassName, getGraph, getViews, isModified, pluginAdded, removeView, setActiveView, toString
-
Constructor Details
-
EditorSession
public EditorSession()Constructs a newEditorSession
with an empty graph instance. -
EditorSession
Constructs a newEditorSession
.- Parameters:
graph
- theGraph
object for this session.
-
-
Method Details
-
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()Returnstrue
, if the session is currently closing.- Returns:
- DOCUMENT ME!
-
setFileName
Sets the fileName.- Parameters:
fileName
- The fileName to set
-
getFileNameFull
Returns the full fileName including path of this session's graph.- Returns:
- the fileName of this session's graph.
-
getFileName
Get just the file name excluding the path- Returns:
- a name of the graph file as string
-
getGraphElementsMap
Returns the graphElementMap.- Returns:
- Map
-
setSelectionModel
Sets the selectionModel.- Parameters:
selectionModel
- The selectionModel to set
-
getSelectionModel
Returns the selectionModel.- Returns:
- DOCUMENT ME!
-
getUndoManager
Returns the undoManager for this session.- Returns:
- the undoManager for this session.
-
actionPerformed
Registrates the selectedTool
as anMouseInputListener
at the view.- Specified by:
actionPerformed
in interfaceActionListener
- Parameters:
e
- DOCUMENT ME!
-
getWorkSessionFilePath
-
isSaved
public boolean isSaved() -
setFileTypeDescription
Sets a file type description which can be used to choose an appropriate output serializer independent of the file extension.- Parameters:
fileTypeDescription
-
-
getFileTypeDescription
Returns a file type description which can be used to choose an appropriate output serializer independent of the file extension.- Returns:
- a file type description
-