com.wildcrest.j2printerworks
Class J2Pageable

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended bycom.wildcrest.j2printerworks.J2Pageable
All Implemented Interfaces:
Flowable, java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.print.Pageable, java.io.Serializable
Direct Known Subclasses:
J2ComponentPrinter, J2FlowPrinter, J2ListPrinter, J2PanelPrinter, J2TablePrinter, J2TextPrinter, J2TreePrinter

public abstract class J2Pageable
extends javax.swing.JComponent
implements Flowable, java.awt.print.Pageable

An abstract base class that converts a Flowable into a Pageable (a set of formatted pages starting and ending on page boundaries), and which is the parent class of J2TextPrinter, J2TablePrinter, J2TreePrinter, J2ComponentPrinter, J2PanelPrinter, J2ListPrinter, and J2FlowPrinter.

This class is not called directly by developers but is designed to be used as a framework for implementing components that are to be both Pageable and Flowable.

J2Pageable declares both the Pageable and Flowable interfaces. A subclass of J2Pageable must provide an implementation for the methods of Flowable, which J2Pageable uses to create an implementation of Pageable, complete with all the J2PrinterWorks features such as headers, footers, margins, orientation, and scaling.

For example, J2TextPrinter is declared as extending J2Pageable. J2TextPrinter itself implements the Flowable interface methods for a given JTextPane and inherits from J2Pageable the implementation of a standard Java Pageable as well as all the J2PrinterWorks methods for headers, footers, margins, orientation, scale, etc.

(C) Copyright 2009, Wildcrest Associates (http://www.wildcrest.com). All rights reserved.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static int BOTTOM
          Specifies vertical alignment to be bottom justified within the available space.
static int BOX
          Specifies that a box is drawn around the header or the footer.
static int CENTER
          Specifies horizontal or vertical alignment to be centered within the available space.
static int FIRST
          Denotes header and footer values for page 1.
static int GLOBAL
          Indicates that the "global" (overall, default, J2Printer) values are to be used for margins, header/footer style, orientation, and scale instead of a "local" value for this Pageable
static int LANDSCAPE
          Specifies that the page orientation is landscape.
static int LEFT
          Specifies horizontal alignment to be left justified within the available space.
static int LINE
          Specifies that a line is drawn below the header or above the footer.
static int NONE
          Specifies that no additional line or box is drawn for the header or footer.
static int PORTRAIT
          Specifies that the page orientation is portrait.
static int PPI72
          A constant specifying the standard printing resolution of 72 dots ("points") per inch.
static int REST
          Denotes header and footer values for pages 2...n.
static int REVERSE_LANDSCAPE
          Specifies that the page orientation is reverse landscape (landscape rotated 180 degrees).
static int RIGHT
          Specifies horizontal alignment to be right justified within the available space.
static int TOP
          Specifies vertical alignment to be top justified within the available space.
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.print.Pageable
UNKNOWN_NUMBER_OF_PAGES
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
J2Pageable()
          Construct a J2Pageable object.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener l)
          Add a PropertyChangeListener for this component
 void clearFooters()
          Clears all the footers for both page 1 and pages 2...n of this Pageable instance.
 void clearFooters(int which)
          Clears all the footers for either page 1 of pages 2...n of this Pageable instance.
 void clearHeaders()
          Clears all the headers for both page 1 and pages 2...n of this Pageable instance (NOTE: value cannot be changed in Free Trial Version).
 void clearHeaders(int which)
          Clears all the headers for either page 1 of pages 2...n of this Pageable instance (NOTE: value cannot be changed in Free Trial Version).
 void dispose()
          Release all heap objects created by this J2Pageable object, must not call until printing completes.
 double getBodyHeight(int which)
          Return available body height between margins, headers/footers, and gaps for printing content for either page 1 or pages 2...n.
 double getBodyWidth()
          Return available body width between margins for printing content.
 double getBottomMargin()
          Returns the bottom margin of this J2Pageable instance.
 java.lang.Object getCenterFooter()
          Returns the center footer of this J2Pageable instance (same as getCenterFooter(FIRST)).
 java.lang.Object getCenterFooter(int which)
          Returns the center footer for either page 1 or pages 2...n of this J2Pageable instance.
 java.lang.Object getCenterHeader()
          Returns the center header of this J2Pageable instance (same as getCenterHeader(FIRST)).
 java.lang.Object getCenterHeader(int which)
          Returns the center header for either page 1 or pages 2...n of this J2Pageable instance.
 java.awt.Font getFooterFont()
          Returns the Font specified for footers of this J2Pageable instance (same as getFooterFont(FIRST)).
 java.awt.Font getFooterFont(int which)
          Returns the Font for printing the footers for either page 1 or pages 2...n of this J2Pageable instance when these are specified using a String.
 int getFooterStyle()
          Returns footer style (BOX, LINE, or NONE) of this J2Pageable instance (returns answer for page 1).
 int getFooterStyle(int which)
          Returns footer style (BOX, LINE, or NONE) for either page 1 or pages 2...n of this J2Pageable instance.
 double getGapAboveFooter()
          Returns the gap between the bottom edge of the body and the footer of this J2Pageable instance in inches.
 double getGapBelowHeader()
          Returns the gap between the header and top edge of the body of this J2Pageable instance in inches.
 java.awt.Font getHeaderFont()
          Returns the Font specified for headers of this J2Pageable instance (same as getHeadersFont(FIRST)).
 java.awt.Font getHeaderFont(int which)
          Returns the Font for printing the headers for either page 1 or pages 2...n of this J2Pageable instance when these are specified using a String.
 int getHeaderStyle()
          Returns header style (BOX, LINE, or NONE) of this J2Pageable instance (returns answer for page 1).
 int getHeaderStyle(int which)
          Returns header style (BOX, LINE, or NONE) for either page 1 or pages 2...n of this J2Pageable instance.
 java.lang.Object getLeftFooter()
          Returns the left footer of this J2Pageable instance (same as getLeftFooter(FIRST)).
 java.lang.Object getLeftFooter(int which)
          Returns the left footer for either page 1 or pages 2...n of this J2Pageable instance.
 java.lang.Object getLeftHeader()
          Returns the left header of this J2Pageable instance (same as getLeftHeader(FIRST)).
 java.lang.Object getLeftHeader(int which)
          Returns the left header for either page 1 or pages 2...n of this J2Pageable instance.
 double getLeftMargin()
          Returns the left margin of this J2Pageable instance.
 java.awt.Dimension getMaximumSize()
          Return maximum size of bean icon (32x32)
 java.awt.Dimension getMinimumSize()
          Return minimum size of bean icon (32x32)
 int getNumberOfPages()
          Returns the total number of pages (1...n) for this paginated Flowable (part of this class's implementation of java.awt.print.Pageable).
 int getNumberOfPagesHigh()
          Returns the number of pages (1...n) vertically for this Flowable.
 int getNumberOfPagesWide()
          Returns the number of pages (1...n) horizontally for this paginated Flowable.
 int getOrientation()
          Returns page orientation of this J2Pageable instance (PORTRAIT, LANDSCAPE, or REVERSE_LANDSCAPE).
 java.awt.print.PageFormat getPageFormat()
          Method for creating a PageFormat instance based on this J2Pageable's margins, size, & orientation.
 java.awt.print.PageFormat getPageFormat(int pageIndex)
          Returns PageFormat for page with this pageIndex (0...n-1) (part of this class's implementation of java.awt.print.Pageable).
 java.awt.Dimension getPreferredSize()
          Return preferred size of bean icon (32x32)
 java.awt.print.Printable getPrintable(int pageIndex)
          Returns a Printable instance for the page with this pageIndex (0...n-1) (part of this class's implementation of java.awt.print.Pageable).
 java.lang.Object getRightFooter()
          Returns the right footer of this J2Pageable instance (same as getRightFooter(FIRST)).
 java.lang.Object getRightFooter(int which)
          Returns the right footer for either page 1 or pages 2...n of this J2Pageable instance.
 java.lang.Object getRightHeader()
          Returns the right header of this J2Pageable instance (same as getRightHeader(FIRST)).
 java.lang.Object getRightHeader(int which)
          Returns the right header for either page 1 or pages 2...n of this J2Pageable instance.
 double getRightMargin()
          Returns the right margin of this J2Pageable instance.
 double getScale()
          Returns current scaling factor for this J2Pageable.
 double getTopMargin()
          Returns the top margin of this J2Pageable instance.
 void paint(java.awt.Graphics g)
          This method is provided to paint this component's bean icon in your visual builder.
 void removePropertyChangeListener(java.beans.PropertyChangeListener l)
          Remove a PropertyChangeListener for this component
 void setBottomMargin(double bottomMargin)
          Sets desired bottom margin of this J2Pageable instance in inches from the edge of page (when viewing content).
 void setCenterFooter(int which, java.lang.Object centerFooter)
          Sets the center footer for either page 1 or pages 2...n of this J2Pageable instance using a String or JLabel
 void setCenterFooter(java.lang.Object centerFooter)
          Sets the center footer for both page 1 and pages 2...n of this J2Pageable instance using a String or JLabel.
 void setCenterHeader(int which, java.lang.Object centerHeader)
          Sets the center header for either page 1 or pages 2...n of this J2Pageable instance using a String or JLabel (NOTE: value cannot be changed in Free Trial Version).
 void setCenterHeader(java.lang.Object centerHeader)
          Sets the center header for both page 1 and pages 2...n of this J2Pageable instance using a String or JLabel (NOTE: value cannot be changed in Free Trial Version).
 void setFooterFont(java.awt.Font font)
          Sets the Font for printing the footers for both page 1 and pages 2...n of this J2Pageable instance when these are specified using a String.
 void setFooterFont(int which, java.awt.Font font)
          Sets the Font for printing the footers for either page 1 or pages 2...n of this J2Pageable instance when these are specified using a String.
 void setFooterStyle(int style)
          Sets footer style (BOX, LINE, or NONE) for both page 1 and pages 2...n of this J2Pageable instance.
 void setFooterStyle(int which, int style)
          Sets footer style (BOX, LINE, or NONE) for either page 1 or pages 2...n of this J2Pageable instance.
 void setGapAboveFooter(double gapAboveFooter)
          Sets the gap between the bottom edge of body and the top of the footer of this J2Pageable instance in inches.
 void setGapBelowHeader(double gapBelowHeader)
          Sets the gap between the bottom of the header and the top edge of the body of this J2Pageable instance in inches.
 void setHeaderFont(java.awt.Font font)
          Sets the Font for printing the headers for both page 1 and pages 2...n of this J2Pageable instance when these are specified using a String (NOTE: value cannot be changed in Free Trial Version).
 void setHeaderFont(int which, java.awt.Font font)
          Sets the Font for printing the headers for either page 1 or pages 2...n of this J2Pageable instance when these are specified using a String (NOTE: value cannot be changed in Free Trial Version).
 void setHeaderStyle(int style)
          Sets header style (BOX, LINE, or NONE) for both page 1 and pages 2...n of this J2Pageable instance (NOTE: value cannot be changed in Free Trial Version).
 void setHeaderStyle(int which, int style)
          Sets header style (BOX, LINE, or NONE) for either page 1 or pages 2...n of this J2Pageable instance (NOTE: value cannot be changed in Free Trial Version).
 void setLeftFooter(int which, java.lang.Object leftFooter)
          Sets the left footer for either page 1 or pages 2...n of this J2Pageable instance using a String or JLabel
 void setLeftFooter(java.lang.Object leftFooter)
          Sets the left footer for both page 1 and pages 2...n of this J2Pageable instance using a String or JLabel.
 void setLeftHeader(int which, java.lang.Object leftHeader)
          Sets the left header for either page 1 or pages 2...n of this J2Pageable instance using a String or JLabel (NOTE: value cannot be changed in Free Trial Version).
 void setLeftHeader(java.lang.Object leftHeader)
          Sets the left header for both page 1 and pages 2...n of this J2Pageable instance using a String or JLabel (NOTE: value cannot be changed in Free Trial Version).
 void setLeftMargin(double leftMargin)
          Sets desired left margin of this J2Pageable instance in inches from the edge of page (when viewing content).
 void setLocale(java.util.Locale locale)
          Sets the operative locale for J2PrinterWorks
 void setMaximumPages(int pagesWide, int pagesHigh)
          Rescale this Pageable to print within a maximum number of vertical and/or horizontal pages (will minify to fit).
 void setOrientation(int orientation)
          Sets page orientation of this J2Pageable instance.
 void setPageFormat(java.awt.print.PageFormat pageFormat)
          Method for setting this J2Pageable's margins, size, and orientation from an external PageFormat instance.
 void setParam(java.lang.String str)
          Convenience method for entering internal parameters.
 void setRightFooter(int which, java.lang.Object rightFooter)
          Sets the right footer for either page 1 or pages 2...n of this J2Pageable instance using a String or JLabel
 void setRightFooter(java.lang.Object rightFooter)
          Sets the right footer for both page 1 and pages 2...n of this J2Pageable instance using a String or JLabel.
 void setRightHeader(int which, java.lang.Object rightHeader)
          Sets the right header for either page 1 or pages 2...n of this J2Pageable instance using a String or JLabel (NOTE: value cannot be changed in Free Trial Version).
 void setRightHeader(java.lang.Object rightHeader)
          Sets the right header for both page 1 and pages 2...n of this J2Pageable instance using a String or JLabel (NOTE: value cannot be changed in Free Trial Version).
 void setRightMargin(double rightMargin)
          Sets desired right margin of this J2Pageable instance in inches from the edge of page (when viewing content).
 void setScale(double scale)
          Sets magnification or minification scaling factor for printing this J2Pageable.
 void setTopMargin(double topMargin)
          Sets desired top margin of this J2Pageable instance in inches from the edge of page (when viewing content).
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getNextFocusableComponent, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.wildcrest.j2printerworks.Flowable
doneX, doneY, printFlowable, resetFlowable, usedX, usedY
 

Field Detail

FIRST

public static final int FIRST
Denotes header and footer values for page 1.

See Also:
Constant Field Values

REST

public static final int REST
Denotes header and footer values for pages 2...n.

See Also:
Constant Field Values

NONE

public static final int NONE
Specifies that no additional line or box is drawn for the header or footer.

See Also:
Constant Field Values

LINE

public static final int LINE
Specifies that a line is drawn below the header or above the footer.

See Also:
Constant Field Values

BOX

public static final int BOX
Specifies that a box is drawn around the header or the footer.

See Also:
Constant Field Values

LANDSCAPE

public static final int LANDSCAPE
Specifies that the page orientation is landscape.

See Also:
Constant Field Values

PORTRAIT

public static final int PORTRAIT
Specifies that the page orientation is portrait.

See Also:
Constant Field Values

REVERSE_LANDSCAPE

public static final int REVERSE_LANDSCAPE
Specifies that the page orientation is reverse landscape (landscape rotated 180 degrees).

See Also:
Constant Field Values

CENTER

public static final int CENTER
Specifies horizontal or vertical alignment to be centered within the available space.

See Also:
Constant Field Values

LEFT

public static final int LEFT
Specifies horizontal alignment to be left justified within the available space.

See Also:
Constant Field Values

RIGHT

public static final int RIGHT
Specifies horizontal alignment to be right justified within the available space.

See Also:
Constant Field Values

TOP

public static final int TOP
Specifies vertical alignment to be top justified within the available space.

See Also:
Constant Field Values

BOTTOM

public static final int BOTTOM
Specifies vertical alignment to be bottom justified within the available space.

See Also:
Constant Field Values

PPI72

public static final int PPI72
A constant specifying the standard printing resolution of 72 dots ("points") per inch.

See Also:
Constant Field Values

GLOBAL

public static final int GLOBAL
Indicates that the "global" (overall, default, J2Printer) values are to be used for margins, header/footer style, orientation, and scale instead of a "local" value for this Pageable

See Also:
Constant Field Values
Constructor Detail

J2Pageable

public J2Pageable()
Construct a J2Pageable object.

Method Detail

dispose

public void dispose()
Release all heap objects created by this J2Pageable object, must not call until printing completes.


getNumberOfPagesHigh

public int getNumberOfPagesHigh()
Returns the number of pages (1...n) vertically for this Flowable.


getNumberOfPagesWide

public int getNumberOfPagesWide()
Returns the number of pages (1...n) horizontally for this paginated Flowable.


getNumberOfPages

public int getNumberOfPages()
Returns the total number of pages (1...n) for this paginated Flowable (part of this class's implementation of java.awt.print.Pageable).

Specified by:
getNumberOfPages in interface java.awt.print.Pageable

setMaximumPages

public void setMaximumPages(int pagesWide,
                            int pagesHigh)
Rescale this Pageable to print within a maximum number of vertical and/or horizontal pages (will minify to fit).

Note 1: This method causes the rescaling to take place at the time it is called and does NOT remember or maintain the page limits you specify. Thus, if you change any printing parameters including your document content, headers, footers, margins, paper size, orientation, etc., you must call setMaximumPages again.

Note 2: When printing with a J2TablePrinter, J2PanelPrinter, or J2ComponentPrinter, if fitting to one page wide is desired, it is much more efficient to use setHorizontalRule(SHRINK_TO_FIT) (or setPageRule(SHRINK_TO_FIT) in the case of J2PanelPrinter) than to call setMaximumPages(1,0). The later method iterates by 0.5% deccrements until the proper scale is determined, whereas the former calculates the exact size needed to fit the page directly. Also, unlike the setMaximumPages method, which is a one-time operation and not maintained as a state (see Note 1), the setHorizontalRule setting is remembered as a state and will be maintained even if printing parameters change.

Parameters:
pagesWide - specifies maximum horizontal number of pages for printing this Pageable (< or = 0 if unconstrained).
pagesHigh - specifies maximum vertical number of pages for printing this Pageable (< or = 0 if unconstrained).

getPageFormat

public java.awt.print.PageFormat getPageFormat(int pageIndex)
Returns PageFormat for page with this pageIndex (0...n-1) (part of this class's implementation of java.awt.print.Pageable).

Specified by:
getPageFormat in interface java.awt.print.Pageable
Parameters:
pageIndex - specifies the pageIndex (0...n-1) for which the PageFormat is requested

getPrintable

public java.awt.print.Printable getPrintable(int pageIndex)
Returns a Printable instance for the page with this pageIndex (0...n-1) (part of this class's implementation of java.awt.print.Pageable).

Specified by:
getPrintable in interface java.awt.print.Pageable
Parameters:
pageIndex - specifies the pageIndex (0...n-1) for which an instance of Printable is requested.

paint

public void paint(java.awt.Graphics g)
This method is provided to paint this component's bean icon in your visual builder.

Parameters:
g - Graphics context object

getBodyWidth

public double getBodyWidth()
Return available body width between margins for printing content. Value based on this J2Pageable's left and right margin settings if specified or on the "global" J2Printer (overall) values of these if not. Value is given in unscaled printing coordinates ("points" = 1/72ths of an inch).


getBodyHeight

public double getBodyHeight(int which)
Return available body height between margins, headers/footers, and gaps for printing content for either page 1 or pages 2...n. Value based on this J2Pageable's top and bottom margin settings, headers, footers, gapBelow Header, and gapAboveFooter if specified or on the "global" J2Printer (overall) values of these if not. Value is given in unscaled printing coordinates ("points" = 1/72ths of an inch).

Parameters:
which - J2Pageable.FIRST (1) if page 1, or = J2Pageable.REST (0) if pages 2...n.

setPageFormat

public void setPageFormat(java.awt.print.PageFormat pageFormat)
Method for setting this J2Pageable's margins, size, and orientation from an external PageFormat instance. Sets this J2Pageable's left, right, top, and bottom margins and orientation based on the values in the PageFormat instance.

Parameters:
pageFormat - PageFormat whose values will be used to set the PageSetup margins and orientation.

getPageFormat

public java.awt.print.PageFormat getPageFormat()
Method for creating a PageFormat instance based on this J2Pageable's margins, size, & orientation. Each value will be based on this J2Pageable's instance values if specified, or the "global" (overall, default, J2Printer) values if not. Margins will be adjusted so they are not smaller than the current unprintable margins.


getPreferredSize

public java.awt.Dimension getPreferredSize()
Return preferred size of bean icon (32x32)


getMinimumSize

public java.awt.Dimension getMinimumSize()
Return minimum size of bean icon (32x32)


getMaximumSize

public java.awt.Dimension getMaximumSize()
Return maximum size of bean icon (32x32)


setParam

public void setParam(java.lang.String str)
Convenience method for entering internal parameters.


setLocale

public void setLocale(java.util.Locale locale)
Sets the operative locale for J2PrinterWorks


setHeaderFont

public void setHeaderFont(java.awt.Font font)
Sets the Font for printing the headers for both page 1 and pages 2...n of this J2Pageable instance when these are specified using a String (NOTE: value cannot be changed in Free Trial Version).

Parameters:
font - Font used for printing headers (null means use the "global" J2Printer value). Default: Serif,PLAIN,10

getHeaderFont

public java.awt.Font getHeaderFont()
Returns the Font specified for headers of this J2Pageable instance (same as getHeadersFont(FIRST)).


setHeaderFont

public void setHeaderFont(int which,
                          java.awt.Font font)
Sets the Font for printing the headers for either page 1 or pages 2...n of this J2Pageable instance when these are specified using a String (NOTE: value cannot be changed in Free Trial Version).

Parameters:
which - J2Pageable.FIRST (1) if page 1, or J2Pageable.REST (0) if pages 2...n.
font - Font used for printing headers (null means use the "global" J2Printer value). Default: Serif,PLAIN,10

getHeaderFont

public java.awt.Font getHeaderFont(int which)
Returns the Font for printing the headers for either page 1 or pages 2...n of this J2Pageable instance when these are specified using a String.

Parameters:
which - J2Pageable.FIRST (1) if page 1, or J2Pageable.REST (0) if pages 2...n.

setFooterFont

public void setFooterFont(java.awt.Font font)
Sets the Font for printing the footers for both page 1 and pages 2...n of this J2Pageable instance when these are specified using a String.

Parameters:
font - Font used for printing footers (null means use the "global" J2Printer value). Default: Serif,PLAIN,10

getFooterFont

public java.awt.Font getFooterFont()
Returns the Font specified for footers of this J2Pageable instance (same as getFooterFont(FIRST)).


setFooterFont

public void setFooterFont(int which,
                          java.awt.Font font)
Sets the Font for printing the footers for either page 1 or pages 2...n of this J2Pageable instance when these are specified using a String.

Parameters:
which - J2Pageable.FIRST (1) if page 1, or J2Pageable.REST (0) if pages 2...n.
font - Font used for printing footers (null means use the "global" J2Printer value). Default: Serif,PLAIN,10

getFooterFont

public java.awt.Font getFooterFont(int which)
Returns the Font for printing the footers for either page 1 or pages 2...n of this J2Pageable instance when these are specified using a String.

Parameters:
which - J2Pageable.FIRST (1) if page 1, or J2Pageable.REST (0) if pages 2...n.

setLeftFooter

public void setLeftFooter(java.lang.Object leftFooter)
Sets the left footer for both page 1 and pages 2...n of this J2Pageable instance using a String or JLabel.

Parameters:
leftFooter - String or JLabel representing the leftFooter (null means use the "global" J2Printer value). All occurrences of ### (3 pound signs) replaced by current page number. All occurrences of @@@ (3 at signs) replaced by total number of pages. All strings between pairs of ||| (3 vertical bars) passed to Java SimpleDateFormat class for formatting the current date & time. Default: |||EEE, MMM d, yyyy|||
See Also:
SimpleDateFormat

getLeftFooter

public java.lang.Object getLeftFooter()
Returns the left footer of this J2Pageable instance (same as getLeftFooter(FIRST)). Return Object may be String or JLabel.


setLeftFooter

public void setLeftFooter(int which,
                          java.lang.Object leftFooter)
Sets the left footer for either page 1 or pages 2...n of this J2Pageable instance using a String or JLabel

Parameters:
which - J2Pageable.FIRST (1) if page 1, or J2Pageable.REST (0) if pages 2...n.
leftFooter - String or JLabel representing the leftFooter (null means use the "global" J2Printer value). All occurrences of ### (3 pound signs) replaced by current page number. All occurrences of @@@ (3 at signs) replaced by total number of pages. All strings between pairs of ||| (3 vertical bars) passed to Java SimpleDateFormat class for formatting the current date & time. Default: |||EEE, MMM d, yyyy|||
See Also:
SimpleDateFormat

getLeftFooter

public java.lang.Object getLeftFooter(int which)
Returns the left footer for either page 1 or pages 2...n of this J2Pageable instance. Return Object may be String or JLabel.

Parameters:
which - J2Pageable.FIRST (1) if page 1, or J2Pageable.REST (0) if pages 2...n.

setCenterFooter

public void setCenterFooter(java.lang.Object centerFooter)
Sets the center footer for both page 1 and pages 2...n of this J2Pageable instance using a String or JLabel.

Parameters:
centerFooter - String or JLabel representing the centerFooter (null means use the "global" J2Printer value). Page number and data & time formatting same as for setLeftFooter. Default: Page ### of @@@

getCenterFooter

public java.lang.Object getCenterFooter()
Returns the center footer of this J2Pageable instance (same as getCenterFooter(FIRST)). Return Object may be String or JLabel.


setCenterFooter

public void setCenterFooter(int which,
                            java.lang.Object centerFooter)
Sets the center footer for either page 1 or pages 2...n of this J2Pageable instance using a String or JLabel

Parameters:
which - J2Pageable.FIRST (1) if page 1, or J2Pageable.REST (0) if pages 2...n.
centerFooter - String or JLabel representing the centerFooter (null means use the "global" J2Printer value). Page number and data & time formatting same as for setLeftFooter. Default: Page ### of @@@

getCenterFooter

public java.lang.Object getCenterFooter(int which)
Returns the center footer for either page 1 or pages 2...n of this J2Pageable instance. Return Object may be String or JLabel.

Parameters:
which - J2Pageable.FIRST (1) if page 1, or J2Pageable.REST (0) if pages 2...n.

setRightFooter

public void setRightFooter(java.lang.Object rightFooter)
Sets the right footer for both page 1 and pages 2...n of this J2Pageable instance using a String or JLabel.

Parameters:
rightFooter - String or JLabel representing the rightFooter (null means use the "global" J2Printer value). Page number and data & time formatting same as for setLeftFooter. Default: |||hh:mm:ss a zzz|||

getRightFooter

public java.lang.Object getRightFooter()
Returns the right footer of this J2Pageable instance (same as getRightFooter(FIRST)). Return Object may be String or JLabel.


setRightFooter

public void setRightFooter(int which,
                           java.lang.Object rightFooter)
Sets the right footer for either page 1 or pages 2...n of this J2Pageable instance using a String or JLabel

Parameters:
which - J2Pageable.FIRST (1) if page 1, or J2Pageable.REST (0) if pages 2...n.
rightFooter - String or JLabel representing the rightFooter (null means use the "global" J2Printer value). Page number and data & time formatting same as for setLeftFooter. Default: |||hh:mm:ss a zzz|||

getRightFooter

public java.lang.Object getRightFooter(int which)
Returns the right footer for either page 1 or pages 2...n of this J2Pageable instance. Return Object may be String or JLabel.

Parameters:
which - J2Pageable.FIRST (1) if page 1, or J2Pageable.REST (0) if pages 2...n.

setLeftHeader

public void setLeftHeader(java.lang.Object leftHeader)
Sets the left header for both page 1 and pages 2...n of this J2Pageable instance using a String or JLabel (NOTE: value cannot be changed in Free Trial Version).

Parameters:
leftHeader - String or JLabel representing the leftHeader (null means use the "global" J2Printer value) All occurrences of ### (3 pound signs) replaced by current page number. All occurrences of @@@ (3 at signs) replaced by total number of pages. All strings between pairs of ||| (3 vertical bars) passed to Java SimpleDateFormat class for formatting the current date & time. Default: Wildcrest copyright notice
See Also:
SimpleDateFormat

getLeftHeader

public java.lang.Object getLeftHeader()
Returns the left header of this J2Pageable instance (same as getLeftHeader(FIRST)). Return Object may be String or JLabel.


setLeftHeader

public void setLeftHeader(int which,
                          java.lang.Object leftHeader)
Sets the left header for either page 1 or pages 2...n of this J2Pageable instance using a String or JLabel (NOTE: value cannot be changed in Free Trial Version).

Parameters:
which - J2Pageable.FIRST (1) if page 1, or J2Pageable.REST (0) if pages 2...n.
leftHeader - String or JLabel representing the leftHeader (null means use the "global" J2Printer value). All occurrences of ### (3 pound signs) replaced by current page number. All occurrences of @@@ (3 at signs) replaced by total number of pages. All strings between pairs of ||| (3 vertical bars) passed to Java SimpleDateFormat class for formatting the current date & time. Default: Wildcrest copyright notice
See Also:
SimpleDateFormat

getLeftHeader

public java.lang.Object getLeftHeader(int which)
Returns the left header for either page 1 or pages 2...n of this J2Pageable instance. Return Object may be String or JLabel.

Parameters:
which - J2Pageable.FIRST (1) if page 1, or J2Pageable.REST (0) if pages 2...n.

setCenterHeader

public void setCenterHeader(java.lang.Object centerHeader)
Sets the center header for both page 1 and pages 2...n of this J2Pageable instance using a String or JLabel (NOTE: value cannot be changed in Free Trial Version).

Parameters:
centerHeader - String or JLabel representing the centerHeader (null means use the "global" J2Printer value). Page number and data & time formatting same as for setLeftHeader. Default: Wildcrest copyright notice

getCenterHeader

public java.lang.Object getCenterHeader()
Returns the center header of this J2Pageable instance (same as getCenterHeader(FIRST)). Return Object may be String or JLabel.


setCenterHeader

public void setCenterHeader(int which,
                            java.lang.Object centerHeader)
Sets the center header for either page 1 or pages 2...n of this J2Pageable instance using a String or JLabel (NOTE: value cannot be changed in Free Trial Version).

Parameters:
which - J2Pageable.FIRST (1) if page 1, or J2Pageable.REST (0) if pages 2...n.
centerHeader - String or JLabel representing the centerHeader (null means use the "global" J2Printer value). Page number and data & time formatting same as for setLeftHeader. Default: Wildcrest copyright notice

getCenterHeader

public java.lang.Object getCenterHeader(int which)
Returns the center header for either page 1 or pages 2...n of this J2Pageable instance. Return Object may be String or JLabel.

Parameters:
which - J2Pageable.FIRST (1) if page 1, or J2Pageable.REST (0) if pages 2...n.

setRightHeader

public void setRightHeader(java.lang.Object rightHeader)
Sets the right header for both page 1 and pages 2...n of this J2Pageable instance using a String or JLabel (NOTE: value cannot be changed in Free Trial Version).

Parameters:
rightHeader - String or JLabel representing the rightHeader (null means use the "global" J2Printer value). Page number and data & time formatting same as for setLeftHeader. Default: Wildcrest copyright notice

getRightHeader

public java.lang.Object getRightHeader()
Returns the right header of this J2Pageable instance (same as getRightHeader(FIRST)). Return Object may be String or JLabel.


setRightHeader

public void setRightHeader(int which,
                           java.lang.Object rightHeader)
Sets the right header for either page 1 or pages 2...n of this J2Pageable instance using a String or JLabel (NOTE: value cannot be changed in Free Trial Version).

Parameters:
which - J2Pageable.FIRST (1) if page 1, or J2Pageable.REST (0) if pages 2...n.
rightHeader - String or JLabel representing the rightHeader (null means use the "global" J2Printer value). Page number and data & time formatting same as for setLeftHeader. Default: Wildcrest copyright notice

getRightHeader

public java.lang.Object getRightHeader(int which)
Returns the right header for either page 1 or pages 2...n of this J2Pageable instance. Return Object may be String or JLabel.

Parameters:
which - J2Pageable.FIRST (1) if page 1, or J2Pageable.REST (0) if pages 2...n.

setHeaderStyle

public void setHeaderStyle(int style)
Sets header style (BOX, LINE, or NONE) for both page 1 and pages 2...n of this J2Pageable instance (NOTE: value cannot be changed in Free Trial Version).

Parameters:
style - J2Pageable.BOX or .LINE or .NONE or .GLOBAL. Default: GLOBAL

getHeaderStyle

public int getHeaderStyle()
Returns header style (BOX, LINE, or NONE) of this J2Pageable instance (returns answer for page 1).


setHeaderStyle

public void setHeaderStyle(int which,
                           int style)
Sets header style (BOX, LINE, or NONE) for either page 1 or pages 2...n of this J2Pageable instance (NOTE: value cannot be changed in Free Trial Version).

Parameters:
which - J2Pageable.FIRST (1) if page 1, or J2Pageable.REST (0) if pages 2...n.
style - J2Pageable.BOX or .LINE or .NONE or .GLOBAL. Default: GLOBAL

getHeaderStyle

public int getHeaderStyle(int which)
Returns header style (BOX, LINE, or NONE) for either page 1 or pages 2...n of this J2Pageable instance.

Parameters:
which - J2Pageable.FIRST (1) if page 1, or J2Pageable.REST (0) if pages 2...n.

setFooterStyle

public void setFooterStyle(int style)
Sets footer style (BOX, LINE, or NONE) for both page 1 and pages 2...n of this J2Pageable instance.

Parameters:
style - J2Pageable.BOX or .LINE or .NONE or .GLOBAL. Default: GLOBAL

getFooterStyle

public int getFooterStyle()
Returns footer style (BOX, LINE, or NONE) of this J2Pageable instance (returns answer for page 1).


setFooterStyle

public void setFooterStyle(int which,
                           int style)
Sets footer style (BOX, LINE, or NONE) for either page 1 or pages 2...n of this J2Pageable instance.

Parameters:
which - J2Pageable.FIRST (1) if page 1, or J2Pageable.REST (0) if pages 2...n.
style - J2Pageable.BOX or .LINE or .NONE or .GLOBAL. Default: GLOBAL

getFooterStyle

public int getFooterStyle(int which)
Returns footer style (BOX, LINE, or NONE) for either page 1 or pages 2...n of this J2Pageable instance.

Parameters:
which - J2Pageable.FIRST (1) if page 1, or J2Pageable.REST (0) if pages 2...n.

clearHeaders

public void clearHeaders()
Clears all the headers for both page 1 and pages 2...n of this Pageable instance (NOTE: value cannot be changed in Free Trial Version).


clearHeaders

public void clearHeaders(int which)
Clears all the headers for either page 1 of pages 2...n of this Pageable instance (NOTE: value cannot be changed in Free Trial Version).

Parameters:
which - int = FIRST (1) if page 1, or = REST (0) if pages 2...n.

clearFooters

public void clearFooters()
Clears all the footers for both page 1 and pages 2...n of this Pageable instance.


clearFooters

public void clearFooters(int which)
Clears all the footers for either page 1 of pages 2...n of this Pageable instance.

Parameters:
which - int = FIRST (1) if page 1, or = REST (0) if pages 2...n.

setLeftMargin

public void setLeftMargin(double leftMargin)
Sets desired left margin of this J2Pageable instance in inches from the edge of page (when viewing content). A negative value (e.g., J2Pageable.GLOBAL = -1) means use the J2Printer "global" value. Specifying a negative value also sets the other 3 margins to negative values (i.e. GLOBAL). Specifying a non-negative value sets the other 3 margins to 0.0 if currently negative. Actual margin will not be less than the unprintable left margin (negative means use the "global" J2Printer value).

Parameters:
leftMargin - left margin in inches. Default: GLOBAL

getLeftMargin

public double getLeftMargin()
Returns the left margin of this J2Pageable instance.


setRightMargin

public void setRightMargin(double rightMargin)
Sets desired right margin of this J2Pageable instance in inches from the edge of page (when viewing content). A negative value (e.g., J2Pageable.GLOBAL = -1) means use the J2Printer "global" value. Specifying a negative value also sets the other 3 margins to negative values (i.e. GLOBAL). Specifying a non-negative value sets the other 3 margins to 0.0 if currently negative. Actual margin will not be less than the unprintable right margin.

Parameters:
rightMargin - right margin in inches (negative means use the "global" J2Printer value). Default: GLOBAL

getRightMargin

public double getRightMargin()
Returns the right margin of this J2Pageable instance.


setTopMargin

public void setTopMargin(double topMargin)
Sets desired top margin of this J2Pageable instance in inches from the edge of page (when viewing content). A negative value (e.g., J2Pageable.GLOBAL = -1) means use the J2Printer "global" value. Specifying a negative value also sets the other 3 margins to negative values (i.e. GLOBAL). Specifying a non-negative value sets the other 3 margins to 0.0 if currently negative.

Parameters:
topMargin - top margin above header in inches (negative means use the "global" J2Printer value). Actual margin will not be less than the unprintable top margin. Default: GLOBAL

getTopMargin

public double getTopMargin()
Returns the top margin of this J2Pageable instance.


setBottomMargin

public void setBottomMargin(double bottomMargin)
Sets desired bottom margin of this J2Pageable instance in inches from the edge of page (when viewing content). A negative value (e.g., J2Pageable.GLOBAL = -1) means use the J2Printer "global" value. Specifying a negative value also sets the other 3 margins to negative values (i.e. GLOBAL). Specifying a non-negative value sets the other 3 margins to 0.0 if currently negative. Actual margin will not be less than the unprintable bottom margin.

Parameters:
bottomMargin - bottom margin below footer in inches (negative means use the "global" J2Printer value). Default: GLOBAL

getBottomMargin

public double getBottomMargin()
Returns the bottom margin of this J2Pageable instance.


setGapBelowHeader

public void setGapBelowHeader(double gapBelowHeader)
Sets the gap between the bottom of the header and the top edge of the body of this J2Pageable instance in inches.

Parameters:
gapBelowHeader - gap between the header and top edge of the body (negative means use the "global" J2Printer value). Default -1.0

getGapBelowHeader

public double getGapBelowHeader()
Returns the gap between the header and top edge of the body of this J2Pageable instance in inches.


setGapAboveFooter

public void setGapAboveFooter(double gapAboveFooter)
Sets the gap between the bottom edge of body and the top of the footer of this J2Pageable instance in inches.

Parameters:
gapAboveFooter - gap between the bottom edge of the body and the footer in inches (negative means use the "global" J2Printer value). Default -1.0

getGapAboveFooter

public double getGapAboveFooter()
Returns the gap between the bottom edge of the body and the footer of this J2Pageable instance in inches.


setOrientation

public void setOrientation(int orientation)
Sets page orientation of this J2Pageable instance.

Parameters:
orientation - J2Printer.PORTRAIT or .LANDSCAPE or .REVERSE_LANDSCAPE or .GLOBAL (same as PageFormat.PORTRAIT, etc.). Default: GLOBAL

getOrientation

public int getOrientation()
Returns page orientation of this J2Pageable instance (PORTRAIT, LANDSCAPE, or REVERSE_LANDSCAPE).


setScale

public void setScale(double scale)
Sets magnification or minification scaling factor for printing this J2Pageable.

Parameters:
scale - scaling factor for printing this J2Pageable (Default: GLOBAL)

getScale

public double getScale()
Returns current scaling factor for this J2Pageable.


addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
Add a PropertyChangeListener for this component


removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
Remove a PropertyChangeListener for this component