public abstract class ViewerCanvas extends javax.swing.JComponent implements IViewerCanvas, Zoomable, java.io.Serializable
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW| Constructor and Description |
|---|
ViewerCanvas() |
| Modifier and Type | Method and Description |
|---|---|
void |
addChangeListener(javax.swing.event.ChangeListener cl)
Register interest in changes to the viewer.
|
void |
first()
Go to the first page
|
java.awt.Paint |
getBackgroundColor()
Get the current background colour of the viewer.
|
javax.swing.JComponent |
getCanvasComponent()
Get the component that shows the view.
|
java.awt.Dimension |
getMaximumSize() |
java.awt.Dimension |
getMinimumSize() |
abstract int |
getPageCount()
Get the number of pages in the model
|
int |
getPageNo()
Get the current page number
|
java.awt.Dimension |
getPreferredSize() |
int |
getZoomPercent()
Get the zoom percent
|
boolean |
gotoPage(int index)
Go to a specific page.
|
boolean |
isBitmapZoom()
Returns whether bitmap zoom is enabled
|
void |
last()
Go to the last page
|
boolean |
next()
Go to the next page
|
void |
paintComponent(java.awt.Graphics g) |
boolean |
previous()
Go to the previous page
|
void |
read(java.io.File f)
Read the model from a file
|
abstract void |
read(java.io.InputStream is)
Read the model from a stream
|
void |
removeChangeListener(javax.swing.event.ChangeListener cl)
Remove the change listener
|
void |
setBackgroundColor(java.awt.Paint c)
Set the background colour of the viewer - this is the area behind
any pages, so it defaults to grey, so you can see the page boundaries.
|
void |
setBitmapZoom(boolean b)
Determine whether zoom should be bitmap scaling.
|
abstract void |
setObject(java.lang.Object o)
Set an object as the model for the viewer.
|
void |
setPageNo(int no)
Show a specific page (in the range 1<=no<=getPageCount())
|
void |
setZoomPercent(int zoom)
Set the zoom percent
|
abstract void |
update()
Recalculates the dimensions of the view and repaints.
|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUIadd, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validateaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCyclepublic void addChangeListener(javax.swing.event.ChangeListener cl)
IViewerCanvasaddChangeListener in interface IViewerCanvascl - The change listenerpublic void removeChangeListener(javax.swing.event.ChangeListener cl)
IViewerCanvasremoveChangeListener in interface IViewerCanvascl - The change listenerpublic abstract void setObject(java.lang.Object o)
IViewerCanvassetObject in interface IViewerCanvaso - The object to viewpublic abstract void read(java.io.InputStream is)
throws java.io.IOException
IViewerCanvasread in interface IViewerCanvasis - The input streamjava.io.IOException - if the stream is invalid for this viewerpublic abstract void update()
IViewerCanvasupdate in interface IViewerCanvaspublic abstract int getPageCount()
IViewerCanvasgetPageCount in interface IViewerCanvasgetPageCount in interface com.elixirtech.ui.INavigationpublic void read(java.io.File f)
throws java.io.IOException
IViewerCanvasread in interface IViewerCanvasf - The file to readjava.io.IOException - if the file is invalid for this viewer, or doesn't existpublic void setZoomPercent(int zoom)
ZoomablesetZoomPercent in interface Zoomablezoom - A value 1 to 100 will zoom out, >100 will zoom in.public int getZoomPercent()
ZoomablegetZoomPercent in interface Zoomablepublic void setBitmapZoom(boolean b)
ZoomablesetBitmapZoom in interface Zoomableb - True to enable bitmap zoomspublic boolean isBitmapZoom()
ZoomableisBitmapZoom in interface Zoomablepublic void setBackgroundColor(java.awt.Paint c)
c - The new background colorpublic java.awt.Paint getBackgroundColor()
public void setPageNo(int no)
IViewerCanvassetPageNo in interface IViewerCanvasno - The page to show (1-based)public int getPageNo()
IViewerCanvasgetPageNo in interface IViewerCanvasgetPageNo in interface com.elixirtech.ui.INavigationpublic java.awt.Dimension getPreferredSize()
getPreferredSize in class javax.swing.JComponentpublic java.awt.Dimension getMinimumSize()
getMinimumSize in class javax.swing.JComponentpublic java.awt.Dimension getMaximumSize()
getMaximumSize in class javax.swing.JComponentpublic javax.swing.JComponent getCanvasComponent()
IViewerCanvasgetCanvasComponent in interface IViewerCanvaspublic void paintComponent(java.awt.Graphics g)
paintComponent in class javax.swing.JComponentpublic void first()
first in interface com.elixirtech.ui.INavigationpublic boolean previous()
previous in interface com.elixirtech.ui.INavigationpublic boolean next()
next in interface com.elixirtech.ui.INavigationpublic void last()
last in interface com.elixirtech.ui.INavigationpublic boolean gotoPage(int index)
gotoPage in interface com.elixirtech.ui.INavigationindex - The page number (1-based)