home *** CD-ROM | disk | FTP | other *** search
- package webeq3.action;
-
- import java.awt.Color;
-
- public class SyntaxInfo {
- public static final int NONE = 0;
- public static final int OPERATOR = 1;
- public static final int OPERAND = 2;
- public static final int FUNCTION = 3;
- public static final int WHITESPACE = 4;
- public static final int FENCE = 5;
- public static final int WARNING = 6;
- public static final int ERROR = 7;
- static Color[] fgcolors;
- static Color[] bgcolors;
- static Color[] framecolors;
- public int type = 0;
- public int errorStatus = 0;
- public int framestyle;
- public boolean blink;
- private Color fgcolor;
- private Color bgcolor;
- private Color framecolor;
- protected boolean blink_on;
-
- public SyntaxInfo() {
- this.type = 0;
- this.refresh();
- }
-
- public SyntaxInfo(int var1) {
- this.type = var1;
- this.refresh();
- }
-
- public Color getFGcolor() {
- return this.fgcolor;
- }
-
- public Color getBGcolor() {
- return this.bgcolor;
- }
-
- public Color getFramecolor() {
- return this.framecolor;
- }
-
- public void setType(int var1) {
- this.type = var1;
- this.refresh();
- }
-
- public void setError(int var1) {
- this.errorStatus = var1;
- this.blink = true;
- this.refresh();
- }
-
- public void setBlink(boolean var1) {
- this.blink = var1;
- }
-
- public void setFrame(int var1) {
- this.framestyle = var1;
- this.refresh();
- }
-
- protected void refresh() {
- if (this.errorStatus != 0) {
- if (!this.blink_on && this.blink) {
- this.fgcolor = fgcolors[this.type];
- this.bgcolor = bgcolors[this.type];
- this.framecolor = framecolors[this.type];
- } else {
- this.fgcolor = fgcolors[this.errorStatus];
- this.bgcolor = bgcolors[this.errorStatus];
- this.framecolor = framecolors[this.errorStatus];
- }
- } else if (!this.blink_on && this.blink) {
- this.fgcolor = null;
- this.bgcolor = null;
- this.framecolor = null;
- } else {
- this.fgcolor = fgcolors[this.type];
- this.bgcolor = bgcolors[this.type];
- this.framecolor = framecolors[this.type];
- }
-
- }
-
- static {
- fgcolors = new Color[]{Color.black, Color.red, Color.blue, Color.green.darker(), Color.black, Color.black, Color.black, Color.black};
- bgcolors = new Color[]{null, null, null, null, null, null, Color.yellow, Color.red};
- framecolors = new Color[]{Color.white, Color.white, Color.white, Color.white, Color.white, Color.gray, Color.yellow, Color.red};
- }
- }
-