]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
New datatype to represent the property border-separation
authorKaren Lease <klease@apache.org>
Wed, 11 Apr 2001 21:39:55 +0000 (21:39 +0000)
committerKaren Lease <klease@apache.org>
Wed, 11 Apr 2001 21:39:55 +0000 (21:39 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194200 13f79535-47bb-0310-9956-ffa450edef68

src/org/apache/fop/datatypes/LengthPair.java [new file with mode: 0644]

diff --git a/src/org/apache/fop/datatypes/LengthPair.java b/src/org/apache/fop/datatypes/LengthPair.java
new file mode 100644 (file)
index 0000000..00e70fd
--- /dev/null
@@ -0,0 +1,47 @@
+/*-- $Id$ --
+ * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
+ * For details on use and redistribution please refer to the
+ * LICENSE file included with these sources.
+ */
+
+package org.apache.fop.datatypes;
+
+import org.apache.fop.messaging.MessageHandler;
+import org.apache.fop.fo.Property;
+
+/**
+ * This datatype hold a pair of lengths, specifiying the dimensions in
+ * both inline and block-progression-directions.
+ * It is currently only used to specify border-separation in tables.
+ */
+public class LengthPair implements CompoundDatatype {
+
+    private Property ipd;
+    private Property bpd;
+
+  // From CompoundDatatype
+    public void setComponent(String sCmpnName, Property cmpnValue,
+                            boolean bIsDefault) {
+      if (sCmpnName.equals("block-progression-direction"))
+         bpd = cmpnValue;
+      else if (sCmpnName.equals("inline-progression-direction"))
+         ipd = cmpnValue;
+    }
+
+  // From CompoundDatatype
+  public Property getComponent(String sCmpnName) {
+      if (sCmpnName.equals("block-progression-direction"))
+       return getBPD();
+      else if (sCmpnName.equals("inline-progression-direction"))
+       return getIPD();
+      else return null; // SHOULDN'T HAPPEN
+    }
+
+    public Property getIPD() {
+       return this.ipd;
+    }
+
+    public Property getBPD() {
+       return this.bpd;
+    }
+}