voji.report
Class ReportComponent

java.lang.Object
  |
  +--voji.report.ReportComponent
Direct Known Subclasses:
ReportColor, ReportFrame, ReportImage, ReportSpace, ReportTable, ReportText

public class ReportComponent
extends java.lang.Object

This is the common base class of all components which can be part of a report.


Constructor Summary
ReportComponent()
          Constructs a new empty ReportComponent instance
 
Method Summary
 void add(ReportComponent component)
          Adds a new component
 void draw(PageGraphics g)
          Draws this component
 int getHeight(PageGraphics g)
          Returns the total height of this component.
protected  int getOwnHeight(PageGraphics g)
          Returns the local height of this component.
 void remove(ReportComponent component)
          Removes a component
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReportComponent

public ReportComponent()
Constructs a new empty ReportComponent instance

Method Detail

add

public void add(ReportComponent component)
Adds a new component

Parameters:
component - the component to add

remove

public void remove(ReportComponent component)
Removes a component

Parameters:
component - the component to remove from this container

getHeight

public int getHeight(PageGraphics g)
Returns the total height of this component. That means the maximum of this component's own height and its sub component's total height.

Parameters:
g - the graphical context where the height has to refer to
See Also:
getOwnHeight(PageGraphics), draw(PageGraphics)

getOwnHeight

protected int getOwnHeight(PageGraphics g)
Returns the local height of this component. Overwrite this if your component really draws something.

Parameters:
g - a graphical context for you to determine font sizes etc.
See Also:
getHeight(PageGraphics)

draw

public void draw(PageGraphics g)
Draws this component

Parameters:
g - the graphical context where to draw to
See Also:
getHeight(PageGraphics)