|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent com.wildcrest.j2printerworks.J2Pageable com.wildcrest.j2printerworks.J2FlowPrinter
A Java 2 component for printing one or more Flowables back-to-back either as a Pageable (starting and
ending on page boundaries) or as a Flowable (which can be printed back-to-back with other Flowables).
This component allows you to construct complex documents made up of a series of any of
the J2PrinterWorks printing components, such as a rich text document made up of JTextPanes,
interspersed with instances of JTable, JTree, JList, or JPanel (including Images or drawings),
each with their own titles and captions.
This feature also allows the J2PrinterWorks subset products such as the J2PrinterWorks Table Edition to
print more than one table in a document and to surround these
with titles, captions, and other smaller content.
The only restriction on the use of J2FlowPrinter is that the same Flowable instance
cannot appear twice in the same J2FlowPrinter instance. If you need to do this,
use the J2Printer clone method (or your own means) to create a duplicate copy of such a Flowable.
Since J2FlowPrinter is itself a Flowable, J2FlowPrinter instances can be nested.
(C) Copyright 2009, Wildcrest Associates (http://www.wildcrest.com). All rights reserved.
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 |
Fields inherited from class com.wildcrest.j2printerworks.J2Pageable |
BOTTOM, BOX, CENTER, FIRST, GLOBAL, LANDSCAPE, LEFT, LINE, NONE, PORTRAIT, PPI72, REST, REVERSE_LANDSCAPE, RIGHT, TOP |
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 | |
J2FlowPrinter()
Construct a J2FlowPrinter object (no Flowables specified) |
|
J2FlowPrinter(Flowable flowable)
Construct a J2FlowPrinter object for a single Flowable. |
|
J2FlowPrinter(java.util.Vector flowables)
Construct a J2FlowPrinter object for a Vector of Flowables. |
Method Summary | |
java.util.Vector |
addFlowable(Flowable flowable)
Add a single Flowable to this J2FlowPrinter's current list of Flowables and return result. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener l)
Add a PropertyChangeListener for this component |
void |
clearFlowables()
Clear this J2FlowPrinter's current list of Flowables. |
void |
dispose()
Release all heap objects created by this J2FlowPrinter object, must not call until printing completes. |
boolean |
doneX()
Returns whether there is no more of this Flowable object to print horizontally. |
boolean |
doneY()
Returns whether there is no more of this Flowable object to print vertically. |
java.util.Vector |
getFlowables()
Get this J2FlowPrinter's current list of Flowables as a Vector of Flowables. |
void |
printFlowable(java.awt.Graphics g,
int availableWidth,
int availableHeight,
int nextFullPageWidth,
int nextFullPageHeight)
Print the next sequential section of this Flowable object that fits into the next incremental area. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener l)
Remove a PropertyChangeListener for this component |
void |
resetFlowable()
Reset the Flowable object so that it starts printing from the beginning. |
java.util.Vector |
setFlowable(Flowable flowable)
Set this J2FlowPrinter's current list of Flowables to a single Flowable and return result. |
void |
setFlowables(java.util.Vector flowables)
Set this J2FlowPrinter's current list of Flowables. |
int |
usedX()
Returns the amount this Flowable object was able to advance horizontally in the last printFlowable call. |
int |
usedY()
Returns the amount this Flowable object was able to advance vertically in the last printFlowable call. |
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 |
Constructor Detail |
public J2FlowPrinter(java.util.Vector flowables)
flowables
- Vector of Flowablespublic J2FlowPrinter(Flowable flowable)
flowable
- Flowable to be used.public J2FlowPrinter()
Method Detail |
public void setFlowables(java.util.Vector flowables)
flowables
- Vector of Flowablespublic java.util.Vector getFlowables()
public void clearFlowables()
public java.util.Vector addFlowable(Flowable flowable)
flowable
- Flowable to be addedpublic java.util.Vector setFlowable(Flowable flowable)
flowable
- Flowable to be used.public void dispose()
dispose
in class J2Pageable
public void printFlowable(java.awt.Graphics g, int availableWidth, int availableHeight, int nextFullPageWidth, int nextFullPageHeight)
Flowable
g
- context into which the page is to be drawn (null means advance but don't actually print)availableWidth
- horizontal amount into which the next sequential amount of this Flowable is to be printed.availableHeight
- vertical amount into which the next sequential amount of this Flowable is to be printed.nextFullPageWidth
- horizontal size of next full page (lets Flowables decide whether to opt for next page).nextFullPageHeight
- vertical size of next full page (lets Flowables decide whether to opt for next page).
The above parameters specify a rectangular area of size width by height (height = down the page) in pixels (72 dpi printing "points"). A Flowable object is assumed to print in "raster" order (over then down). Assumes upon entry that translation and scale are already set up so that 0,0 is the upper left corner to print and width and height are already increased by the overall printer scale. Flowable object must return Graphics context translation and scale to values at entry if changed during printing. Upon return from printFlowable, the doneX, doneY, usedX, and usedY methods describe the resulting state of the Flowable, based on its ability to make progress. Return values of usedX and usedY are to be specified in same scale as availableWidth and availableHeight were given.
public int usedX()
Flowable
public int usedY()
Flowable
public boolean doneX()
Flowable
public boolean doneY()
Flowable
public void resetFlowable()
Flowable
public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
addPropertyChangeListener
in class J2Pageable
public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
removePropertyChangeListener
in class J2Pageable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |