cdox.data
Interface Data

All Known Implementing Classes:
AudioData, GenericData, VideoData

public interface Data

This interface is used to represent the data that is known about the current CD and to fill this data on a cover.

The framework is meant to work together in the following way: the Data object is independant from eventual data sources and does only store, well, the data about the particular type of CD. The user can fill in parts of the data or the whole data himself, and this data can be used together with a DataSource implementation to fill in the rest of the data automatically (by querying a database or whatever).

A data object could also support a different style of data retrieval. If one has burned a normal CD-R with some files, a Data object could let the user specify the path to the CD-R, while a corresponding DataSource object would read the directories/files from the path and fill the information into the Data object.

There exist no standard ways to fill data into a Data object. Since the DataSource objects are always bound to a specific Data object it is up to the implementors to provide useful methods for this purpose.

Another important method is the getSupportedVersion() method. It would be quite bad, if the user uses a CDox/whatever that supports only version 1 of the file format and downloads a plugin that uses features from version 2 of the file format... Remember that the store data method fills in the data into the XML file, so the wrong version would be bad. We'll try to keep the file format backwords compatible of course.

Version:
June 22th 2002
Author:
Rutger Bezema, Andreas Schmitz

Method Summary
 void fillBack(Cover c)
          This method should fill the given cover with elements that are created from the data which is stored here.
 void fillBooklet(Cover c)
          This method should fill the given cover with elements that are created from the data which is stored here.
 void fillFront(Cover c)
          This method should fill the given cover with elements that are created from the data which is stored here.
 java.lang.String getDescription()
          Returns a descriptive string of the CD type that this Data object represents.
 int getSupportedVersion()
          Must return the version of the CDox file format that supports this data type.
 void reconstruct(org.w3c.dom.Element desc)
          Reads its data from the DOM subtree beginning with the given Element.
 void storeData(org.w3c.dom.Element desc)
          This method stores the data of this element in a DOM tree.
 boolean userFillData(java.awt.Frame parent)
          This method should let the user fill in appropriate values as data.
 

Method Detail

userFillData

public boolean userFillData(java.awt.Frame parent)
This method should let the user fill in appropriate values as data.

Parameters:
parent - the parent frame.
Returns:
true if the user clicked ok, false otherwhise

getSupportedVersion

public int getSupportedVersion()
Must return the version of the CDox file format that supports this data type.

Returns:
the version number.

storeData

public void storeData(org.w3c.dom.Element desc)
This method stores the data of this element in a DOM tree. The desc parameter is the DOM element <description>. The type attribute of this element must be set, and the child elements must be created according to the XML Schema from the CDox format.

Parameters:
desc - the <description> element.

getDescription

public java.lang.String getDescription()
Returns a descriptive string of the CD type that this Data object represents.

Returns:
the string.

reconstruct

public void reconstruct(org.w3c.dom.Element desc)
Reads its data from the DOM subtree beginning with the given Element.

Parameters:
desc - the top node of the DOM subtree.

fillFront

public void fillFront(Cover c)
               throws java.lang.IllegalArgumentException
This method should fill the given cover with elements that are created from the data which is stored here. This method is for front sides.

Parameters:
c - the cover where to add new elements.
Throws:
java.lang.IllegalArgumentException - if the cover is no front side.

fillBack

public void fillBack(Cover c)
              throws java.lang.IllegalArgumentException
This method should fill the given cover with elements that are created from the data which is stored here. This method is for back sides.

Parameters:
c - the cover where to add new elements.
Throws:
java.lang.IllegalArgumentException - if the cover is no back side.

fillBooklet

public void fillBooklet(Cover c)
                 throws java.lang.IllegalArgumentException
This method should fill the given cover with elements that are created from the data which is stored here. This method is for booklets.

Parameters:
c - the cover where to add new elements.
Throws:
java.lang.IllegalArgumentException - if the cover is no booklet.