home *** CD-ROM | disk | FTP | other *** search
Java Source | 1995-11-19 | 1.9 KB | 68 lines |
- import browser.Applet;
- import System.*;
- import awt.*;
- import java.lang.Boolean;
-
- public class MAEstroLaunch extends Applet
- {
- String launchString;
- Image logoImage;
- Boolean mouseWasPressed;
-
- public void init()
- {
- String appName = getAttribute("appName");
- String docName = getAttribute("docName");
- String theMessage = getAttribute("message");
- String selectStart = getAttribute("selectStart");
- String selectEnd = getAttribute("selectEnd");
- String selectDuration = getAttribute("selectDuration");
- String selectOffset = getAttribute("selectOffset");
- String messageArg = null;
-
- if (theMessage != null)
- {
- messageArg = "-message " + theMessage;
- }
- if (null == docName)
- {
- docName = " ";
- }
- launchString = "maetalk" + " " + appName + " " + docName +
- " " + messageArg + " " + selectStart + " " + selectEnd +
- " " + selectDuration + " " + selectOffset;
- logoImage = getImage("/export/ultrademocd/web/MAEstroLogo.gif");
- resize(logoImage.width, logoImage.height);
- mouseWasPressed = new Boolean(false);
- }
-
- public void start()
- {
- System.out.println("The applet was started, but does nothing 'til the mouse is pressed and released.");
- }
-
- public void paint(Graphics g)
- {
- g.drawImage(logoImage, 0, 0);
- g.paint3DRect(0, 0, logoImage.width + 2, logoImage.height + 2,
- false, true);
- }
-
- public void mouseDown(int x, int y)
- {
- mouseWasPressed = new Boolean(true);
- }
-
- public void mouseUp(int x, int y)
- {
- if (true == mouseWasPressed.booleanValue())
- {
- System.out.println("The mouse was pressed and released in the applet.");
- System.out.println("Launching.");
- System.out.println("launchString is ::" + launchString + "::");
- System.exec(launchString);
- mouseWasPressed = new Boolean(false); /* Reset the mouse state */
- }
- }
- } /* end class MAEstroLaunch */
-