home *** CD-ROM | disk | FTP | other *** search
- import java.applet.AudioClip;
- import java.awt.Polygon;
- import java.net.MalformedURLException;
- import java.net.URL;
- import java.util.StringTokenizer;
-
- class hintpot {
- public Polygon polyMyArea = new Polygon();
- public imgarea m_parent;
- public String szHint;
- public String szURLDescription;
- public URL uURL;
- public String auSourceName;
- public AudioClip auSource;
- public int audioMode;
- public int openMode;
- private boolean bHintVisible = false;
- private boolean bUseFrame = false;
- public String szFrame;
- public boolean bInitialised = false;
- public boolean bUsed = true;
-
- public hintpot() {
- }
-
- public hintpot(String var1, imgarea var2) {
- int var3 = 0;
- int var4 = 0;
- int var5 = 0;
- int var6 = 0;
- int var7 = 0;
- int var8 = 0;
- String var9 = "";
- boolean var10 = false;
- this.m_parent = var2;
- StringTokenizer var11 = new StringTokenizer(var1, "#");
-
- try {
- this.szURLDescription = var11.nextToken();
- } catch (Exception var20) {
- this.szHint = "Unable to determine URL";
- }
-
- if (this.szHint != null && this.szHint.equals("No tooltips")) {
- this.szHint = null;
- }
-
- try {
- this.auSourceName = var11.nextToken();
- } catch (Exception var19) {
- this.szHint = "Unable to determine audio file";
- }
-
- try {
- this.audioMode = Integer.valueOf(var11.nextToken());
- } catch (Exception var18) {
- this.szHint = "Unable to determine audio mode";
- }
-
- try {
- this.openMode = Integer.valueOf(var11.nextToken());
- } catch (Exception var17) {
- this.szHint = "Unable to determine open mode";
- }
-
- try {
- this.szFrame = var11.nextToken();
- } catch (Exception var16) {
- this.szHint = "Unable to determine title";
- }
-
- try {
- this.uURL = new URL(this.m_parent.m_parent.getDocumentBase(), this.szURLDescription);
- } catch (MalformedURLException var15) {
- this.uURL = null;
- }
-
- if (this.uURL != null) {
- this.szURLDescription = this.uURL.toString();
- } else {
- this.szURLDescription = "Invalid URL";
- }
-
- if (this.szURLDescription != null) {
- try {
- var3 = Integer.parseInt(var11.nextToken());
- var6 = Integer.parseInt(var11.nextToken());
- var4 = Integer.parseInt(var11.nextToken());
- var7 = Integer.parseInt(var11.nextToken());
- } catch (Exception var14) {
- this.szURLDescription = null;
- this.debug("Error: At least two points must be specified for hintpot '" + this.szHint + "'");
- }
-
- try {
- var5 = Integer.parseInt(var9 = var11.nextToken());
- var8 = Integer.parseInt(var11.nextToken());
- } catch (Exception var13) {
- var10 = true;
- }
-
- if (var10) {
- this.polyMyArea.addPoint(var3, var6);
- this.polyMyArea.addPoint(var4, var6);
- this.polyMyArea.addPoint(var4, var7);
- this.polyMyArea.addPoint(var3, var7);
- this.bInitialised = true;
- } else {
- this.polyMyArea.addPoint(var3, var6);
- this.polyMyArea.addPoint(var4, var7);
- this.polyMyArea.addPoint(var5, var8);
-
- while(!this.bInitialised) {
- try {
- var3 = Integer.parseInt(var9 = var11.nextToken());
- var6 = Integer.parseInt(var11.nextToken());
- this.polyMyArea.addPoint(var3, var6);
- } catch (Exception var12) {
- this.bInitialised = true;
- }
- }
- }
-
- if (!var9.equals("")) {
- this.szHint = var9;
- }
- }
-
- }
-
- public void copy(hintpot var1) {
- this.polyMyArea = var1.polyMyArea;
- this.m_parent = var1.m_parent;
- this.szHint = var1.szHint;
- this.szURLDescription = var1.szURLDescription;
- this.uURL = var1.uURL;
- this.bHintVisible = var1.bHintVisible;
- this.bUseFrame = var1.bUseFrame;
- this.szFrame = var1.szFrame;
- this.bInitialised = var1.bInitialised;
- this.bUsed = var1.bUsed;
- }
-
- public boolean MouseMove(int var1, int var2, int var3) {
- if (this.m_parent.makeStatic > 0) {
- return true;
- } else {
- if (this.polyMyArea.inside(var1, var2)) {
- this.m_parent.setStatusText(this.szURLDescription, true);
- this.m_parent.setNewHintText(this.szHint);
- if (this.m_parent.m_parent.mapMode == 1 && this.m_parent.selHotAreaIndex != var3) {
- this.m_parent.preHotAreaIndex = this.m_parent.selHotAreaIndex;
- this.m_parent.selHotAreaIndex = var3;
- }
-
- if (!this.bHintVisible) {
- this.bHintVisible = true;
- }
-
- if (this.m_parent.bHintChanged) {
- this.m_parent.m_parent.mapImageArea.preHotAreaIndex = -1;
- if (this.audioMode == 0 && this.auSource != null && common.soundOff == 0) {
- this.auSource.play();
- }
-
- this.m_parent.parseHint();
- this.m_parent.m_parent.m_common.setTheCursor(12);
- }
- } else {
- this.m_parent.setStatusText(this.szURLDescription, false);
- if (this.bHintVisible) {
- this.bHintVisible = false;
- }
- }
-
- return this.bHintVisible;
- }
- }
-
- public void MouseUp(int var1, int var2) {
- if (this.polyMyArea.inside(var1, var2) && this.bHintVisible) {
- URL var3;
- if (this.m_parent.m_parent.m_common.disableLevel == 2) {
- this.m_parent.m_parent.mapImageArea.szHintText = "CoolMap is fetching " + this.m_parent.m_parent.m_common.homeURL + ". Please wait...";
- var3 = this.m_parent.m_parent.m_common.uhomeURL;
- } else {
- this.m_parent.m_parent.mapImageArea.szHintText = "CoolMap is fetching " + this.szURLDescription + ". Please wait...";
- var3 = this.uURL;
- }
-
- this.m_parent.m_parent.mapImageArea.makeStatic = 1;
- this.m_parent.m_parent.mapImageArea.parseHint();
- this.m_parent.m_parent.mapImageArea.paint(this.m_parent.m_parent.gcOn);
- if (this.audioMode == 1 && this.auSource != null && common.soundOff == 0) {
- this.auSource.play();
- }
-
- if (this.openMode == 1) {
- this.m_parent.m_parent.getAppletContext().showDocument(var3, "_blank");
- } else {
- this.m_parent.m_parent.getAppletContext().showDocument(var3);
- }
-
- this.m_parent.m_parent.showStatus("Fetching " + this.szURLDescription);
- }
-
- }
-
- private void debug(String var1) {
- this.debug(var1);
- }
- }
-