All Packages Class Hierarchy This Package Previous Next Index
Among other things, this interface contains methods for loading and saving
the Data and displaying the Data to the user of the Framework. These
methods are called load, save and display. Not every Data class has to
provide this functionality. For each of these methods, this interface
contains a corresponding boolean variable which indicates wether a
particular Data class can load, save or display its data. Before any of
these methods are used by the Framework, it checks the corresponding
boolean variable and only calls the method if the variable has the value
true
. These variables are called canLoad, canSave and
canDisplay. If a Data class does not provide functionality for loading,
saving or displaying its data, it still has to provide an implementation
for each of these methods, in order to implement this interface. The Data
class can give an empty implementation and set the corresponding access
variable to false
. The easiest way to create a Data class is
to extend class ModuleData. This abstract class has implements the Data
interface and has useful implementations for most of the methods from the
Data interface.
The access variables, canLoad, canSave and canDisplay are declared in this
interface with a default value which is false
. Data classes
that want to change this value have to contain a public and static boolean
variable with the same name. Such a variable hides the variable declared
in this interface. A method that wants to access a variable in the Data
class must use a reference which is of the same type as the Data class. If
it is of the same type as this interface, the method will get the value
declared here, the hidden value. If only a reference of the same type as
this interface is available, the correct value can be retrieved using
reflection.
public static final boolean canSave
false
.
Data classes that implement this interface can supply a class variable of
the same name that has a different value. Such a variable must be
public and static, because it needs to override the
constant declared here. Because this is an interface, all variables
declared here are implicitly public, static and final. If the
implementing class contains a variable which has the same name as the
constant declared here, but is not public and static, the Framework will
not find it.
public static final boolean canLoad
false
.
Data classes that implement this interface can supply a class variable of
the same name that has a different value. Such a variable must be
public and static, because it needs to override the
constant declared here. Because this is an interface, all variables
declared here are implicitly public, static and final. If the
implementing class contains a variable which has the same name as the
constant declared here, but is not public and static, the Framework will
not find it.
public static final boolean canDisplay
false
.
Data classes that implement this interface can supply a class variable of
the same name that has a different value. Such a variable must be
public and static, because it needs to override the
constant declared here. Because this is an interface, all variables
declared here are implicitly public, static and final. If the
implementing class contains a variable which has the same name as the
constant declared here, but is not public and static, the Framework will
not find it.
public abstract void load(String filename) throws FileNotFoundException, IOException
public abstract void save(String filename) throws FileNotFoundException, IOException
public abstract DataVisualisation display(String title, String filename)
public abstract File loadFileAvailable(String filename)
filename
and
extensions (tags) that are/must be defined in the data classes.
public abstract File saveFileAvailable(String filename) throws DataException
File
if the file can be saved.
All Packages Class Hierarchy This Package Previous Next Index