com.wildcrest.j2printerworks
Class J2PrinterWebStart

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended bycom.wildcrest.j2printerworks.J2Printer
                  extended bycom.wildcrest.j2printerworks.J2PrinterWebStart
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class J2PrinterWebStart
extends J2Printer

J2PrinterWebStart is a J2Printer subclass that enables Java Web Start applications to print one or more Pageables as a single document using the Java JNLP APIs.

Because of limitations in the JNLP API, Java Web Start printing does not support certain capabilities that are supported under regular Java "PrinterJob" printing. In particular, the following capabilities are not supported:

Bacause of the, the following methods inherited from the J2Printer base class have no effect for the J2PrinterWebStart subclass: In addition, cancelPrinting() has no effect if setSeparatePrintThread is false, but does work if setSeparatePrintThread is true, which is the default.

Another limitation of Java Web Start printing is that it is not possible to determine the unprintable margins for a given printer (see Java Bug Parade 4809667). Therefore, unlike the case for the J2Printer base class, the J2PrinterWebStart subclass methods setLeftMargin, setRightMargin, setTopMargin, and setBottomMargin do not protect you from setting margins smaller than the printable area of the page.

(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
 
Fields inherited from class com.wildcrest.j2printerworks.J2Printer
BEFORE, BOTTOM, BOX, CENTER, FIRST, GLOBAL, LANDSCAPE, LEFT, LINE, NEVER, NONE, OUTLINE, PLAIN, PORTRAIT, PPI72, printerJob, printerJobSeparateThread, REST, REVERSE_LANDSCAPE, RIGHT, SHADOW, TOP, WAIT
 
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.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
J2PrinterWebStart()
          Construct a J2PrinterWebStart object with no serial number.
J2PrinterWebStart(java.lang.String serialNum)
          Construct a J2PrinterWebStart object with given serial number.
 
Method Summary
 void cancelPrinting()
          Cancel the current printing job.
 int getNumberOfCopies()
          Since Java Web Start does not have a setCopies method, the getNumberOfCopies method always returns 1
 java.awt.print.PrinterJob getPrinterJob()
          Since Java Web Start does not use PrinterJob, the getPrinterJob method always returns null
 java.lang.String getPrintJobName()
          Since Java Web Start does not have a setJobName method, the getPrintJobName method always returns null
 boolean isPrintDialogUsed()
          Since Java Web Start current does not support printing without a print dialog, the getPrintDialogUsed method always returns true.
 void setNumberOfCopies(int numberOfCopies)
          Since Java Web Start does not have a setCopies method, the setNumberOfCopies method has no effect.
 void setPrintDialogUsed(boolean printDialogUsed)
          Since Java Web Start current does not support printing without a print dialog, the setPrintDialogUsed method has no effect.
 void setPrinterJob(java.awt.print.PrinterJob printerJob)
          Since Java Web Start does not use PrinterJob, the setPrinterJob method has no effect.
 void setPrintJobName(java.lang.String printJobName)
          Since Java Web Start does not have a setJobName method, the setPrintJobName method has no effect.
 
Methods inherited from class com.wildcrest.j2printerworks.J2Printer
addPageable, addPropertyChangeListener, changePrintPreviewLookAndFeel, clearFooters, clearFooters, clearHeaders, clearHeaders, clearPageable, clone, displayPDFFile, dispose, disposePageImageBuffers, fire, getBodyHeight, getBodyWidth, getBottomMargin, getCenterFooter, getCenterFooter, getCenterHeader, getCenterHeader, getCurrentPrintPreviewPageNumber, getCurrentPrintPreviewScale, getException, getFooterFont, getFooterFont, getFooterStyle, getFooterStyle, getGapAboveFooter, getGapBelowHeader, getHeaderFont, getHeaderFont, getHeaderStyle, getHeaderStyle, getLeftFooter, getLeftFooter, getLeftHeader, getLeftHeader, getLeftMargin, getMaximumSize, getMinimumSize, getNup, getOrientation, getPageable, getPageBeingPrinted, getPageFormat, getPageImage, getPageImage, getPageImage, getPageImage, getPageImage, getPaperHeight, getPaperWidth, getParentFrame, getPreferredSize, getPrintPreviewCloseOnPrint, getPrintPreviewPageNumber, getPrintPreviewPageSetupDialog, getPrintPreviewScale, getPrintPreviewString, getPrintPreviewToolBar, getRightFooter, getRightFooter, getRightHeader, getRightHeader, getRightMargin, getScale, getStartingPageNumber, getTopMargin, getVersion, isCrossPlatformDialogs, isCurrentPrintPreviewTwoPageDisplay, isDebug, isPrintDialogResponse, isPrintingUnderway, isPrintPreviewClosed, isPrintPreviewTwoPageDisplay, isSeparatePrintThread, joinPageables, main, makePagePanel, mergePageables, paint, print, print, printPDFFile, printToHTML, printToPDF, printToPDF, printToPDF, printToPDFNoFonts, printToPDFNoFonts, printToPDFNoFonts, refreshPrintPreviewDialog, removePropertyChangeListener, saveImageToJPEG, setBottomMargin, setBusyCursor, setCenterFooter, setCenterFooter, setCenterHeader, setCenterHeader, setDebug, setFooterFont, setFooterFont, setFooterStyle, setFooterStyle, setGapAboveFooter, setGapBelowHeader, setHeaderFont, setHeaderFont, setHeaderStyle, setHeaderStyle, setLeftFooter, setLeftFooter, setLeftHeader, setLeftHeader, setLeftMargin, setNumberOfPageImageBuffers, setNup, setOrientation, setPageable, setPageFormat, setPageImagesMonochrome, setPaperSize, setParam, setParentFrame, setPrintPreviewCloseOnPrint, setPrintPreviewDialogZoomLevels, setPrintPreviewIconImage, setPrintPreviewPageNumber, setPrintPreviewPageSetupDialog, setPrintPreviewScale, setPrintPreviewString, setPrintPreviewTwoPageDisplay, setRightFooter, setRightFooter, setRightHeader, setRightHeader, setRightMargin, setScale, setSeparatePrintThread, setStartingPageNumber, setTopMargin, showPageSetupDialog, showPageSetupDialog, showPrintPreviewDialog, showPrintPreviewDialog, showPrintPreviewDialog, showPrintPreviewDialog, showPrintPreviewPageSetupButton
 
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, setLocale, 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

J2PrinterWebStart

public J2PrinterWebStart()
Construct a J2PrinterWebStart object with no serial number.


J2PrinterWebStart

public J2PrinterWebStart(java.lang.String serialNum)
Construct a J2PrinterWebStart object with given serial number.

Method Detail

cancelPrinting

public void cancelPrinting()
Cancel the current printing job. This cancels the Java imaging for the current Pageable, but does not cancel the actual printing once the output has been spooled to the OS. NOTE: Because JNLP does not presently support a cancel method, this method has no effect if you have called setSeparatePrintThread(false)

Overrides:
cancelPrinting in class J2Printer

setPrinterJob

public void setPrinterJob(java.awt.print.PrinterJob printerJob)
Since Java Web Start does not use PrinterJob, the setPrinterJob method has no effect.

Overrides:
setPrinterJob in class J2Printer
Parameters:
printerJob - PrinterJob to use for printing. PrinterJob instance will also be used to set the number of copies and print job name. If null, the default printer will be used, with 1 copy, and job name "J2PrinterWorks print document".

getPrinterJob

public java.awt.print.PrinterJob getPrinterJob()
Since Java Web Start does not use PrinterJob, the getPrinterJob method always returns null

Overrides:
getPrinterJob in class J2Printer

setPrintJobName

public void setPrintJobName(java.lang.String printJobName)
Since Java Web Start does not have a setJobName method, the setPrintJobName method has no effect.

Overrides:
setPrintJobName in class J2Printer
Parameters:
printJobName - String is ignored

getPrintJobName

public java.lang.String getPrintJobName()
Since Java Web Start does not have a setJobName method, the getPrintJobName method always returns null

Overrides:
getPrintJobName in class J2Printer

setNumberOfCopies

public void setNumberOfCopies(int numberOfCopies)
Since Java Web Start does not have a setCopies method, the setNumberOfCopies method has no effect.

Overrides:
setNumberOfCopies in class J2Printer
Parameters:
numberOfCopies - is ignored

getNumberOfCopies

public int getNumberOfCopies()
Since Java Web Start does not have a setCopies method, the getNumberOfCopies method always returns 1

Overrides:
getNumberOfCopies in class J2Printer

setPrintDialogUsed

public void setPrintDialogUsed(boolean printDialogUsed)
Since Java Web Start current does not support printing without a print dialog, the setPrintDialogUsed method has no effect.

Overrides:
setPrintDialogUsed in class J2Printer
Parameters:
printDialogUsed - boolean is ignored

isPrintDialogUsed

public boolean isPrintDialogUsed()
Since Java Web Start current does not support printing without a print dialog, the getPrintDialogUsed method always returns true.

Overrides:
isPrintDialogUsed in class J2Printer