|
ReportCat 1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
li.netcat.print.PreviewPanel
Defaut implementation of a print preview panel. This panel can be used to visualize one page
of a Print
. If more than one PreviewPanel
is used to view different pages of the same Print
,
make shure that all PreviewPanel
s use the same PrintManager
as it's model.
This implementation allows the user to modify the print margins interactively.
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 |
MODE_HEAVY
Defines the mode of interactivity to "heavy", i.e. the layout is done during the drag operation. |
static int |
MODE_LIGHT
Defines the mode of interactivity to "light", i.e. the layout is done only once after the drag operation. |
static int |
MODE_NONE
Defines the mode of interactivity to "none", i.e. the borders cannot be modified interactively. |
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 | |
PreviewPanel(Print print)
Constructs a new PreviewPanel using the given Print . |
|
PreviewPanel(PrintManager printManager)
Constructs a new PreviewPanel using the given PrintManager . |
Method Summary | |
void |
doLayout()
|
java.awt.Dimension |
getMinimumSize()
|
java.awt.Dimension |
getPreferredSize()
|
PrintManager |
getPrintManager()
Returns the PrintManager associated with this preview. |
java.awt.Color |
getResizeBorderColor()
Returns the color of the resize border. |
double |
getZoom()
Returns the current zoom value. |
void |
nextPage()
Increments the pageIndex by 1. |
void |
paint(java.awt.Graphics g)
|
protected void |
paintEmptyPage(java.awt.Graphics g,
int width,
int height,
int paperX,
int paperY,
int paperWidth,
int paperHeight)
Override this method for a custom look. |
protected void |
paintNoPage(java.awt.Graphics g,
int width,
int height,
int paperX,
int paperY,
int paperWidth,
int paperHeight)
Override this method for a custom look. |
void |
previousPage()
Decrements the pageIndex by 1. |
void |
setAutoPageIndex(boolean b)
If autoPageIndex is set to true (default), the pageIndex is automatically set to the
last page of the report if the report has less pages than the current value of pageIndex. |
void |
setBounds(int x,
int y,
int width,
int height)
|
void |
setPageIndex(int index)
Sets the index of the current page to be displayed. |
void |
setResizeBorderColor(java.awt.Color color)
Sets the color of the resize border. |
void |
setResizeMode(int mode)
Sets the resize mode. |
void |
setZoom(double zoom)
Sets the current zoon value. |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, 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, getMaximumSize, 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, 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, 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, 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 |
Field Detail |
public static int MODE_NONE
public static int MODE_LIGHT
public static int MODE_HEAVY
Constructor Detail |
public PreviewPanel(Print print)
PreviewPanel
using the given Print
.
print
- The Print
to be previewed, might be null
.public PreviewPanel(PrintManager printManager)
PreviewPanel
using the given PrintManager
.
printManager
- The PrintManager
used for layouting, must not be null
.Method Detail |
public PrintManager getPrintManager()
PrintManager
associated with this preview. Use the manager to modify
layout specific properties like the PageFormat
.
PrintManager
associated with this preview, is never null.public void nextPage()
public void previousPage()
public void setPageIndex(int index)
index
- The index of the pageto be displayed, the first page has an index of 0.public void setAutoPageIndex(boolean b)
true
(default), the pageIndex is automatically set to the
last page of the report if the report has less pages than the current value of pageIndex.
b
- The new value of the autoPageIndex property.public void setResizeMode(int mode)
mode
- One of the values MODE_*
.public java.awt.Color getResizeBorderColor()
public void setResizeBorderColor(java.awt.Color color)
color
- The color of the resize border or null
, if no border should be painted.public double getZoom()
public void setZoom(double zoom)
zoom
- The new zoom value.protected void paintNoPage(java.awt.Graphics g, int width, int height, int paperX, int paperY, int paperWidth, int paperHeight)
g
- The Graphics
object.width
- The width of the panel.height
- The height of the panel.paperX
- The x offset of the paper.paperY
- The y offset of the paper.paperWidth
- The width of the paper.paperHeight
- The height of the paper.protected void paintEmptyPage(java.awt.Graphics g, int width, int height, int paperX, int paperY, int paperWidth, int paperHeight)
g
- The Graphics
object.width
- The width of the panel.height
- The height of the panel.paperX
- The x offset of the paper.paperY
- The y offset of the paper.paperWidth
- The width of the paper.paperHeight
- The height of the paper.public java.awt.Dimension getMinimumSize()
public java.awt.Dimension getPreferredSize()
public void setBounds(int x, int y, int width, int height)
public void doLayout()
public void paint(java.awt.Graphics g)
|
ReportCat 1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |