home *** CD-ROM | disk | FTP | other *** search
- package javax.swing.text.html;
-
- import javax.swing.text.AttributeSet;
-
- class StyleSheet$FontSize extends StyleSheet.CssValue {
- // $FF: synthetic field
- private final StyleSheet this$0;
- float value;
- boolean relative;
- boolean index;
- boolean percentage;
-
- StyleSheet$FontSize(StyleSheet var1) {
- super(var1);
- this.this$0 = var1;
- }
-
- float getValue(AttributeSet var1) {
- return this.index ? this.this$0.getPointSize((int)this.value) : this.value;
- }
-
- boolean isRelative() {
- return this.relative;
- }
-
- Object parseCssValue(String var1) {
- StyleSheet$FontSize var2 = new StyleSheet$FontSize(this.this$0);
- var2.svalue = var1;
-
- try {
- if (var1.equals("xx-small")) {
- var2.value = 0.0F;
- var2.index = true;
- } else if (var1.equals("x-small")) {
- var2.value = 1.0F;
- var2.index = true;
- } else if (var1.equals("small")) {
- var2.value = 2.0F;
- var2.index = true;
- } else if (var1.equals("medium")) {
- var2.value = 3.0F;
- var2.index = true;
- } else if (var1.equals("large")) {
- var2.value = 4.0F;
- var2.index = true;
- } else if (var1.equals("x-large")) {
- var2.value = 5.0F;
- var2.index = true;
- } else if (var1.equals("xx-large")) {
- var2.value = 6.0F;
- var2.index = true;
- } else if (var1.equals("bigger")) {
- var2.value = 1.0F;
- var2.index = true;
- var2.relative = true;
- } else if (var1.equals("smaller")) {
- var2.value = -1.0F;
- var2.index = true;
- var2.relative = true;
- } else if (var1.endsWith("pt")) {
- String var3 = var1.substring(0, var1.length() - 2);
- var2.value = Float.valueOf(var3);
- } else {
- var2.value = Float.valueOf(var1);
- }
- } catch (NumberFormatException var4) {
- var2 = null;
- }
-
- return var2;
- }
-
- Object parseHtmlValue(String var1) {
- StyleSheet$FontSize var2 = new StyleSheet$FontSize(this.this$0);
- var2.svalue = var1;
-
- try {
- if (var1 != null && var1.charAt(0) == '+') {
- int var5 = Integer.valueOf(var1.substring(1));
- var2.value = (float)(StyleSheet.access$0(this.this$0) + var5);
- var2.index = true;
- } else if (var1 != null && var1.charAt(0) == '-') {
- int var3 = -Integer.valueOf(var1.substring(1));
- var2.value = (float)(StyleSheet.access$0(this.this$0) + var3);
- var2.index = true;
- } else {
- var2.value = (float)Integer.parseInt(var1);
- if (var2.value > 6.0F) {
- var2.value = 6.0F;
- } else if (var2.value < 0.0F) {
- var2.value = 0.0F;
- }
-
- var2.index = true;
- }
- } catch (NumberFormatException var4) {
- var2 = null;
- }
-
- return var2;
- }
- }
-