PercentBase pcBase = this.propInfo.getPercentBase();
if (pcBase != null) {
if (pcBase.getDimension() == 0) {
prop = new NumberProperty(pcval * pcBase.getBaseValue());
} else if (pcBase.getDimension() == 1) {
prop = new LengthProperty(new PercentLength(pcval,
pcBase));
} else {
throw new PropertyException("Illegal percent dimension value");
}
} else {
// WARNING? Interpret as a decimal fraction, eg. 50% = .5
prop = new NumberProperty(pcval);
}
break;
case TOK_NUMERIC:
// A number plus a valid unit name.
int numLen = currentTokenValue.length() - currentUnitLength;
String unitPart = currentTokenValue.substring(numLen);
Double numPart = new Double(currentTokenValue.substring(0,
numLen));
Length length = null;
if (unitPart.equals(RELUNIT)) {
length = new FixedLength(numPart.doubleValue(),
propInfo.currentFontSize());
} else
length = new FixedLength(numPart.doubleValue(), unitPart);
if (length == null) {
throw new PropertyException("unrecognized unit name: "
+ currentTokenValue);
} else
prop = new LengthProperty(length);
break;
case TOK_COLORSPEC:
prop = new ColorTypeProperty(new ColorType(currentTokenValue));
break;