home *** CD-ROM | disk | FTP | other *** search
- import java.applet.Applet;
- import java.awt.BorderLayout;
- import java.awt.Button;
- import java.awt.Checkbox;
- import java.awt.CheckboxGroup;
- import java.awt.Color;
- import java.awt.Component;
- import java.awt.Container;
- import java.awt.Dimension;
- import java.awt.Event;
- import java.awt.FlowLayout;
- import java.awt.Font;
- import java.awt.Frame;
- import java.awt.Graphics;
- import java.awt.GridLayout;
- import java.awt.Image;
- import java.awt.Label;
- import java.awt.Panel;
- import java.awt.Rectangle;
- import java.awt.TextArea;
- import java.awt.TextField;
- import java.awt.Window;
- import java.awt.image.ImageObserver;
- import java.net.MalformedURLException;
- import java.net.URL;
-
- public class coolmap extends Applet implements Runnable {
- Thread timer;
- imgarea mapImageArea;
- Rectangle mapArea;
- int maxStates = 2;
- Image imgStaticOffScreen;
- Image imgBackground;
- Image imgForeground;
- Graphics gcOff;
- Graphics gcOn;
- Dimension dimOffScreen;
- boolean bInitComplete = false;
- Button borderButton;
- Button saveButton;
- Button resetButton;
- Button delButton;
- Button selButton;
- Button getResultButton;
- Button readmeButton;
- Button adButton;
- CheckboxGroup theMode = new CheckboxGroup();
- Checkbox[] modeBox;
- CheckboxGroup audioMode;
- Checkbox[] audioOption;
- CheckboxGroup openMode;
- Checkbox[] openOption;
- CheckboxGroup hotMode;
- Checkbox[] hotOption;
- CheckboxGroup tipsMode;
- Checkbox[] tipsOption;
- String[] borderButtonLabel;
- TextField getHint;
- TextField getURL;
- TextField getAU;
- TextField getImageName;
- TextArea getResult;
- Label resultLabel;
- String deskArrange;
- int animateCount;
- boolean readmeDone;
- String mode;
- Image mapImage;
- int mapMode;
- int editState;
- int currentPoint;
- String imageName;
- public common m_common;
- int doItOnce;
- int countRun;
- int instructionID;
- String mmm;
- String myAd;
- int adCount;
- int adCountMax;
- int hotStyle;
- int tipsOn;
- int imageWidth;
- int imageHeigth;
- int AdButtonHeight;
-
- public void init() {
- this.m_common = new common(this);
- this.m_common.releaseLevel = this.m_common.TheAdware;
- this.m_common.Name = "TheAdware";
- this.m_common.iniCommon();
- if (this.m_common.releaseLevel == this.m_common.TheAdware) {
- this.m_common.disableLevel = 1;
- }
-
- int var2 = ((Component)this).size().width;
- int var3 = ((Component)this).size().height;
- this.borderButtonLabel[0] = "Specify Hot Arear Border";
- this.borderButtonLabel[1] = "Cancel Editing Border";
- String var1 = ((Applet)this).getParameter("mode");
- this.mode = var1 != null ? var1 : "design";
- var1 = ((Applet)this).getParameter("imageWidth");
- this.imageWidth = var1 == null ? 350 : Integer.valueOf(var1);
- var1 = ((Applet)this).getParameter("imageHeigth");
- this.imageHeigth = var1 == null ? 300 : Integer.valueOf(var1);
- var1 = ((Applet)this).getParameter("tipsOn");
- this.tipsOn = var1 == null ? 1 : Integer.valueOf(var1);
- var1 = ((Applet)this).getParameter("imageLeft");
- int var4 = var1 == null ? 0 : Integer.valueOf(var1);
- var1 = ((Applet)this).getParameter("imageTop");
- int var5 = var1 == null ? 0 : Integer.valueOf(var1);
- var1 = ((Applet)this).getParameter("AdButtonHeight");
- int var6 = var1 == null ? 30 : Integer.valueOf(var1);
- this.mapArea = new Rectangle();
- if (this.mode.equalsIgnoreCase("map")) {
- if (this.m_common.releaseLevel == this.m_common.TheAdware) {
- this.mapArea.reshape(var4, var5, ((Component)this).size().width, ((Component)this).size().height - var6);
- } else {
- this.mapArea.reshape(var4, var5, ((Component)this).size().width, ((Component)this).size().height);
- }
- } else {
- var1 = ((Applet)this).getParameter("appletWidth");
- int var7 = var1 == null ? this.imageWidth : Integer.valueOf(var1);
- var1 = ((Applet)this).getParameter("appletHeigth");
- int var8 = var1 == null ? this.imageHeigth : Integer.valueOf(var1);
- this.mapArea.reshape(var4, var5, var7, var8);
- }
-
- this.mapImageArea = new imgarea(this, this.mapArea);
- var1 = ((Applet)this).getParameter("deskArrange");
- this.deskArrange = var1 != null ? var1 : "TopBottom";
- var1 = ((Applet)this).getParameter("hintWidth");
- this.mapImageArea.hintWidth = var1 == null ? 90 : Integer.valueOf(var1);
- var1 = ((Applet)this).getParameter("fontHeight");
- this.mapImageArea.fontHeight = var1 == null ? 10 : Integer.valueOf(var1);
- var1 = ((Applet)this).getParameter("hotStyle");
- this.hotStyle = var1 == null ? 1 : Integer.valueOf(var1);
- this.imageName = ((Applet)this).getParameter("mapImage");
- if (this.imageName != null) {
- if (this.m_common.whichBase == 0) {
- this.mapImage = ((Applet)this).getImage(((Applet)this).getDocumentBase(), this.imageName);
- } else {
- this.mapImage = ((Applet)this).getImage(((Applet)this).getCodeBase(), this.imageName);
- }
- }
-
- this.m_common.tracker.addImage(this.mapImage, 1);
-
- try {
- this.m_common.tracker.waitForAll();
- } catch (InterruptedException var10) {
- return;
- }
-
- this.iniMain();
- this.maintainStaticImages();
- this.copyOfftoOn();
- this.m_common.homeURL = "http://www.coolshare.com";
-
- try {
- this.m_common.uhomeURL = new URL(this.m_common.homeURL);
- } catch (MalformedURLException var9) {
- this.m_common.uhomeURL = null;
- }
-
- if (this.m_common.releaseLevel != this.m_common.TheShareware) {
- if (this.m_common.releaseLevel == this.m_common.TheAdware) {
- this.adCountMax = this.m_common.aboutMe.length();
- this.myAd = "";
-
- for(int var23 = 0; var23 < this.adCountMax; ++var23) {
- String var10001 = this.myAd;
- this.myAd = var10001 + " ";
- }
-
- String var25 = this.myAd;
- this.myAd = var25 + " Image map made easy! FREE to place in your page !! ";
- var25 = this.myAd;
- this.myAd = var25 + "This is a COOL Java image map applet with a built-in Design Center where you can ";
- var25 = this.myAd;
- this.myAd = var25 + "specify Hot Areas visibly. The Design Center will generate HTML code ";
- var25 = this.myAd;
- this.myAd = var25 + "that calls this image map applet when you finish all the Hot Areas. Click Here! ";
- var25 = this.myAd;
- this.myAd = var25 + "You are welcome to place this COOL map in your page for FREE!! More and BETTER ";
- var25 = this.myAd;
- this.myAd = var25 + "Java applets and the best screen savers are available over there! ";
- var25 = this.myAd;
- this.myAd = var25 + "Click to get them!! This button will not appear in the shareware version.";
-
- for(int var24 = 0; var24 < this.adCountMax; ++var24) {
- var25 = this.myAd;
- this.myAd = var25 + " ";
- }
- } else if (this.m_common.releaseLevel > this.m_common.TheShareware || this.m_common.releaseLevel < this.m_common.TheAdware) {
- this.m_common.TheStatus = this.m_common.aboutMe;
- }
- }
-
- this.bInitComplete = true;
- }
-
- public void start() {
- this.mapImageArea.makeStatic = 0;
- this.timer = new Thread(this);
- this.timer.setPriority(1);
- this.timer.start();
- }
-
- public void stop() {
- if (this.timer != null) {
- this.timer.stop();
- this.timer = null;
- }
-
- }
-
- public boolean mouseExit(Event var1, int var2, int var3) {
- return true;
- }
-
- public boolean mouseEnter(Event var1, int var2, int var3) {
- return true;
- }
-
- public void run() {
- this.m_common.maintainBK();
- this.maintainStaticImages();
- this.gcOff.drawImage(this.m_common.bufBK, 0, 0, this);
- this.gcOff.drawImage(this.mapImage, this.mapArea.x, this.mapArea.y, this);
- this.copyOfftoOn();
- if (!this.mode.equalsIgnoreCase("design")) {
- if (this.m_common.releaseLevel == this.m_common.TheAdware) {
- this.adCount = 0;
- }
-
- while(this.timer != null) {
- if (this.mapImageArea.selHotAreaIndex >= 0) {
- if (this.mapImageArea.HotAreas[this.mapImageArea.selHotAreaIndex].auSource != null && common.soundOff > 0) {
- this.mapImageArea.HotAreas[this.mapImageArea.selHotAreaIndex].auSource.stop();
- }
-
- this.update_hotare_tips();
- }
-
- Thread.yield();
-
- try {
- Thread.sleep(200L);
- } catch (InterruptedException var2) {
- }
-
- if (this.m_common.releaseLevel == this.m_common.TheAdware) {
- ++this.adCount;
- if (this.adCount + this.adCountMax > this.myAd.length() - 2) {
- this.adCount = 0;
- }
-
- this.adButton.setLabel(this.myAd.substring(this.adCount, this.adCount + this.adCountMax));
- }
-
- if (this.m_common.showAdCount >= this.m_common.showAd) {
- this.m_common.showAdCount = 0;
- if (this.m_common.disableLevel > 0) {
- ((Applet)this).showStatus(this.m_common.aboutMe);
- }
- } else {
- ++this.m_common.showAdCount;
- }
-
- if (this.m_common.delayLoadAudio > -2) {
- if (this.m_common.delayLoadAudio <= 0) {
- if (this.m_common.delayLoadAudio == 0) {
- this.mapImageArea.loadAudioFiles();
- this.m_common.loadHideSound();
- this.m_common.delayLoadAudio = -100;
- }
- } else {
- --this.m_common.delayLoadAudio;
- }
- }
- }
-
- } else {
- this.update_applet();
-
- while(this.timer != null) {
- Thread.yield();
-
- try {
- Thread.sleep(1000L);
- } catch (InterruptedException var1) {
- }
-
- if (this.mapImageArea.selHotAreaIndex >= 0) {
- if (this.mapImageArea.HotAreas[this.mapImageArea.selHotAreaIndex].auSource != null && common.soundOff > 0) {
- this.mapImageArea.HotAreas[this.mapImageArea.selHotAreaIndex].auSource.stop();
- }
-
- if (this.mapMode == 0) {
- if (this.countRun == 0) {
- this.countRun = 1;
- this.mapImageArea.paintHotArea(this.gcOn, false, Color.black);
- } else {
- this.countRun = 0;
- this.mapImageArea.paintHotArea(this.gcOn, false, Color.yellow);
- }
- } else {
- this.update_hotare_tips();
- }
- }
-
- if (!this.readmeDone) {
- if (this.readmeButton.getLabel().equals("Read Me First!!")) {
- this.readmeButton.setLabel("Read Me First!!");
- } else if (this.readmeButton.getLabel().equals("Read Me First!!")) {
- this.readmeButton.setLabel("Read Me First!!");
- }
- }
- }
-
- }
- }
-
- public void update_hotare_tips() {
- if (this.hotStyle != 0 || this.tipsOn != 0) {
- if (this.tipsOn == 1) {
- this.gcOff.drawImage(this.m_common.bufBK, 0, 0, this);
- this.gcOff.drawImage(this.mapImage, this.mapArea.x, this.mapArea.y, this);
- }
-
- if (this.hotStyle > 0) {
- if (this.tipsOn == 1) {
- if (this.countRun == 0) {
- this.countRun = 1;
- this.mapImageArea.paintHotArea(this.gcOff, false, Color.black);
- } else {
- this.countRun = 0;
- this.mapImageArea.paintHotArea(this.gcOff, false, Color.yellow);
- }
- } else if (this.countRun == 0) {
- this.countRun = 1;
- this.mapImageArea.paintHotArea(this.gcOn, false, Color.black);
- } else {
- this.countRun = 0;
- this.mapImageArea.paintHotArea(this.gcOn, false, Color.yellow);
- }
- }
-
- if (this.tipsOn == 1) {
- this.gcOff.setFont(new Font("TimesRoman", 1, this.mapImageArea.fontHeight));
- this.mapImageArea.paintTips(this.gcOff, true);
- this.copyOfftoOn();
- }
-
- }
- }
-
- public String getRoundString(int var1, String var2) {
- String var3 = "";
- if (this.animateCount >= var1) {
- return this.animateCount < var2.length() ? var2.substring(this.animateCount - var1, this.animateCount) : var2.substring(this.animateCount - var1, var2.length()) + var2.substring(0, this.animateCount - var2.length());
- } else {
- for(int var4 = 0; var4 < var1 - this.animateCount; ++var4) {
- var3 = var3 + " ";
- }
-
- return var3 + var2.substring(0, var1 - this.animateCount);
- }
- }
-
- public void update_applet() {
- if (!this.mode.equalsIgnoreCase("map")) {
- if (this.mapImageArea.iMaxHotArea >= 0 && this.mapImageArea.selHotAreaIndex >= 0 && this.mapMode == 0) {
- this.delButton.enable();
- } else {
- this.delButton.disable();
- }
-
- if (this.mapMode != 0) {
- this.borderButton.disable();
- } else {
- this.borderButton.enable();
- }
-
- if (this.mapMode == 0 && (this.mapImageArea.iMaxHotArea >= 0 || this.editState != 0) && (this.editState != 0 || this.mapImageArea.selHotAreaIndex >= 0)) {
- this.saveButton.enable();
- } else {
- this.saveButton.disable();
- }
-
- if (this.mapMode == 0 && this.mapImageArea.iMaxHotArea >= 0) {
- this.selButton.enable();
- } else {
- this.selButton.disable();
- }
-
- if (this.mapImageArea.iMaxHotArea >= 0 && this.mapMode == 0) {
- this.getResultButton.enable();
- } else {
- this.getResultButton.disable();
- }
-
- this.hotMode.setCurrent(this.hotOption[this.hotStyle]);
- this.tipsMode.setCurrent(this.tipsOption[this.tipsOn]);
- if (this.mapImageArea.iMaxHotArea >= 0 && this.mapMode != 1) {
- this.resetButton.enable();
- } else {
- this.resetButton.disable();
- }
-
- this.theMode.setCurrent(this.modeBox[this.mapMode]);
- this.borderButton.setLabel(this.borderButtonLabel[this.editState]);
- if (!this.resetButton.getLabel().equals("Remove All Hot Areas")) {
- this.saveButton.setLabel("Save Selected Hot Area");
- this.resetButton.setLabel("Remove All Hot Areas");
- this.delButton.setLabel("Delete Selected Hot Area");
- this.selButton.setLabel("Select An Existing Area");
- this.getResultButton.setLabel("Generate HTML Script");
- this.readmeButton.setLabel("Read Me First!!");
- }
-
- if (this.editState == 0) {
- this.saveButton.setLabel("Save Selected Hot Area");
- } else {
- this.saveButton.setLabel("Save Editing Hot Area");
- }
-
- if (this.mapMode == 0 && this.mapImageArea.selHotAreaIndex >= 0 && this.mapImageArea.selHotAreaIndex < this.mapImageArea.maxNumArea - 1) {
- this.getHint.setText(this.mapImageArea.HotAreas[this.mapImageArea.selHotAreaIndex].szHint);
- this.getURL.setText(this.mapImageArea.HotAreas[this.mapImageArea.selHotAreaIndex].szURLDescription);
- this.getAU.setText(this.mapImageArea.HotAreas[this.mapImageArea.selHotAreaIndex].auSourceName);
- }
-
- this.getImageName.setText(this.imageName);
-
- for(int var1 = 0; var1 < 2; ++var1) {
- if (this.mapMode != 0) {
- this.audioOption[var1].disable();
- this.openOption[var1].disable();
- } else {
- this.audioOption[var1].enable();
- this.openOption[var1].enable();
- }
- }
-
- if (this.mapMode == 0 && (this.mapImageArea.selHotAreaIndex >= 0 || this.editState != 0)) {
- this.getURL.enable();
- this.getAU.enable();
- this.getImageName.enable();
- this.getHint.enable();
- } else {
- this.getURL.disable();
- this.getAU.disable();
- this.getImageName.disable();
- this.getHint.disable();
- }
-
- this.update_instruction();
- if (this.m_common.disableLevel == 2) {
- this.getURL.disable();
- }
-
- }
- }
-
- public void update_instruction() {
- String var1;
- if (!this.readmeDone) {
- var1 = "Please click at button label \"Read Me First\" to see the instructions\n before editing image map.\n\n";
- } else {
- var1 = "The result HTML script will be dislay here after you click at the button\n";
- var1 = var1 + "labeled \"Generate HTML Script\". You can copy and paste the content\n";
- var1 = var1 + "in this field to your page: CoolMap is ready to go!! \nEasy and quickly done!!\n\n";
- }
-
- switch (this.instructionID) {
- case 0:
- var1 = this.generateResult();
- break;
- case 1:
- if (this.m_common.disableLevel == 2) {
- if (this.m_common.releaseLevel == this.m_common.TheDemo) {
- var1 = var1 + "You can not change the URL in this demo version. That is, if you click\n";
- var1 = var1 + "at any Hot Area in the map, Mark Qian's Home Page will be opened so \n";
- var1 = var1 + "that you can download the Adware version(FREE) and shareware version\n";
- var1 = var1 + "of CoolMap and more exciting Java applet, best screen savers over there.\n";
- } else {
- var1 = var1 + "To remove the button above imagemap, you need to register the shareware \n";
- var1 = var1 + "version of CoolMap.\n";
- }
- }
- break;
- case 2:
- var1 = "You can click at a Hot Area directly to select it.";
- break;
- case 3:
- var1 = "To specify a border for a Hot Area, you need to\n";
- var1 = var1 + " 1). Point your mouse cursor to a point where you like to use as the first point of the hot area. Press left \n";
- var1 = var1 + " mouse button and drag to the second point. Then release mouse button.\n";
- var1 = var1 + " 2). Click at next point.\n";
- var1 = var1 + " 3). Repeat step 2 until you finished all the points which limit the hot area.\n\n";
- var1 = var1 + "Click at button labeled \"Read Me\" to see the details about how to \n";
- var1 = var1 + "create a Hot Area.";
- case 4:
- case 5:
- case 6:
- case 7:
- }
-
- this.getResult.setText(var1);
- }
-
- public boolean handleEvent(Event var1) {
- switch (var1.id) {
- case 1001:
- if (var1.target == this.borderButton) {
- if (this.editState == 1) {
- this.editState = 0;
- this.currentPoint = 0;
- this.m_common.setTheCursor(0);
- } else {
- this.editState = 1;
- this.m_common.setTheCursor(1);
- this.mapImageArea.preHotAreaIndex = -1;
- this.mapImageArea.selHotAreaIndex = -1;
- this.currentPoint = 0;
- this.instructionID = 3;
- }
-
- this.mapImageArea.paint(this.gcOn);
- } else if (var1.target == this.saveButton) {
- if (this.editState == 1 && this.currentPoint > 2) {
- this.getHotArea();
- } else {
- this.updateHotArea(this.mapImageArea.selHotAreaIndex);
- }
-
- this.editState = 0;
- this.currentPoint = 0;
- this.mapImageArea.paint(this.gcOn);
- this.m_common.setTheCursor(0);
- } else if (var1.target == this.modeBox[0]) {
- this.mapMode = 0;
- this.currentPoint = 0;
- this.editState = 0;
- this.mapImageArea.makeStatic = 0;
- this.update_applet();
- this.mapImageArea.paint(this.gcOn);
- this.m_common.setTheCursor(0);
- } else if (var1.target == this.modeBox[1]) {
- this.m_common.setTheCursor(3);
- this.mapMode = 1;
- this.editState = 0;
- this.update_applet();
- this.doLoadAudio();
- this.update_applet();
- this.mapImageArea.paint(this.gcOn);
- this.m_common.setTheCursor(0);
- } else if (var1.target != this.hotOption[0] && var1.target != this.hotOption[1]) {
- if (var1.target != this.tipsOption[0] && var1.target != this.tipsOption[1]) {
- if (var1.target == this.delButton) {
- if (this.mapImageArea.selHotAreaIndex >= 0 && this.mapImageArea.selHotAreaIndex <= this.mapImageArea.iMaxHotArea) {
- this.mapMode = 0;
- this.editState = 0;
- this.mapImageArea.HotAreas[this.mapImageArea.selHotAreaIndex].bUsed = false;
- this.mapImageArea.preHotAreaIndex = -1;
- this.mapImageArea.selHotAreaIndex = -1;
- this.mapImageArea.updateHotList();
- this.mapImageArea.paint(this.gcOn);
- }
- } else if (var1.target == this.selButton) {
- this.editState = 0;
- if (this.mapImageArea.iMaxHotArea >= 0) {
- ++this.mapImageArea.preHotAreaIndex;
- if (++this.mapImageArea.selHotAreaIndex > this.mapImageArea.iMaxHotArea) {
- this.mapImageArea.selHotAreaIndex = 0;
- this.mapImageArea.preHotAreaIndex = this.mapImageArea.iMaxHotArea;
- }
-
- this.mapImageArea.paint(this.gcOn);
- }
-
- this.instructionID = 2;
- } else if (var1.target == this.resetButton) {
- this.mapMode = 0;
- this.editState = 0;
- this.mapImageArea.preHotAreaIndex = -1;
- this.mapImageArea.selHotAreaIndex = -1;
- this.currentPoint = 0;
- this.mapImageArea.iMaxHotArea = -1;
- this.mapImageArea.paint(this.gcOn);
- } else if (var1.target == this.getResultButton) {
- this.m_common.setTheCursor(3);
- this.editState = 0;
- this.instructionID = 0;
- this.getResult.setText("CoolMap is generating HTML script. Please wait...");
- this.imageName = this.getImageName.getText();
- this.resultLabel.setText("Result HTML Script: (Copy and paste the content below to your page)");
- this.m_common.setTheCursor(0);
- } else if (var1.target == this.adButton) {
- if (this.m_common.uhomeURL != null) {
- ((Applet)this).getAppletContext().showDocument(this.m_common.uhomeURL);
- }
- } else if (var1.target == this.readmeButton) {
- String var2 = " CoolMap is a Java applet written by Mark Qian. It is COOL because it comes with a design \n";
- var2 = var2 + "center which makes image map design and maintenance visible. What you see here is \n";
- var2 = var2 + "the Design Mode. An image map consists of a series of hot areas where tooltips will be\n";
- var2 = var2 + "poped up to descibe to details about that area when mouse cursor is moved over. A sound will \n";
- var2 = var2 + "also be played when mouse is moved over a particular hot area. The corresponding URL will\n";
- var2 = var2 + "be opened when clicking at a hot area.\n";
- var2 = var2 + " To use CoolMap's Design Center to generate HTML script which calls CoolMap for you with your hot areas,\n";
- var2 = var2 + "you need to\n\n";
- var2 = var2 + " 1). Set parameter mode in you HTML script that call CoolMap to Design. Then run the script with a browser\n";
- var2 = var2 + " (You have done this).\n";
- var2 = var2 + " 2). Select the Edit mode in Mode section.\n";
- var2 = var2 + " 3). Point your mouse cursor to a point where you like to use as the first point of the hot area. Press left \n";
- var2 = var2 + " mouse button and drag to the second point. Then release mouse button.\n";
- var2 = var2 + " 4). Click at next point.\n";
- var2 = var2 + " 5). Repeat step 4 until you finished all the points which limit the hot area.\n";
- var2 = var2 + " 6). Edit content of tooltips.\n";
- var2 = var2 + " 7). Edit URL address. This URL will be opened when the hot area is clicked.\n";
- var2 = var2 + " 8). Select an audio file for the hot area. This audio file will be played when mouse cursor moves over the hot area.\n";
- var2 = var2 + " 9). Click at button label 'Save Current Hot Area'.\n";
- var2 = var2 + " 10). Click at button label 'Generate HTML Script'.\n";
- var2 = var2 + " 11). Select the content in the text area at the bottom label 'HTML Script'(this field is label 'Instructions' before \n";
- var2 = var2 + " you click at button label 'Generate HTML Script') using mouse\n";
- var2 = var2 + " 12). Select Edit and Copy from the pull-down manu of broser to copy the HTML script to clipboard.\n";
- var2 = var2 + " 13). Paste the content of clipboard to an empty text file named, say test.htm. Then browse test.htm with your browser.\n";
- var2 = var2 + " If you see what you want, insert the HTML script to your page.\n\n";
- var2 = var2 + " Done!! Easy and quickly done!!";
- Frame var3 = new Frame();
- ((Container)this).add(var3);
- readme var4 = new readme(var3, this, " Instructions To Create A Image Map Using CoolMap", false, var2);
- ((Component)var4).resize(700, 400);
- ((Window)var4).show();
- this.readmeDone = true;
- this.readmeButton.setLabel("Read Me");
- }
- } else if (this.tipsMode.getCurrent() == this.tipsOption[0]) {
- this.tipsOn = 0;
- } else if (this.tipsMode.getCurrent() == this.tipsOption[1]) {
- this.tipsOn = 1;
- }
- } else if (this.hotMode.getCurrent() == this.hotOption[0]) {
- this.hotStyle = 0;
- } else if (this.hotMode.getCurrent() == this.hotOption[1]) {
- this.hotStyle = 1;
- }
-
- this.update_applet();
- return true;
- default:
- return false;
- }
- }
-
- public void doLoadAudio() {
- this.mapImageArea.makeStatic = 1;
- this.mapImageArea.hintX = 100;
- this.mapImageArea.hintY = 100;
- this.mapImageArea.szHintText = "CoolMap is fetching audio files. Please wait...";
- this.mapImageArea.parseHint();
- this.mapImageArea.paint(this.gcOn);
- this.mapImageArea.loadAudioFiles();
- this.mapImageArea.makeStatic = 0;
- this.mapImageArea.setNewHintText((String)null);
- this.doItOnce = 1;
- this.mapImageArea.paint(this.gcOn);
- this.doItOnce = 0;
- Event var1 = new Event(this, 2434L, 505, 20, 20, 2, 1);
- ((Component)this).postEvent(var1);
- }
-
- public String generateResult() {
- if (this.mapImageArea.iMaxHotArea < 0) {
- return "";
- } else {
- String var1 = "";
- var1 = var1 + "<HTML>\n";
- var1 = var1 + "<HEAD><TITLE> Test coolmap </TITLE> </HEAD>\n";
- var1 = var1 + "<BODY BGCOLOR=\"#BCBCBC\">\n";
- if (this.m_common.releaseLevel == this.m_common.TheAdware) {
- var1 = var1 + "<applet code=\"coolmap.class\" width=" + this.mapImageArea.size().width + " height=" + (this.mapImageArea.size().height + this.AdButtonHeight) + ">\n";
- } else {
- var1 = var1 + "<applet code=\"coolmap.class\" width=" + this.mapImageArea.size().width + " height=" + this.mapImageArea.size().height + ">\n";
- }
-
- var1 = var1 + "<param name=mode value=\"map\">\n";
- var1 = var1 + "<param name=imageTop value=\"" + this.mapArea.y + "\">\n";
- var1 = var1 + "<param name=imageLeft value=\"" + this.mapArea.x + "\">\n";
- var1 = var1 + "<param name=imageWidth value=\"" + this.imageWidth + "\">\n";
- var1 = var1 + "<param name=imageHeigth value=\"" + this.imageHeigth + "\">\n";
- var1 = var1 + "<param name=hintWidth value=\"" + this.mapImageArea.hintWidth + "\">\n";
- var1 = var1 + "<param name=fontHeight value=\"" + this.mapImageArea.fontHeight + "\">\n";
- var1 = var1 + "<param name=mapImage value=\"" + this.imageName + "\">\n";
- var1 = var1 + "<param name=background value=\"" + this.m_common.background + "\">\n";
- var1 = var1 + "<param name=bgcolor value=\"" + this.m_common.bgcolor + "\">\n";
- var1 = var1 + "<param name=hotStyle value=\"" + this.hotStyle + "\">\n";
- var1 = var1 + "<param name=tipsOn value=\"" + this.tipsOn + "\">\n";
-
- for(int var2 = 0; var2 <= this.mapImageArea.iMaxHotArea; ++var2) {
- var1 = var1 + "<param name=hot_area" + (var2 + 1);
- var1 = var1 + " value=\"" + this.mapImageArea.HotAreas[var2].szURLDescription;
- var1 = var1 + "#" + this.mapImageArea.HotAreas[var2].auSourceName;
- var1 = var1 + "#" + this.mapImageArea.HotAreas[var2].audioMode;
- var1 = var1 + "#" + this.mapImageArea.HotAreas[var2].openMode;
- if (this.mapImageArea.HotAreas[var2].openMode == 0) {
- var1 = var1 + "#No_Title";
- } else {
- var1 = var1 + "#" + this.mapImageArea.HotAreas[var2].szFrame;
- }
-
- for(int var3 = 0; var3 < this.mapImageArea.HotAreas[var2].polyMyArea.npoints; ++var3) {
- var1 = var1 + "#" + this.mapImageArea.HotAreas[var2].polyMyArea.xpoints[var3];
- var1 = var1 + "#" + this.mapImageArea.HotAreas[var2].polyMyArea.ypoints[var3];
- }
-
- if (this.mapImageArea.HotAreas[var2].szHint != null && !this.mapImageArea.HotAreas[var2].szHint.equals("")) {
- var1 = var1 + "#" + this.mapImageArea.HotAreas[var2].szHint + "\">\n";
- } else {
- var1 = var1 + "#No tooltips\">\n";
- }
- }
-
- var1 = var1 + "</applet>\n";
- var1 = var1 + "</BODY>\n";
- var1 = var1 + "</HTML>\n";
- return var1;
- }
- }
-
- public void testHotArea() {
- if (this.mapImageArea.iMaxHotArea >= 0) {
- String var1 = "iMaxHotArea=" + this.mapImageArea.iMaxHotArea + "\n";
-
- for(int var2 = 0; var2 <= this.mapImageArea.iMaxHotArea; ++var2) {
- var1 = var1 + "Hint: " + this.mapImageArea.HotAreas[var2].szHint + "\n";
- var1 = var1 + "URL: " + this.mapImageArea.HotAreas[var2].szURLDescription + "\n";
-
- for(int var3 = 0; var3 < this.mapImageArea.HotAreas[var2].polyMyArea.npoints; ++var3) {
- var1 = var1 + this.mapImageArea.HotAreas[var2].polyMyArea.xpoints[var3] + "-" + this.mapImageArea.HotAreas[var2].polyMyArea.ypoints[var3] + ", ";
- }
-
- var1 = var1 + "\n";
- }
-
- this.getResult.setText(var1);
- }
- }
-
- public void getHotArea() {
- ++this.mapImageArea.iMaxHotArea;
- this.mapImageArea.HotAreas[this.mapImageArea.iMaxHotArea] = new hintpot();
-
- for(int var1 = 0; var1 < this.currentPoint; ++var1) {
- this.mapImageArea.HotAreas[this.mapImageArea.iMaxHotArea].polyMyArea.addPoint(this.mapImageArea.hotPointX[var1], this.mapImageArea.hotPointY[var1]);
- this.mapImageArea.HotAreas[this.mapImageArea.iMaxHotArea].m_parent = this.mapImageArea;
- }
-
- this.updateHotArea(this.mapImageArea.iMaxHotArea);
- this.mapImageArea.selHotAreaIndex = this.mapImageArea.iMaxHotArea;
- }
-
- public void updateHotArea(int var1) {
- if (var1 >= 0 && var1 <= this.mapImageArea.iMaxHotArea) {
- this.mapImageArea.HotAreas[var1].szHint = this.getHint.getText();
- this.mapImageArea.HotAreas[var1].szURLDescription = this.getURL.getText();
- this.mapImageArea.HotAreas[var1].auSourceName = this.getAU.getText();
- if (this.audioMode.getCurrent() == this.audioOption[0]) {
- this.mapImageArea.HotAreas[var1].audioMode = 0;
- } else {
- this.mapImageArea.HotAreas[var1].audioMode = 1;
- }
-
- if (this.openMode.getCurrent() == this.openOption[0]) {
- this.mapImageArea.HotAreas[var1].openMode = 0;
- } else {
- this.mapImageArea.HotAreas[var1].openMode = 1;
- }
-
- if (this.mapImageArea.HotAreas[var1].szURLDescription != null) {
- try {
- this.mapImageArea.HotAreas[var1].uURL = new URL(this.mapImageArea.HotAreas[var1].szURLDescription);
- } catch (MalformedURLException var2) {
- this.mapImageArea.HotAreas[var1].uURL = null;
- }
- }
- }
- }
-
- public void iniMain() {
- ((Component)this).setBackground(Color.lightGray);
- ((Component)this).setFont(new Font("Helvetica", 0, 12));
- if (this.mode.equalsIgnoreCase("map")) {
- ((Container)this).setLayout(new BorderLayout());
- if (this.m_common.releaseLevel == this.m_common.TheAdware) {
- this.adButton = new Button("Click here to place it in your page for FREE");
- ((Container)this).add("North", this.adButton);
- ((Container)this).add("South", this.mapImageArea);
- } else {
- ((Container)this).add("North", this.mapImageArea);
- }
-
- this.mapMode = 1;
- } else {
- if (!this.deskArrange.equalsIgnoreCase("LeftRight")) {
- ((Container)this).setLayout(new BorderLayout());
- }
-
- Panel var1 = new Panel();
- ((Container)var1).setLayout(new BorderLayout());
- Panel var2 = new Panel();
- ((Container)var2).setLayout(new GridLayout(0, 1, 0, 0));
- Panel var3 = new Panel();
- ((Container)var3).setLayout(new FlowLayout());
- this.modeBox[0] = new Checkbox("Edit", this.theMode, false);
- this.modeBox[1] = new Checkbox("Test", this.theMode, false);
- ((Container)var3).add(new Label("Mode:"));
- ((Container)var3).add(this.modeBox[0]);
- ((Container)var3).add(this.modeBox[1]);
- Panel var4 = new Panel();
- ((Container)var4).setLayout(new FlowLayout());
- this.audioOption[0] = new Checkbox("Play when mouse over", this.audioMode, true);
- this.audioOption[1] = new Checkbox("Play when cick", this.audioMode, false);
- ((Container)var4).add(new Label("Audio Mode:"));
- ((Container)var4).add(new Label(" "));
- ((Container)var4).add(this.audioOption[0]);
- ((Container)var4).add(new Label(" "));
- ((Container)var4).add(this.audioOption[1]);
- Panel var5 = new Panel();
- ((Container)var5).setLayout(new FlowLayout());
- this.openOption[0] = new Checkbox("URL in original Window", this.openMode, true);
- this.openOption[1] = new Checkbox("URL in new Window", this.openMode, false);
- ((Container)var5).add(new Label("URL Open Mode:"));
- ((Container)var5).add(new Label(" "));
- ((Container)var5).add(this.openOption[0]);
- ((Container)var5).add(new Label(" "));
- ((Container)var5).add(this.openOption[1]);
- Panel var6 = new Panel();
- ((Container)var6).setLayout(new FlowLayout());
- this.hotOption[0] = new Checkbox("Not show border", this.hotMode, true);
- this.hotOption[1] = new Checkbox("Flash border", this.hotMode, false);
- ((Container)var6).add(new Label("Hot Area Border Mode:"));
- ((Container)var6).add(new Label(" "));
- ((Container)var6).add(this.hotOption[0]);
- ((Container)var6).add(new Label(" "));
- ((Container)var6).add(this.hotOption[1]);
- Panel var7 = new Panel();
- ((Container)var7).setLayout(new FlowLayout());
- this.tipsOption[0] = new Checkbox("Not show tooltips", this.tipsMode, true);
- this.tipsOption[1] = new Checkbox("Show tooltips", this.tipsMode, false);
- ((Container)var7).add(new Label("Tooltips Mode:"));
- ((Container)var7).add(new Label(" "));
- ((Container)var7).add(this.tipsOption[0]);
- ((Container)var7).add(new Label(" "));
- ((Container)var7).add(this.tipsOption[1]);
- Panel var8 = new Panel();
- ((Container)var8).setLayout(new FlowLayout());
- ((Container)var8).add(new Label(" "));
- ((Container)var8).add(new Label(" "));
- ((Container)var8).add(new Label(" "));
- ((Container)var2).add(var4);
- ((Container)var2).add(var5);
- ((Container)var2).add(var6);
- ((Container)var2).add(var7);
- this.borderButton = new Button(this.borderButtonLabel[this.editState]);
- this.saveButton = new Button("Delete Selected Hot Area");
- this.resetButton = new Button("Delete Selected Hot Area");
- this.delButton = new Button("Delete Selected Hot Area");
- this.selButton = new Button("Delete Selected Hot Area");
- this.getResultButton = new Button("Delete Selected Hot Area");
- this.readmeButton = new Button("Delete Selected Hot Area");
- Panel var9 = new Panel();
- ((Container)var9).setLayout(new GridLayout(0, 2, 4, 5));
- ((Container)var9).add(var3);
- ((Container)var9).add(new Label(""));
- ((Container)var9).add(this.selButton);
- ((Container)var9).add(this.borderButton);
- ((Container)var9).add(this.delButton);
- ((Container)var9).add(this.saveButton);
- ((Container)var9).add(this.resetButton);
- ((Container)var9).add(this.getResultButton);
- ((Container)var9).add(this.readmeButton);
- Panel var10 = new Panel();
- ((Container)var10).setLayout(new BorderLayout());
- this.getHint = new TextField("Enter your tooltip text here", 45);
- this.getURL = new TextField("http://", 45);
- this.getAU = new TextField("LAUGH.AU", 45);
- this.getImageName = new TextField(this.imageName, 45);
- this.resultLabel = new Label("Instructions: ");
- this.getResult = new TextArea("This field is used to display instructions and HTML results", 5, 20);
- Panel var11 = new Panel();
- Panel var12 = new Panel();
- Panel var13 = new Panel();
- Panel var14 = new Panel();
- Panel var15 = new Panel();
- Panel var16 = new Panel();
- ((Container)var11).setLayout(new GridLayout(0, 1, 2, 2));
- ((Container)var12).setLayout(new BorderLayout());
- ((Container)var13).setLayout(new BorderLayout());
- ((Container)var14).setLayout(new BorderLayout());
- ((Container)var15).setLayout(new BorderLayout());
- ((Container)var16).setLayout(new BorderLayout());
- ((Container)var12).add("North", new Label("Content of Tooltips:"));
- ((Container)var12).add("South", this.getHint);
- ((Container)var13).add("North", new Label("URL:"));
- ((Container)var13).add("South", this.getURL);
- ((Container)var14).add("North", new Label("Audio File:"));
- ((Container)var14).add("South", this.getAU);
- ((Container)var15).add("North", new Label("Imagemap File:"));
- ((Container)var15).add("South", this.getImageName);
- ((Container)var16).add("North", this.resultLabel);
- ((Container)var16).add("South", this.getResult);
- ((Container)var11).add(var12);
- ((Container)var11).add(var13);
- ((Container)var11).add(var14);
- ((Container)var11).add(var15);
- ((Container)var10).add("North", var11);
- ((Container)var10).add("South", var16);
- Panel var17 = new Panel();
- ((Container)var17).setLayout(new BorderLayout());
- ((Container)var17).add("North", var9);
- ((Container)var17).add("South", var2);
- ((Container)var1).add("North", var17);
- ((Container)var1).add("South", var10);
- if (this.deskArrange.equalsIgnoreCase("LeftRight")) {
- ((Container)this).add(this.mapImageArea);
- ((Container)this).add(new Label(" "));
- ((Container)this).add(var1);
- } else {
- ((Container)this).add("North", this.mapImageArea);
- ((Container)this).add("South", var1);
- }
- }
- }
-
- private void maintainOffScreenGC() {
- Dimension var1 = ((Component)this).size();
- if (this.imgStaticOffScreen == null || var1.width != this.dimOffScreen.width || var1.height != this.dimOffScreen.height || this.gcOff == null) {
- this.imgStaticOffScreen = ((Component)this).createImage(var1.width, var1.height);
- this.dimOffScreen = var1;
- this.gcOff = this.imgStaticOffScreen.getGraphics();
- this.gcOff.setColor(Color.lightGray);
- this.gcOff.fillRect(0, 0, this.dimOffScreen.width, this.dimOffScreen.height);
- }
-
- }
-
- public void maintainStaticImages() {
- this.maintainOffScreenGC();
- this.gcOff.drawImage(this.m_common.bufBK, 0, 0, this);
- this.gcOff.drawImage(this.mapImage, this.mapArea.x, this.mapArea.y, this);
- this.mapImageArea.paintHotArea(this.gcOff, true, Color.black);
- }
-
- public void copyOfftoOn() {
- this.mapImageArea.getGraphics().drawImage(this.imgStaticOffScreen, 0, 0, (ImageObserver)null);
- }
-
- Color getColorFromParam(String var1, Color var2) {
- byte var7 = 0;
- String var3;
- if ((var3 = ((Applet)this).getParameter(var1)) == null) {
- return var2;
- } else {
- if (var3.startsWith("#")) {
- var7 = 1;
- }
-
- int var4;
- int var5;
- int var6;
- try {
- var4 = Integer.parseInt(var3.substring(var7, 2 + var7), 16);
- var6 = Integer.parseInt(var3.substring(2 + var7, 4 + var7), 16);
- var5 = Integer.parseInt(var3.substring(4 + var7, 6 + var7), 16);
- } catch (Exception var8) {
- return var2;
- }
-
- return new Color(var4, var6, var5);
- }
- }
-
- public void paint(Graphics var1) {
- this.bInitComplete = true;
- if (this.bInitComplete) {
- this.maintainStaticImages();
- this.copyOfftoOn();
- }
-
- }
-
- public void debug(String var1) {
- System.out.println(var1);
- }
-
- public coolmap() {
- this.modeBox = new Checkbox[this.maxStates];
- this.audioMode = new CheckboxGroup();
- this.audioOption = new Checkbox[2];
- this.openMode = new CheckboxGroup();
- this.openOption = new Checkbox[2];
- this.hotMode = new CheckboxGroup();
- this.hotOption = new Checkbox[2];
- this.tipsMode = new CheckboxGroup();
- this.tipsOption = new Checkbox[2];
- this.borderButtonLabel = new String[this.maxStates];
- this.deskArrange = "TopBottom";
- this.readmeDone = false;
- this.mode = "design";
- this.instructionID = 1;
- this.adCountMax = 200;
- this.hotStyle = 1;
- this.tipsOn = 1;
- this.AdButtonHeight = 30;
- }
- }
-