uk.co.ist.mwt
Class ImageArea

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--uk.co.ist.mwt.ImageArea

public class ImageArea
extends javax.swing.JComponent

The ImageArea is a space which knows how to display an image.

See Also:
Serialized Form

Inner classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, 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
 
Constructor Summary
ImageArea()
           
 
Method Summary
 java.awt.Image getDisabledImage()
          Method to get the image displayed in the area when it has been disabled
 java.awt.Image getImage()
          Method to get the image displayed in the area
 java.awt.Dimension getMinimumSize()
          Gets the minimum size of the ImageArea.
 java.awt.Dimension getPreferredSize()
          Gets the preferred size of the ImageArea.
 boolean imageUpdate(java.awt.Image img, int flags, int x, int y, int w, int h)
          Routine to repaint the image when it changes; we ask the parent to relayout if our idea of its size has changed.
 void paintComponent(java.awt.Graphics g)
          Method to paint the area
 void setDisabledImage(java.awt.Image i)
          Method to specify the image to display in the area when it has been disabled
 void setImage(java.awt.Image i)
          Method to specify the image to display in the area
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInsets, getInsets, getLocation, getMaximumSize, getNextFocusableComponent, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getUIClassID, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, processComponentKeyEvent, processFocusEvent, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVisible, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setCursor, setLayout, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hide, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ImageArea

public ImageArea()
Method Detail

setImage

public void setImage(java.awt.Image i)
Method to specify the image to display in the area
Parameters:
i - the image to display

getImage

public java.awt.Image getImage()
Method to get the image displayed in the area

setDisabledImage

public void setDisabledImage(java.awt.Image i)
Method to specify the image to display in the area when it has been disabled
Parameters:
i - the image to display

getDisabledImage

public java.awt.Image getDisabledImage()
Method to get the image displayed in the area when it has been disabled

paintComponent

public void paintComponent(java.awt.Graphics g)
Method to paint the area
Overrides:
paintComponent in class javax.swing.JComponent
Parameters:
g - the graphics context into which we should draw

getPreferredSize

public java.awt.Dimension getPreferredSize()
Gets the preferred size of the ImageArea. This is the same as its minimum size, and is large enough to hold the image.
Overrides:
getPreferredSize in class javax.swing.JComponent
See Also:
Container.minimumSize()

getMinimumSize

public java.awt.Dimension getMinimumSize()
Gets the minimum size of the ImageArea. This is the same as its preferred size, and is large enough to hold the image.
Overrides:
getMinimumSize in class javax.swing.JComponent
See Also:
Container.preferredSize()

imageUpdate

public boolean imageUpdate(java.awt.Image img,
                           int flags,
                           int x,
                           int y,
                           int w,
                           int h)
Routine to repaint the image when it changes; we ask the parent to relayout if our idea of its size has changed.
Overrides:
imageUpdate in class java.awt.Component