aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/fo/properties/EnumNumber.java
diff options
context:
space:
mode:
authorFinn Bock <bckfnn@apache.org>2004-10-28 15:21:54 +0000
committerFinn Bock <bckfnn@apache.org>2004-10-28 15:21:54 +0000
commitc79639a5e7e393fb36de72c9271217158858d848 (patch)
tree3b70677ecbcc8956d3007fa3e10c081f1a88da37 /src/java/org/apache/fop/fo/properties/EnumNumber.java
parentb0e76bca6ec366023f5f98d8e07aa77dbfabafe1 (diff)
downloadxmlgraphics-fop-c79639a5e7e393fb36de72c9271217158858d848.tar.gz
xmlgraphics-fop-c79639a5e7e393fb36de72c9271217158858d848.zip
Removed special case handling of "auto" enum for length properties.
Added general support for "auto" and other enums on Length and Numeric properties. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198107 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/fo/properties/EnumNumber.java')
-rwxr-xr-xsrc/java/org/apache/fop/fo/properties/EnumNumber.java69
1 files changed, 69 insertions, 0 deletions
diff --git a/src/java/org/apache/fop/fo/properties/EnumNumber.java b/src/java/org/apache/fop/fo/properties/EnumNumber.java
new file mode 100755
index 000000000..967d0357f
--- /dev/null
+++ b/src/java/org/apache/fop/fo/properties/EnumNumber.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.fo.properties;
+
+/**
+ * A number quantity in XSL which is specified as an enum, such as "no-limit".
+ */
+public class EnumNumber extends NumberProperty {
+ private Property enum;
+
+ public EnumNumber(Property enum) {
+ super(null);
+ this.enum = enum;
+ }
+
+ public int getEnum() {
+ return enum.getEnum();
+ }
+
+ /**
+ * Returns the length in 1/1000ths of a point (millipoints)
+ * @return the length in millipoints
+ */
+ public int getValue() {
+ log.error("getValue() called on " + enum + " number");
+ return 0;
+ }
+
+ /**
+ * Returns the value as numeric.
+ * @return the length in millipoints
+ */
+ public double getNumericValue() {
+ log.error("getNumericValue() called on " + enum + " number");
+ return 0;
+ }
+
+ /**
+ * @see org.apache.fop.fo.properties.Property#getString()
+ */
+ public String getString() {
+ return enum.toString();
+ }
+
+ /**
+ * @see org.apache.fop.fo.properties.Property#getString()
+ */
+ public Object getObject() {
+ return enum.getObject();
+ }
+
+
+}