com.java4less.rreport
Class RArea

java.lang.Object
  |
  +--com.java4less.rreport.RArea

public class RArea
extends java.lang.Object

Main component of a Report. A Rreport is made of Rareas. A RArea is a group of objects (RObject) that must be printed together. Typical examples of areas in a report are:

- Page header
- Page footer
- Report header
- Report footer
- Detail section

An area can be printed 1 or more times (repetitions). Each time the area is printed the objects in the area will contain a different value. These values can be assigned:
- automatically using a RSource object.
- or programatically using area.setObjectValue(...);

Areas can have linked/nested areas. After each repetition of an area, all linked areas are printed. This is used to create master/detail relationships (see also RJDBCSource).


Field Summary
 int AreaPosition
          not used
static int FRAME_AREA
          the area has a frame.
static int FRAME_NONE
          the area has no frame.
static int FRAME_PAGE
          just one frame for all repetitions of this area in the page.
static int FRAME_PAGE_NO_TOP
           
 double height
          size at runtime.
 double horizontalTab
          In centimeters.
 double HTMLResolution
          resolution used when exporting to HTML.
 java.util.Vector items
          vector that contains the Robjects in the area.
 double layoutHeight
          defined size of the area.
 double marginBottom
          In centimeters.
 double marginLeft
          In centimeters.
 double marginRight
          In centimeters.
 double marginTop
          In centimeters.
 boolean newPage
          print this area in a new page?
 boolean NewReference
          not used
 RArea Reference
          not used
 double verticalTab
          In centimeters.
 double width
          size at runtime.
 double x
          positiom X at runtime.
 double y
          positiom Y at runtime.
 
Constructor Summary
RArea()
           
 
Method Summary
 void add(RObject obj)
          Adds an element to the area.
 void add(RObject obj, boolean end)
          Adds an element to the area.
 java.awt.Color getBackground()
          background color
 RPicture getBackgroundImage()
          background image
 RSource getDataSource()
          gets the Rsource used to assign values to the elements in the area
 RLineStyle getFrameStyle()
          gets the frame style.
 int getFrameType()
          frame type: NONE,PAGE...
 double[] getGrid()
          gets the positions of the columns (lines) of the grid.
 RLineStyle getGridStyle()
          line style of the frame.
 RArea getHeaderArea()
          gets or sets the header area for this a area.
 boolean getHorizontalGrid()
          specifies that the grid must use horizontal separators also.
 java.lang.String getHTML()
          gets the HTML version of the area.
 RObject getItemByName(java.lang.String name)
          Returns the Robject whose name matches the parameter.
 RArea getLinkedArea()
          gets or sets the superarea (where this area is nested).
 RAreaListener getListener()
          get area listener
 java.lang.String getName()
          gets/sets area name.
 void importLine(java.lang.String key, java.lang.String val)
          to be used by RReportImp.java
 void setBackground(java.awt.Color c)
          background color
 void setBackgroundImage(RPicture i)
          background image
 void setDataSource(RSource s)
          Sets the Rsource used to assign values to the elements in the area
 void setFrame(boolean b)
          set frame type for the area.
 void setFrameStyle(RLineStyle fStyle)
          sets the frame style.
 void setFrameType(int fType)
          sets the frame type.
 void setGrid(double[] colSeps)
          Sets the positions of the columns (lines) of the grid.
 void setGridStyle(RLineStyle gStyle)
          styled used by the grid.
 void setHeaderArea(RArea a)
          gets or sets the header area for this a area.
 void setHorizontalGrid(boolean b)
          specifies that the grid must use horizontal separators also.
 void setHTML(java.lang.String h)
          sets the HTML version of the area.
 void setLinkedArea(RArea a)
          gets or sets the superarea (where this area is nested).
 void setListener(RAreaListener l)
          set area listener
 void setName(java.lang.String n)
          gets/sets area name.
 boolean setObjectValue(java.lang.String name, java.lang.Object Value)
          Sets the runtime value of an element in the area.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FRAME_NONE

public static final int FRAME_NONE
the area has no frame.

FRAME_PAGE

public static final int FRAME_PAGE
just one frame for all repetitions of this area in the page.

FRAME_AREA

public static final int FRAME_AREA
the area has a frame.

FRAME_PAGE_NO_TOP

public static final int FRAME_PAGE_NO_TOP

verticalTab

public double verticalTab
In centimeters. If you want to leave an empty space left to the area or at the bottom of the area use these fields.

horizontalTab

public double horizontalTab
In centimeters. If you want to leave an empty space left to the area or at the bottom of the area use these fields.

marginLeft

public double marginLeft
In centimeters. These are margins inside the area.

marginRight

public double marginRight
In centimeters. These are margins inside the area.

marginBottom

public double marginBottom
In centimeters. These are margins inside the area.

marginTop

public double marginTop
In centimeters. These are margins inside the area.

Reference

public RArea Reference
not used

NewReference

public boolean NewReference
not used

AreaPosition

public int AreaPosition
not used

newPage

public boolean newPage
print this area in a new page?

HTMLResolution

public double HTMLResolution
resolution used when exporting to HTML. This resolution is used to convert CM to pixels.

x

public double x
positiom X at runtime. Used by RReport.

y

public double y
positiom Y at runtime. Used by RReport.

width

public double width
size at runtime. Used by RReport.

height

public double height
size at runtime. Used by RReport.

layoutHeight

public double layoutHeight
defined size of the area. Not modified at runtime.

items

public java.util.Vector items
vector that contains the Robjects in the area.
Constructor Detail

RArea

public RArea()
Method Detail

setListener

public void setListener(RAreaListener l)
set area listener

getListener

public RAreaListener getListener()
get area listener

setName

public void setName(java.lang.String n)
gets/sets area name.

getName

public java.lang.String getName()
gets/sets area name.

setLinkedArea

public void setLinkedArea(RArea a)
gets or sets the superarea (where this area is nested).

getLinkedArea

public RArea getLinkedArea()
gets or sets the superarea (where this area is nested).

setHeaderArea

public void setHeaderArea(RArea a)
gets or sets the header area for this a area. If the current repetition of the area cannot be printed in the current page, a new page is created. The header area will be printed in the new page before the current area

getHeaderArea

public RArea getHeaderArea()
gets or sets the header area for this a area. If the current repetition of the area cannot be printed in the current page, a new page is created. The header area will be printed in the new page before the current area

importLine

public void importLine(java.lang.String key,
                       java.lang.String val)
to be used by RReportImp.java

getBackground

public java.awt.Color getBackground()
background color

getBackgroundImage

public RPicture getBackgroundImage()
background image

setBackground

public void setBackground(java.awt.Color c)
background color

setBackgroundImage

public void setBackgroundImage(RPicture i)
background image

setFrame

public void setFrame(boolean b)
set frame type for the area. Default is NONE

setDataSource

public void setDataSource(RSource s)
Sets the Rsource used to assign values to the elements in the area

getDataSource

public RSource getDataSource()
gets the Rsource used to assign values to the elements in the area

getHTML

public java.lang.String getHTML()
gets the HTML version of the area.

setHTML

public void setHTML(java.lang.String h)
sets the HTML version of the area.

getHorizontalGrid

public boolean getHorizontalGrid()
specifies that the grid must use horizontal separators also.

setHorizontalGrid

public void setHorizontalGrid(boolean b)
specifies that the grid must use horizontal separators also.

setFrameType

public void setFrameType(int fType)
sets the frame type.

setFrameStyle

public void setFrameStyle(RLineStyle fStyle)
sets the frame style. The frame will be displayed at the position marginLeft/3 , marginTop/3 ...

setGridStyle

public void setGridStyle(RLineStyle gStyle)
styled used by the grid. See setGrid().

setGrid

public void setGrid(double[] colSeps)
Sets the positions of the columns (lines) of the grid.

getFrameType

public int getFrameType()
frame type: NONE,PAGE...

getFrameStyle

public RLineStyle getFrameStyle()
gets the frame style. The frame will be displayed at the position marginLeft/3 , marginTop/3 ...

getGridStyle

public RLineStyle getGridStyle()
line style of the frame.

getGrid

public double[] getGrid()
gets the positions of the columns (lines) of the grid.

add

public void add(RObject obj)
Adds an element to the area.

add

public void add(RObject obj,
                boolean end)
Adds an element to the area. If end=true this will be the last element in the list (only for use of the Visual Builder).

getItemByName

public RObject getItemByName(java.lang.String name)
Returns the Robject whose name matches the parameter.

setObjectValue

public boolean setObjectValue(java.lang.String name,
                              java.lang.Object Value)
Sets the runtime value of an element in the area.