| Method from org.jfree.report.modules.output.table.base.TableWriter Detail: |
public Object clone() throws CloneNotSupportedException {
final TableWriter clone = (TableWriter) super.clone();
clone.delegate = (SimplePageLayoutDelegate) delegate.clone();
clone.delegate.setWorker(clone);
return clone;
}
Clones the function.
Be aware, this does not create a deep copy. If you have complex
strucures contained in objects, you have to override this function. |
public ReportEvent getCurrentEvent() {
return currentEvent;
}
Returns the current event, which has been updated at the start of every
ReportListener method. |
public float getCursorPosition() {
return getCursor().getY();
}
Returns the current cursor position. It is assumed, that the cursor goes
from top to down, columns are not used. |
public int getDependencyLevel() {
return depLevel;
}
The dependency level defines the level of execution for this function. Higher dependency
functions are executed before lower dependency functions. For ordinary functions and
expressions, the range for dependencies is defined to start from 0 (lowest dependency
possible to 2^31 (upper limit of int).
PageLayouter functions override the default behaviour an place them self at depency level -1,
an so before any userdefined function. |
public Expression getInstance() {
final TableWriter tw = (TableWriter) super.getInstance();
tw.delegate = new SimplePageLayoutDelegate(tw);
return tw;
}
Return a completly separated copy of this function. The copy does no
longer share any changeable objects with the original function. |
public float getMaxWidth() {
return maxWidth;
}
Gets the maximum width available for a root band during the layouting process. |
public TableProducer getProducer() {
return producer;
}
|
public float getReservedSpace() {
return 0;
}
Returns the reserved size for the current page. This size is not used
when performing a layout. This is usually used to preserve the pagefooters
space. As this writer does not limit the height of the bands, this method
returns 0. |
public float getTopContentPosition() {
return 0;
}
Returns the position of the first content. As this writer does not limit
the height of the bands, this method returns 0. |
public Object getValue() {
return this;
}
|
public void groupFinished(ReportEvent event) {
setCurrentEvent(event);
delegate.groupFinished(event);
clearCurrentEvent ();
}
Prints the group footer for the current group. |
public void groupStarted(ReportEvent event) {
setCurrentEvent(event);
delegate.groupStarted(event);
clearCurrentEvent ();
}
Prints the group header for the current group. |
public boolean isPageEmpty() {
if (producer == null)
{
throw new IllegalStateException("Producer is null." + toString());
}
return producer.isLayoutContainsContent();
}
Checks, whether the current page is empty. An page is empty if it does
not contain printed content. An empty page may have spooled content. |
public boolean isPageEnded() {
return false;
}
Checks, whether the page has ended. Once a page that is completly filled,
only the page footer will be printed and a page break will be done after
that.
As this target has no notion of pages, the virtual page does never end
automaticly. |
public boolean isWatermarkSupported() {
return false;
}
|
public void itemsAdvanced(ReportEvent event) {
setCurrentEvent(event);
delegate.itemsAdvanced(event);
clearCurrentEvent();
}
|
public void itemsFinished(ReportEvent event) {
// this event does nothing
setCurrentEvent(event);
delegate.itemsFinished(event);
clearCurrentEvent();
}
Handles the end of the item processing.
The itemBand is finished, the report starts to close open groups. |
public void itemsStarted(ReportEvent event) {
setCurrentEvent(event);
delegate.itemsStarted(event);
clearCurrentEvent();
}
|
public void pageCanceled(ReportEvent event) {
// we are fairly sure, that our table report processor does not invoke this
// method :)
}
Receives notification that a page was canceled by the ReportProcessor.
This method is called, when a page was removed from the report after
it was generated. |
public void pageFinished(ReportEvent event) {
setCurrentEvent(event);
delegate.pageFinished(event);
producer.endPage();
clearCurrentEvent();
}
|
public void pageStarted(ReportEvent event) {
setCurrentEvent(event);
// a new page has started, so reset the cursor ...
String sheetName = null;
if (getSheetNameFunction() != null)
{
sheetName = String.valueOf(getDataRow().get(getSheetNameFunction()));
}
producer.beginPage(sheetName);
delegate.pageStarted(event);
clearCurrentEvent();
}
Prints the PageHeader and all repeating group headers. |
public boolean print(Band band,
boolean spoolBand,
boolean handlePagebreakBefore) throws ReportProcessingException {
if (!isInEndPage() && (isPageEmpty() == false)
&& band.getStyle().getBooleanStyleProperty(BandStyleSheet.PAGEBREAK_BEFORE) == true)
{
endPage();
startPage();
}
final float y = getCursor().getY();
// don't save the state if the current page is currently being finished
// or restarted; PageHeader and PageFooter are printed out of order and
// do not influence the reporting state
final Rectangle2D bounds = doLayout(band);
bounds.setRect(0, y, bounds.getWidth(), bounds.getHeight());
doPrint(bounds, band);
if (!isInEndPage() && (isPageEmpty() == false)
&& band.getStyle().getBooleanStyleProperty(BandStyleSheet.PAGEBREAK_AFTER) == true)
{
endPage();
startPage();
}
return true;
}
Prints the given band at the current cursor position. |
public boolean printBottom(Band band) throws ReportProcessingException {
return print (band, false, false);
}
Prints the given band at the bottom of the page.
As we don't use the idea of pages here, this call is mapped to the
print method. |
public boolean printWatermark(Band watermark) throws ReportProcessingException {
throw new ReportProcessingException("Watermark printing is not supported for table targets.");
}
|
public void reportFinished(ReportEvent event) {
setCurrentEvent(event);
delegate.reportFinished(event);
endPage();
producer.close();
clearCurrentEvent();
}
Receives notification that the report has finished. |
public void reportInitialized(ReportEvent event) {
if (getMaxWidth() == 0)
{
throw new IllegalStateException("Assert: TableWriter function was not initialized properly");
}
}
|
public void reportStarted(ReportEvent event) {
setCurrentEvent(event);
producer.open();
startPage();
delegate.reportStarted(event);
clearCurrentEvent();
}
Receives notification that the report has started. |
public void resetCursor() {
setCursor(new TableWriterCursor());
}
Reinitialize the cursor of the layout worker. Called when
a new page is started. |
public void setCurrentEvent(ReportEvent currentEvent) {
this.currentEvent = currentEvent;
}
Defines the current event, which must be updated at the start of every
ReportListener method. |
public void setDependencyLevel(int deplevel) {
this.depLevel = deplevel;
}
Overrides the depency level. Should be lower than any other function depency. |
public void setMaxWidth(float width) {
maxWidth = width;
}
Defines the maximum width available for a root band during the layouting process. |
public void setProducer(TableProducer producer) {
if (producer == null)
{
throw new NullPointerException("Producer given must not be null.");
}
this.producer = producer;
}
Sets the TableProducer, that should be used to create the TableCellData. |
public void setReservedSpace(float reserved) {
}
|
public void setTopPageContentPosition(float topPosition) {
}
This writer does not limit the height of an band and therefore does
not implement that feature. |
public void startPage() {
if (inEndPage == true)
{
throw new IllegalStateException("Already in startPage or endPage");
}
inEndPage = true;
final ReportEvent currentEvent = getCurrentEvent();
final ReportState cEventState = currentEvent.getState();
cEventState.firePageStartedEvent(currentEvent.getType());
setCurrentEvent(currentEvent);
inEndPage = false;
}
Starts a new page. Fires the PageStarted event. |