noope.output
Class DrawingWindow

java.lang.Object
  |
  +--java.awt.Component
        |
        +--noope.output.DrawingWindow
All Implemented Interfaces:
AnimationListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class DrawingWindow
extends java.awt.Component
implements AnimationListener

This class displays a BufferedImage on the screen. To prevent graphics mess-ups, access objects of this class in a synchronized way.

Version:
26-Apr-2001: added get{Preferred,Minimum,Maximum}Size() methods [Miklos]; 22-Apr-2001 changed by Miklos Reiter to use synchronized access and not two BufferdImage objects: this is faster and more reliable; dispose() added by Miklos Reiter on 19-Apr-2001
Author:
Miklos Reiter
See Also:
Serialized Form

Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent
 
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
DrawingWindow(java.awt.image.BufferedImage im)
          Constructs a DrawingWindow object that displays the given BufferedImage.
 
Method Summary
 void dispose()
          Disposes of system resources used.
 java.awt.Graphics2D drawingGraphics()
          Returns a Graphics2D object that can be used to draw into the BufferedImage.
 java.awt.Dimension getMaximumSize()
           
 java.awt.Dimension getMinimumSize()
           
 java.awt.Dimension getPreferredSize()
           
 boolean isWorking()
          False after dispose() has been called.
 void paint(java.awt.Graphics g)
          Draws the BufferedImage the DrawingWindow has been constructed with onto the screen.
 void updateComplete()
          This method calls repaint().
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DrawingWindow

public DrawingWindow(java.awt.image.BufferedImage im)
Constructs a DrawingWindow object that displays the given BufferedImage. To use this you have to then insert it into a frame and display it on the screen.
Method Detail

getMinimumSize

public java.awt.Dimension getMinimumSize()
Overrides:
getMinimumSize in class java.awt.Component

getPreferredSize

public java.awt.Dimension getPreferredSize()
Overrides:
getPreferredSize in class java.awt.Component

getMaximumSize

public java.awt.Dimension getMaximumSize()
Overrides:
getMaximumSize in class java.awt.Component

paint

public void paint(java.awt.Graphics g)
Draws the BufferedImage the DrawingWindow has been constructed with onto the screen.
Overrides:
paint in class java.awt.Component

drawingGraphics

public java.awt.Graphics2D drawingGraphics()
Returns a Graphics2D object that can be used to draw into the BufferedImage.
Specified by:
drawingGraphics in interface AnimationListener

updateComplete

public void updateComplete()
This method calls repaint().
Specified by:
updateComplete in interface AnimationListener

dispose

public void dispose()
Disposes of system resources used. Added by Miklos Reiter on 19-Apr-2001.
Specified by:
dispose in interface AnimationListener

isWorking

public boolean isWorking()
False after dispose() has been called.
Specified by:
isWorking in interface AnimationListener