net.xoetrope.awt
Class XImageMap

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Canvas
          extended by net.xoetrope.awt.XImage
              extended by net.xoetrope.awt.XHotspotImage
                  extended by net.xoetrope.awt.XImageMap
All Implemented Interfaces:
java.awt.event.MouseMotionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, XAttributedComponent, XImageHolder

public class XImageMap
extends XHotspotImage

An extended hotspot support the drawing of a polygon around the 'hot' area

Copyright (c) Xoetrope Ltd., 1998-2004
License: see license.txt $Revision: 2.3 $

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.Canvas
java.awt.Canvas.AccessibleAWTCanvas
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  boolean drawHotspots
          true to drawa highlight on the hotspots
protected  java.util.Vector linePoints
          The points/vertices marked on the image
 
Fields inherited from class net.xoetrope.awt.XHotspotImage
defaultCursor, disabled, handCursor, hotspots, images, names
 
Fields inherited from class net.xoetrope.awt.XImage
currentProject
 
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
XImageMap()
          Create a new image map
 
Method Summary
 void addPoint(int x, int y)
          Add a new point
 void addPoint(java.awt.Point pt)
          Add a new point
 boolean getDrawHotspots()
          Get the flag controlling rendering of the hotspots.
 void paint(java.awt.Graphics g)
          Render the component
 void setDrawHotspots(boolean draw)
          Set the flag controlling rendering of the hotspots.
 
Methods inherited from class net.xoetrope.awt.XHotspotImage
checkHotspot, disableHotspot, enableHotspot, getName, handleElement, hotspotDisabled, hotspotEnabled, mouseDragged, mouseMoved, read
 
Methods inherited from class net.xoetrope.awt.XImage
addNotify, getImageName, getPreferredSize, imageUpdate, setAttribute, setImage, update
 
Methods inherited from class java.awt.Canvas
createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, 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, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

linePoints

protected java.util.Vector linePoints
The points/vertices marked on the image


drawHotspots

protected boolean drawHotspots
true to drawa highlight on the hotspots

Constructor Detail

XImageMap

public XImageMap()
Create a new image map

Method Detail

addPoint

public void addPoint(java.awt.Point pt)
Add a new point

Parameters:
pt - the new point

addPoint

public void addPoint(int x,
                     int y)
Add a new point

Parameters:
x - the new point's x coordinate
y - the new point's y coordinate

paint

public void paint(java.awt.Graphics g)
Render the component

Overrides:
paint in class XImage
Parameters:
g - the graphics context

setDrawHotspots

public void setDrawHotspots(boolean draw)
Set the flag controlling rendering of the hotspots. When turned on a line is drawn to show the edges of the hotspots

Parameters:
draw - true to render the hotspots

getDrawHotspots

public boolean getDrawHotspots()
Get the flag controlling rendering of the hotspots.

Returns:
true if the hotspots are rendered