FileDocCategorySizeDatePackage
HighlightArea.javaAPI DocSun JDK 1.4.2 Example3167Thu May 12 00:35:29 BST 2005None

HighlightArea

public class HighlightArea extends ImageMapArea
An area highlighting ImageArea class. This class extends the basic ImageArea Class to highlight an area of the base image when the mouse enters the area.
author
Jim Graham
version
1.11, 01/23/03

Fields Summary
int
hlmode
int
hlpercent
Constructors Summary
Methods Summary
public voidenter()
The area is repainted when the mouse enters.

	repaint();
    
public voidexit()
The area is repainted when the mouse leaves.

	repaint();
    
public voidhandleArg(java.lang.String arg)
The argument string is the highlight mode to be used.

	if (arg == null) {
	    hlmode = parent.hlmode;
	    hlpercent = parent.hlpercent;
	} else {
	    if (arg.startsWith("darker")) {
		hlmode = parent.DARKER;
		arg = arg.substring("darker".length());
	    } else {
		hlmode = parent.BRIGHTER;
		if (arg.startsWith("brighter")) {
		    arg = arg.substring("brighter".length());
		}
	    }
	    hlpercent = Integer.parseInt(arg);
	}
    
public voidhighlight(java.awt.Graphics g)

	if (entered) {
	    g.drawImage(hlImage, X, Y, this);
	}
    
public voidmakeImages()

	setHighlight(parent.getHighlight(X, Y, W, H, hlmode, hlpercent));