1 51 package org.apache.fop.fo; 52 53 import org.apache.fop.datatypes.ColorType; 54 import org.apache.fop.fo.expr.Numeric; 55 56 public class NumberProperty extends Property { 57 58 public static class Maker extends Property.Maker { 59 60 public Maker(String propName) { 61 super(propName); 62 } 63 64 public Property convertProperty(Property p, 65 PropertyList propertyList, FObj fo) { 66 if (p instanceof NumberProperty) 67 return p; 68 Number val = p.getNumber(); 69 if (val != null) 70 return new NumberProperty(val); 71 return convertPropertyDatatype(p, propertyList, fo); 72 } 73 74 } 75 76 private Number number; 77 78 public NumberProperty(Number num) { 79 this.number = num; 80 } 81 82 public NumberProperty(double num) { 83 this.number = new Double (num); 84 } 85 86 public NumberProperty(int num) { 87 this.number = new Integer (num); 88 } 89 90 public Number getNumber() { 91 return this.number; 92 } 93 94 102 103 public Object getObject() { 104 return this.number; 105 } 106 107 public Numeric getNumeric() { 108 return new Numeric(this.number); 109 } 110 111 public ColorType getColorType() { 112 return new ColorType((float)0.0, (float)0.0, (float)0.0); 115 } 116 117 } 118 | Popular Tags |