jimm.datavision.layout.swing
Class SwingLE

java.lang.Object
  extended by jimm.datavision.layout.LayoutEngine
      extended by jimm.datavision.layout.swing.SwingLE

public class SwingLE
extends LayoutEngine

SwingLE is a layout engine that creates a Swing window. The window can be printed by selecting the appropriate menu item.

Author:
Jim Menard, jimm@io.com
See Also:
SwingPageContents, SwingPage, SwingField, SwingPrintBook

Field Summary
protected  javax.swing.JPanel cardPanel
           
protected  javax.swing.Action closeAction
           
protected  int displayPageNum
           
protected static java.lang.String EXPORT_ICON
           
protected  javax.swing.Action exportAction
           
protected static java.lang.String FIRST_ICON
           
protected  javax.swing.JFrame frame
           
protected  javax.swing.Action goFirstAction
           
protected  javax.swing.Action goLastAction
           
protected  javax.swing.Action goNextAction
           
protected  javax.swing.Action goPrevAction
           
protected static java.lang.String LAST_ICON
           
protected static java.lang.String NEXT_ICON
           
protected  SwingPageContents pageBeingBuilt
           
protected  java.util.ArrayList pageContents
           
protected  javax.swing.JLabel pageCountLabel
           
protected  java.awt.Dimension pageDim
           
protected static java.lang.String PREV_ICON
           
protected static java.lang.String PRINT_ICON
           
protected  javax.swing.Action printAction
           
protected  javax.swing.JScrollPane scroller
           
protected static java.awt.Dimension WINDOW_START_SIZE
           
 
Fields inherited from class jimm.datavision.layout.LayoutEngine
currentSection, newPage, out, pageHeight, pageHeightUsed, pageNumber, pageWidth, POINTS_PER_INCH, previousSectionArea, report, SECT_DETAIL, SECT_GROUP_FOOTER, SECT_GROUP_HEADER, SECT_PAGE_FOOTER, SECT_PAGE_HEADER, SECT_REPORT_FOOTER, SECT_REPORT_HEADER, wantsMoreData
 
Constructor Summary
SwingLE()
          Constructor.
 
Method Summary
 void cancel()
          Called by someone else running the report to cancel all the hard work this layout engine has performed.
 void close()
          Closes this window.
protected  void displayFirstPage()
          Performs the "First Page" command.
protected  void displayLastPage()
          Performs the "Last Page" command.
protected  void displayNextPage()
          Performs the "Next Page" command.
protected  void displayPage(int num)
          Fills the window with the contents of the specified page.
protected  void displayPrevPage()
          Performs the "Previous Page" command.
protected  void doEnd()
          Done loading report.
protected  void doEndPage()
          At the end of the first page, starts building it in a separate thread.
protected  void doOutputField(Field field)
          Creates a new SwingField and adds it to the current page.
protected  void doOutputImage(ImageField image)
          Called by outputImage as a chance to insert behavior when a image is output.
protected  void doOutputLine(Line line)
          Creates a new line.
protected  void doStart()
          Creates window and displays a blank page.
protected  void doStartPage()
          Creates a new page.
protected  void export()
          Opens the report export dialog.
 javax.swing.JFrame getJFrame()
           
protected  void makeActions()
          Creates the actions used by menu items and toolbar widgets.
protected  void makeMenu(javax.swing.JFrame frame)
          Creates the window menu.
protected  javax.swing.JToolBar makeToolbar()
          Creates and returns a new tool bar.
 void printReport()
          Prints the report.
protected  void updateNavActions()
          Updates the navigation buttons based on number of pages and the current display page.
protected  void updatePageCountLabel()
          Updates the page count label based on the current page number and the total number of pages.
 
Methods inherited from class jimm.datavision.layout.LayoutEngine
calcDetailHeight, calcPageFooterHeight, calcReportFooterHeight, calcSectionHeights, checkRemainingPageLength, closeOutput, currentSectionTypeAsString, detail, doOutputSection, end, endPage, groupFooters, groupHeaders, outputField, outputImage, outputLine, outputSection, pageHeight, pageNumber, pageWidth, setReport, start, startPage, wantsMoreData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WINDOW_START_SIZE

protected static final java.awt.Dimension WINDOW_START_SIZE

PRINT_ICON

protected static final java.lang.String PRINT_ICON
See Also:
Constant Field Values

EXPORT_ICON

protected static final java.lang.String EXPORT_ICON
See Also:
Constant Field Values

FIRST_ICON

protected static final java.lang.String FIRST_ICON
See Also:
Constant Field Values

PREV_ICON

protected static final java.lang.String PREV_ICON
See Also:
Constant Field Values

NEXT_ICON

protected static final java.lang.String NEXT_ICON
See Also:
Constant Field Values

LAST_ICON

protected static final java.lang.String LAST_ICON
See Also:
Constant Field Values

frame

protected javax.swing.JFrame frame

pageDim

protected java.awt.Dimension pageDim

cardPanel

protected javax.swing.JPanel cardPanel

scroller

protected javax.swing.JScrollPane scroller

displayPageNum

protected int displayPageNum

pageContents

protected java.util.ArrayList pageContents

pageBeingBuilt

protected SwingPageContents pageBeingBuilt

pageCountLabel

protected javax.swing.JLabel pageCountLabel

printAction

protected javax.swing.Action printAction

closeAction

protected javax.swing.Action closeAction

exportAction

protected javax.swing.Action exportAction

goFirstAction

protected javax.swing.Action goFirstAction

goPrevAction

protected javax.swing.Action goPrevAction

goNextAction

protected javax.swing.Action goNextAction

goLastAction

protected javax.swing.Action goLastAction
Constructor Detail

SwingLE

public SwingLE()
Constructor.

Method Detail

cancel

public void cancel()
Description copied from class: LayoutEngine
Called by someone else running the report to cancel all the hard work this layout engine has performed.

Overrides:
cancel in class LayoutEngine

getJFrame

public javax.swing.JFrame getJFrame()

doStart

protected void doStart()
Creates window and displays a blank page.

Overrides:
doStart in class LayoutEngine

doEnd

protected void doEnd()
Done loading report.

Overrides:
doEnd in class LayoutEngine

makeActions

protected void makeActions()
Creates the actions used by menu items and toolbar widgets.


makeMenu

protected void makeMenu(javax.swing.JFrame frame)
Creates the window menu.

Parameters:
frame - the window that will contain the menu

makeToolbar

protected javax.swing.JToolBar makeToolbar()
Creates and returns a new tool bar.


doStartPage

protected void doStartPage()
Creates a new page.

Overrides:
doStartPage in class LayoutEngine

doEndPage

protected void doEndPage()
At the end of the first page, starts building it in a separate thread. Check to see if the first page is done being built. If so, it is displayed.

Overrides:
doEndPage in class LayoutEngine

close

public void close()
Closes this window. Does not call System.exit.


export

protected void export()
Opens the report export dialog.


updateNavActions

protected void updateNavActions()
Updates the navigation buttons based on number of pages and the current display page.


updatePageCountLabel

protected void updatePageCountLabel()
Updates the page count label based on the current page number and the total number of pages.


displayFirstPage

protected void displayFirstPage()
Performs the "First Page" command.


displayNextPage

protected void displayNextPage()
Performs the "Next Page" command.


displayPrevPage

protected void displayPrevPage()
Performs the "Previous Page" command.


displayLastPage

protected void displayLastPage()
Performs the "Last Page" command.


displayPage

protected void displayPage(int num)
Fills the window with the contents of the specified page. If necessary, builds the page. Starts building the next and previous pages in separate threads, if they have not already been built.

Parameters:
num - page number, starting at 1
See Also:
SwingPageContents

doOutputField

protected void doOutputField(Field field)
Creates a new SwingField and adds it to the current page.

Specified by:
doOutputField in class LayoutEngine
Parameters:
field - the report field

doOutputImage

protected void doOutputImage(ImageField image)
Description copied from class: LayoutEngine
Called by outputImage as a chance to insert behavior when a image is output.

Specified by:
doOutputImage in class LayoutEngine
Parameters:
image - an image field

doOutputLine

protected void doOutputLine(Line line)
Creates a new line. Unimplemented.

Specified by:
doOutputLine in class LayoutEngine
Parameters:
line - a line

printReport

public void printReport()
Prints the report.