Esempio n. 1
0
 public final Color color() throws ParseException {
   Token t;
   String s;
   Token r, g, b, a;
   switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
     case RGB:
       jj_consume_token(RGB);
       jj_consume_token(LPAREN);
       r = jj_consume_token(REAL);
       jj_consume_token(COMA);
       g = jj_consume_token(REAL);
       jj_consume_token(COMA);
       b = jj_consume_token(REAL);
       jj_consume_token(RPAREN);
       s = String.format("rgb(%s,%s,%s)", r.image, g.image, b.image);
       break;
     case RGBA:
       jj_consume_token(RGBA);
       jj_consume_token(LPAREN);
       r = jj_consume_token(REAL);
       jj_consume_token(COMA);
       g = jj_consume_token(REAL);
       jj_consume_token(COMA);
       b = jj_consume_token(REAL);
       jj_consume_token(COMA);
       a = jj_consume_token(REAL);
       jj_consume_token(RPAREN);
       s = String.format("rgba(%s,%s,%s,%s)", r.image, g.image, b.image, a.image);
       break;
     case HTMLCOLOR:
       t = jj_consume_token(HTMLCOLOR);
       s = t.image;
       break;
     case IDENTIFIER:
       t = jj_consume_token(IDENTIFIER);
       s = t.image;
       break;
     case STRING:
       t = jj_consume_token(STRING);
       s = t.image.substring(1, t.image.length() - 1);
       break;
     default:
       jj_la1[15] = jj_gen;
       jj_consume_token(-1);
       throw new ParseException();
   }
   Color color = Style.convertColor(s);
   if (color == null) color = Color.BLACK;
   {
     if (true) return color;
   }
   throw new Error("Missing return statement in function");
 }
Esempio n. 2
0
 public final void style(Style style) throws ParseException {
   Color color;
   Colors colors;
   String url;
   Value value;
   Values values;
   Style.FillMode fillMode;
   Style.StrokeMode strokeMode;
   Style.ShadowMode shadowMode;
   Style.TextMode textMode;
   Style.TextVisibilityMode textVisMode;
   Style.TextBackgroundMode textBgMode;
   Style.TextStyle textStyle;
   Style.TextAlignment textAlignment;
   Style.IconMode iconMode;
   Style.VisibilityMode visMode;
   Style.SizeMode sizeMode;
   Style.Shape shape;
   Style.SpriteOrientation spriteOrient;
   Style.ArrowShape arrowShape;
   Style.JComponents component;
   switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
     case COMMENT:
       jj_consume_token(COMMENT);
       break;
     case ZINDEX:
       jj_consume_token(ZINDEX);
       jj_consume_token(COLON);
       value = value();
       jj_consume_token(SEMICOLON);
       style.setValue("z-index", new Integer((int) value.value));
       break;
     case FILLMODE:
       jj_consume_token(FILLMODE);
       jj_consume_token(COLON);
       fillMode = fillMode();
       jj_consume_token(SEMICOLON);
       style.setValue("fill-mode", fillMode);
       break;
     case FILLCOLOR:
       jj_consume_token(FILLCOLOR);
       jj_consume_token(COLON);
       colors = colors();
       jj_consume_token(SEMICOLON);
       style.setValue("fill-color", colors);
       break;
     case FILLIMAGE:
       jj_consume_token(FILLIMAGE);
       jj_consume_token(COLON);
       url = url();
       jj_consume_token(SEMICOLON);
       style.setValue("fill-image", url);
       break;
     case STROKEMODE:
       jj_consume_token(STROKEMODE);
       jj_consume_token(COLON);
       strokeMode = strokeMode();
       jj_consume_token(SEMICOLON);
       style.setValue("stroke-mode", strokeMode);
       break;
     case STROKECOLOR:
       jj_consume_token(STROKECOLOR);
       jj_consume_token(COLON);
       colors = colors();
       jj_consume_token(SEMICOLON);
       style.setValue("stroke-color", colors);
       break;
     case STROKEWIDTH:
       jj_consume_token(STROKEWIDTH);
       jj_consume_token(COLON);
       value = value();
       jj_consume_token(SEMICOLON);
       style.setValue("stroke-width", value);
       break;
     case SHADOWMODE:
       jj_consume_token(SHADOWMODE);
       jj_consume_token(COLON);
       shadowMode = shadowMode();
       jj_consume_token(SEMICOLON);
       style.setValue("shadow-mode", shadowMode);
       break;
     case SHADOWCOLOR:
       jj_consume_token(SHADOWCOLOR);
       jj_consume_token(COLON);
       colors = colors();
       jj_consume_token(SEMICOLON);
       style.setValue("shadow-color", colors);
       break;
     case SHADOWWIDTH:
       jj_consume_token(SHADOWWIDTH);
       jj_consume_token(COLON);
       value = value();
       jj_consume_token(SEMICOLON);
       style.setValue("shadow-width", value);
       break;
     case SHADOWOFFSET:
       jj_consume_token(SHADOWOFFSET);
       jj_consume_token(COLON);
       values = values();
       jj_consume_token(SEMICOLON);
       style.setValue("shadow-offset", values);
       break;
     case PADDING:
       jj_consume_token(PADDING);
       jj_consume_token(COLON);
       values = values();
       jj_consume_token(SEMICOLON);
       style.setValue("padding", values);
       break;
     case TEXTMODE:
       jj_consume_token(TEXTMODE);
       jj_consume_token(COLON);
       textMode = textMode();
       jj_consume_token(SEMICOLON);
       style.setValue("text-mode", textMode);
       break;
     case TEXTVISIBILITYMODE:
       jj_consume_token(TEXTVISIBILITYMODE);
       jj_consume_token(COLON);
       textVisMode = textVisMode();
       jj_consume_token(SEMICOLON);
       style.setValue("text-visibility-mode", textVisMode);
       break;
     case TEXTVISIBILITY:
       jj_consume_token(TEXTVISIBILITY);
       jj_consume_token(COLON);
       values = values();
       jj_consume_token(SEMICOLON);
       style.setValue("text-visibility", values);
       break;
     case TEXTBACKGROUNDMODE:
       jj_consume_token(TEXTBACKGROUNDMODE);
       jj_consume_token(COLON);
       textBgMode = textBgMode();
       jj_consume_token(SEMICOLON);
       style.setValue("text-background-mode", textBgMode);
       break;
     case TEXTCOLOR:
       jj_consume_token(TEXTCOLOR);
       jj_consume_token(COLON);
       colors = colors();
       jj_consume_token(SEMICOLON);
       style.setValue("text-color", colors);
       break;
     case TEXTBACKGROUNDCOLOR:
       jj_consume_token(TEXTBACKGROUNDCOLOR);
       jj_consume_token(COLON);
       colors = colors();
       jj_consume_token(SEMICOLON);
       style.setValue("text-background-color", colors);
       break;
     case TEXTSTYLE:
       jj_consume_token(TEXTSTYLE);
       jj_consume_token(COLON);
       textStyle = textStyle();
       jj_consume_token(SEMICOLON);
       style.setValue("text-style", textStyle);
       break;
     case TEXTFONT:
       jj_consume_token(TEXTFONT);
       jj_consume_token(COLON);
       url = font();
       jj_consume_token(SEMICOLON);
       style.setValue("text-font", url);
       break;
     case TEXTSIZE:
       jj_consume_token(TEXTSIZE);
       jj_consume_token(COLON);
       value = value();
       jj_consume_token(SEMICOLON);
       style.setValue("text-size", value);
       break;
     case TEXTALIGNMENT:
       jj_consume_token(TEXTALIGNMENT);
       jj_consume_token(COLON);
       textAlignment = textAlign();
       jj_consume_token(SEMICOLON);
       style.setValue("text-alignment", textAlignment);
       break;
     case TEXTOFFSET:
       jj_consume_token(TEXTOFFSET);
       jj_consume_token(COLON);
       values = values();
       jj_consume_token(SEMICOLON);
       style.setValue("text-offset", values);
       break;
     case TEXTPADDING:
       jj_consume_token(TEXTPADDING);
       jj_consume_token(COLON);
       values = values();
       jj_consume_token(SEMICOLON);
       style.setValue("text-padding", values);
       break;
     case ICONMODE:
       jj_consume_token(ICONMODE);
       jj_consume_token(COLON);
       iconMode = iconMode();
       jj_consume_token(SEMICOLON);
       style.setValue("icon-mode", iconMode);
       break;
     case ICON:
       jj_consume_token(ICON);
       jj_consume_token(COLON);
       url = icon();
       jj_consume_token(SEMICOLON);
       style.setValue("icon", url);
       break;
     case JCOMPONENT:
       jj_consume_token(JCOMPONENT);
       jj_consume_token(COLON);
       component = jcomponent();
       jj_consume_token(SEMICOLON);
       style.setValue("jcomponent", component);
       break;
     case VISIBILITYMODE:
       jj_consume_token(VISIBILITYMODE);
       jj_consume_token(COLON);
       visMode = visMode();
       jj_consume_token(SEMICOLON);
       style.setValue("visibility-mode", visMode);
       break;
     case VISIBILITY:
       jj_consume_token(VISIBILITY);
       jj_consume_token(COLON);
       values = values();
       jj_consume_token(SEMICOLON);
       style.setValue("visibility", values);
       break;
     case SIZEMODE:
       jj_consume_token(SIZEMODE);
       jj_consume_token(COLON);
       sizeMode = sizeMode();
       jj_consume_token(SEMICOLON);
       style.setValue("size-mode", sizeMode);
       break;
     case SIZE:
       jj_consume_token(SIZE);
       jj_consume_token(COLON);
       values = values();
       jj_consume_token(SEMICOLON);
       style.setValue("size", values);
       break;
     case SHAPEPOINTS:
       jj_consume_token(SHAPEPOINTS);
       jj_consume_token(COLON);
       values = values();
       jj_consume_token(SEMICOLON);
       style.setValue("shape-points", values);
       break;
     case SHAPE:
       jj_consume_token(SHAPE);
       jj_consume_token(COLON);
       shape = shape();
       jj_consume_token(SEMICOLON);
       style.setValue("shape", shape);
       break;
     case SPRITEORIENT:
       jj_consume_token(SPRITEORIENT);
       jj_consume_token(COLON);
       spriteOrient = spriteOrient();
       jj_consume_token(SEMICOLON);
       style.setValue("sprite-orientation", spriteOrient);
       break;
     case ARROWSHAPE:
       jj_consume_token(ARROWSHAPE);
       jj_consume_token(COLON);
       arrowShape = arrowShape();
       jj_consume_token(SEMICOLON);
       style.setValue("arrow-shape", arrowShape);
       break;
     case ARROWIMGURL:
       jj_consume_token(ARROWIMGURL);
       jj_consume_token(COLON);
       url = url();
       jj_consume_token(SEMICOLON);
       style.setValue("arrow-image", url);
       break;
     case ARROWSIZE:
       jj_consume_token(ARROWSIZE);
       jj_consume_token(COLON);
       values = values();
       jj_consume_token(SEMICOLON);
       style.setValue("arrow-size", values);
       break;
     case CANVASCOLOR:
       jj_consume_token(CANVASCOLOR);
       jj_consume_token(COLON);
       colors = colors();
       jj_consume_token(SEMICOLON);
       style.setValue("canvas-color", colors);
       break;
     default:
       jj_la1[11] = jj_gen;
       jj_consume_token(-1);
       throw new ParseException();
   }
 }