|
|||||||||
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
com.elixirtech.glint.viewer.ViewerCanvas
public abstract class ViewerCanvas
The abstract implementation of IViewerCanvas that provides a common infrastructure independent of the model being viewed.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.BaselineResizeBehavior |
Field Summary |
---|
Fields inherited from class javax.swing.JComponent |
---|
TOOL_TIP_TEXT_KEY, 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 | |
---|---|
ViewerCanvas()
|
Method Summary | |
---|---|
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. |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, 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, 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, updateUI |
Methods inherited from class java.awt.Container |
---|
add, 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, transferFocusBackward, transferFocusDownCycle, validate |
Methods inherited from class java.awt.Component |
---|
action, 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, 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, hide, 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, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ViewerCanvas()
Method Detail |
---|
public void addChangeListener(javax.swing.event.ChangeListener cl)
IViewerCanvas
addChangeListener
in interface IViewerCanvas
cl
- The change listenerpublic void removeChangeListener(javax.swing.event.ChangeListener cl)
IViewerCanvas
removeChangeListener
in interface IViewerCanvas
cl
- The change listenerpublic abstract void setObject(java.lang.Object o)
IViewerCanvas
setObject
in interface IViewerCanvas
o
- The object to viewpublic abstract void read(java.io.InputStream is) throws java.io.IOException
IViewerCanvas
read
in interface IViewerCanvas
is
- The input stream
java.io.IOException
- if the stream is invalid for this viewerpublic abstract void update()
IViewerCanvas
update
in interface IViewerCanvas
public abstract int getPageCount()
IViewerCanvas
getPageCount
in interface IViewerCanvas
getPageCount
in interface com.elixirtech.ui.INavigation
public void read(java.io.File f) throws java.io.IOException
IViewerCanvas
read
in interface IViewerCanvas
f
- The file to read
java.io.IOException
- if the file is invalid for this viewer, or doesn't existpublic void setZoomPercent(int zoom)
Zoomable
setZoomPercent
in interface Zoomable
zoom
- A value 1 to 100 will zoom out, >100 will zoom in.public int getZoomPercent()
Zoomable
getZoomPercent
in interface Zoomable
public void setBitmapZoom(boolean b)
Zoomable
setBitmapZoom
in interface Zoomable
b
- True to enable bitmap zoomspublic boolean isBitmapZoom()
Zoomable
isBitmapZoom
in interface Zoomable
public void setBackgroundColor(java.awt.Paint c)
c
- The new background colorpublic java.awt.Paint getBackgroundColor()
public void setPageNo(int no)
IViewerCanvas
setPageNo
in interface IViewerCanvas
no
- The page to show (1-based)public int getPageNo()
IViewerCanvas
getPageNo
in interface IViewerCanvas
getPageNo
in interface com.elixirtech.ui.INavigation
public java.awt.Dimension getPreferredSize()
getPreferredSize
in class javax.swing.JComponent
public java.awt.Dimension getMinimumSize()
getMinimumSize
in class javax.swing.JComponent
public java.awt.Dimension getMaximumSize()
getMaximumSize
in class javax.swing.JComponent
public javax.swing.JComponent getCanvasComponent()
IViewerCanvas
getCanvasComponent
in interface IViewerCanvas
public void paintComponent(java.awt.Graphics g)
paintComponent
in class javax.swing.JComponent
public void first()
first
in interface com.elixirtech.ui.INavigation
public boolean previous()
previous
in interface com.elixirtech.ui.INavigation
public boolean next()
next
in interface com.elixirtech.ui.INavigation
public void last()
last
in interface com.elixirtech.ui.INavigation
public boolean gotoPage(int index)
gotoPage
in interface com.elixirtech.ui.INavigation
index
- The page number (1-based)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |