You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by ac...@apache.org on 2008/07/17 21:13:58 UTC
svn commit: r677689 [3/4] - in
/xmlgraphics/fop/branches/Temp_AFPGOCAResources: conf/
src/java/org/apache/fop/render/ src/java/org/apache/fop/render/afp/
src/java/org/apache/fop/render/afp/goca/
src/java/org/apache/fop/render/afp/modca/ src/java/org/ap...
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ImageCellPosition.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ImageCellPosition.java?rev=677689&r1=677688&r2=677689&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ImageCellPosition.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ImageCellPosition.java Thu Jul 17 12:13:56 2008
@@ -69,26 +69,14 @@
yOffset = y;
}
- /**
- * Accessor method to write the AFP datastream for the Image Cell Position
- * @param os The stream to write to
- * @throws java.io.IOException if an I/O exception occurred
- */
+ /** {@inheritDoc} */
public void write(OutputStream os) throws IOException {
byte[] data = new byte[21];
-
- data[0] = 0x5A;
-
- data[1] = 0x00;
+ copySF(data, Type.POSITION, Category.IM_IMAGE);
+
+ data[1] = 0x00; // length
data[2] = 0x14;
- data[3] = (byte) 0xD3;
- data[4] = (byte) 0xAC;
- data[5] = (byte) 0x7B;
- data[6] = 0x00;
- data[7] = 0x00;
- data[8] = 0x00;
-
/**
* Specifies the offset along the Xp direction, in image points,
* of this image cell from the IM image object area origin.
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ImageDataDescriptor.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ImageDataDescriptor.java?rev=677689&r1=677688&r2=677689&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ImageDataDescriptor.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ImageDataDescriptor.java Thu Jul 17 12:13:56 2008
@@ -27,35 +27,29 @@
*/
public class ImageDataDescriptor extends AbstractAFPObject {
- private int _xresol = 0;
- private int _yresol = 0;
- private int _width = 0;
- private int _height = 0;
-
+ private int widthRes = 0;
+ private int heightRes = 0;
+ private int width = 0;
+ private int height = 0;
+
/**
* Constructor for a ImageDataDescriptor for the specified
* resolution, width and height.
- * @param xresol The horizontal resolution of the image.
- * @param yresol The vertical resolution of the image.
+ *
+ * @param widthRes The horizontal resolution of the image.
+ * @param heightRes The vertical resolution of the image.
* @param width The width of the image.
* @param height The height of the height.
*/
- public ImageDataDescriptor(int xresol, int yresol, int width, int height) {
-
- _xresol = xresol;
- _yresol = yresol;
- _width = width;
- _height = height;
-
+ public ImageDataDescriptor(int widthRes, int heightRes, int width, int height) {
+ this.widthRes = widthRes;
+ this.heightRes = heightRes;
+ this.width = width;
+ this.height = height;
}
- /**
- * Accessor method to write the AFP datastream for the Image Data Descriptor
- * @param os The stream to write to
- * @throws java.io.IOException
- */
- public void write(OutputStream os)
- throws IOException {
+ /** {@inheritDoc} */
+ public void write(OutputStream os) throws IOException {
byte[] data = new byte[] {
0x5A,
@@ -86,24 +80,22 @@
data[1] = l[0];
data[2] = l[1];
- byte[] x = BinaryUtils.convert(_xresol, 2);
+ byte[] x = BinaryUtils.convert(widthRes, 2);
data[10] = x[0];
data[11] = x[1];
- byte[] y = BinaryUtils.convert(_yresol, 2);
+ byte[] y = BinaryUtils.convert(heightRes, 2);
data[12] = y[0];
data[13] = y[1];
- byte[] w = BinaryUtils.convert(_width, 2);
+ byte[] w = BinaryUtils.convert(width, 2);
data[14] = w[0];
data[15] = w[1];
- byte[] h = BinaryUtils.convert(_height, 2);
+ byte[] h = BinaryUtils.convert(height, 2);
data[16] = h[0];
data[17] = h[1];
os.write(data);
-
}
-
}
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ImageInputDescriptor.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ImageInputDescriptor.java?rev=677689&r1=677688&r2=677689&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ImageInputDescriptor.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ImageInputDescriptor.java Thu Jul 17 12:13:56 2008
@@ -36,11 +36,7 @@
private int resolution = 240;
- /**
- * Accessor method to write the AFP datastream for the Image Input Descriptor
- * @param os The stream to write to
- * @throws java.io.IOException if an I/O exception occurred
- */
+ /** {@inheritDoc} */
public void write(OutputStream os) throws IOException {
byte[] data = new byte[45];
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ImageObject.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ImageObject.java?rev=677689&r1=677688&r2=677689&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ImageObject.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ImageObject.java Thu Jul 17 12:13:56 2008
@@ -38,6 +38,7 @@
/**
* Constructor for the image object with the specified name,
* the name must be a fixed length of eight characters.
+ *
* @param name The name of the image.
*/
public ImageObject(String name) {
@@ -46,6 +47,7 @@
/**
* Set the dimensions of the image.
+ *
* @param xresol the x resolution of the image
* @param yresol the y resolution of the image
* @param width the image width
@@ -61,6 +63,7 @@
/**
* Sets the image encoding.
+ *
* @param encoding The image encoding.
*/
public void setImageEncoding(byte encoding) {
@@ -72,6 +75,7 @@
/**
* Sets the image compression.
+ *
* @param compression The image compression.
*/
public void setImageCompression(byte compression) {
@@ -83,6 +87,7 @@
/**
* Sets the image IDE size.
+ *
* @param size The IDE size.
*/
public void setImageIDESize(byte size) {
@@ -94,6 +99,7 @@
/**
* Sets the image IDE color model.
+ *
* @param colorModel the IDE color model.
*/
public void setImageIDEColorModel(byte colorModel) {
@@ -105,6 +111,7 @@
/**
* Set the data of the image.
+ *
* @param data The image data
*/
public void setImageData(byte[] data) {
@@ -116,6 +123,7 @@
/**
* Helper method to return the start of the image object.
+ *
* @param len the length of this ipd start
* @return byte[] The data stream.
*/
@@ -135,9 +143,14 @@
return data;
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
+ protected void writeStart(OutputStream os) throws IOException {
+ byte[] data = new byte[17];
+ copySF(data, Type.BEGIN, Category.IMAGE);
+ os.write(data);
+ }
+
+ /** {@inheritDoc} */
protected void writeContent(OutputStream os) throws IOException {
super.writeContent(os);
if (imageSegment != null) {
@@ -154,45 +167,10 @@
}
}
- /**
- * {@inheritDoc}
- */
- protected void writeStart(OutputStream os) throws IOException {
- byte[] data = new byte[17];
- data[0] = 0x5A; // Structured field identifier
- data[1] = 0x00; // Length byte 1
- data[2] = 0x10; // Length byte 2
- data[3] = (byte) 0xD3; // Structured field id byte 1
- data[4] = (byte) 0xA8; // Structured field id byte 2
- data[5] = (byte) 0xFB; // Structured field id byte 3
- data[6] = 0x00; // Flags
- data[7] = 0x00; // Reserved
- data[8] = 0x00; // Reserved
- for (int i = 0; i < nameBytes.length; i++) {
- data[9 + i] = nameBytes[i];
- }
- os.write(data);
- }
-
- /**
- * Helper method to write the end of the Image Object.
- * @param os The stream to write to
- * @throws IOException in the event
- */
+ /** {@inheritDoc} */
protected void writeEnd(OutputStream os) throws IOException {
byte[] data = new byte[17];
- data[0] = 0x5A; // Structured field identifier
- data[1] = 0x00; // Length byte 1
- data[2] = 0x10; // Length byte 2
- data[3] = (byte) 0xD3; // Structured field id byte 1
- data[4] = (byte) 0xA9; // Structured field id byte 2
- data[5] = (byte) 0xFB; // Structured field id byte 3
- data[6] = 0x00; // Flags
- data[7] = 0x00; // Reserved
- data[8] = 0x00; // Reserved
- for (int i = 0; i < nameBytes.length; i++) {
- data[9 + i] = nameBytes[i];
- }
+ copySF(data, Type.END, Category.IMAGE);
os.write(data);
}
}
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ImageOutputControl.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ImageOutputControl.java?rev=677689&r1=677688&r2=677689&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ImageOutputControl.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ImageOutputControl.java Thu Jul 17 12:13:56 2008
@@ -67,17 +67,11 @@
* The Y-axis offset.
*/
public ImageOutputControl(int x, int y) {
-
xCoord = x;
yCoord = y;
-
}
- /**
- * Accessor method to write the AFP datastream for the Image Output Control
- * @param os The stream to write to
- * @throws java.io.IOException if an I/O exception occured
- */
+ /** {@inheritDoc} */
public void write(OutputStream os) throws IOException {
byte[] data = new byte[33];
@@ -170,7 +164,6 @@
data[32] = (byte) 0xFF;
os.write(data);
-
}
/**
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ImageRasterData.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ImageRasterData.java?rev=677689&r1=677688&r2=677689&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ImageRasterData.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ImageRasterData.java Thu Jul 17 12:13:56 2008
@@ -58,11 +58,7 @@
this.rasterData = data;
}
- /**
- * Accessor method to write the AFP datastream for the Image Raster Data
- * @param os The stream to write to
- * @throws java.io.IOException if an I/O exception occurred
- */
+ /** {@inheritDoc} */
public void write(OutputStream os) throws IOException {
byte[] data = new byte[9];
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ImageSegment.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ImageSegment.java?rev=677689&r1=677688&r2=677689&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ImageSegment.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ImageSegment.java Thu Jul 17 12:13:56 2008
@@ -18,6 +18,7 @@
/* $Id$ */
package org.apache.fop.render.afp.modca;
+
import java.io.IOException;
import java.io.OutputStream;
@@ -59,16 +60,14 @@
super(name);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected int getNameLength() {
return 4;
}
/**
- * Sets the image size parameters
- * resolution, hsize and vsize.
+ * Sets the image size parameters resolution, hsize and vsize.
+ *
* @param hresol The horizontal resolution of the image.
* @param vresol The vertical resolution of the image.
* @param hsize The horizontal size of the image.
@@ -83,6 +82,7 @@
/**
* Sets the image encoding.
+ *
* @param encoding The image encoding.
*/
public void setImageEncoding(byte encoding) {
@@ -94,6 +94,7 @@
/**
* Sets the image compression.
+ *
* @param compression The image compression.
*/
public void setImageCompression(byte compression) {
@@ -105,6 +106,7 @@
/**
* Sets the image IDE size.
+ *
* @param size The IDE size.
*/
public void setImageIDESize(byte size) {
@@ -116,6 +118,7 @@
/**
* Sets the image IDE color model.
+ *
* @param colorModel the IDE color model.
*/
public void setImageIDEColorModel(byte colorModel) {
@@ -127,6 +130,7 @@
/**
* Set the data of the image.
+ *
* @param data the image data
*/
public void setImageData(byte[] data) {
@@ -136,19 +140,16 @@
imageContent.setImageData(data);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void writeContent(OutputStream os) throws IOException {
if (imageContent != null) {
imageContent.write(os);
}
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected void writeStart(OutputStream os) throws IOException {
+ byte[] nameBytes = getNameBytes();
byte[] data = new byte[] {
0x70, // ID
0x04, // Length
@@ -160,11 +161,8 @@
os.write(data);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected void writeEnd(OutputStream os) throws IOException {
-
byte[] data = new byte[] {
0x71, // ID
0x00, // Length
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ImageSizeParameter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ImageSizeParameter.java?rev=677689&r1=677688&r2=677689&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ImageSizeParameter.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ImageSizeParameter.java Thu Jul 17 12:13:56 2008
@@ -48,11 +48,7 @@
this.vSize = vsize;
}
- /**
- * Accessor method to write the AFP datastream for the Image Size Parameter
- * @param os The stream to write to
- * @throws java.io.IOException if an I/O exception occured
- */
+ /** {@inheritDoc} */
public void write(OutputStream os) throws IOException {
byte[] data = new byte[] {
(byte)0x94, // ID = Image Size Parameter
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/IncludeObject.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/IncludeObject.java?rev=677689&r1=677688&r2=677689&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/IncludeObject.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/IncludeObject.java Thu Jul 17 12:13:56 2008
@@ -22,11 +22,6 @@
import java.io.IOException;
import java.io.OutputStream;
-import org.apache.fop.render.afp.DataObjectInfo;
-import org.apache.fop.render.afp.ObjectAreaInfo;
-import org.apache.fop.render.afp.modca.triplets.FullyQualifiedNameTriplet;
-import org.apache.fop.render.afp.modca.triplets.MappingOptionTriplet;
-import org.apache.fop.render.afp.modca.triplets.ObjectClassificationTriplet;
import org.apache.fop.render.afp.tools.BinaryUtils;
/**
@@ -42,32 +37,32 @@
* data objects in the page segment.
* </p>
*/
-public class IncludeObject extends AbstractNamedAFPObject implements DataObjectAccessor {
+public class IncludeObject extends AbstractNamedAFPObject {
/**
* the include object is of type page segment
*/
- protected static final byte TYPE_PAGE_SEGMENT = (byte)0x5F;
+ public static final byte TYPE_PAGE_SEGMENT = (byte)0x5F;
/**
* the include object is of type other
*/
- protected static final byte TYPE_OTHER = (byte)0x92;
+ public static final byte TYPE_OTHER = (byte)0x92;
/**
* the include object is of type graphic
*/
- protected static final byte TYPE_GRAPHIC = (byte)0xBB;
+ public static final byte TYPE_GRAPHIC = (byte)0xBB;
/**
* the included object is of type barcode
*/
- protected static final byte TYPE_BARCODE = (byte)0xEB;
+ public static final byte TYPE_BARCODE = (byte)0xEB;
/**
* the included object is of type image
*/
- protected static final byte TYPE_IMAGE = (byte)0xFB;
+ public static final byte TYPE_IMAGE = (byte)0xFB;
/**
* The object type (default is other)
@@ -99,10 +94,10 @@
*/
private int yContentOffset = 0;
- /**
- * the referenced data object
- */
- private DataObjectAccessor dataObjectAccessor = null;
+// /**
+// * the referenced data object
+// */
+// private DataObjectAccessor dataObjectAccessor = null;
/**
* Constructor for the include object with the specified name, the name must
@@ -112,69 +107,69 @@
* @param name the name of this include object
* @param dataObjectAccessor the data object accessor
*/
- public IncludeObject(String name, DataObjectAccessor dataObjectAccessor) {
+ public IncludeObject(String name/*, DataObjectAccessor dataObjectAccessor*/) {
super(name);
- this.dataObjectAccessor = dataObjectAccessor;
-
- AbstractNamedAFPObject dataObject = dataObjectAccessor.getDataObject();
- if (dataObject instanceof ImageObject) {
- this.dataObjectType = TYPE_IMAGE;
- } else if (dataObject instanceof GraphicsObject) {
- this.dataObjectType = TYPE_GRAPHIC;
- } else if (dataObject instanceof PageSegment) {
- this.dataObjectType = TYPE_PAGE_SEGMENT;
- } else {
- this.dataObjectType = TYPE_OTHER;
- // Strip any object container
- if (dataObject instanceof ObjectContainer) {
- ObjectContainer objectContainer = (ObjectContainer)dataObject;
- dataObject = objectContainer.getDataObject();
- }
- }
-
- DataObjectInfo dataObjectInfo = dataObjectAccessor.getDataObjectInfo();
- ObjectAreaInfo objectAreaInfo = dataObjectInfo.getObjectAreaInfo();
- setObjectArea(objectAreaInfo.getX(), objectAreaInfo.getY());
-
- super.setFullyQualifiedName(
- FullyQualifiedNameTriplet.TYPE_REPLACE_FIRST_GID_NAME,
- FullyQualifiedNameTriplet.FORMAT_CHARSTR,
- dataObjectInfo.getUri());
-
- Registry registry = Registry.getInstance();
- Registry.ObjectType objectType = registry.getObjectType(dataObjectInfo);
- super.setObjectClassification(
- ObjectClassificationTriplet.CLASS_TIME_INVARIANT_PAGINATED_PRESENTATION_OBJECT,
- objectType);
+// this.dataObjectAccessor = dataObjectAccessor;
- super.setMeasurementUnits(objectAreaInfo.getWidthRes(), objectAreaInfo.getHeightRes());
-
- super.setMappingOption(MappingOptionTriplet.SCALE_TO_FIT);
-
- super.setObjectAreaSize(objectAreaInfo.getWidth(), objectAreaInfo.getHeight());
+// AbstractNamedAFPObject dataObject = dataObjectAccessor.getDataObject();
+// if (dataObject instanceof ImageObject) {
+// this.dataObjectType = TYPE_IMAGE;
+// } else if (dataObject instanceof GraphicsObject) {
+// this.dataObjectType = TYPE_GRAPHIC;
+// } else if (dataObject instanceof PageSegment) {
+// this.dataObjectType = TYPE_PAGE_SEGMENT;
+// } else {
+// this.dataObjectType = TYPE_OTHER;
+// // Strip any object container
+// if (dataObject instanceof ObjectContainer) {
+// ObjectContainer objectContainer = (ObjectContainer)dataObject;
+// dataObject = objectContainer.getDataObject();
+// }
+// }
+
+// DataObjectInfo dataObjectInfo = dataObjectAccessor.getDataObjectInfo();
+// ObjectAreaInfo objectAreaInfo = dataObjectInfo.getObjectAreaInfo();
+// setObjectArea(objectAreaInfo.getX(), objectAreaInfo.getY());
+//
+// super.setFullyQualifiedName(
+// FullyQualifiedNameTriplet.TYPE_REPLACE_FIRST_GID_NAME,
+// FullyQualifiedNameTriplet.FORMAT_CHARSTR,
+// dataObjectInfo.getUri());
+//
+// Registry registry = Registry.getInstance();
+// Registry.ObjectType objectType = registry.getObjectType(dataObjectInfo);
+// super.setObjectClassification(
+// ObjectClassificationTriplet.CLASS_TIME_INVARIANT_PAGINATED_PRESENTATION_OBJECT,
+// objectType);
+//
+// super.setMeasurementUnits(objectAreaInfo.getWidthRes(), objectAreaInfo.getHeightRes());
+//
+// super.setMappingOption(MappingOptionTriplet.SCALE_TO_FIT);
+//
+// super.setObjectAreaSize(objectAreaInfo.getWidth(), objectAreaInfo.getHeight());
}
- /**
- * {@inheritDoc}
- */
- public AbstractNamedAFPObject getDataObject() {
- return dataObjectAccessor.getDataObject();
- }
-
- /**
- * {@inheritDoc}
- */
- public DataObjectInfo getDataObjectInfo() {
- return dataObjectAccessor.getDataObjectInfo();
- }
-
- /**
- * {@inheritDoc}
- */
- public void setDataObjectInfo(DataObjectInfo dataObjectInfo) {
- dataObjectAccessor.setDataObjectInfo(dataObjectInfo);
- }
+// /**
+// * {@inheritDoc}
+// */
+// public AbstractNamedAFPObject getDataObject() {
+// return dataObjectAccessor.getDataObject();
+// }
+//
+// /**
+// * {@inheritDoc}
+// */
+// public DataObjectInfo getDataObjectInfo() {
+// return dataObjectAccessor.getDataObjectInfo();
+// }
+//
+// /**
+// * {@inheritDoc}
+// */
+// public void setDataObjectInfo(DataObjectInfo dataObjectInfo) {
+// dataObjectAccessor.setDataObjectInfo(dataObjectInfo);
+// }
/**
* Sets the orientation to use for the Include Object.
@@ -194,6 +189,7 @@
/**
* Sets the x and y offset to the origin in the object area
+ *
* @param x the X-axis origin of the object area
* @param y the Y-axis origin of the object area
*/
@@ -203,7 +199,8 @@
}
/**
- * Sets the x and y offset of the content area to the object area
+ * Sets the x and y offset of the content area to the object area
+ *
* @param x the X-axis origin defined in the object
* @param y the Y-axis origin defined in the object
*/
@@ -213,30 +210,24 @@
}
/**
- * {@inheritDoc}
+ * Sets the data object type
+ *
+ * @param type the data object type
*/
+ public void setDataObjectType(byte type) {
+ this.dataObjectType = type;
+ }
+
+ /** {@inheritDoc} */
public void write(OutputStream os) throws IOException {
byte[] data = new byte[36];
- data[0] = 0x5A;
+ super.copySF(data, Type.INCLUDE, Category.DATA_RESOURCE);
// Set the total record length
byte[] len = BinaryUtils.convert(35 + getTripletDataLength(), 2); //Ignore first byte
data[1] = len[0];
data[2] = len[1];
- // Structured field ID for a IOB
- data[3] = (byte) 0xD3;
- data[4] = (byte) 0xAF;
- data[5] = (byte) 0xC3;
-
- data[6] = 0x00; // Reserved
- data[7] = 0x00; // Reserved
- data[8] = 0x00; // Reserved
-
- for (int i = 0; i < nameBytes.length; i++) {
- data[9 + i] = nameBytes[i];
- }
-
data[17] = 0x00; // reserved
data[18] = dataObjectType;
@@ -330,9 +321,7 @@
os.write(tripletData);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public String toString() {
return "IOB: " + this.getName();
}
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/IncludePageOverlay.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/IncludePageOverlay.java?rev=677689&r1=677688&r2=677689&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/IncludePageOverlay.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/IncludePageOverlay.java Thu Jul 17 12:13:56 2008
@@ -56,6 +56,7 @@
/**
* Constructor for the Include Page Overlay
+ *
* @param overlayName Name of the page segment
* @param x The x position
* @param y The y position
@@ -63,6 +64,7 @@
*/
public IncludePageOverlay(String overlayName, int x, int y, int orientation) {
super(overlayName);
+
this.x = x;
this.y = y;
setOrientation(orientation);
@@ -84,40 +86,25 @@
}
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void write(OutputStream os) throws IOException {
byte[] data = new byte[25]; //(9 +16)
- data[0] = 0x5A;
+ copySF(data, Type.INCLUDE, Category.PAGE_OVERLAY);
// Set the total record length
byte[] len = BinaryUtils.convert(24, 2); //Ignore first byte
data[1] = len[0];
data[2] = len[1];
- // Structured field ID for a IPO
- data[3] = (byte) 0xD3;
- data[4] = (byte) 0xAF;
- data[5] = (byte) 0xD8;
-
- data[6] = 0x00; // Reserved
- data[7] = 0x00; // Reserved
- data[8] = 0x00; // Reserved
-
- for (int i = 0; i < nameBytes.length; i++) {
- data[9 + i] = nameBytes[i];
- }
-
- byte[] xcoord = BinaryUtils.convert(x, 3);
- data[17] = xcoord[0]; // x coordinate
- data[18] = xcoord[1];
- data[19] = xcoord[2];
-
- byte[] ycoord = BinaryUtils.convert(y, 3);
- data[20] = ycoord[0]; // y coordinate
- data[21] = ycoord[1];
- data[22] = ycoord[2];
+ byte[] xPos = BinaryUtils.convert(x, 3);
+ data[17] = xPos[0]; // x coordinate
+ data[18] = xPos[1];
+ data[19] = xPos[2];
+
+ byte[] yPos = BinaryUtils.convert(y, 3);
+ data[20] = yPos[0]; // y coordinate
+ data[21] = yPos[1];
+ data[22] = yPos[2];
switch (orientation) {
case 90:
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/IncludePageSegment.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/IncludePageSegment.java?rev=677689&r1=677688&r2=677689&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/IncludePageSegment.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/IncludePageSegment.java Thu Jul 17 12:13:56 2008
@@ -45,56 +45,46 @@
/**
* The x position where we need to put this object on the page
*/
- private byte[] x;
-
+ private int x;
+
/**
* The y position where we need to put this object on the page
*/
- private byte[] y;
-
+ private int y;
+
/**
* Constructor for the Include Page Segment
+ *
* @param name Name of the page segment
* @param x The x position
* @param y The y position
*/
public IncludePageSegment(String name, int x, int y) {
super(name);
- this.x = BinaryUtils.convert(x, 3);
- this.y = BinaryUtils.convert(y, 3);
+
+ this.x = x;
+ this.y = y;
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void write(OutputStream os) throws IOException {
-
byte[] data = new byte[23]; //(9 +14)
-
- data[0] = 0x5A;
+ copySF(data, Type.INCLUDE, Category.PAGE_SEGMENT);
// Set the total record length
byte[] len = BinaryUtils.convert(22, 2); //Ignore first byte
data[1] = len[0];
data[2] = len[1];
- // Structured field ID for a IPS
- data[3] = (byte) 0xD3;
- data[4] = (byte) 0xAF;
- data[5] = (byte) 0x5F;
- data[6] = 0x00; // Reserved
- data[7] = 0x00; // Reserved
- data[8] = 0x00; // Reserved
-
- for (int i = 0; i < nameBytes.length; i++) {
- data[9 + i] = nameBytes[i];
- }
- data[17] = x[0]; // x coordinate
- data[18] = x[1];
- data[19] = x[2];
- data[20] = y[0]; // y coordinate
- data[21] = y[1];
- data[22] = y[2];
+ byte[] xPos = BinaryUtils.convert(x, 3);
+ data[17] = xPos[0]; // x coordinate
+ data[18] = xPos[1];
+ data[19] = xPos[2];
+
+ byte[] yPos = BinaryUtils.convert(y, 3);
+ data[20] = yPos[0]; // y coordinate
+ data[21] = yPos[1];
+ data[22] = yPos[2];
os.write(data);
}
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/InterchangeSet.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/InterchangeSet.java?rev=677689&r1=677688&r2=677689&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/InterchangeSet.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/InterchangeSet.java Thu Jul 17 12:13:56 2008
@@ -46,6 +46,8 @@
private int value;
/**
+ * Returns the interchange set value of a given string
+ *
* @param str an interchange set value
* @return an interchange set
*/
@@ -60,6 +62,7 @@
throw new IllegalArgumentException("Invalid MO:DCA interchange set :" + str);
}
}
+
/**
* Main constructor
*
@@ -70,6 +73,8 @@
}
/**
+ * Returns true if complies with MOD:CA interchange set 1
+ *
* @return true if complies with MOD:CA interchange set 1
*/
protected boolean is1() {
@@ -77,6 +82,8 @@
}
/**
+ * Returns true if complies with MOD:CA interchange set 2
+ *
* @return true if complies with MOD:CA interchange set 2
*/
public boolean is2() {
@@ -84,20 +91,22 @@
}
/**
+ * Returns true if complies with MOD:CA resource set
+ *
* @return true if complies with MOD:CA resource set
*/
public boolean isResource() {
return value == RESOURCE_SET;
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public String toString() {
return NAMES[value];
}
/**
+ * Returns true if MOD:CA interchange set 2 (resource groups) is supported
+ *
* @return true if MOD:CA interchange set 2 (resource groups) is supported
*/
public boolean supportsLevel2() {
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/InvokeMediumMap.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/InvokeMediumMap.java?rev=677689&r1=677688&r2=677689&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/InvokeMediumMap.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/InvokeMediumMap.java Thu Jul 17 12:13:56 2008
@@ -34,38 +34,24 @@
/**
* Constructor for the Invoke Medium Map
+ *
* @param name the name of the medium map
*/
public InvokeMediumMap(String name) {
super(name);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void write(OutputStream os) throws IOException {
byte[] data = new byte[17];
-
- data[0] = 0x5A;
+ copySF(data, Type.MAP, Category.MEDIUM_MAP);
// Set the total record length
byte[] len = BinaryUtils.convert(16, 2); //Ignore first byte
data[1] = len[0];
data[2] = len[1];
- // Structured field ID for a IPO
- data[3] = (byte) 0xD3;
- data[4] = (byte) 0xAB;
- data[5] = (byte) 0xCC;
-
- data[6] = 0x00; // Reserved
- data[7] = 0x00; // Reserved
- data[8] = 0x00; // Reserved
-
- for (int i = 0; i < nameBytes.length; i++) {
- data[9 + i] = nameBytes[i];
- }
os.write(data);
}
}
\ No newline at end of file
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/MapCodedFont.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/MapCodedFont.java?rev=677689&r1=677688&r2=677689&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/MapCodedFont.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/MapCodedFont.java Thu Jul 17 12:13:56 2008
@@ -56,9 +56,7 @@
fontList = new java.util.ArrayList();
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void write(OutputStream os) throws IOException {
byte[] startData = new byte[] {
0x5A,
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/MapDataResource.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/MapDataResource.java?rev=677689&r1=677688&r2=677689&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/MapDataResource.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/MapDataResource.java Thu Jul 17 12:13:56 2008
@@ -34,6 +34,7 @@
* required for presentation.
*/
public class MapDataResource extends AbstractStructuredAFPObject {
+
/**
* Static default generated name reference
*/
@@ -41,6 +42,7 @@
/**
* Main constructor
+ *
* @param dataObjectAccessor a data object accessor
*/
public MapDataResource(DataObjectAccessor dataObjectAccessor) {
@@ -49,7 +51,7 @@
ResourceInfo resourceInfo = dataObjectInfo.getResourceInfo();
ResourceLevel resourceLevel = resourceInfo.getLevel();
if (resourceLevel.isExternal()) {
- String url = resourceLevel.getExternalResourceGroupFilePath();
+ String url = resourceLevel.getExternalFilePath();
if (url != null) {
super.setFullyQualifiedName(
FullyQualifiedNameTriplet.TYPE_DATA_OBJECT_EXTERNAL_RESOURCE_REF,
@@ -69,30 +71,20 @@
objectType);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void writeStart(OutputStream os) throws IOException {
super.writeStart(os);
+ byte[] data = new byte[9];
+ copySF(data, Type.MAP, Category.DATA_RESOURCE);
byte[] len = BinaryUtils.convert(10 + getTripletDataLength(), 2);
- byte[] data = new byte[] {
- 0x5A, // Structured field identifier
- len[0], // Length byte 1
- len[1], // Length byte 2
- (byte) 0xD3, // Structured field id byte 1
- (byte) 0xAB, // Structured field id byte 2
- (byte) 0xC3, // Structured field id byte 3
- 0x00, // Flags
- 0x00, // Reserved
- 0x00 // Reserved
- };
+ data[1] = len[0];
+ data[2] = len[1];
+
os.write(data);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void writeContent(OutputStream os) throws IOException {
// RGLength
byte[] len = BinaryUtils.convert(2 + getTripletDataLength(), 2);
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ObjectAreaDescriptor.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ObjectAreaDescriptor.java?rev=677689&r1=677688&r2=677689&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ObjectAreaDescriptor.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ObjectAreaDescriptor.java Thu Jul 17 12:13:56 2008
@@ -33,6 +33,7 @@
/**
* Construct an object area descriptor for the specified object width
* and object height.
+ *
* @param width The page width.
* @param height The page height.
* @param widthResolution The page width resolution.
@@ -42,13 +43,8 @@
super(width, height, widthResolution, heightResolution);
}
- /**
- * Accessor method to write the AFP datastream for the Object Area Descriptor
- * @param os The stream to write to
- * @throws java.io.IOException thrown if an I/O exception of some sort has occurred
- */
- public void write(OutputStream os)
- throws IOException {
+ /** {@inheritDoc} */
+ public void write(OutputStream os) throws IOException {
byte[] data = new byte[29];
data[0] = 0x5A;
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ObjectAreaPosition.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ObjectAreaPosition.java?rev=677689&r1=677688&r2=677689&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ObjectAreaPosition.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ObjectAreaPosition.java Thu Jul 17 12:13:56 2008
@@ -33,9 +33,12 @@
private int x;
private int y;
private int rotation;
-
+ private int xOffset;
+ private int yOffset;
+
/**
* Construct an object area position for the specified object y, y position.
+ *
* @param x The x coordinate.
* @param y The y coordinate.
* @param rotation The coordinate system rotation (must be 0, 90, 180, 270).
@@ -46,50 +49,52 @@
this.rotation = rotation;
}
- /**
- * Accessor method to write the AFP datastream for the Object Area Position
- * @param os The stream to write to
- * @throws java.io.IOException in the event that an I/O exception of some sort has occurred.
- */
+ /** {@inheritDoc} */
public void write(OutputStream os) throws IOException {
+ byte[] data = new byte[33];
+ copySF(data, Type.POSITION, Category.OBJECT_AREA);
+
byte[] len = BinaryUtils.convert(32, 2);
+ data[1] = len[0]; // Length
+ data[2] = len[1];
+
+ data[9] = 0x01; // OAPosID = 1
+ data[10] = 0x17; // RGLength = 23
+
byte[] xcoord = BinaryUtils.convert(x, 3);
+ data[11] = xcoord[0]; // XoaOSet
+ data[12] = xcoord[1];
+ data[13] = xcoord[2];
+
byte[] ycoord = BinaryUtils.convert(y, 3);
- byte[] data = new byte[] {
- 0x5A,
- len[0], // Length
- len[1], // Length
- (byte) 0xD3,
- (byte) 0xAC,
- (byte) 0x6B,
- 0x00, // Flags
- 0x00, // Reserved
- 0x00, // Reserved
- 0x01, // OAPosID = 1
- 0x17, // RGLength = 23
- xcoord[0], // XoaOSet
- xcoord[1],
- xcoord[2],
- ycoord[0], // YoaOSet
- ycoord[1],
- ycoord[2],
- (byte)(rotation / 2), // XoaOrent
- 0x00,
- (byte)(rotation / 2 + 45), // YoaOrent
- 0x00,
- 0x00, // Reserved
- 0x00, // XocaOSet
- 0x00,
- 0x00,
- 0x00, // YocaOSet
- 0x00,
- 0x00,
- 0x00, // XocaOrent
- 0x00,
- 0x2D, // YocaOrent
- 0x00,
- 0x00, // RefCSys
- };
+ data[14] = ycoord[0]; // YoaOSet
+ data[15] = ycoord[1];
+ data[16] = ycoord[2];
+
+ byte xorient = (byte)(rotation / 2);
+ data[17] = xorient; // XoaOrent
+
+ byte yorient = (byte)(rotation / 2 + 45);
+ data[19] = yorient; // YoaOrent
+
+ byte[] xoffset = BinaryUtils.convert(xOffset, 3);
+ data[22] = xoffset[0]; // XocaOSet
+ data[23] = xoffset[1];
+ data[24] = xoffset[2];
+
+ byte[] yoffset = BinaryUtils.convert(yOffset, 3);
+ data[25] = yoffset[0]; // YocaOSet
+ data[26] = yoffset[1];
+ data[27] = yoffset[2];
+
+ data[28] = 0x00; // XocaOrent
+ data[29] = 0x00;
+
+ data[30] = 0x2D; // YocaOrent
+ data[31] = 0x00;
+
+ data[32] = 0x01; // RefCSys
+
os.write(data);
}
}
\ No newline at end of file
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ObjectContainer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ObjectContainer.java?rev=677689&r1=677688&r2=677689&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ObjectContainer.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ObjectContainer.java Thu Jul 17 12:13:56 2008
@@ -31,24 +31,18 @@
/**
* Object containers are MO:DCA objects that envelop and carry object data.
*/
-public class ObjectContainer extends AbstractNamedAFPObject implements DataObjectAccessor {
+public class ObjectContainer extends AbstractNamedAFPObject /*implements DataObjectAccessor*/ {
private static final String DEFAULT_NAME = "OC000001";
- /**
- * the data object
- */
+ /** the data object */
private AbstractDataObject dataObj = null;
- /**
- * the object data
- */
+ /** the object data */
private byte[] objectData = null;
- /**
- * the data object info
- */
- private DataObjectInfo dataObjectInfo;
+// /** the data object info */
+// private DataObjectInfo dataObjectInfo;
/**
* Default constructor
@@ -59,6 +53,7 @@
/**
* Main constructor
+ *
* @param name the name of this object container
*/
public ObjectContainer(String name) {
@@ -67,85 +62,61 @@
/**
* Sets the data object for this object container
+ *
* @param dataObj the data object to reside within this object container
*/
public void setDataObject(AbstractDataObject dataObj) {
this.dataObj = dataObj;
}
- /**
- * {@inheritDoc}
- */
- public AbstractNamedAFPObject getDataObject() {
- return this.dataObj;
- }
-
- /**
- * {@inheritDoc}
- */
- public DataObjectInfo getDataObjectInfo() {
- return this.dataObjectInfo;
- }
+// /** {@inheritDoc} */
+// public AbstractNamedAFPObject getDataObject() {
+// return this.dataObj;
+// }
+//
+// /** {@inheritDoc} */
+// public DataObjectInfo getDataObjectInfo() {
+// return this.dataObjectInfo;
+// }
+
+// /** {@inheritDoc} */
+// public void setDataObjectInfo(DataObjectInfo dataObjectInfo) {
+// this.dataObjectInfo = dataObjectInfo;
+//
+// Registry registry = Registry.getInstance();
+// Registry.ObjectType objectType = registry.getObjectType(dataObjectInfo);
+// if (objectType != null) {
+// super.setObjectClassification(
+// ObjectClassificationTriplet.CLASS_TIME_VARIANT_PRESENTATION_OBJECT,
+// objectType);
+// } else {
+// log.warn("no object type for " + dataObjectInfo.getUri());
+// }
+// super.setFullyQualifiedName(
+// FullyQualifiedNameTriplet.TYPE_REPLACE_FIRST_GID_NAME,
+// FullyQualifiedNameTriplet.FORMAT_CHARSTR,
+// dataObjectInfo.getUri());
+// }
- /**
- * {@inheritDoc}
- */
- public void setDataObjectInfo(DataObjectInfo dataObjectInfo) {
- this.dataObjectInfo = dataObjectInfo;
-
- Registry registry = Registry.getInstance();
- Registry.ObjectType objectType = registry.getObjectType(dataObjectInfo);
- if (objectType != null) {
- super.setObjectClassification(
- ObjectClassificationTriplet.CLASS_TIME_VARIANT_PRESENTATION_OBJECT,
- objectType);
- } else {
- log.warn("no object type for " + dataObjectInfo.getUri());
- }
- super.setFullyQualifiedName(
- FullyQualifiedNameTriplet.TYPE_REPLACE_FIRST_GID_NAME,
- FullyQualifiedNameTriplet.FORMAT_CHARSTR,
- dataObjectInfo.getUri());
- }
-
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected void writeStart(OutputStream os) throws IOException {
- super.writeStart(os);
-
// create object data from data object
ByteArrayOutputStream bos = new ByteArrayOutputStream();
dataObj.write(bos);
this.objectData = bos.toByteArray();
+ byte[] data = new byte[17];
+ copySF(data, Type.BEGIN, Category.OBJECT_CONTAINER);
+
// Set the total record length
byte[] len = BinaryUtils.convert(16 + getTripletDataLength(), 2);
- byte[] data = new byte[] {
- 0x5A, // Structured field identifier
- len[0], // Length byte 1
- len[1], // Length byte 2
- (byte)0xD3, // Structured field id byte 1
- (byte)0xA8, // Structured field id byte 2
- (byte)0x92, // Structured field id byte 3
- 0x00, // Flags
- 0x00, // Reserved
- 0x00, // Reserved
- nameBytes[0],
- nameBytes[1],
- nameBytes[2],
- nameBytes[3],
- nameBytes[4],
- nameBytes[5],
- nameBytes[6],
- nameBytes[7]
- };
+ data[1] = len[0]; // Length byte 1
+ data[2] = len[1]; // Length byte 2
+
os.write(data);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected void writeContent(OutputStream os) throws IOException {
super.writeContent(os);
@@ -156,29 +127,10 @@
}
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected void writeEnd(OutputStream os) throws IOException {
- byte[] data = new byte[] {
- 0x5A, // Structured field identifier
- 0x00, // Length byte 1
- 0x10, // Length byte 2
- (byte)0xD3, // Structured field id byte 1
- (byte)0xA9, // Structured field id byte 2
- (byte)0x92, // Structured field id byte 3
- 0x00, // Flags
- 0x00, // Reserved
- 0x00, // Reserved
- nameBytes[0],
- nameBytes[1],
- nameBytes[2],
- nameBytes[3],
- nameBytes[4],
- nameBytes[5],
- nameBytes[6],
- nameBytes[7],
- };
+ byte[] data = new byte[17];
+ copySF(data, Type.END, Category.OBJECT_CONTAINER);
os.write(data);
}
@@ -187,13 +139,12 @@
*/
private class ObjectContainerData extends AbstractPreparedAFPObject {
- /**
- * The maximum object container data length
- */
+ /** The maximum object container data length */
private static final int MAX_DATA_LEN = 32759;
/**
* Main constructor
+ *
* @param objData the object data
*/
public ObjectContainerData(byte[] objData, int startIndex) {
@@ -208,7 +159,7 @@
data[2] = len[1]; // Length byte 2
data[3] = (byte)0xD3; // Structured field id byte 1
data[4] = (byte)0xEE; // Structured field id byte 2
- data[5] = (byte)0x92; // Structured field id byte 3
+ data[5] = getCategoryCode(); // Structured field id byte 3
data[6] = 0x00; // Flags
data[7] = 0x00; // Reserved
data[8] = 0x00; // Reserved
@@ -219,13 +170,21 @@
super.setData(data);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public String toString() {
return "ObjectContainerData("
+ (data != null ? "" + (data.length - 2) : "null")
+ ")";
}
+
+ /** {@inheritDoc} */
+ protected byte getCategoryCode() {
+ return (byte)0x92;
+ }
+ }
+
+ /** {@inheritDoc} */
+ protected byte getCategoryCode() {
+ return (byte)0x92;
}
}
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ObjectEnvironmentGroup.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ObjectEnvironmentGroup.java?rev=677689&r1=677688&r2=677689&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ObjectEnvironmentGroup.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ObjectEnvironmentGroup.java Thu Jul 17 12:13:56 2008
@@ -73,6 +73,7 @@
/**
* Constructor for the ObjectEnvironmentGroup, this takes a
* name parameter which must be 8 characters long.
+ *
* @param name the object environment group name
*/
public ObjectEnvironmentGroup(String name) {
@@ -81,6 +82,7 @@
/**
* Sets the object area parameters.
+ *
* @param info the object area info
*/
public void setObjectArea(ObjectAreaInfo info) {
@@ -93,6 +95,7 @@
/**
* Set the dimensions of the image.
+ *
* @param xresol the x resolution of the image
* @param yresol the y resolution of the image
* @param width the image width
@@ -104,6 +107,7 @@
/**
* Set the graphics data descriptor.
+ *
* @param xresol the x resolution of the graphics window
* @param yresol the y resolution of the graphics window
* @param xlwind the left edge of the graphics window
@@ -117,35 +121,14 @@
xlwind, xrwind, ybwind, ytwind);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected void writeStart(OutputStream os) throws IOException {
- byte[] data = new byte[] {
- 0x5A, // Structured field identifier
- 0x00, // Length byte 1
- 0x10, // Length byte 2
- (byte) 0xD3, // Structured field id byte 1
- (byte) 0xA8, // Structured field id byte 2
- (byte) 0xC7, // Structured field id byte 3
- 0x00, // Flags
- 0x00, // Reserved
- 0x00, // Reserved
- nameBytes[0], // Name
- nameBytes[1], //
- nameBytes[2], //
- nameBytes[3], //
- nameBytes[4], //
- nameBytes[5], //
- nameBytes[6], //
- nameBytes[7] //
- };
+ byte[] data = new byte[17];
+ copySF(data, Type.BEGIN, Category.OBJECT_ENVIRONMENT_GROUP);
os.write(data);
}
-
- /**
- * {@inheritDoc}
- */
+
+ /** {@inheritDoc} */
protected void writeContent(OutputStream os) throws IOException {
super.writeContent(os);
@@ -160,30 +143,11 @@
graphicsDataDescriptor.write(os);
}
}
-
- /**
- * {@inheritDoc}
- */
+
+ /** {@inheritDoc} */
protected void writeEnd(OutputStream os) throws IOException {
- byte[] data = new byte[] {
- 0x5A, // Structured field identifier
- 0x00, // Length byte 1
- 0x10, // Length byte 2
- (byte) 0xD3, // Structured field id byte 1
- (byte) 0xA9, // Structured field id byte 2
- (byte) 0xC7, // Structured field id byte 3
- 0x00, // Flags
- 0x00, // Reserved
- 0x00, // Reserved
- nameBytes[0], // Name
- nameBytes[1], //
- nameBytes[2], //
- nameBytes[3], //
- nameBytes[4], //
- nameBytes[5], //
- nameBytes[6], //
- nameBytes[7], //
- };
+ byte[] data = new byte[17];
+ copySF(data, Type.END, Category.OBJECT_ENVIRONMENT_GROUP);
os.write(data);
}
}
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/Overlay.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/Overlay.java?rev=677689&r1=677688&r2=677689&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/Overlay.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/Overlay.java Thu Jul 17 12:13:56 2008
@@ -53,43 +53,17 @@
super(name, width, height, rotation, widthResolution, heightResolution);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected void writeStart(OutputStream os) throws IOException {
byte[] data = new byte[17];
- data[0] = 0x5A; // Structured field identifier
- data[1] = 0x00; // Length byte 1
- data[2] = 0x10; // Length byte 2
- data[3] = (byte) 0xD3; // Structured field id byte 1
- data[4] = (byte) 0xA8; // Structured field id byte 2
- data[5] = (byte) 0xDF; // Structured field id byte 3
- data[6] = 0x00; // Flags
- data[7] = 0x00; // Reserved
- data[8] = 0x00; // Reserved
- for (int i = 0; i < nameBytes.length; i++) {
- data[9 + i] = nameBytes[i];
- }
+ copySF(data, Type.BEGIN, Category.OVERLAY);
os.write(data);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected void writeEnd(OutputStream os) throws IOException {
byte[] data = new byte[17];
- data[0] = 0x5A; // Structured field identifier
- data[1] = 0x00; // Length byte 1
- data[2] = 0x10; // Length byte 2
- data[3] = (byte) 0xD3; // Structured field id byte 1
- data[4] = (byte) 0xA9; // Structured field id byte 2
- data[5] = (byte) 0xDF; // Structured field id byte 3
- data[6] = 0x00; // Flags
- data[7] = 0x00; // Reserved
- data[8] = 0x00; // Reserved
- for (int i = 0; i < nameBytes.length; i++) {
- data[9 + i] = nameBytes[i];
- }
+ copySF(data, Type.END, Category.OVERLAY);
os.write(data);
}
}
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/PageDescriptor.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/PageDescriptor.java?rev=677689&r1=677688&r2=677689&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/PageDescriptor.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/PageDescriptor.java Thu Jul 17 12:13:56 2008
@@ -33,6 +33,7 @@
/**
* Construct a page descriptor for the specified page width
* and page height.
+ *
* @param width The page width.
* @param height The page height.
* @param widthResolution The page width resolution
@@ -42,13 +43,8 @@
super(width, height, widthResolution, heightResolution);
}
- /**
- * Accessor method to write the AFP datastream for the Page Descriptor
- * @param os The stream to write to
- * @throws java.io.IOException in the event that an I/O Exception occurred
- */
- public void write(OutputStream os)
- throws IOException {
+ /** {@inheritDoc} */
+ public void write(OutputStream os) throws IOException {
log.debug("width=" + width);
log.debug("height=" + height);
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/PageGroup.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/PageGroup.java?rev=677689&r1=677688&r2=677689&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/PageGroup.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/PageGroup.java Thu Jul 17 12:13:56 2008
@@ -91,57 +91,27 @@
return complete;
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected void writeContent(OutputStream os) throws IOException {
writeObjects(tagLogicalElements, os);
super.writeContent(os);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected void writeStart(OutputStream os) throws IOException {
byte[] data = new byte[17];
- data[0] = 0x5A; // Structured field identifier
- data[1] = 0x00; // Length byte 1
- data[2] = 0x10; // Length byte 2
- data[3] = (byte) 0xD3; // Structured field id byte 1
- data[4] = (byte) 0xA8; // Structured field id byte 2
- data[5] = (byte) 0xAD; // Structured field id byte 3
- data[6] = 0x00; // Flags
- data[7] = 0x00; // Reserved
- data[8] = 0x00; // Reserved
- for (int i = 0; i < nameBytes.length; i++) {
- data[9 + i] = nameBytes[i];
- }
+ copySF(data, Type.BEGIN, Category.PAGE_GROUP);
os.write(data);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected void writeEnd(OutputStream os) throws IOException {
byte[] data = new byte[17];
- data[0] = 0x5A; // Structured field identifier
- data[1] = 0x00; // Length byte 1
- data[2] = 0x10; // Length byte 2
- data[3] = (byte) 0xD3; // Structured field id byte 1
- data[4] = (byte) 0xA9; // Structured field id byte 2
- data[5] = (byte) 0xAD; // Structured field id byte 3
- data[6] = 0x00; // Flags
- data[7] = 0x00; // Reserved
- data[8] = 0x00; // Reserved
- for (int i = 0; i < nameBytes.length; i++) {
- data[9 + i] = nameBytes[i];
- }
+ copySF(data, Type.END, Category.PAGE_GROUP);
os.write(data);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public String toString() {
return this.getName();
}
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/PageObject.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/PageObject.java?rev=677689&r1=677688&r2=677689&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/PageObject.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/PageObject.java Thu Jul 17 12:13:56 2008
@@ -225,49 +225,21 @@
addObject(imImageObject);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected void writeStart(OutputStream os) throws IOException {
byte[] data = new byte[17];
- data[0] = 0x5A; // Structured field identifier
- data[1] = 0x00; // Length byte 1
- data[2] = 0x10; // Length byte 2
- data[3] = (byte) 0xD3; // Structured field id byte 1
- data[4] = (byte) 0xA8; // Structured field id byte 2
- data[5] = (byte) 0xAF; // Structured field id byte 3
- data[6] = 0x00; // Flags
- data[7] = 0x00; // Reserved
- data[8] = 0x00; // Reserved
- for (int i = 0; i < nameBytes.length; i++) {
- data[9 + i] = nameBytes[i];
- }
+ copySF(data, Type.BEGIN, Category.PAGE);
os.write(data);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected void writeEnd(OutputStream os) throws IOException {
byte[] data = new byte[17];
- data[0] = 0x5A; // Structured field identifier
- data[1] = 0x00; // Length byte 1
- data[2] = 0x10; // Length byte 2
- data[3] = (byte) 0xD3; // Structured field id byte 1
- data[4] = (byte) 0xA9; // Structured field id byte 2
- data[5] = (byte) 0xAF; // Structured field id byte 3
- data[6] = 0x00; // Flags
- data[7] = 0x00; // Reserved
- data[8] = 0x00; // Reserved
- for (int i = 0; i < nameBytes.length; i++) {
- data[9 + i] = nameBytes[i];
- }
+ copySF(data, Type.END, Category.PAGE);
os.write(data);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public String toString() {
return this.getName();
}
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/PageSegment.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/PageSegment.java?rev=677689&r1=677688&r2=677689&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/PageSegment.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/PageSegment.java Thu Jul 17 12:13:56 2008
@@ -35,6 +35,7 @@
/**
* Main constructor
+ *
* @param name the name of this object
*/
public PageSegment(String name) {
@@ -42,6 +43,8 @@
}
/**
+ * Returns a list of objects contained withing this page segment
+ *
* @return a list of objects contained within this page segment
*/
public List/*<AbstractAFPObject>*/ getObjects() {
@@ -53,63 +56,34 @@
/**
* Adds a resource object (image/graphic) to this page segment
+ *
* @param object the resource objec to add to this page segment
*/
public void addObject(AbstractAFPObject object) {
getObjects().add(object);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected void writeStart(OutputStream os) throws IOException {
byte[] data = new byte[17];
- data[0] = 0x5A; // Structured field identifier
- data[1] = 0x00; // Length byte 1
- data[2] = 0x10; // Length byte 2
- data[3] = (byte) 0xD3; // Structured field id byte 1
- data[4] = (byte) 0xA8; // Structured field id byte 2
- data[5] = (byte) 0x5F; // Structured field id byte 3
- data[6] = 0x00; // Flags
- data[7] = 0x00; // Reserved
- data[8] = 0x00; // Reserved
- for (int i = 0; i < nameBytes.length; i++) {
- data[9 + i] = nameBytes[i];
- }
+ copySF(data, Type.BEGIN, Category.PAGE_SEGMENT);
os.write(data);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected void writeContent(OutputStream os) throws IOException {
super.writeContent(os);
writeObjects(objects, os);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected void writeEnd(OutputStream os) throws IOException {
byte[] data = new byte[17];
- data[0] = 0x5A; // Structured field identifier
- data[1] = 0x00; // Length byte 1
- data[2] = 0x10; // Length byte 2
- data[3] = (byte) 0xD3; // Structured field id byte 1
- data[4] = (byte) 0xA9; // Structured field id byte 2
- data[5] = (byte) 0x5F; // Structured field id byte 3
- data[6] = 0x00; // Flags
- data[7] = 0x00; // Reserved
- data[8] = 0x00; // Reserved
- for (int i = 0; i < nameBytes.length; i++) {
- data[9 + i] = nameBytes[i];
- }
+ copySF(data, Type.END, Category.PAGE_SEGMENT);
os.write(data);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public String toString() {
return this.name;
}
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/PreprocessPresentationObject.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/PreprocessPresentationObject.java?rev=677689&r1=677688&r2=677689&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/PreprocessPresentationObject.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/PreprocessPresentationObject.java Thu Jul 17 12:13:56 2008
@@ -41,6 +41,7 @@
/**
* Main constructor
+ *
* @param prePresObj the presentation object to be preprocessed
*/
public PreprocessPresentationObject(AbstractStructuredAFPObject prePresObj) {
@@ -66,6 +67,7 @@
/**
* Sets the object orientations relative to media leading edge
+ *
* @param orientation the object orientations relative to media leading edge
*/
public void setOrientation(byte orientation) {
@@ -74,6 +76,7 @@
/**
* Sets the X axis origin for object content
+ *
* @param xOffset the X axis origin for object content
*/
public void setXOffset(int xOffset) {
@@ -82,15 +85,14 @@
/**
* Sets the Y axis origin for object content
+ *
* @param yOffset the Y axis origin for object content
*/
public void setYOffset(int yOffset) {
this.objYOffset = yOffset;
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void writeStart(OutputStream os) throws IOException {
super.writeStart(os);
@@ -109,9 +111,7 @@
os.write(data);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void writeContent(OutputStream os) throws IOException {
byte[] data = new byte[12];
byte[] l = BinaryUtils.convert(12 + getTripletDataLength(), 2);
@@ -146,4 +146,9 @@
// Triplets
super.writeContent(os);
}
+
+ /** {@inheritDoc} */
+ protected byte getCategoryCode() {
+ return (byte)0xC3;
+ }
}
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/PresentationTextDescriptor.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/PresentationTextDescriptor.java?rev=677689&r1=677688&r2=677689&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/PresentationTextDescriptor.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/PresentationTextDescriptor.java Thu Jul 17 12:13:56 2008
@@ -50,6 +50,7 @@
/**
* Constructor a PresentationTextDescriptor for the specified
* width and height.
+ *
* @param width The width of the page.
* @param height The height of the page.
* @param widthResolution The width resolution of the page.
@@ -60,13 +61,8 @@
super(width, height, widthResolution, heightResolution);
}
- /**
- * Accessor method to write the AFP datastream for the Presentation Text Descriptor
- * @param os The stream to write to
- * @throws java.io.IOException thrown if an I/O exception of some sort has occurred
- */
- public void write(OutputStream os)
- throws IOException {
+ /** {@inheritDoc} */
+ public void write(OutputStream os) throws IOException {
byte[] data = new byte[23];
data[0] = 0x5A;
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/PresentationTextObject.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/PresentationTextObject.java?rev=677689&r1=677688&r2=677689&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/PresentationTextObject.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/PresentationTextObject.java Thu Jul 17 12:13:56 2008
@@ -171,6 +171,7 @@
/**
* Accessor method to write the AFP datastream for the PresentationTextObject.
+ *
* @param os The stream to write to
* @throws java.io.IOException thrown if an I/O exception of some sort has occurred
*/
@@ -182,49 +183,24 @@
/**
* Returns the name of this presentation text object
+ *
* @return the name of this presentation text object
*/
public String getName() {
return name;
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected void writeStart(OutputStream os) throws IOException {
byte[] data = new byte[17];
- data[0] = 0x5A; // Structured field identifier
- data[1] = 0x00; // Length byte 1
- data[2] = 0x10; // Length byte 2
- data[3] = (byte) 0xD3; // Structured field id byte 1
- data[4] = (byte) 0xA8; // Structured field id byte 2
- data[5] = (byte) 0x9B; // Structured field id byte 3
- data[6] = 0x00; // Flags
- data[7] = 0x00; // Reserved
- data[8] = 0x00; // Reserved
- for (int i = 0; i < nameBytes.length; i++) {
- data[9 + i] = nameBytes[i];
- }
+ copySF(data, Type.BEGIN, Category.PRESENTATION_TEXT);
os.write(data);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected void writeEnd(OutputStream os) throws IOException {
byte[] data = new byte[17];
- data[0] = 0x5A; // Structured field identifier
- data[1] = 0x00; // Length byte 1
- data[2] = 0x10; // Length byte 2
- data[3] = (byte) 0xD3; // Structured field id byte 1
- data[4] = (byte) 0xA9; // Structured field id byte 2
- data[5] = (byte) 0x9B; // Structured field id byte 3
- data[6] = 0x00; // Flags
- data[7] = 0x00; // Reserved
- data[8] = 0x00; // Reserved
- for (int i = 0; i < nameBytes.length; i++) {
- data[9 + i] = nameBytes[i];
- }
+ copySF(data, Type.END, Category.PRESENTATION_TEXT);
os.write(data);
}
@@ -247,9 +223,7 @@
}
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public String toString() {
if (presentationTextDataList != null) {
return presentationTextDataList.toString();
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/Registry.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/Registry.java?rev=677689&r1=677688&r2=677689&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/Registry.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/Registry.java Thu Jul 17 12:13:56 2008
@@ -128,6 +128,32 @@
MimeConstants.MIME_PCL
)
);
+ mimeEntryMap.put(
+ MimeConstants.MIME_SVG,
+ new ObjectType(
+ COMPID_EPS,
+ null, // no component id
+ "Scaleable Vector Graphics",
+ false,
+ MimeConstants.MIME_SVG
+ )
+ );
+ }
+
+ /**
+ * Returns the Registry ObjectType for a given mimetype
+ *
+ * @param mimeType the object mime type
+ * @return the Registry ObjectType for a given data object info
+ */
+ public Registry.ObjectType getObjectType(String mimeType) {
+ ObjectType entry = null;
+ if (mimeType != null) {
+ entry = (Registry.ObjectType)mimeEntryMap.get(mimeType);
+ } else {
+ log.info("mimetype '" + mimeType + "' not found");
+ }
+ return entry;
}
/**
@@ -141,15 +167,11 @@
if (dataObjectInfo instanceof ImageObjectInfo) {
ImageObjectInfo imageInfo = (ImageObjectInfo)dataObjectInfo;
String mimeType = imageInfo.getMimeType();
- if (mimeType != null) {
- entry = (Registry.ObjectType)mimeEntryMap.get(mimeType);
- } else {
- log.info("mimetype for " + dataObjectInfo + " is null");
- }
+ return getObjectType(mimeType);
}
return entry;
}
-
+
/**
* Encapsulates a MOD:CA Registry Object Type entry
*/
@@ -215,6 +237,22 @@
}
/**
+ * @return true if this is an image type
+ */
+ public boolean isImage() {
+ return mimeType == MimeConstants.MIME_TIFF
+ || mimeType == MimeConstants.MIME_GIF
+ || mimeType == MimeConstants.MIME_JPEG;
+ }
+
+ /**
+ * @return true if this is a graphic type
+ */
+ public boolean isGraphic() {
+ return mimeType == MimeConstants.MIME_SVG;
+ }
+
+ /**
* {@inheritDoc}
*/
public String toString() {
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ResourceEnvironmentGroup.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ResourceEnvironmentGroup.java?rev=677689&r1=677688&r2=677689&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ResourceEnvironmentGroup.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ResourceEnvironmentGroup.java Thu Jul 17 12:13:56 2008
@@ -103,58 +103,32 @@
/**
* Returns an indication if the resource environment group is complete
+ *
* @return whether or not this resource environment group is complete or not
*/
public boolean isComplete() {
return complete;
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected void writeStart(OutputStream os) throws IOException {
byte[] data = new byte[17];
- data[0] = 0x5A; // Structured field identifier
- data[1] = 0x00; // Length byte 1
- data[2] = 0x10; // Length byte 2
- data[3] = (byte) 0xD3; // Structured field id byte 1
- data[4] = (byte) 0xA8; // Structured field id byte 2
- data[5] = (byte) 0xD9; // Structured field id byte 3
- data[6] = 0x00; // Flags
- data[7] = 0x00; // Reserved
- data[8] = 0x00; // Reserved
- for (int i = 0; i < nameBytes.length; i++) {
- data[9 + i] = nameBytes[i];
- }
+ copySF(data, Type.BEGIN, Category.RESOURCE_ENVIROMENT_GROUP);
os.write(data);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
+ protected void writeEnd(OutputStream os) throws IOException {
+ byte[] data = new byte[17];
+ copySF(data, Type.END, Category.RESOURCE_ENVIROMENT_GROUP);
+ os.write(data);
+ }
+
+ /** {@inheritDoc} */
protected void writeContent(OutputStream os) throws IOException {
writeObjects(mapDataResources, os);
writeObjects(mapPageOverlays, os);
writeObjects(preProcessPresentationObjects, os);
}
- /**
- * {@inheritDoc}
- */
- protected void writeEnd(OutputStream os) throws IOException {
- byte[] data = new byte[17];
- data[0] = 0x5A; // Structured field identifier
- data[1] = 0x00; // Length byte 1
- data[2] = 0x10; // Length byte 2
- data[3] = (byte) 0xD3; // Structured field id byte 1
- data[4] = (byte) 0xA9; // Structured field id byte 2
- data[5] = (byte) 0xD9; // Structured field id byte 3
- data[6] = 0x00; // Flags
- data[7] = 0x00; // Reserved
- data[8] = 0x00; // Reserved
- for (int i = 0; i < nameBytes.length; i++) {
- data[9 + i] = nameBytes[i];
- }
- os.write(data);
- }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org