All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class framework.ModuleData

java.lang.Object
   |
   +----framework.ModuleData

public abstract class ModuleData
extends Object
implements Data
Parent of all data classes. Implements data so the save and load methods must be present. canSave, canLoad.. The class is abstract to prevent it from instantiation.


Constructor Index

 o ModuleData()

Method Index

 o canDisplay()
Indicates whether the data objects of this type can be displayed on screen.
 o canLoad()
Indicates whether the data objects of this type can be loaded from disk.
 o canSave()
Indicates whether the data objects of this type can be saved to disk.
 o display(String, String)
All Data classes can have a display method that displays the data in a dialog window.
 o getLoadTags()
The subclass of this class should implement the getLoadTags method.
 o getSaveTags()
The subclass of this class should implement the getSaveTags method.
 o load(String)
May be overridden by subclasses of this class, the method in the subclass will then save data to disk.
 o loadFileAvailable(String)
Checks whether a file exists with this name and (one of the defined) extension(s).
 o save(String)
May be overridden by subclasses of this class, the method in the subclass will then read data from disk.
 o saveFileAvailable(String)
Checks whether a file can be saved with this name and the first extension as it is defined in the data type class.

Constructors

 o ModuleData
 public ModuleData()

Methods

 o getLoadTags
 protected abstract String[] getLoadTags()
The subclass of this class should implement the getLoadTags method.

 o getSaveTags
 protected abstract String[] getSaveTags()
The subclass of this class should implement the getSaveTags method.

 o canLoad
 public boolean canLoad()
Indicates whether the data objects of this type can be loaded from disk. If there is no load method implemented for the data type then the data type should implement the canLoad method and make it return false.

 o load
 public void load(String filename) throws FileNotFoundException, IOException
May be overridden by subclasses of this class, the method in the subclass will then save data to disk. If not overridden, the canLoad method must be implemented and return false. So in reality this method is never called.

 o canSave
 public boolean canSave()
Indicates whether the data objects of this type can be saved to disk. If there is no save method implemented for the data type then the data type should implement the canLoad method and make it return false.

 o save
 public void save(String filename) throws FileNotFoundException, IOException
May be overridden by subclasses of this class, the method in the subclass will then read data from disk. If not overridden, the canSave method must be implemented and return false. So in reality this method is never called.

 o canDisplay
 public boolean canDisplay()
Indicates whether the data objects of this type can be displayed on screen. If there is no display method implemented for the data type then the data type should implement the canDisplay method and make it return false.

 o display
 public DataVisualisation display(String title,
                                  String filename)
All Data classes can have a display method that displays the data in a dialog window. The display method can be overridden in subclasses. If it is not overridden then the canDisplay method must be overridden and return false.

Returns:
null. Subclasses must override this method with one that returns a proper instance of a class that implements the DataVisualisation class.
See Also:
canDisplay, display, DataVisualisation
 o loadFileAvailable
 public File loadFileAvailable(String partialFilename)
Checks whether a file exists with this name and (one of the defined) extension(s).

Returns:
the File if one file has been found that can be loaded,null otherwise.
 o saveFileAvailable
 public File saveFileAvailable(String partialFilename) throws DataException
Checks whether a file can be saved with this name and the first extension as it is defined in the data type class.

Returns:
the File if the file can be saved, null otherwise.

All Packages  Class Hierarchy  This Package  Previous  Next  Index