Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

gnu.javax.print
Class PrinterDialog  view PrinterDialog download PrinterDialog.java

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Window
              extended byjava.awt.Dialog
                  extended byjavax.swing.JDialog
                      extended bygnu.javax.print.PrinterDialog
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.RootPaneContainer, java.io.Serializable, javax.swing.WindowConstants

public final class PrinterDialog
extends javax.swing.JDialog
implements java.awt.event.ActionListener

Implementation of the PrinterDialog used by javax.print.ServiceUI for visual selection of print services and its attributes.


Nested Class Summary
(package private)  class PrinterDialog.AppearancePanel
          The Appearance panel for quality, color etc.
(package private)  class PrinterDialog.GeneralPanel
          The General Panel used in the printing dialog.
(package private)  class PrinterDialog.PageSetupPanel
          The Page setup Panel.
 
Nested classes inherited from class javax.swing.JDialog
javax.swing.JDialog.AccessibleJDialog
 
Nested classes inherited from class java.awt.Dialog
java.awt.Dialog.AccessibleAWTDialog
 
Nested classes inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
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
private  PrinterDialog.AppearancePanel appearance_panel
           
private  javax.print.attribute.PrintRequestAttributeSet attributes
           
private  javax.print.attribute.PrintRequestAttributeSet atts
           
private  javax.swing.JButton cancel_bt
           
private  javax.print.PrintService defaultService
           
private  javax.print.DocFlavor flavor
           
private  PrinterDialog.GeneralPanel general_panel
           
private static java.util.ResourceBundle messages
           
private  javax.swing.JButton ok_bt
           
private  boolean onlyPageDialog
           
private  PrinterDialog.PageSetupPanel pagesetup_panel
           
private  javax.print.PrintService selectedService
           
private  javax.print.PrintService[] services
           
 
Fields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Dialog
 
Fields inherited from class java.awt.Window
 
Fields inherited from class java.awt.Container
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
  PrinterDialog(java.awt.GraphicsConfiguration gc, javax.print.PrintService[] services, javax.print.PrintService defaultService, javax.print.DocFlavor flavor, javax.print.attribute.PrintRequestAttributeSet attributes)
          Constructs a printer dialog.
private PrinterDialog(java.awt.GraphicsConfiguration gc, javax.print.PrintService[] services, javax.print.PrintService defaultService, javax.print.DocFlavor flavor, javax.print.attribute.PrintRequestAttributeSet attributes, boolean onlyPageDialog, java.lang.String title)
          Class private constructs a printer dialog.
  PrinterDialog(java.awt.GraphicsConfiguration gc, javax.print.PrintService service, javax.print.DocFlavor flavor, javax.print.attribute.PrintRequestAttributeSet attributes)
          Constructs a page settings only dialog.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Action handler for Print/Cancel buttons.
(package private)  javax.print.attribute.Attribute attribute(java.lang.Class category)
           
(package private)  boolean categorySupported(java.lang.Class category)
           
(package private)  java.lang.Object defaultValue(java.lang.Class category)
           
 javax.print.attribute.PrintRequestAttributeSet getAttributes()
          Returns the modified attributes set.
(package private) static java.lang.String getLocalizedString(java.lang.String key)
          Retrieves localized messages from the resource bundle.
protected  javax.print.PrintService[] getPrintServices()
          Returns the print service array.
 javax.print.PrintService getSelectedPrintService()
          Returns the print service selected by the user.
private  void initUI(boolean onlyPageDialog)
           
protected  void setSelectedPrintService(javax.print.PrintService service)
          Sets the currently selected print service.
(package private)  void updateAll()
          Calls update on all panels to adjust for a new selected print service.
 
Methods inherited from class javax.swing.JDialog
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getPreferredSize, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Dialog
addNotify, dispose, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setResizable, setTitle, setUndecorated, show
 
Methods inherited from class java.awt.Window
addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getGraphicsConfiguration, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ok_bt

private javax.swing.JButton ok_bt

cancel_bt

private javax.swing.JButton cancel_bt

general_panel

private PrinterDialog.GeneralPanel general_panel

pagesetup_panel

private PrinterDialog.PageSetupPanel pagesetup_panel

appearance_panel

private PrinterDialog.AppearancePanel appearance_panel

services

private javax.print.PrintService[] services

defaultService

private javax.print.PrintService defaultService

selectedService

private javax.print.PrintService selectedService

flavor

private javax.print.DocFlavor flavor

attributes

private javax.print.attribute.PrintRequestAttributeSet attributes

onlyPageDialog

private boolean onlyPageDialog

atts

private javax.print.attribute.PrintRequestAttributeSet atts

messages

private static final java.util.ResourceBundle messages
Constructor Detail

PrinterDialog

private PrinterDialog(java.awt.GraphicsConfiguration gc,
                      javax.print.PrintService[] services,
                      javax.print.PrintService defaultService,
                      javax.print.DocFlavor flavor,
                      javax.print.attribute.PrintRequestAttributeSet attributes,
                      boolean onlyPageDialog,
                      java.lang.String title)
               throws java.awt.HeadlessException
Class private constructs a printer dialog.


PrinterDialog

public PrinterDialog(java.awt.GraphicsConfiguration gc,
                     javax.print.PrintService service,
                     javax.print.DocFlavor flavor,
                     javax.print.attribute.PrintRequestAttributeSet attributes)
              throws java.awt.HeadlessException
Constructs a page settings only dialog.


PrinterDialog

public PrinterDialog(java.awt.GraphicsConfiguration gc,
                     javax.print.PrintService[] services,
                     javax.print.PrintService defaultService,
                     javax.print.DocFlavor flavor,
                     javax.print.attribute.PrintRequestAttributeSet attributes)
              throws java.awt.HeadlessException
Constructs a printer dialog.

Method Detail

initUI

private void initUI(boolean onlyPageDialog)

getAttributes

public javax.print.attribute.PrintRequestAttributeSet getAttributes()
Returns the modified attributes set.


getSelectedPrintService

public javax.print.PrintService getSelectedPrintService()
Returns the print service selected by the user.


setSelectedPrintService

protected void setSelectedPrintService(javax.print.PrintService service)
Sets the currently selected print service.


getPrintServices

protected javax.print.PrintService[] getPrintServices()
Returns the print service array.


updateAll

void updateAll()
Calls update on all panels to adjust for a new selected print service.


categorySupported

boolean categorySupported(java.lang.Class category)

defaultValue

java.lang.Object defaultValue(java.lang.Class category)

attribute

javax.print.attribute.Attribute attribute(java.lang.Class category)

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Action handler for Print/Cancel buttons. If cancel is pressed we reset the attributes and the selected service.

Specified by:
actionPerformed in interface java.awt.event.ActionListener

getLocalizedString

static final java.lang.String getLocalizedString(java.lang.String key)
Retrieves localized messages from the resource bundle.