1 22 23 package cypress; 24 25 public class CssFloat extends CssValue 26 { 27 28 private float _value; 29 30 private CssFloat( float value, int type, CssValue prev ) 31 { 32 super( type, prev ); 33 _value = value; 34 } 35 36 public float getFloatValue() 37 { 38 return _value; 39 } 40 41 public static CssFloat createCentimeter( float value, CssValue prev ) 42 { 43 return new CssFloat( value, CENTIMETER, prev ); 44 } 45 46 public static CssFloat createEm( float value, CssValue prev ) 47 { 48 return new CssFloat( value, EM, prev ); 49 } 50 51 public static CssFloat createEx( float value, CssValue prev ) 52 { 53 return new CssFloat( value, EX, prev ); 54 } 55 56 57 public static CssFloat createInch( float value, CssValue prev ) 58 { 59 return new CssFloat( value, INCH, prev ); 60 } 61 62 public static CssFloat createMillimeter( float value, CssValue prev ) 63 { 64 return new CssFloat( value, MILLIMETER, prev ); 65 } 66 67 public static CssFloat createPercentage( float value, CssValue prev ) 68 { 69 return new CssFloat( value, PERCENTAGE, prev ); 70 } 71 72 public static CssFloat createPica( float value, CssValue prev ) 73 { 74 return new CssFloat( value, PICA, prev ); 75 } 76 77 public static CssFloat createPixel( float value, CssValue prev ) 78 { 79 return new CssFloat( value, PIXEL, prev ); 80 } 81 82 public static CssFloat createPoint( float value, CssValue prev ) 83 { 84 return new CssFloat( value, POINT, prev ); 85 } 86 87 public static CssFloat createReal( float value, CssValue prev ) 88 { 89 return new CssFloat( value, REAL, prev ); 90 } 91 92 public String toString() 93 { 94 return "float: " + _value; 95 } 96 } 97 | Popular Tags |