|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Canvas
net.xoetrope.awt.XImage
net.xoetrope.awt.XHotspotImage
public class XHotspotImage
A widget for displaying an image and associating hotspots at coordinates specified in an external file
Copyright: Copyright (c) Xoetrope Ltd., 1998-2003
License: see license.txt
| 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 static java.awt.Cursor |
defaultCursor
The default mouse over cursor - the arrow |
protected java.util.Hashtable |
disabled
The disabled hotspots |
protected static java.awt.Cursor |
handCursor
The hand cursor - the normal pointer for a hotspot |
protected java.util.Vector |
hotspots
The hotspots |
protected java.util.Vector |
images
The images |
protected java.util.Vector |
names
The hotspot 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 | |
|---|---|
XHotspotImage()
Constructor. |
|
| Method Summary | |
|---|---|
int |
checkHotspot(java.awt.Point p)
Check the Point p to see if any of the polygons in the hotspots Vector contain it. |
void |
disableHotspot(java.lang.String name)
Create a hashtable to store the disabled hotspots and move the disabled one into it from the main Vector. |
void |
enableHotspot(java.lang.String name)
Move the hotspot from the disabled Hashtable to the main Vector |
java.lang.String |
getName(int i)
Get the name of the hotspot in element i of the names vector |
protected void |
handleElement(XmlElement ele)
Not implemented |
protected void |
hotspotDisabled(java.lang.String name,
int idx)
Convenience method to inform subclasses when a hotspot has been disabled |
protected void |
hotspotEnabled(java.lang.String name)
Convenience method to inform subclasses when a hotspot has been enabled |
void |
mouseDragged(java.awt.event.MouseEvent e)
Unused method. |
void |
mouseMoved(java.awt.event.MouseEvent e)
Call the checkHotSpot function to change the cursor |
void |
read(java.io.Reader r)
Reads the hotspot information from the reader parameter and adds them to the names and hotspots vectors. |
| Methods inherited from class net.xoetrope.awt.XImage |
|---|
addNotify, getImageName, getPreferredSize, imageUpdate, paint, 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 |
|---|
protected static java.awt.Cursor handCursor
protected static java.awt.Cursor defaultCursor
protected java.util.Vector hotspots
protected java.util.Vector images
protected java.util.Vector names
protected java.util.Hashtable disabled
| Constructor Detail |
|---|
public XHotspotImage()
| Method Detail |
|---|
public void enableHotspot(java.lang.String name)
name - the name of the hotspot to enableprotected void hotspotEnabled(java.lang.String name)
name - the name of the hotspot being enabled.public void disableHotspot(java.lang.String name)
name - the name of the hotspot to be disabled
protected void hotspotDisabled(java.lang.String name,
int idx)
name - the name of the hotspot being disabled.idx - the index of the hotspot being disabledpublic java.lang.String getName(int i)
i - The index of the hotspot
public void read(java.io.Reader r)
r - Reader of the file.protected void handleElement(XmlElement ele)
ele - an XML elementpublic int checkHotspot(java.awt.Point p)
p - The Point which we are checking
public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved in interface java.awt.event.MouseMotionListenere - MouseEventpublic void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged in interface java.awt.event.MouseMotionListenere - the mouse event
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||