Style Intelligence v12.0

inetsoft.report
Class FixedContainer

java.lang.Object
  extended by inetsoft.report.FixedContainer
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
SectionBand

public class FixedContainer
extends Object
implements Serializable, Cloneable

FixedContainer is an element container. It can be used to create fixed position and size elements in a non-flow page area. This class is also the base class for section band. It manages the positioning and size of elements in the container.

See Also:
Serialized Form

Field Summary
protected  WeakReference parent
           
 
Constructor Summary
FixedContainer(ReportSheet parent)
          Create a container.
 
Method Summary
 String addBean(String name, Rectangle bounds)
          Add a bean to the report.
 String addBullet(Image icon, Rectangle bounds)
          Add a bullet with user specified image as bullet icon.
 String addBullet(Rectangle bounds)
          Add a bullet to the document.
 String addChart(DataSet chart, Rectangle bounds)
          Add a chart to the report.
 String addComponent(Component comp, Rectangle bounds)
          Add an AWT component to the document.
 String addElement(ReportElement e, Rectangle bounds)
          Add an element to the document.
 String addElement(ReportElement e, Rectangle bounds, SectionBand.Separator vseparator)
          Add an element to the document.
 String addForm(FormLens form, Rectangle bounds)
          Add a form to the document.
 String addImage(Image image, Rectangle bounds)
          Add an image to the document.
 String addPainter(Painter area, Rectangle bounds)
          Add a painter element to the document.
 String addSeparator(int style, Rectangle bounds)
          Add a separator.
 void addShape(PageLayout.Shape shape)
          Add a shape to the report.
 String addTab(int fill, Rectangle bounds)
          Add a tab.
 String addTable(TableLens table, Rectangle bounds)
          Add a table to the document.
 String addText(String text, Rectangle bounds)
          Add a text element to the document.
 String addText(TextLens text, Rectangle bounds)
          Add a text element to the document.
 String addTextBox(String text, int border, int textalign, Rectangle bounds)
          Add a text box to the document.
 String addTextBox(TextLens text, int border, int textalign, Rectangle bounds)
          Add a text box to the document.
 String addTextBox(TextLens text, Rectangle bounds)
          Add a text box to the document.
 String addTOC(TOC toc, Rectangle bounds)
          Add a table of contents section to the report.
 Object clone()
           
 Enumeration elements()
          Get all elements in the container.
 Enumeration elements(boolean sort)
          Get all elements in the container.
 Rectangle getBounds(int idx)
          Get the bounds of the specified element.
 ReportElement getElement(int idx)
          Get the specified element.
 ReportElement getElement(String id)
          Find an element with the specified ID.
 int getElementCount()
          Return the number of elements in the document.
 int getElementIndex(ReportElement e)
          Get the index of the specified element.
 int getElementIndex(String id)
          Find an element with the specified ID.
 Rectangle getPrintBounds(int idx)
          Get the bounds of the specified element.
 ReportSheet getReport()
          Get the report this container is associated with.
 PageLayout.Shape getShape(int idx)
          Get the specified shape.
 int getShapeCount()
          Get the number of shapes contained in this report.
 int getShapeIndex(PageLayout.Shape shape)
          Find the index of the shape.
 SectionBand.Separator getVSeparator(int idx)
          Get the vline setting of the specified element.
 SectionBand.Separator[] getVSeparators()
          Get the vline setting of the specified element.
 void removeAllElements()
          Remove all elements.
 void removeElement(int idx)
          Remove the specified element.
 void removeShape(int idx)
          Remove the specified shape.
 void reset()
          Reset the internal state so it's ready for next printing.
 void setBounds(int idx, Rectangle bounds)
          Set the bounds of the specified element.
 void setElement(int idx, ReportElement elem)
          Replace an element at the specified position.
 void setPrintBounds(int idx, Rectangle bounds)
          Set the bounds of the specified element.
 void setReport(ReportSheet report)
          Set the report this element is contained in.
 void setVSeparator(int idx, SectionBand.Separator bounds)
          Set the vline setting of the specified element.
 void setVSeparators(SectionBand.Separator[] arr)
          Set the vline setting of the specified element.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parent

protected transient WeakReference parent
Constructor Detail

FixedContainer

public FixedContainer(ReportSheet parent)
Create a container. A report must be passed in. The report must be the report where this container is going to be placed in.

Parameters:
parent - ReportSheet the container is associated with.
Method Detail

getReport

public ReportSheet getReport()
Get the report this container is associated with.


setReport

public void setReport(ReportSheet report)
Set the report this element is contained in.


addText

public String addText(String text,
                      Rectangle bounds)
Add a text element to the document. The text string can be a simple string, or contains multiple lines separated by the newline character.

Parameters:
text - text string.
bounds - position and size of the element in the container.
Returns:
element id.

addText

public String addText(TextLens text,
                      Rectangle bounds)
Add a text element to the document. The TextLens provides an extra level of indirection. For example, it can be used to refer to a TextField on a GUI screen, the most up-to-date value in the text field will be used when printing the document. This way a ReportSheet can be created once, and don't need to be modified when the text contents change.

The inetsoft.report.lens package also contains a StreamTextLens, which allows retrieving text from a file, URL, or any input stream.

Parameters:
text - text content lens.
bounds - position and size of the element in the container.
Returns:
element id.

addTextBox

public String addTextBox(TextLens text,
                         Rectangle bounds)
Add a text box to the document. A text box is a standalone area on the document that contains a text string. It has a border around by default. The text box element is similar to the painter elements in that they both use the painter layout and wrapping options. The current setting of the painter layout and wrapping are used by the text box elements as well.

Parameters:
text - text content.
bounds - position and size of the element in the container.
Returns:
element id.

addTextBox

public String addTextBox(TextLens text,
                         int border,
                         int textalign,
                         Rectangle bounds)
Add a text box to the document. A text box is a standalone area on the document that contains a text string. It has a border around by default. The text box element is similar to the painter elements in that they both use the painter layout and wrapping options. The current setting of the painter layout and wrapping are used by the text box elements as well.

Parameters:
text - text content.
border - border line style. One of the line styles defined in the StyleConstants class.
textalign - text alignment within the box.
bounds - position and size of the element in the container.
Returns:
element id.

addTextBox

public String addTextBox(String text,
                         int border,
                         int textalign,
                         Rectangle bounds)
Add a text box to the document. A text box is a standalone area on the document that contains a text string. It has a border around by default. The text box element is similar to the painter elements in that they both use the painter layout and wrapping options. The current setting of the painter layout and wrapping are used by the text box elements as well.

Parameters:
text - text content.
border - border line style. One of the line styles defined in the StyleConstants class.
textalign - text alignment within the box.
bounds - position and size of the element in the container.
Returns:
element id.

addPainter

public String addPainter(Painter area,
                         Rectangle bounds)
Add a painter element to the document. A painter is a self contained object that can paint a document area. It can be used to add any content to the document, through which the program has full control on exact presentation on the document. Painter is the general mechanism used to support some of the more common data types. For example, Component and Image are handled internally by a painter object. The program is free to define its own painter.

Parameters:
area - the painter element.
bounds - position and size of the element in the container.
Returns:
element id.

addChart

public String addChart(DataSet chart,
                       Rectangle bounds)
Add a chart to the report. The chart behaves like a painter. It reserves an area and paints a chart on the area. The current PainterLayout value is also applied to the chart.

Parameters:
chart - chart data model.
bounds - position and size of the element in the container.
Returns:
element id.

addComponent

public String addComponent(Component comp,
                           Rectangle bounds)
Add an AWT component to the document. The onscreen image of the component is 'copied' on to the document.

Parameters:
comp - component.
bounds - position and size of the element in the container.
Returns:
element id.

addImage

public String addImage(Image image,
                       Rectangle bounds)
Add an image to the document.

Parameters:
image - image object.
bounds - position and size of the element in the container.
Returns:
element id.

addBullet

public String addBullet(Rectangle bounds)
Add a bullet to the document. A bullet can be used to create a bullet list. The default bullet is a round dot. The bullet has a special layout property. After a bullet is added, a hanging indent is created to just right of the bullet. If a Break is added, the cursor is advanced to the next line at the hanging indent position. If a newline element is added, the hanging indent is reset.

Parameters:
bounds - position and size of the element in the container.
Returns:
element id.

addBullet

public String addBullet(Image icon,
                        Rectangle bounds)
Add a bullet with user specified image as bullet icon. The bullet is otherwise same as the default.

Parameters:
icon - icon to used for bullet.
bounds - position and size of the element in the container.
Returns:
element id.

addSeparator

public String addSeparator(int style,
                           Rectangle bounds)
Add a separator. A separator is a horizontal line in either 3D or plain mode.

Parameters:
style - the line style (defined in StyleConstants).
bounds - position and size of the element in the container.
Returns:
element id.

addTab

public String addTab(int fill,
                     Rectangle bounds)
Add a tab. The fill specifies a line style to fill the tab space.

Parameters:
fill - a line style defined in StyleConstants.
bounds - position and size of the element in the container.
Returns:
element id.

addTable

public String addTable(TableLens table,
                       Rectangle bounds)
Add a table to the document. The table lens object encapsulate the table attributes and contents. Through the table lens, the print discovers table attributes such as color, border, font, etc.. For more details, refer the TableLens document.

Parameters:
table - table lens.
bounds - position and size of the element in the container.
Returns:
element id.

addForm

public String addForm(FormLens form,
                      Rectangle bounds)
Add a form to the document. A form is a collection of labels and values. With each field consists of a label and a field value. The fields are layed out in rows and columns.

Parameters:
form - form lens.
bounds - position and size of the element in the container.
Returns:
element id.

addTOC

public String addTOC(TOC toc,
                     Rectangle bounds)
Add a table of contents section to the report. The table of contents is built from the heading elements in the report. Heading elements are special text elements that contains a heading level.

Parameters:
toc - table of contents style.
bounds - position and size of the element in the container.
Returns:
element id.

addBean

public String addBean(String name,
                      Rectangle bounds)
Add a bean to the report.

Parameters:
name - name.
bounds - position and size of the element in the container.
Returns:
element id.

addElement

public String addElement(ReportElement e,
                         Rectangle bounds)
Add an element to the document. Classes extending the ReportSheet can extend element classes from the Element, and use this method for adding the element to the document.

Parameters:
e - document element.
bounds - position and size of the element in the container.
Returns:
element id.

addElement

public String addElement(ReportElement e,
                         Rectangle bounds,
                         SectionBand.Separator vseparator)
Add an element to the document. Classes extending the ReportSheet can extend element classes from the Element, and use this method for adding the element to the document.

Parameters:
e - document element.
bounds - position and size of the element in the container.
vseparator - position and vertical seperator line style of the element in the container.
Returns:
element id.

getElementCount

public int getElementCount()
Return the number of elements in the document.

Returns:
number of elements.

getElement

public ReportElement getElement(int idx)
Get the specified element.

Parameters:
idx - element index.
Returns:
document element.

getElement

public ReportElement getElement(String id)
Find an element with the specified ID.


removeElement

public void removeElement(int idx)
Remove the specified element.

Parameters:
idx - element index.

removeAllElements

public void removeAllElements()
Remove all elements.


getElementIndex

public int getElementIndex(ReportElement e)
Get the index of the specified element.

Parameters:
e - element.
Returns:
element index.

getElementIndex

public int getElementIndex(String id)
Find an element with the specified ID.

Returns:
element index or -1 if element is not found.

elements

public Enumeration elements()
Get all elements in the container.


elements

public Enumeration elements(boolean sort)
Get all elements in the container.

Parameters:
sort - true if should sort elements in print order

getBounds

public Rectangle getBounds(int idx)
Get the bounds of the specified element.


setBounds

public void setBounds(int idx,
                      Rectangle bounds)
Set the bounds of the specified element.


setElement

public void setElement(int idx,
                       ReportElement elem)
Replace an element at the specified position.


getPrintBounds

public Rectangle getPrintBounds(int idx)
Get the bounds of the specified element.


setPrintBounds

public void setPrintBounds(int idx,
                           Rectangle bounds)
Set the bounds of the specified element.


getVSeparators

public SectionBand.Separator[] getVSeparators()
Get the vline setting of the specified element.


setVSeparators

public void setVSeparators(SectionBand.Separator[] arr)
Set the vline setting of the specified element.


getVSeparator

public SectionBand.Separator getVSeparator(int idx)
Get the vline setting of the specified element.


setVSeparator

public void setVSeparator(int idx,
                          SectionBand.Separator bounds)
Set the vline setting of the specified element.


addShape

public void addShape(PageLayout.Shape shape)
Add a shape to the report. The shape is drawn as the background of the report.

Parameters:
shape - a shape (line, rectangle, or oval).

getShapeCount

public int getShapeCount()
Get the number of shapes contained in this report.


getShape

public PageLayout.Shape getShape(int idx)
Get the specified shape.


removeShape

public void removeShape(int idx)
Remove the specified shape.


getShapeIndex

public int getShapeIndex(PageLayout.Shape shape)
Find the index of the shape.

Returns:
-1 if shape is not in the container.

reset

public void reset()
Reset the internal state so it's ready for next printing.


clone

public Object clone()
Overrides:
clone in class Object

Copyright © 1996-2014 InetSoft Technology Corp. All Rights Reserved.