org.statcato.file
Class Project
- java.lang.Object
-
- org.statcato.file.Project
-
public class Project extends java.lang.ObjectA project file that stores the LogWindow instance, DatasheetTabbedPane instance,as well as generated charts of this application.- Since:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.Stringextension
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidautoSaveWrite()Writes project file to the temporary file path.booleanclose()If the project is not yet saved, prompts the user to save.booleanexists()Returns whether this project exists (is valid).voidexit()Deletes temporary file if it exists.java.io.FilegetFile()Returns the saved project file.java.lang.StringgetName()Returns the name of this project.booleanisModified()Returns true if the project is modified since the last save.booleanreadFile(java.lang.String path)Read a project file from the given path.voidsetAutoSaveInterval(int seconds)Sets the auto save interval variable to the given value.voidsetDeleteAutoSaveFile(boolean delete)Sets the delete auto save file boolean to the given value.booleanwriteToFile(boolean saveAs)Writes this project to a file.
-
-
-
Constructor Detail
-
Project
public Project(Statcato app)
Constructor.- Parameters:
app- Parent Statcato application
-
-
Method Detail
-
setAutoSaveInterval
public void setAutoSaveInterval(int seconds)
Sets the auto save interval variable to the given value.- Parameters:
seconds- number of seconds
-
setDeleteAutoSaveFile
public void setDeleteAutoSaveFile(boolean delete)
Sets the delete auto save file boolean to the given value.- Parameters:
delete- boolean indicating whether to delete auto save file
-
exists
public boolean exists()
Returns whether this project exists (is valid).- Returns:
- whether this project exists (is valid)
-
isModified
public boolean isModified()
Returns true if the project is modified since the last save.- Returns:
- true if the project is modified since the last save or false otherwise
-
writeToFile
public boolean writeToFile(boolean saveAs)
Writes this project to a file. Opens a file chooser for the user to select file for save as or if the project has not been saved before.- Parameters:
saveAs- whether it is an save as operation- Returns:
- true if the project is saved successfully or false otherwise.
-
getFile
public java.io.File getFile()
Returns the saved project file.- Returns:
- project file
-
autoSaveWrite
public void autoSaveWrite()
Writes project file to the temporary file path.
-
getName
public java.lang.String getName()
Returns the name of this project.- Returns:
- name, or empty string if this project has no name
-
readFile
public boolean readFile(java.lang.String path)
Read a project file from the given path. The read log is appended to the existing log, and the datasheets are added to the existing datasheet pane.- Parameters:
path- project file path- Returns:
- true if a project file is read successfully, or false otherwise
-
close
public boolean close()
If the project is not yet saved, prompts the user to save. Closes the open project (log and datasheets).- Returns:
- whether the project can be closed.
-
exit
public void exit()
Deletes temporary file if it exists.
-
-
DMelt 3.0 © DataMelt by jWork.ORG