com.rolemodelsoft.drawlet.awt
Class PaintableViewer

java.lang.Object
  |
  +--java.awt.Component
        |
        +--com.rolemodelsoft.drawlet.awt.PaintableViewer

public class PaintableViewer
extends java.awt.Component

A component which can show any Paintable.

See Also:
Serialized Form

Field Summary
protected  Paintable paintable
           
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
PaintableViewer()
          Create a PaintableViewer.
PaintableViewer(Paintable paintable)
          Create a PaintableViewer initially showing the given Paintable.
 
Method Summary
 java.awt.Dimension getMinimumSize()
          Answer the size the receiver must be displayed at.
 Paintable getPaintable()
           
 java.awt.Dimension getPreferredSize()
          Answer the size the receiver prefers to be displayed at.
 void paint(java.awt.Graphics g)
          Paint the thing we're viewing.
 void paintBackground(java.awt.Graphics g)
          Paint the background of the component.
 void setPaintable(Paintable paintable)
          Set the thing we are viewing and repaint.
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, 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, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, 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, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, 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
 

Field Detail

paintable

protected Paintable paintable
Constructor Detail

PaintableViewer

public PaintableViewer()
Create a PaintableViewer.

PaintableViewer

public PaintableViewer(Paintable paintable)
Create a PaintableViewer initially showing the given Paintable.
Parameters:
paintable - the thing to view
Method Detail

getMinimumSize

public java.awt.Dimension getMinimumSize()
Answer the size the receiver must be displayed at.
Overrides:
getMinimumSize in class java.awt.Component
Returns:
an integer representing the minimum size for the receiver.

getPaintable

public Paintable getPaintable()
Returns:
the paintable assocatied with the receiver.

getPreferredSize

public java.awt.Dimension getPreferredSize()
Answer the size the receiver prefers to be displayed at.
Overrides:
getPreferredSize in class java.awt.Component
Returns:
an integer representing the preferred size for the receiver

paint

public void paint(java.awt.Graphics g)
Paint the thing we're viewing.
Overrides:
paint in class java.awt.Component
Parameters:
g - the graphics object to use in painting.

paintBackground

public void paintBackground(java.awt.Graphics g)
Paint the background of the component.
Parameters:
g - the graphics object to use in painting.

setPaintable

public void setPaintable(Paintable paintable)
Set the thing we are viewing and repaint.
Parameters:
paintable - the Paintable to be associated with this viewer.