home *** CD-ROM | disk | FTP | other *** search
- package webeq3.app;
-
- import java.applet.Applet;
- import java.awt.Color;
- import java.awt.Component;
- import java.awt.Dimension;
- import java.awt.image.ImageObserver;
- import java.net.MalformedURLException;
- import java.net.URL;
- import webeq3.editor.EditorFrame;
-
- public class Handler {
- boolean is_applet = false;
- Applet my_applet;
- Component main;
- String[] argv;
- String defaultStatus = "";
-
- public void setParameters(Applet var1) {
- this.my_applet = var1;
- this.is_applet = true;
- }
-
- public void setParameters(Component var1, String[] var2) {
- this.main = var1;
- this.argv = var2;
- }
-
- public void setDefaultStatus(String var1) {
- this.defaultStatus = var1;
- }
-
- public Color getBackground() {
- return this.is_applet ? this.my_applet.getBackground() : this.main.getBackground();
- }
-
- public Color getForeground() {
- return this.is_applet ? this.my_applet.getForeground() : this.main.getForeground();
- }
-
- public ImageObserver getImageObserver() {
- return (ImageObserver)(this.is_applet ? this.my_applet : this.main);
- }
-
- public Component getComponent() {
- return (Component)(this.is_applet ? this.my_applet : this.main);
- }
-
- public String getParameter(String var1) {
- return this.is_applet ? this.my_applet.getParameter(var1) : null;
- }
-
- public Dimension size() {
- return this.is_applet ? this.my_applet.size() : this.main.size();
- }
-
- public void showStatus(String var1) {
- if (this.is_applet) {
- this.my_applet.showStatus(var1);
- } else if (this.main != null && this.main instanceof EditorFrame) {
- ((EditorFrame)this.main).setPromptString(var1);
- }
-
- }
-
- public void showDefaultStatus() {
- if (this.is_applet) {
- this.my_applet.showStatus(this.defaultStatus);
- }
-
- }
-
- public URL getCodeBase() {
- if (this.is_applet) {
- return this.my_applet.getCodeBase();
- } else {
- try {
- return new URL("file:" + System.getProperty("user.dir") + "/");
- } catch (MalformedURLException var2) {
- ((Throwable)var2).printStackTrace();
- return null;
- }
- }
- }
-
- public URL getDocumentBase() {
- if (this.is_applet) {
- return this.my_applet.getDocumentBase();
- } else {
- try {
- return new URL("file:" + System.getProperty("user.dir") + "/");
- } catch (MalformedURLException var2) {
- ((Throwable)var2).printStackTrace();
- return null;
- }
- }
- }
-
- public void showDocument(URL var1) {
- if (this.is_applet) {
- this.my_applet.getAppletContext().showDocument(var1);
- }
- }
-
- public void repaint() {
- if (this.is_applet) {
- this.my_applet.repaint();
- } else {
- this.main.repaint();
- }
-
- }
- }
-