org.jfree.report.states
Class StartState

java.lang.Object
  extended byorg.jfree.report.states.ReportState
      extended byorg.jfree.report.states.StartState
All Implemented Interfaces:
java.lang.Cloneable

public final class StartState
extends ReportState

The first state in the JFreeReport state transition diagram.

Author:
David Gilbert

Field Summary
 
Fields inherited from class org.jfree.report.states.ReportState
BEFORE_FIRST_GROUP, BEFORE_FIRST_PAGE, BEFORE_FIRST_ROW
 
Constructor Summary
StartState(FinishState fstate, int level)
          Creates a new START state.
StartState(JFreeReport report)
          Creates a start state for a given report.
 
Method Summary
 ReportState advance()
          Advances from the 'START' state to the 'PRE-GROUP-HEADER' state (the only transition that is possible from this state).
 boolean isPrefetchState()
          Returns the corrected display item for this state.
 boolean isStart()
          Returns true because this *is* the start state.
 void resetState()
          Resets the state.
 
Methods inherited from class org.jfree.report.states.ReportState
advanceItem, clone, createStateProgress, enterGroup, fireGroupFinishedEvent, fireGroupStartedEvent, fireItemsAdvancedEvent, fireItemsFinishedEvent, fireItemsStartedEvent, fireLayoutCompleteEvent, firePageCanceledEvent, firePageFinishedEvent, firePageStartedEvent, firePrepareEvent, fireReportDoneEvent, fireReportFinishedEvent, fireReportInitializedEvent, fireReportStartedEvent, getAncestorHashcode, getCurrentDataItem, getCurrentDisplayItem, getCurrentGroupIndex, getCurrentPage, getDataRow, getDataRowBackend, getDataRowPreview, getErrors, getFunctions, getLevel, getLevels, getNumberOfRows, getProperties, getProperty, getProperty, getReport, getReportDefinition, isAncestor, isErrorOccured, isFinish, isLastItemInGroup, isPrepareRun, isProceeding, leaveGroup, nextPage, setAncestorHashcode, setCurrentGroupIndex, setCurrentItem, setCurrentPage, setProperty
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StartState

public StartState(JFreeReport report)
           throws java.lang.CloneNotSupportedException,
                  FunctionInitializeException
Creates a start state for a given report.

The report is cloned, and an internal reference to the clone is maintained. Changing the original report after report processing has begun will have no effect on the report output for this run.

This is the only state constructor to create a state without cloning another.

Parameters:
report - the report.
Throws:
java.lang.CloneNotSupportedException - if the initial cloning of the report definition fails.
FunctionInitializeException

StartState

public StartState(FinishState fstate,
                  int level)
           throws ReportProcessingException
Creates a new START state.

Parameters:
fstate - the finish state.
level - the level.
Throws:
ReportProcessingException - if the State could not be initialized properly.
Method Detail

advance

public ReportState advance()
Advances from the 'START' state to the 'PRE-GROUP-HEADER' state (the only transition that is possible from this state).

Initialises the 'report.date' property, and fires a 'report-started' event.

Specified by:
advance in class ReportState
Returns:
the next state (PRE-GROUP-HEADER').

isStart

public boolean isStart()
Returns true because this *is* the start state.

Overrides:
isStart in class ReportState
Returns:
always true, as this state starts the report processing.

isPrefetchState

public boolean isPrefetchState()
Returns the corrected display item for this state. As the currentItem has not yet advanced we perform a readAHead lookup when populating elements.

Overrides:
isPrefetchState in class ReportState
Returns:
true; Header related states preview the next itemband DataRow.

resetState

public void resetState()
Resets the state.

Overrides:
resetState in class ReportState