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.
-
ModuleData()
-
-
canDisplay()
- Indicates whether the data objects of this type can be displayed on
screen.
-
canLoad()
- Indicates whether the data objects of this type can be loaded from
disk.
-
canSave()
- Indicates whether the data objects of this type can be saved to
disk.
-
display(String, String)
- All Data classes can have a display method that displays the data in a
dialog window.
-
getLoadTags()
- The subclass of this class should implement the getLoadTags method.
-
getSaveTags()
- The subclass of this class should implement the getSaveTags method.
-
load(String)
- May be overridden by subclasses of this class, the method in the
subclass will then save data to disk.
-
loadFileAvailable(String)
- Checks whether a file exists with this name and (one of the defined)
extension(s).
-
save(String)
- May be overridden by subclasses of this class, the method in the
subclass will then read data from disk.
-
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.
ModuleData
public ModuleData()
getLoadTags
protected abstract String[] getLoadTags()
- The subclass of this class should implement the getLoadTags method.
getSaveTags
protected abstract String[] getSaveTags()
- The subclass of this class should implement the getSaveTags method.
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
.
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.
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
.
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.
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
.
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
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.
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