1 36 37 40 41 import java.awt.Graphics ; 42 import java.net.URL ; 43 import java.net.MalformedURLException ; 44 45 53 class HighlightArea extends ImageMapArea { 54 int hlmode; 55 int hlpercent; 56 57 60 public void handleArg(String arg) { 61 if (arg == null) { 62 hlmode = parent.hlmode; 63 hlpercent = parent.hlpercent; 64 } else { 65 if (arg.startsWith("darker")) { 66 hlmode = parent.DARKER; 67 arg = arg.substring("darker".length()); 68 } else { 69 hlmode = parent.BRIGHTER; 70 if (arg.startsWith("brighter")) { 71 arg = arg.substring("brighter".length()); 72 } 73 } 74 hlpercent = Integer.parseInt(arg); 75 } 76 } 77 78 public void makeImages() { 79 setHighlight(parent.getHighlight(X, Y, W, H, hlmode, hlpercent)); 80 } 81 82 public void highlight(Graphics g) { 83 if (entered) { 84 g.drawImage(hlImage, X, Y, this); 85 } 86 } 87 88 91 public void enter() { 92 repaint(); 93 } 94 95 98 public void exit() { 99 repaint(); 100 } 101 } 102 | Popular Tags |