home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / VCafe / WDESAMPL.BIN / HighlightArea.class (.txt) < prev    next >
Encoding:
Java Class File  |  1996-11-19  |  1.4 KB  |  45 lines

  1. import java.awt.Graphics;
  2.  
  3. class HighlightArea extends ImageMapArea {
  4.    int hlmode;
  5.    int hlpercent;
  6.  
  7.    public void handleArg(String var1) {
  8.       if (var1 == null) {
  9.          this.hlmode = super.parent.hlmode;
  10.          this.hlpercent = super.parent.hlpercent;
  11.       } else {
  12.          if (var1.startsWith("darker")) {
  13.             this.hlmode = 1;
  14.             var1 = var1.substring("darker".length());
  15.          } else {
  16.             this.hlmode = 0;
  17.             if (var1.startsWith("brighter")) {
  18.                var1 = var1.substring("brighter".length());
  19.             }
  20.          }
  21.  
  22.          this.hlpercent = Integer.parseInt(var1);
  23.       }
  24.    }
  25.  
  26.    public void makeImages() {
  27.       ((ImageMapArea)this).setHighlight(super.parent.getHighlight(super.X, super.Y, super.W, super.H, this.hlmode, this.hlpercent));
  28.    }
  29.  
  30.    public void highlight(Graphics var1) {
  31.       if (super.entered) {
  32.          var1.drawImage(super.hlImage, super.X, super.Y, this);
  33.       }
  34.  
  35.    }
  36.  
  37.    public void enter() {
  38.       ((ImageMapArea)this).repaint();
  39.    }
  40.  
  41.    public void exit() {
  42.       ((ImageMapArea)this).repaint();
  43.    }
  44. }
  45.