corina.files
Class HTML
java.lang.Object
|
+--corina.files.Filetype
|
+--corina.files.HTML
- public class HTML
- extends Filetype
Pretty-print HTML export. Obviously, there's no way to import
an HTML file (or reason you'd want to), but this is useful as a
simple way to print a sample, an easy way to export into a modern
word processor (like AbiWord or Microsoft Word), and as an easy way
to put dendro data on the web, should that ever be desireable.
If anybody ever gets around to adding options to the various
exporters, there should be options on this class for which sections
to output (data, metadata, Weiserjahre, etc.), because apparently
for publication they only want the data/count section. Also, give
the option of printing out all metadata fields, or only the
non-null ones.
If, in a few years, everybody is using an XML-capable browser
(like Mozilla), and the
browser people have decided on a stylesheet system (XSLTT, CSS1,
CSS2, etc.), this can be replaced completely with XML, which will
be saveable and loadable, and still browser-viewable with
stylesheets. The user can even edit the stylesheet, thus giving
him more control over the output. Basically XML is a big win for
everybody, if the browser writers and users can get their acts
together.
This class is not finished, because it's not a high priority at
this point. Left to do:
- make one-big-table into many-smaller-tables, so browsers can
render it quicker
- internationalize it; only the metadata is, so far
- use the real element summaries
- highlight significant Weiserjahre intervals, like crossdating
grids do
- put the count next to the WJ, and print only a histogram next
to the data?
- in the metadata, replace newlines with "<br />" (the
comments field often uses this) (is there a standard ->HTML
converter?)
There's still a lot of refactoring and optimization left to be done
here. (I think it would look particularly elegant in Lisp...)
- Version:
- $Id: HTML.java,v 1.2 2002/08/03 15:21:13 bitpoet Exp $
- Author:
- Ken Harris
Fields inherited from class corina.files.Filetype |
r, w |
Constructor Summary |
HTML()
|
Method Summary |
Sample |
load()
Load a Sample from disk. |
void |
save(Sample sample)
Save a sample in HTML format. |
String |
toString()
Return the human-readable name of this file format. |
HTML
public HTML()
toString
public String toString()
- Return the human-readable name of this file format.
- Overrides:
toString
in class Filetype
- Returns:
- the name of this file format
save
public void save(Sample sample)
throws IOException
- Save a sample in HTML format.
- Overrides:
save
in class Filetype
- Parameters:
filename
- file to save tos
- Sample to save- Throws:
IOException
- if something goes wrong- See Also:
Sample
load
public Sample load()
throws FileNotFoundException,
WrongFiletypeException,
IOException
- Load a Sample from disk. This class doesn't implement loading
(and never will), so just throw an IOException for anybody
who's crazy enough to try this.
- Overrides:
load
in class Filetype
- Parameters:
filename
- the file to load- Returns:
- that file as a Sample
- Throws:
FileNotFoundException
- if the file cannot be found on diskWrongFiletypeException
- if the file is obviously not
this filetypeIOException
- if any other I/O exception occurs