caltool.file
Class File

java.lang.Object
  extended by java.util.Observable
      extended by mvp.Model
          extended by caltool.file.File
All Implemented Interfaces:
java.io.Serializable

public class File
extends mvp.Model

Class File is the model class for the Calendar Tool file handling. It contains methods for all of the operations defined on the File menu, which constitute the functional command group for file handling.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class mvp.Model
view
 
Constructor Summary
File(mvp.View view, CalendarDB calDB, CalendarTool calTool)
          Construct this with the given companion view and the parent CalendarDB model.
 
Method Summary
 void close()
          Close the current calendar if it does not require saving.
 void closeAll()
          Close the all open calendars if they do not require saving.
 void dumpUserCal()
          Temporary system test method to dump out the current user calendar to stdout.
 void exit()
          Exit the Calendar Tool.
 void fileNew()
          Add a new empty calendar to the workspace and make it current.
 void localFiles()
          Set the local files directory in which standard Calendar Tool files are stored.
 void open(java.lang.String filename)
          Open an existing calendar file of the given name and put the data from that file in the workspace.
 void print()
          Install the given page setup info.
 void print(PrintSpecs printSpecs)
          Print the current calendar per the given print specs.
 void save()
          If the current calendar in the workspace requires saving, save it.
 void saveAll()
          For each open calendar in the workspace, save it if it requires saving.
 void saveAs(java.lang.String filename)
          Save the current calendar in a file of the given name.
 void saveConfig()
          Save the current workspace configuration, including the positions of all open view windows.
 
Methods inherited from class mvp.Model
dump, getView, setView
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

File

public File(mvp.View view,
            CalendarDB calDB,
            CalendarTool calTool)
Construct this with the given companion view and the parent CalendarDB model. The CalendarDB is provided for its service methods that access the Calendar Tool workspace.

Method Detail

fileNew

public void fileNew()
Add a new empty calendar to the workspace and make it current.


open

public void open(java.lang.String filename)
Open an existing calendar file of the given name and put the data from that file in the workspace.


close

public void close()
Close the current calendar if it does not require saving. If saving is required, ask the user what to do.


closeAll

public void closeAll()
Close the all open calendars if they do not require saving. If saving is required, ask the user what to do.


save

public void save()
If the current calendar in the workspace requires saving, save it.


saveAs

public void saveAs(java.lang.String filename)
Save the current calendar in a file of the given name.


saveAll

public void saveAll()
For each open calendar in the workspace, save it if it requires saving.


saveConfig

public void saveConfig()
Save the current workspace configuration, including the positions of all open view windows.


localFiles

public void localFiles()
Set the local files directory in which standard Calendar Tool files are stored.


print

public void print()
Install the given page setup info.


print

public void print(PrintSpecs printSpecs)
Print the current calendar per the given print specs.


exit

public void exit()
Exit the Calendar Tool. If saving is required for any open calendars, ask the user what to do.

Overrides:
exit in class mvp.Model

dumpUserCal

public void dumpUserCal()
Temporary system test method to dump out the current user calendar to stdout.