KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > fop > fo > properties > EnumLength


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17
18 /* $Id: EnumLength.java 426576 2006-07-28 15:44:37Z jeremias $ */
19  
20 package org.apache.fop.fo.properties;
21
22 import org.apache.fop.datatypes.PercentBaseContext;
23
24 /**
25  * A length quantity in XSL which is specified as an enum, such as "auto"
26  */

27 public class EnumLength extends LengthProperty {
28     private Property enumProperty;
29     
30     public EnumLength(Property enumProperty) {
31         this.enumProperty = enumProperty;
32     }
33
34     /**
35      * @see org.apache.fop.datatypes.Numeric#getEnum()
36      */

37     public int getEnum() {
38         return enumProperty.getEnum();
39     }
40
41     public boolean isAbsolute() {
42         return false;
43     }
44
45     /**
46      * @see org.apache.fop.datatypes.Numeric#getValue()
47      */

48     public int getValue() {
49         log.error("getValue() called on " + enumProperty + " length");
50         return 0;
51     }
52
53     /**
54      * @see org.apache.fop.datatypes.Numeric#getValue(PercentBaseContext)
55      */

56     public int getValue(PercentBaseContext context) {
57         log.error("getValue() called on " + enumProperty + " length");
58         return 0;
59     }
60
61     /**
62      * @see org.apache.fop.datatypes.Numeric#getNumericValue()
63      */

64     public double getNumericValue() {
65         log.error("getNumericValue() called on " + enumProperty + " number");
66         return 0;
67     }
68
69     /**
70      * @see org.apache.fop.datatypes.Numeric#getNumericValue()
71      */

72     public double getNumericValue(PercentBaseContext context) {
73         log.error("getNumericValue() called on " + enumProperty + " number");
74         return 0;
75     }
76
77     /**
78      * @see org.apache.fop.fo.properties.Property#getString()
79      */

80     public String JavaDoc getString() {
81         return enumProperty.toString();
82     }
83
84     /**
85      * @see org.apache.fop.fo.properties.Property#getString()
86      */

87     public Object JavaDoc getObject() {
88         return enumProperty.getObject();
89     }
90
91
92 }
93
Popular Tags