uk.org.redfelineninja.awt
Class ImageMap

java.lang.Object
  |
  +--java.awt.Component
        |
        +--uk.org.redfelineninja.awt.PixMap
              |
              +--uk.org.redfelineninja.awt.ImageMap
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable
Direct Known Subclasses:
RiskMap

public class ImageMap
extends PixMap

The ImageMap allows programmers to rapidly detect mouse clicks on a image based on the colour that was clicked on.

It extends from PixMap and provides all the drawing funtions of that class.

See Also:
uk.ac.warwick.starfish.awt.PixMap, Serialized Form

Field Summary
 
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
ImageMap(java.awt.Image img)
           
ImageMap(java.awt.Image img, java.util.Hashtable zones)
          All keys relating to non points are removed from the Hashtable
 
Method Summary
 void addActionListener(java.awt.event.ActionListener l)
          adds an ActionListener to the button
 java.awt.Color getCountryColor(java.lang.Object country)
           
 java.awt.Color getOriginalCountryColor(java.lang.Object country)
           
 void paintZone(java.lang.Object zone)
          Paint a zone a particular colour.
 void removeActionListener(java.awt.event.ActionListener l)
          removes an ActionListener from the button
 java.lang.String toString()
           
 
Methods inherited from class uk.org.redfelineninja.awt.PixMap
drawLine, floodFill, floodFillOld, getAutoRepaint, getColor, getColorModel, getImage, getMaximumSize, getMinimumSize, getPixel, getPixel, getPixels, getPreferredSize, loadImage, newPixels, newPixels, paint, setAutoRepaint, setColor, setColor, setColorModel, setPixel, setPixel
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, dispatchEvent, doLayout, enable, enable, enableInputMethods, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, 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, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCycle, update, validate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ImageMap

public ImageMap(java.awt.Image img)

ImageMap

public ImageMap(java.awt.Image img,
                java.util.Hashtable zones)
All keys relating to non points are removed from the Hashtable

Method Detail

paintZone

public void paintZone(java.lang.Object zone)
Paint a zone a particular colour.


getCountryColor

public java.awt.Color getCountryColor(java.lang.Object country)

getOriginalCountryColor

public java.awt.Color getOriginalCountryColor(java.lang.Object country)

addActionListener

public void addActionListener(java.awt.event.ActionListener l)
adds an ActionListener to the button


removeActionListener

public void removeActionListener(java.awt.event.ActionListener l)
removes an ActionListener from the button


toString

public java.lang.String toString()
Overrides:
toString in class java.awt.Component