ach
Class ImagePanel

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Panel
              extended byach.ImagePanel
All Implemented Interfaces:
javax.accessibility.Accessible, AnnotationSaver, BatchPrinter, java.awt.image.ImageObserver, ImgProdObserver, java.awt.MenuContainer, Scrollable, java.io.Serializable, ToolbarController

public class ImagePanel
extends java.awt.Panel
implements ImgProdObserver, BatchPrinter, ToolbarController, Scrollable, AnnotationSaver

ImagePanel.java
Copyright (C) 1997-2010 H. Hackbarth, All Rights Reserved
Panel used as container to display images. Contains scrollbars and several display control buttons. For examples how to use this class please refer to TiffyApplet.java and SwingTiffy.java. Parameter options can be found in method parseOptions(). ImagePanel embeds either the heavyweight class ImgCanvas or the lightweight class ImgComponent to handle the image display. The code contains remarks (search for "lightweight") how to do the required replacements.

THE AUTHOR MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. THE AUTHOR SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
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
 java.awt.Color bgColor
           
 boolean bottomtoolbar
           
 boolean frameUpdated
          flag needed due to bug in MS VM version 2334; see example SwingTiffy.java
static int SETPAGENUMEVTID
           
 
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
ImagePanel(java.awt.Container parent, byte[] imgFileBA, java.lang.String options, boolean showButtonPanel)
          constructor for ImagePanel (image passed as ByteArray)
ImagePanel(java.awt.Container parent, java.awt.Image img, java.lang.String options, boolean showButtonPanel)
          constructor for ImagePanel (image passed as java.awt.Image)
ImagePanel(java.awt.Container parent, java.lang.String name, java.lang.String options, boolean showButtonPanel)
          constructor for ImagePanel (image names passed as String)
ImagePanel(java.awt.Container parent, java.net.URL context, java.lang.String options, boolean showButtonPanel)
          constructor for ImagePanel (image names passed as URL)
 
Method Summary
 boolean action(java.awt.Event evt, java.lang.Object arg)
          The action handler should not be necessary as all events should be handled already by handleEvent()
 void addAnnotationsControl(java.awt.Component c)
          a component specified here will be enabled/disabled depending if annotations exist beside the image
 void addNextPageControl(java.awt.Component c)
          a component specified here will be enabled/disabled depending if there is a "next page" in the list of multiple images
 void addPauseControl(java.awt.Component c)
          a component specified here will be controlled depending on the playState
 void addPlayControl(java.awt.Component c)
          a component specified here will be controlled depending on the playState
 void addPrevPageControl(java.awt.Component c)
          a component specified here will be enabled/disabled depending if there is a "previous page" in the list of multiple images
 void addPrintControl(java.awt.Component c)
          a component specified here will be enabled/disabled depending printing of the image is enabled
 void addPrintViewControl(java.awt.Component c)
          a component specified here will be enabled/disabled depending printing of the viewable part of the image is enabled
 void addSaveControl(java.awt.Component c)
          a component specified here will be enabled/disabled depending saving of the image is enabled
 void addScaleSmoothControl(java.awt.Component c)
          a component specified here will be enabled/disabled depending on the state of btnScaleSmooth
 void addThumbnailsControl(java.awt.Component c)
          a component specified here will be enabled/disabled depending if a thumbnail preview is displayed
 void batchPrint(java.lang.Object printJob, int preferredResolution, java.lang.String printPageSelection)
          Print all slides of a slide sequence and/or all pages of a multipage TIFF either to a PrintJob (JDK 1.1) or PrinterJob (Java 2) (one of them must be not null).
 void cleanUp()
          Clean up code to free all ressources that may be used by this component
 void fitHoriz()
          scale image to fit into the window horizontally
 void fitInWindow()
          scale image to fit into the window completely
 boolean flip()
          flip image vertically
 java.lang.String getAnnotations(boolean resetModifiedState)
          Get currently loaded / edited annotations.
 int getPageNum()
          ToolbarController: get text of PageNum TextField converted to int
 double getZoomFactor(double defaultZoom)
          ToolbarController: get zoom factor from zoom TextField
 boolean handleEvent(java.awt.Event evt)
          The handleEvent() method receives all events generated within the frame window.
 void imageProducerUpdate(java.awt.image.ImageProducer imgSrc, java.lang.String errorMsg, ImageInfo imgInfo)
          The createImageProducer() method of class ImageInfo works asynchronously and will call the imageProducerUpdate method of an ImgProdObserver (implemented by this viewer class!).
 boolean imageUpdate(java.awt.Image img, int flags, int x, int y, int w, int h)
          Callback function to monitor image drawing process will be called several times during drawImage (why not called in JDK 1.1?)
 boolean invert()
          invert image
 void loadImage(ImageInfo imgInfo)
          Comfortable method to load image (using format autodection); runs createImageProducer() and asynchronously calls back imageProducerUpdate() which finally calls showPanel() to display the image.
 boolean mirror()
          mirror image horizontally
 boolean navigation()
          show navigation frame ("grabber hand")
 void paint(java.awt.Graphics g)
          Paint Handler of this component
 boolean printCurrentView(boolean asynchronousFlag)
          Open print dialog and start printing the current viisible area of the image
 boolean printImage(boolean asynchronousFlag)
          Open print dialog and start printing the current image
 boolean rotate090()
          rotate image by 90 degree
 boolean rotate180()
          rotate image by 180 degree
 boolean rotate270()
          rotate image by 270 degree
 void saveAnnotations()
          Default implementation of the AnnotationSaver interface to save current annotations.
 void scheduleSetPage(int page)
           
 void scrollAbs(int x, int y)
          Implementation of Scrollable interface
 void selectInfo(java.lang.Object target)
           
 void setAnnotations(java.lang.String annotations)
          Set (or replace current) annotations and refresh display.
 void setAnnotationSaver(AnnotationSaver as)
          Replace default AnnotationSaver implementation with your own implementation.
 boolean setNextPage()
          for multi-document images step forward to next page for a slide sequence increment slide index
 void setNumPagesText(int numPages)
          ToolbarController: set text of numPages Label to number of pages
 boolean setPageNum(int pageNum)
          for multi-document images step to indicated page for a slide sequence set slide index to indicated slide
 void setPageNumText(int pageNum)
          ToolbarController: set text of PageNum TextField to page number
 boolean setPreviousPage()
          for multi-document images step back to previous page for a slide sequence decrement slide index
 void setToolbarController(ToolbarController tbc)
          Set implementation to be used according to ToolbarController interface
 void setZoomText(double zoomFactor)
          ToolbarController: set text of zoom TextField to zoomFactor (update only if current text is different to avoid unnecessary repaints)
 void showInfo()
          show help file with key map
 void showKeyHelp()
          show help file with key map
 void toggleAnnotations()
          toggle display of annotations
 void togglePlayState()
          Toggle player's state between "play" and "pause"
 void toggleSmoothScaling()
          toggle smooth scaling (antialiasing)
 void toggleThumbnails()
          Toggle display of thumbnail preview
 void update(java.awt.Graphics g)
          Override component's update method to suppress clearing of the screen
 void updatePageNum()
          update pageNum text field and numpages label for a slide sequence set pageNum to slide index for a multi-document image set pageNum to page index
 void zoom(double zoom)
          set free defined zoom factor and calulate new image offset for centered image
 void zoom1To1()
          set 1:1 view (zoom factor 1) and calulate new image offset for centered image
 void zoomIn()
          increase zoom factor and calulate new image offset for centered image
 void zoomOut()
          decrease zoom factor and calulate new image offset for centered image
 
Methods inherited from class java.awt.Panel
addNotify, getAccessibleContext
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
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, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, hasFocus, hide, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, 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, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, 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

frameUpdated

public boolean frameUpdated
flag needed due to bug in MS VM version 2334; see example SwingTiffy.java


SETPAGENUMEVTID

public static final int SETPAGENUMEVTID
See Also:
Constant Field Values

bgColor

public java.awt.Color bgColor

bottomtoolbar

public boolean bottomtoolbar
Constructor Detail

ImagePanel

public ImagePanel(java.awt.Container parent,
                  java.net.URL context,
                  java.lang.String options,
                  boolean showButtonPanel)
constructor for ImagePanel (image names passed as URL)

Parameters:
parent - is the container where this component is to be embedded
options - String with display control options (please refer to TiffyAppletDoc.html)
showButtonPanel - flag controls if the (AWT-based) button panel should be displayd

ImagePanel

public ImagePanel(java.awt.Container parent,
                  java.lang.String name,
                  java.lang.String options,
                  boolean showButtonPanel)
constructor for ImagePanel (image names passed as String)

Parameters:
parent - is the container where this component is to be embedded
name - holds the pathname(s) of the image(s) to be displayed (separated by semicolon)
options - String with display control options (please refer to TiffyAppletDoc.html)
showButtonPanel - flag controls if the (AWT-based) button panel should be displayd

ImagePanel

public ImagePanel(java.awt.Container parent,
                  byte[] imgFileBA,
                  java.lang.String options,
                  boolean showButtonPanel)
constructor for ImagePanel (image passed as ByteArray)

Parameters:
parent - is the container where this component is to be embedded
imgFileBA - holds the ByteArray containing the image file (currently only TIFF, JPG, GIF)
options - String with display control options (please refer to TiffyAppletDoc.html)
showButtonPanel - flag controls if the (AWT-based) button panel should be displayd

ImagePanel

public ImagePanel(java.awt.Container parent,
                  java.awt.Image img,
                  java.lang.String options,
                  boolean showButtonPanel)
constructor for ImagePanel (image passed as java.awt.Image)

Parameters:
parent - is the container where this component is to be embedded
img - holds the image to be displayed
options - String with display control options (please refer to TiffyAppletDoc.html)
showButtonPanel - flag controls if the (AWT-based) button panel should be displayd
Method Detail

addSaveControl

public void addSaveControl(java.awt.Component c)
a component specified here will be enabled/disabled depending saving of the image is enabled

Parameters:
c - Component to be controlled

addPrintControl

public void addPrintControl(java.awt.Component c)
a component specified here will be enabled/disabled depending printing of the image is enabled

Parameters:
c - Component to be controlled

addPrintViewControl

public void addPrintViewControl(java.awt.Component c)
a component specified here will be enabled/disabled depending printing of the viewable part of the image is enabled

Parameters:
c - Component to be controlled

addPrevPageControl

public void addPrevPageControl(java.awt.Component c)
a component specified here will be enabled/disabled depending if there is a "previous page" in the list of multiple images

Parameters:
c - Component to be controlled

addNextPageControl

public void addNextPageControl(java.awt.Component c)
a component specified here will be enabled/disabled depending if there is a "next page" in the list of multiple images

Parameters:
c - Component to be controlled

addThumbnailsControl

public void addThumbnailsControl(java.awt.Component c)
a component specified here will be enabled/disabled depending if a thumbnail preview is displayed

Parameters:
c - Component to be controlled

addPauseControl

public void addPauseControl(java.awt.Component c)
a component specified here will be controlled depending on the playState

Parameters:
c - Component to be controlled

addPlayControl

public void addPlayControl(java.awt.Component c)
a component specified here will be controlled depending on the playState

Parameters:
c - Component to be controlled

addAnnotationsControl

public void addAnnotationsControl(java.awt.Component c)
a component specified here will be enabled/disabled depending if annotations exist beside the image

Parameters:
c - Component to be controlled

addScaleSmoothControl

public void addScaleSmoothControl(java.awt.Component c)
a component specified here will be enabled/disabled depending on the state of btnScaleSmooth

Parameters:
c - Component to be controlled

setToolbarController

public void setToolbarController(ToolbarController tbc)
Set implementation to be used according to ToolbarController interface

Parameters:
tbc - implementation of ToolbarController interface

cleanUp

public void cleanUp()
Clean up code to free all ressources that may be used by this component


showInfo

public void showInfo()
show help file with key map


selectInfo

public void selectInfo(java.lang.Object target)

showKeyHelp

public void showKeyHelp()
show help file with key map


navigation

public boolean navigation()
show navigation frame ("grabber hand")


toggleThumbnails

public void toggleThumbnails()
Toggle display of thumbnail preview


getAnnotations

public java.lang.String getAnnotations(boolean resetModifiedState)
Get currently loaded / edited annotations.

Parameters:
resetModifiedState - flag. If true, all modified flags will be reset to unmodified.
Returns:
String with an XML representation of the annotations or null if no annotations exist.

setAnnotations

public void setAnnotations(java.lang.String annotations)
Set (or replace current) annotations and refresh display. If image is still loading asynchronously, execution is scheduled for next repaint event.

Parameters:
annotations - String containing an XML representation of the annotations.

setAnnotationSaver

public void setAnnotationSaver(AnnotationSaver as)
Replace default AnnotationSaver implementation with your own implementation. Method saveAnnotations() is called when user clicked the "Save annotions" button.


saveAnnotations

public void saveAnnotations()
Default implementation of the AnnotationSaver interface to save current annotations. Can be replaced by your own implementation by setAnnotionSaver(). Method saveAnnotations() of currently set AnnotationSaver is called when user clicked the "Save annotions" button or confirms the "save annotations" popup after annotations have been modified.

Specified by:
saveAnnotations in interface AnnotationSaver

scrollAbs

public void scrollAbs(int x,
                      int y)
Implementation of Scrollable interface

Specified by:
scrollAbs in interface Scrollable
Parameters:
x - absolute x-position of upper left edge of viewable rectangle
y - absolute y-position of upper left edge of viewable rectangle

zoomIn

public void zoomIn()
increase zoom factor and calulate new image offset for centered image


zoomOut

public void zoomOut()
decrease zoom factor and calulate new image offset for centered image


zoom

public void zoom(double zoom)
set free defined zoom factor and calulate new image offset for centered image


zoom1To1

public void zoom1To1()
set 1:1 view (zoom factor 1) and calulate new image offset for centered image


fitHoriz

public void fitHoriz()
scale image to fit into the window horizontally


fitInWindow

public void fitInWindow()
scale image to fit into the window completely


toggleSmoothScaling

public void toggleSmoothScaling()
toggle smooth scaling (antialiasing)


toggleAnnotations

public void toggleAnnotations()
toggle display of annotations


setPageNum

public boolean setPageNum(int pageNum)
for multi-document images step to indicated page for a slide sequence set slide index to indicated slide

Parameters:
pageNum - index of targeted page; counting starts with 1

scheduleSetPage

public void scheduleSetPage(int page)

setPreviousPage

public boolean setPreviousPage()
for multi-document images step back to previous page for a slide sequence decrement slide index


setNextPage

public boolean setNextPage()
for multi-document images step forward to next page for a slide sequence increment slide index


setPageNumText

public void setPageNumText(int pageNum)
ToolbarController: set text of PageNum TextField to page number

Specified by:
setPageNumText in interface ToolbarController

getPageNum

public int getPageNum()
ToolbarController: get text of PageNum TextField converted to int

Specified by:
getPageNum in interface ToolbarController

setNumPagesText

public void setNumPagesText(int numPages)
ToolbarController: set text of numPages Label to number of pages

Specified by:
setNumPagesText in interface ToolbarController

setZoomText

public void setZoomText(double zoomFactor)
ToolbarController: set text of zoom TextField to zoomFactor (update only if current text is different to avoid unnecessary repaints)

Specified by:
setZoomText in interface ToolbarController

getZoomFactor

public double getZoomFactor(double defaultZoom)
ToolbarController: get zoom factor from zoom TextField

Specified by:
getZoomFactor in interface ToolbarController

updatePageNum

public void updatePageNum()
update pageNum text field and numpages label for a slide sequence set pageNum to slide index for a multi-document image set pageNum to page index


rotate090

public boolean rotate090()
rotate image by 90 degree


rotate180

public boolean rotate180()
rotate image by 180 degree


rotate270

public boolean rotate270()
rotate image by 270 degree


mirror

public boolean mirror()
mirror image horizontally


flip

public boolean flip()
flip image vertically


invert

public boolean invert()
invert image


printImage

public boolean printImage(boolean asynchronousFlag)
Open print dialog and start printing the current image

Parameters:
asynchronousFlag - controls whether printing should be carried out as asynchronous thread or synchronously Another more detailed example to use PrintDialog and PrintImage see method printOverlayedImage.

printCurrentView

public boolean printCurrentView(boolean asynchronousFlag)
Open print dialog and start printing the current viisible area of the image

Parameters:
asynchronousFlag - controls whether printing should be carried out as asynchronous thread or synchronously Another more detailed example to use PrintDialog and PrintImage see method printOverlayedImage.

batchPrint

public void batchPrint(java.lang.Object printJob,
                       int preferredResolution,
                       java.lang.String printPageSelection)
Print all slides of a slide sequence and/or all pages of a multipage TIFF either to a PrintJob (JDK 1.1) or PrinterJob (Java 2) (one of them must be not null). Images are automatically scaled proportionally to fit into the printers page size reported by the operating system minus margins stored in the props (hashtable with properties) "LEFTMARGIN", "RIGHTMARGIN", "TOPMARGIN" and "BOTTOMMARGIN" as integer values (1 unit = 1 cm / 1000 = 1 inch / 2540)

Specified by:
batchPrint in interface BatchPrinter
Parameters:
printJob - instance of PrintJob (e.g. instantiated by PrintDialog) or PrinterJob
preferredResolution - specifies the preferred print resolution (only used for MS IE)
printPageSelection - page numbers seperated by semicolons and low - high ranges like 1;2;8-10
See Also:
ImagePanel

togglePlayState

public void togglePlayState()
Toggle player's state between "play" and "pause"


handleEvent

public boolean handleEvent(java.awt.Event evt)
The handleEvent() method receives all events generated within the frame window. You can use this method to respond to window events. To respond to events generated by menus, buttons, etc. or other controls in the frame window but not managed by the applet, override the window's action() method.

Parameters:
evt - Event to be handled
Returns:
true if event was handled

action

public boolean action(java.awt.Event evt,
                      java.lang.Object arg)
The action handler should not be necessary as all events should be handled already by handleEvent()

Parameters:
evt - Event to be handled
arg - the argument object
Returns:
true if event was handled

imageProducerUpdate

public void imageProducerUpdate(java.awt.image.ImageProducer imgSrc,
                                java.lang.String errorMsg,
                                ImageInfo imgInfo)
The createImageProducer() method of class ImageInfo works asynchronously and will call the imageProducerUpdate method of an ImgProdObserver (implemented by this viewer class!). Finally showPanel() will be called by this method

Specified by:
imageProducerUpdate in interface ImgProdObserver
Parameters:
imgSrc - ImageProducer that was created asynchronously
errorMsg - String that contains an error message if an error occured during ImageProducer creation
imgInfo - the ImageInfo object containing the imgName string (used if error is displayed)
See Also:
ImageInfo

loadImage

public void loadImage(ImageInfo imgInfo)
Comfortable method to load image (using format autodection); runs createImageProducer() and asynchronously calls back imageProducerUpdate() which finally calls showPanel() to display the image.

Parameters:
imgInfo - an instance of class ImageInfo used to specify URL or filename of the image and set the desired pagenumber (if a multipage image is loaded).

imageUpdate

public boolean imageUpdate(java.awt.Image img,
                           int flags,
                           int x,
                           int y,
                           int w,
                           int h)
Callback function to monitor image drawing process will be called several times during drawImage (why not called in JDK 1.1?)

Specified by:
imageUpdate in interface java.awt.image.ImageObserver
See Also:
Component.imageUpdate(java.awt.Image, int, int, int, int, int)

paint

public void paint(java.awt.Graphics g)
Paint Handler of this component

Parameters:
g - Graphics context to be painted

update

public void update(java.awt.Graphics g)
Override component's update method to suppress clearing of the screen

Parameters:
g - Graphics context to be painted