home *** CD-ROM | disk | FTP | other *** search
- import java.applet.Applet;
- import java.awt.Color;
- import java.util.StringTokenizer;
-
- public class AppletSettings {
- // $FF: renamed from: ap java.applet.Applet
- Applet field_0;
- Color bgcolor;
- Color textcolor;
- String fontname;
- int fontsize;
- int fontstyle;
-
- AppletSettings(Applet var1) {
- this.bgcolor = Color.lightGray;
- this.textcolor = Color.black;
- this.fontname = "Helvetica";
- this.fontsize = 12;
- this.field_0 = var1;
- String var2 = "";
- var2 = this.field_0.getParameter("FONTNAME");
- if (var2 != null) {
- this.fontname = var2;
- }
-
- var2 = this.field_0.getParameter("FONTSIZE");
- if (var2 != null) {
- this.fontsize = Integer.parseInt(var2);
- }
-
- var2 = this.field_0.getParameter("FONTSTYLE");
- if (var2 != null) {
- var2 = var2.toLowerCase();
- if (var2.indexOf("bold") != -1) {
- ++this.fontstyle;
- }
-
- if (var2.indexOf("italic") != -1) {
- this.fontstyle += 2;
- }
- }
-
- var2 = this.field_0.getParameter("BGCOLOR");
- if (this.makeColor(var2) != null) {
- var2 = var2.toLowerCase();
- this.bgcolor = this.makeColor(var2);
- }
-
- var2 = this.field_0.getParameter("TEXTCOLOR");
- if (this.makeColor(var2) != null) {
- var2 = var2.toLowerCase();
- this.textcolor = this.makeColor(var2);
- }
-
- }
-
- public Color makeColor(String var1) {
- if (var1 == null) {
- return null;
- } else if (var1.indexOf(",") != -1) {
- StringTokenizer var2 = new StringTokenizer(var1, ",");
- return new Color(Integer.parseInt(var2.nextToken()), Integer.parseInt(var2.nextToken()), Integer.parseInt(var2.nextToken()));
- } else if (var1.equals("black")) {
- return Color.black;
- } else if (var1.equals("blue")) {
- return Color.blue;
- } else if (var1.equals("cyan")) {
- return Color.cyan;
- } else if (var1.equals("darkgray")) {
- return Color.darkGray;
- } else if (var1.equals("gray")) {
- return Color.gray;
- } else if (var1.equals("green")) {
- return Color.green;
- } else if (var1.equals("lightgray")) {
- return Color.lightGray;
- } else if (var1.equals("magenta")) {
- return Color.magenta;
- } else if (var1.equals("orange")) {
- return Color.orange;
- } else if (var1.equals("pink")) {
- return Color.pink;
- } else if (var1.equals("red")) {
- return Color.red;
- } else if (var1.equals("white")) {
- return Color.white;
- } else {
- return var1.equals("yellow") ? Color.yellow : null;
- }
- }
- }
-