|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectxdat.Session
public class Session
Stores all relevant information of a session.
References to the DataSheet
and all active Chart
s are stored in session class instances.
When the user saves his Session, this information is serialized and can be
retrieved at a later time.
Care has been taken to avoid serializing swing objects. Therefore, no such objects should be referenced from within this class, only the information needed to reconstruct the chart frames.
Field Summary | |
---|---|
static java.lang.String |
sessionFileExtension
The when storing session files this file extension will be used. |
Constructor Summary | |
---|---|
Session()
Instantiates a new session. |
Method Summary | |
---|---|
void |
addChart(Chart chart)
Adds a chart to the session. |
void |
clearAllCharts()
Clear all charts. |
Chart |
getChart(int index)
Gets a chart from this session. |
int |
getChartCount()
Gets the number of charts |
DataSheet |
getCurrentDataSheet()
Gets the current data sheet. |
java.lang.String |
getSessionDirectory()
Gets the directory where the session was saved. |
java.lang.String |
getSessionName()
Gets the session name. |
static Session |
readFromFile(Main mainWindow,
java.lang.String pathToFile)
Read from file. |
boolean |
removeChart(Chart chart)
Removes a chart from the session. |
void |
saveToFile(java.lang.String pathToFile)
Serializes the session to a file. |
void |
setCurrentDataSheet(DataSheet currentDataSheet)
Sets the current data sheet. |
void |
setSessionDirectory(java.lang.String sessionDirectory)
Sets the directory where the session is saved. |
void |
setSessionName(java.lang.String sessionName)
Sets the session name. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String sessionFileExtension
Constructor Detail |
---|
public Session()
Method Detail |
---|
public void saveToFile(java.lang.String pathToFile) throws java.io.IOException
pathToFile
- the path to file
java.io.IOException
- Signals that an I/O exception has occurred.public static Session readFromFile(Main mainWindow, java.lang.String pathToFile) throws java.io.InvalidClassException, java.io.IOException, java.lang.ClassNotFoundException
mainWindow
- the main windowpathToFile
- the path where the file is saved
InvalidClassException
- thrown when the selected file is not a valid serialized session
java.io.IOException
- Signals that an I/O exception has occurred.
java.lang.ClassNotFoundException
- thrown when the class was not found.public Chart getChart(int index)
index
- the index of the chart
public int getChartCount()
public void addChart(Chart chart)
chart
- the chartpublic boolean removeChart(Chart chart)
chart
- the chart
public void clearAllCharts()
public DataSheet getCurrentDataSheet()
public void setCurrentDataSheet(DataSheet currentDataSheet)
currentDataSheet
- the new current data sheetpublic java.lang.String getSessionName()
public void setSessionName(java.lang.String sessionName)
sessionName
- the new session namepublic java.lang.String getSessionDirectory()
public void setSessionDirectory(java.lang.String sessionDirectory)
sessionDirectory
- the new session directory
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |