jimm.datavision
Class Element

java.lang.Object
  extended by java.util.Observable
      extended by jimm.datavision.Element
All Implemented Interfaces:
java.util.Observer, Writeable
Direct Known Subclasses:
Field, Line

public abstract class Element
extends java.util.Observable
implements Writeable, java.util.Observer

Element is the abstract superclass of Field and Line. These are the visual elements of a report section.

Author:
Jim Menard, jimm@io.com

Field Summary
protected  Report report
           
protected  Section section
           
protected  boolean visible
           
 
Constructor Summary
Element(Report report, Section section, boolean visible)
          Constructor.
 
Method Summary
 Report getReport()
          Returns the report that containts this field.
 Section getSection()
          Returns the section that containts this field.
 boolean isVisible()
          Returns the visible state of this element.
 void setSection(Section s)
          Modifies the section to which this field belongs.
 void setVisible(boolean newVisible)
          Sets the visibility of this element.
 void update(java.util.Observable o, java.lang.Object arg)
           
abstract  void writeXML(XMLWriter out)
          Writes this element as an XML tag.
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

report

protected Report report

section

protected Section section

visible

protected boolean visible
Constructor Detail

Element

public Element(Report report,
               Section section,
               boolean visible)
Constructor. (Though a section knows about it's report, too, often we create elements with a null section and then add them to some section later on).

Parameters:
report - the report containing this element
section - the report section containing this element
Method Detail

update

public void update(java.util.Observable o,
                   java.lang.Object arg)
Specified by:
update in interface java.util.Observer

getSection

public Section getSection()
Returns the section that containts this field.

Returns:
the section

getReport

public Report getReport()
Returns the report that containts this field.

Returns:
the report

setSection

public void setSection(Section s)
Modifies the section to which this field belongs. Only called by section itself.

Parameters:
s - the section

isVisible

public boolean isVisible()
Returns the visible state of this element.

Returns:
the visible state

setVisible

public void setVisible(boolean newVisible)
Sets the visibility of this element.

Parameters:
newVisible - the new visible state

writeXML

public abstract void writeXML(XMLWriter out)
Writes this element as an XML tag. This abstract method is overridden by the Field and Line subclasses.

Specified by:
writeXML in interface Writeable
Parameters:
out - a writer that knows how to write XML