aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdrian Cumiskey <acumiskey@apache.org>2008-08-29 15:24:21 +0000
committerAdrian Cumiskey <acumiskey@apache.org>2008-08-29 15:24:21 +0000
commit45aa720f980b61a92786c879ae6bc2443e17558c (patch)
treecef6fae2ae27c30c2d662055b94c6274bf793854 /src
parentb550f664cfc36faa8baf468ce96199509a2bfc01 (diff)
downloadxmlgraphics-fop-45aa720f980b61a92786c879ae6bc2443e17558c.tar.gz
xmlgraphics-fop-45aa720f980b61a92786c879ae6bc2443e17558c.zip
Added MapContainerData object.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AFPGOCAResources@690294 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/java/org/apache/fop/render/afp/modca/MapContainerData.java57
1 files changed, 57 insertions, 0 deletions
diff --git a/src/java/org/apache/fop/render/afp/modca/MapContainerData.java b/src/java/org/apache/fop/render/afp/modca/MapContainerData.java
new file mode 100644
index 000000000..9ec157ee8
--- /dev/null
+++ b/src/java/org/apache/fop/render/afp/modca/MapContainerData.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.render.afp.modca;
+
+import java.io.IOException;
+import java.io.OutputStream;
+
+import org.apache.fop.render.afp.modca.triplets.MappingOptionTriplet;
+import org.apache.fop.render.afp.tools.BinaryUtils;
+
+/**
+ * The Map Container Data structured field specifies how a presentation data object
+ * that is carried in an Object Container is mapped into its object area.
+ */
+public class MapContainerData extends AbstractStructuredAFPObject {
+
+ /**
+ * Main constructor
+ *
+ * @param optionValue the mapping option value
+ */
+ public MapContainerData(byte optionValue) {
+ super.addTriplet(new MappingOptionTriplet(optionValue));
+ }
+
+ /** {@inheritDoc} */
+ public void writeToStream(OutputStream os) throws IOException {
+ byte[] data = new byte[11];
+ copySF(data, Type.MAP, Category.OBJECT_CONTAINER);
+ int tripletLen = getTripletDataLength();
+ byte[] len = BinaryUtils.convert(10 + tripletLen, 2);
+ data[1] = len[0];
+ data[2] = len[1];
+ len = BinaryUtils.convert(2 + tripletLen, 2);
+ data[9] = len[0];
+ data[10] = len[1];
+ os.write(data);
+ os.write(tripletData);
+ }
+}