Code indent fix

This commit is contained in:
Honfika
2013-12-28 11:33:22 +01:00
parent 91a2b29bcf
commit 037e301982

View File

@@ -178,133 +178,133 @@ public class DefineTextTag extends TextTag implements DrawableTag {
case PARAMETER:
String paramName = (String) s.values[0];
String paramValue = (String) s.values[1];
switch (paramName) {
case "color":
Matcher m = Pattern.compile("#([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])").matcher(paramValue);
if (m.matches()) {
color = new RGB(Integer.parseInt(m.group(1), 16), Integer.parseInt(m.group(2), 16), Integer.parseInt(m.group(3), 16));
} else {
throw new ParseException("Invalid color. Valid format is #rrggbb.", lexer.yyline());
}
break;
case "font":
try {
fontId = Integer.parseInt(paramValue);
for (Tag t : tags) {
if (t instanceof FontTag) {
if (((FontTag) t).getFontId() == fontId) {
font = (FontTag) t;
break;
}
switch (paramName) {
case "color":
Matcher m = Pattern.compile("#([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])").matcher(paramValue);
if (m.matches()) {
color = new RGB(Integer.parseInt(m.group(1), 16), Integer.parseInt(m.group(2), 16), Integer.parseInt(m.group(3), 16));
} else {
throw new ParseException("Invalid color. Valid format is #rrggbb.", lexer.yyline());
}
}
if (font == null) {
throw new ParseException("Font not found", lexer.yyline());
}
} catch (NumberFormatException nfe) {
throw new ParseException("Invalid font id - number expected.", lexer.yyline());
break;
case "font":
try {
fontId = Integer.parseInt(paramValue);
for (Tag t : tags) {
if (t instanceof FontTag) {
if (((FontTag) t).getFontId() == fontId) {
font = (FontTag) t;
break;
}
}
}
if (font == null) {
throw new ParseException("Font not found", lexer.yyline());
}
} catch (NumberFormatException nfe) {
throw new ParseException("Invalid font id - number expected.", lexer.yyline());
}
break;
case "height":
try {
textHeight = Integer.parseInt(paramValue);
} catch (NumberFormatException nfe) {
throw new ParseException("Invalid font height - number expected.", lexer.yyline());
}
break;
case "x":
try {
x = Integer.parseInt(paramValue);
currentX = x;
} catch (NumberFormatException nfe) {
throw new ParseException("Invalid x position - number expected.", lexer.yyline());
}
break;
case "y":
try {
y = Integer.parseInt(paramValue);
currentY = y;
} catch (NumberFormatException nfe) {
throw new ParseException("Invalid y position - number expected.", lexer.yyline());
}
break;
case "xmin":
try {
textBounds.Xmin = Integer.parseInt(paramValue);
} catch (NumberFormatException nfe) {
throw new ParseException("Invalid xmin position - number expected.", lexer.yyline());
}
break;
case "xmax":
try {
textBounds.Xmax = Integer.parseInt(paramValue);
} catch (NumberFormatException nfe) {
throw new ParseException("Invalid xmax position - number expected.", lexer.yyline());
}
break;
case "ymin":
try {
textBounds.Ymin = Integer.parseInt(paramValue);
} catch (NumberFormatException nfe) {
throw new ParseException("Invalid ymin position - number expected.", lexer.yyline());
}
break;
case "ymax":
try {
textBounds.Ymax = Integer.parseInt(paramValue);
} catch (NumberFormatException nfe) {
throw new ParseException("Invalid ymax position - number expected.", lexer.yyline());
}
break;
case "scalex":
try {
textMatrix.scaleX = Integer.parseInt(paramValue);
textMatrix.hasScale = true;
} catch (NumberFormatException nfe) {
throw new ParseException("Invalid scalex value - number expected.", lexer.yyline());
}
break;
case "scaley":
try {
textMatrix.scaleY = Integer.parseInt(paramValue);
textMatrix.hasScale = true;
} catch (NumberFormatException nfe) {
throw new ParseException("Invalid scalex value - number expected.", lexer.yyline());
}
break;
case "rotateskew0":
try {
textMatrix.rotateSkew0 = Integer.parseInt(paramValue);
textMatrix.hasRotate = true;
} catch (NumberFormatException nfe) {
throw new ParseException("Invalid rotateskew0 value - number expected.", lexer.yyline());
}
break;
case "rotateskew1":
try {
textMatrix.rotateSkew1 = Integer.parseInt(paramValue);
textMatrix.hasRotate = true;
} catch (NumberFormatException nfe) {
throw new ParseException("Invalid rotateskew1 value - number expected.", lexer.yyline());
}
break;
case "translatex":
try {
textMatrix.translateX = Integer.parseInt(paramValue);
} catch (NumberFormatException nfe) {
throw new ParseException("Invalid translatex value - number expected.", lexer.yyline());
}
break;
case "translatey":
try {
textMatrix.translateY = Integer.parseInt(paramValue);
} catch (NumberFormatException nfe) {
throw new ParseException("Invalid translatey value - number expected.", lexer.yyline());
}
break;
}
break;
case "height":
try {
textHeight = Integer.parseInt(paramValue);
} catch (NumberFormatException nfe) {
throw new ParseException("Invalid font height - number expected.", lexer.yyline());
}
break;
case "x":
try {
x = Integer.parseInt(paramValue);
currentX = x;
} catch (NumberFormatException nfe) {
throw new ParseException("Invalid x position - number expected.", lexer.yyline());
}
break;
case "y":
try {
y = Integer.parseInt(paramValue);
currentY = y;
} catch (NumberFormatException nfe) {
throw new ParseException("Invalid y position - number expected.", lexer.yyline());
}
break;
case "xmin":
try {
textBounds.Xmin = Integer.parseInt(paramValue);
} catch (NumberFormatException nfe) {
throw new ParseException("Invalid xmin position - number expected.", lexer.yyline());
}
break;
case "xmax":
try {
textBounds.Xmax = Integer.parseInt(paramValue);
} catch (NumberFormatException nfe) {
throw new ParseException("Invalid xmax position - number expected.", lexer.yyline());
}
break;
case "ymin":
try {
textBounds.Ymin = Integer.parseInt(paramValue);
} catch (NumberFormatException nfe) {
throw new ParseException("Invalid ymin position - number expected.", lexer.yyline());
}
break;
case "ymax":
try {
textBounds.Ymax = Integer.parseInt(paramValue);
} catch (NumberFormatException nfe) {
throw new ParseException("Invalid ymax position - number expected.", lexer.yyline());
}
break;
case "scalex":
try {
textMatrix.scaleX = Integer.parseInt(paramValue);
textMatrix.hasScale = true;
} catch (NumberFormatException nfe) {
throw new ParseException("Invalid scalex value - number expected.", lexer.yyline());
}
break;
case "scaley":
try {
textMatrix.scaleY = Integer.parseInt(paramValue);
textMatrix.hasScale = true;
} catch (NumberFormatException nfe) {
throw new ParseException("Invalid scalex value - number expected.", lexer.yyline());
}
break;
case "rotateskew0":
try {
textMatrix.rotateSkew0 = Integer.parseInt(paramValue);
textMatrix.hasRotate = true;
} catch (NumberFormatException nfe) {
throw new ParseException("Invalid rotateskew0 value - number expected.", lexer.yyline());
}
break;
case "rotateskew1":
try {
textMatrix.rotateSkew1 = Integer.parseInt(paramValue);
textMatrix.hasRotate = true;
} catch (NumberFormatException nfe) {
throw new ParseException("Invalid rotateskew1 value - number expected.", lexer.yyline());
}
break;
case "translatex":
try {
textMatrix.translateX = Integer.parseInt(paramValue);
} catch (NumberFormatException nfe) {
throw new ParseException("Invalid translatex value - number expected.", lexer.yyline());
}
break;
case "translatey":
try {
textMatrix.translateY = Integer.parseInt(paramValue);
} catch (NumberFormatException nfe) {
throw new ParseException("Invalid translatey value - number expected.", lexer.yyline());
}
break;
}
break;
case TEXT:
if (font == null) {
throw new ParseException("Font not defined", lexer.yyline());