// Interpret this in context of the property or do it later?
prop = new NCnameProperty(currentTokenValue);
break;
case TOK_FLOAT:
prop = new NumberProperty(new Double(currentTokenValue));
break;
case TOK_INTEGER:
prop = new NumberProperty(new Integer(currentTokenValue));
break;
case TOK_PERCENT:
/*
* Get the length base value object from the Maker. If null, then
* this property can't have % values. Treat it as a real number.
*/
double pcval = new Double(currentTokenValue.substring(0,
currentTokenValue.length() - 1)).doubleValue() / 100.0;
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 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));
if (unitPart.equals(RELUNIT)) {
prop = (Property) NumericOp.multiply(new NumberProperty(numPart.doubleValue()),
propInfo.currentFontSize());
} else {
prop = new FixedLength(numPart.doubleValue(), unitPart);
}
break;