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 je...@apache.org on 2007/10/05 10:48:17 UTC
svn commit: r582131 [2/2] - in /xmlgraphics/fop/trunk: ./
src/documentation/content/xdocs/trunk/ src/java/org/apache/fop/render/afp/
src/java/org/apache/fop/render/afp/modca/ src/java/org/apache/fop/render/ps/
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/AbstractPageObject.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/AbstractPageObject.java?rev=582131&r1=582130&r2=582131&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/AbstractPageObject.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/AbstractPageObject.java Fri Oct 5 01:48:15 2007
@@ -20,7 +20,6 @@
package org.apache.fop.render.afp.modca;
import java.awt.Color;
-import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
@@ -52,47 +51,47 @@
/**
* The active environment group for the page
*/
- protected ActiveEnvironmentGroup _activeEnvironmentGroup = null;
+ protected ActiveEnvironmentGroup activeEnvironmentGroup = null;
/**
* The presentation text object, we only have one per page
*/
- private PresentationTextObject _presentationTextObject = null;
+ private PresentationTextObject presentationTextObject = null;
/**
* The list of objects within the page
*/
- protected List _objects = new ArrayList();
+ protected List objects = new ArrayList();
/**
* The list of tag logical elements
*/
- protected ArrayList _tagLogicalElements = new ArrayList();
+ protected ArrayList tagLogicalElements = new ArrayList();
/**
* The list of the include page segments
*/
- protected ArrayList _segments = new ArrayList();
+ protected ArrayList segments = new ArrayList();
/**
* The page width
*/
- private int _width;
+ private int width;
/**
* The page height
*/
- private int _height;
+ private int height;
/**
* The page rotation
*/
- private int _rotation = 0;
+ private int rotation = 0;
/**
* The page state
*/
- private boolean _complete = false;
+ private boolean complete = false;
/**
* Construct a new page object for the specified name argument, the page
@@ -106,41 +105,45 @@
* the height of the page.
* @param rotation
* the rotation of the page.
+ * @param widthResolution
+ * the width resolution of the page.
+ * @param heightResolution
+ * the height resolution of the page.
*/
- public AbstractPageObject(String name, int width, int height, int rotation) {
+ public AbstractPageObject(String name, int width, int height, int rotation,
+ int widthResolution, int heightResolution) {
super(name);
-
- _name = name;
-
- _rotation = rotation;
- _width = width;
- _height = height;
+ this.width = width;
+ this.height = height;
+ this.rotation = rotation;
/**
* Every page object must have an ActiveEnvironmentGroup
*/
- _activeEnvironmentGroup = new ActiveEnvironmentGroup(_width, _height);
+ activeEnvironmentGroup = new ActiveEnvironmentGroup(width, height,
+ widthResolution, heightResolution);
- if (_rotation != 0) {
- switch (_rotation) {
+ if (rotation != 0) {
+ switch (rotation) {
case 90:
- _activeEnvironmentGroup.setPosition(_width, 0, _rotation);
+ activeEnvironmentGroup.setPosition(width, 0, rotation);
break;
case 180:
- _activeEnvironmentGroup.setPosition(_width, _height, _rotation);
+ activeEnvironmentGroup.setPosition(width, height, rotation);
break;
case 270:
- _activeEnvironmentGroup.setPosition(0, _height, _rotation);
+ activeEnvironmentGroup.setPosition(0, height, rotation);
break;
+ default:
}
}
/**
* We have a presentation text object per page
*/
- _presentationTextObject = new PresentationTextObject();
- _objects.add(_presentationTextObject);
+ presentationTextObject = new PresentationTextObject();
+ objects.add(presentationTextObject);
}
@@ -158,7 +161,7 @@
*/
public void createFont(byte fontReference, AFPFont font, int size) {
- _activeEnvironmentGroup.createFont(fontReference, font, size, 0);
+ activeEnvironmentGroup.createFont(fontReference, font, size, 0);
}
@@ -176,18 +179,19 @@
* the second y coordinate of the line
* @param thickness
* the thickness of the line
- * @param rotation
+ * @param lineRotation
* the rotation of the line
* @param col
* The text color.
*/
- public void createLine(int x1, int y1, int x2, int y2, int thickness, int rotation, Color col) {
+ public void createLine(int x1, int y1, int x2, int y2, int thickness,
+ int lineRotation, Color col) {
- if (_presentationTextObject == null) {
- _presentationTextObject = new PresentationTextObject();
- _objects.add(_presentationTextObject);
+ if (presentationTextObject == null) {
+ presentationTextObject = new PresentationTextObject();
+ objects.add(presentationTextObject);
}
- _presentationTextObject.createLineData(x1, y1, x2, y2, thickness, rotation, col);
+ presentationTextObject.createLineData(x1, y1, x2, y2, thickness, lineRotation, col);
}
@@ -201,7 +205,7 @@
* the x coordinate of the text data
* @param y
* the y coordinate of the text data
- * @param rotation
+ * @param textRotation
* the rotation of the text data
* @param col
* the text color
@@ -212,13 +216,14 @@
* @param data
* the text data to create
*/
- public void createText(int fontNumber, int x, int y, int rotation, Color col, int vsci, int ica, byte[] data) {
+ public void createText(int fontNumber, int x, int y, int textRotation, Color col,
+ int vsci, int ica, byte[] data) {
- if (_presentationTextObject == null) {
- _presentationTextObject = new PresentationTextObject();
- _objects.add(_presentationTextObject);
+ if (presentationTextObject == null) {
+ presentationTextObject = new PresentationTextObject();
+ objects.add(presentationTextObject);
}
- _presentationTextObject.createTextData(fontNumber, x, y, rotation, col, vsci, ica, data);
+ presentationTextObject.createTextData(fontNumber, x, y, textRotation, col, vsci, ica, data);
}
@@ -228,11 +233,11 @@
*/
public void endPage() {
- if (_presentationTextObject != null) {
- _presentationTextObject.endControlSequence();
+ if (presentationTextObject != null) {
+ presentationTextObject.endControlSequence();
}
- _complete = true;
+ complete = true;
}
@@ -261,33 +266,33 @@
int xCoord = 0;
int yCoord = 0;
- int width = 0;
- int height = 0;
+ int areaWidth = 0;
+ int areaHeight = 0;
- switch (_rotation) {
+ switch (rotation) {
case 90:
- xCoord = _width - y - h;
+ xCoord = areaWidth - y - h;
yCoord = x;
- width = h;
- height = w;
+ areaWidth = h;
+ areaHeight = w;
break;
case 180:
- xCoord = _width - x - w;
- yCoord = _height - y - h;
- width = w;
- height = h;
+ xCoord = areaWidth - x - w;
+ yCoord = areaHeight - y - h;
+ areaWidth = w;
+ areaHeight = h;
break;
case 270:
xCoord = y;
- yCoord = _height - x - w;
- width = h;
- height = w;
+ yCoord = areaHeight - x - w;
+ areaWidth = h;
+ areaHeight = w;
break;
default:
xCoord = x;
yCoord = y;
- width = w;
- height = h;
+ areaWidth = w;
+ areaHeight = h;
break;
}
@@ -297,19 +302,19 @@
int greyscale = Math.round((shade / 255) * 16);
String imageName = "IMG"
- + StringUtils.lpad(String.valueOf(_objects.size() + 1),
+ + StringUtils.lpad(String.valueOf(objects.size() + 1),
'0', 5);
IMImageObject io = new IMImageObject(imageName);
ImageOutputControl ioc = new ImageOutputControl(0, 0);
ImageInputDescriptor iid = new ImageInputDescriptor();
ImageCellPosition icp = new ImageCellPosition(xCoord, yCoord);
- icp.setXFillSize(width);
- icp.setYFillSize(height);
+ icp.setXFillSize(areaWidth);
+ icp.setYFillSize(areaHeight);
icp.setXSize(64);
icp.setYSize(8);
- //defing this as a resource
+ //defining this as a resource
ImageRasterData ird = new ImageRasterData(ImageRasterPattern
.getRasterData(greyscale));
@@ -317,27 +322,28 @@
io.setImageInputDescriptor(iid);
io.setImageCellPosition(icp);
io.setImageRasterData(ird);
- _objects.add(io);
+ objects.add(io);
}
/**
* Helper method to create an image on the current page and to return
* the object.
+ * @return the image object
*/
public ImageObject getImageObject() {
- if (_presentationTextObject != null) {
- _presentationTextObject.endControlSequence();
+ if (presentationTextObject != null) {
+ presentationTextObject.endControlSequence();
}
- _presentationTextObject = null;
+ presentationTextObject = null;
String imageName = "IMG"
- + StringUtils.lpad(String.valueOf(_objects.size() + 1),
+ + StringUtils.lpad(String.valueOf(objects.size() + 1),
'0', 5);
ImageObject io = new ImageObject(imageName);
- _objects.add(io);
+ objects.add(io);
return io;
}
@@ -352,7 +358,7 @@
public void createTagLogicalElement(String name, String value) {
TagLogicalElement tle = new TagLogicalElement(name, value);
- _tagLogicalElements.add(tle);
+ tagLogicalElements.add(tle);
}
@@ -364,7 +370,7 @@
public void createNoOperation(String content) {
NoOperation noOp = new NoOperation(content);
- _objects.add(noOp);
+ objects.add(noOp);
}
@@ -381,7 +387,7 @@
public void createIncludePageSegment(String name, int xCoor, int yCoor) {
IncludePageSegment ips = new IncludePageSegment(name, xCoor, yCoor);
- _segments.add(ips);
+ segments.add(ips);
}
@@ -391,35 +397,39 @@
* @return the ActiveEnvironmentGroup object
*/
public ActiveEnvironmentGroup getActiveEnvironmentGroup() {
- return _activeEnvironmentGroup;
+ return activeEnvironmentGroup;
}
/**
* Returns an indication if the page is complete
+ * @return whether this page is complete
*/
public boolean isComplete() {
- return _complete;
+ return complete;
}
/**
* Returns the height of the page
+ * @return the height of the page
*/
public int getHeight() {
- return _height;
+ return height;
}
/**
* Returns the width of the page
+ * @return the width of the page
*/
public int getWidth() {
- return _width;
+ return width;
}
/**
* Returns the rotation of the page
+ * @return the rotation of the page
*/
public int getRotation() {
- return _rotation;
+ return rotation;
}
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/ActiveEnvironmentGroup.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/ActiveEnvironmentGroup.java?rev=582131&r1=582130&r2=582131&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/ActiveEnvironmentGroup.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/ActiveEnvironmentGroup.java Fri Oct 5 01:48:15 2007
@@ -20,8 +20,8 @@
package org.apache.fop.render.afp.modca;
import java.io.IOException;
import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
+
import org.apache.fop.render.afp.fonts.AFPFont;
/**
@@ -47,41 +47,44 @@
/**
* The collection of MapCodedFont objects
*/
- private ArrayList _mapCodedFonts = new ArrayList();
+ private ArrayList mapCodedFonts = new ArrayList();
/**
* The Object Area Descriptor for the active environment group
*/
- private ObjectAreaDescriptor _objectAreaDescriptor = null;
+ private ObjectAreaDescriptor objectAreaDescriptor = null;
/**
* The Object Area Position for the active environment group
*/
- private ObjectAreaPosition _objectAreaPosition = null;
+ private ObjectAreaPosition objectAreaPosition = null;
/**
* The PresentationTextDescriptor for the active environment group
*/
- private PresentationTextDescriptor _presentationTextDataDescriptor = null;
+ private PresentationTextDescriptor presentationTextDataDescriptor = null;
/**
* The PageDescriptor for the active environment group
*/
- private PageDescriptor _pageDescriptor = null;
+ private PageDescriptor pageDescriptor = null;
/**
* The collection of MapPageOverlay objects
*/
- private ArrayList _mapPageOverlays = new ArrayList();
+ private ArrayList mapPageOverlays = new ArrayList();
/**
* Default constructor for the ActiveEnvironmentGroup.
* @param width the page width
* @param height the page height
+ * @param widthResolution the page width resolution
+ * @param heightResolution the page height resolution
*/
- public ActiveEnvironmentGroup(int width, int height) {
+ public ActiveEnvironmentGroup(int width, int height,
+ int widthResolution, int heightResolution) {
- this(DEFAULT_NAME, width, height);
+ this(DEFAULT_NAME, width, height, widthResolution, heightResolution);
}
@@ -91,20 +94,24 @@
* @param name the active environment group name
* @param width the page width
* @param height the page height
+ * @param widthResolution the page width resolution
+ * @param heightResolution the page height resolution
*/
- public ActiveEnvironmentGroup(String name, int width, int height) {
+ public ActiveEnvironmentGroup(String name, int width, int height,
+ int widthResolution, int heightResolution) {
super(name);
// Create PageDescriptor
- _pageDescriptor = new PageDescriptor(width, height);
+ pageDescriptor = new PageDescriptor(width, height, widthResolution, heightResolution);
// Create ObjectAreaDescriptor
- _objectAreaDescriptor = new ObjectAreaDescriptor(width, height);
+ objectAreaDescriptor = new ObjectAreaDescriptor(width, height,
+ widthResolution, heightResolution);
// Create PresentationTextDataDescriptor
- _presentationTextDataDescriptor =
- new PresentationTextDescriptor(width, height);
+ presentationTextDataDescriptor = new PresentationTextDescriptor(width, height,
+ widthResolution, heightResolution);
}
@@ -117,7 +124,7 @@
public void setPosition(int x, int y, int rotation) {
// Create ObjectAreaPosition
- _objectAreaPosition = new ObjectAreaPosition(x, y, rotation);
+ objectAreaPosition = new ObjectAreaPosition(x, y, rotation);
}
@@ -128,7 +135,7 @@
*/
public PageDescriptor getPageDescriptor() {
- return _pageDescriptor;
+ return pageDescriptor;
}
@@ -139,32 +146,32 @@
*/
public PresentationTextDescriptor getPresentationTextDataDescriptor() {
- return _presentationTextDataDescriptor;
+ return presentationTextDataDescriptor;
}
/**
* Accessor method to write the AFP datastream for the active environment group.
* @param os The stream to write to
- * @throws java.io.IOException
+ * @throws java.io.IOException throws if an I/O exception of some sort has occurred
*/
public void writeDataStream(OutputStream os)
throws IOException {
writeStart(os);
- writeObjectList(_mapCodedFonts, os);
+ writeObjectList(mapCodedFonts, os);
- writeObjectList(_mapPageOverlays, os);
+ writeObjectList(mapPageOverlays, os);
- _pageDescriptor.writeDataStream(os);
+ pageDescriptor.writeDataStream(os);
- if (_objectAreaDescriptor != null && _objectAreaPosition != null) {
- _objectAreaDescriptor.writeDataStream(os);
- _objectAreaPosition.writeDataStream(os);
+ if (objectAreaDescriptor != null && objectAreaPosition != null) {
+ objectAreaDescriptor.writeDataStream(os);
+ objectAreaPosition.writeDataStream(os);
}
- _presentationTextDataDescriptor.writeDataStream(os);
+ presentationTextDataDescriptor.writeDataStream(os);
writeEnd(os);
@@ -189,9 +196,9 @@
data[7] = 0x00; // Reserved
data[8] = 0x00; // Reserved
- for (int i = 0; i < _nameBytes.length; i++) {
+ for (int i = 0; i < nameBytes.length; i++) {
- data[9 + i] = _nameBytes[i];
+ data[9 + i] = nameBytes[i];
}
@@ -218,9 +225,9 @@
data[7] = 0x00; // Reserved
data[8] = 0x00; // Reserved
- for (int i = 0; i < _nameBytes.length; i++) {
+ for (int i = 0; i < nameBytes.length; i++) {
- data[9 + i] = _nameBytes[i];
+ data[9 + i] = nameBytes[i];
}
@@ -245,7 +252,7 @@
if (mcf == null) {
mcf = new MapCodedFont();
- _mapCodedFonts.add(mcf);
+ mapCodedFonts.add(mcf);
}
try {
@@ -259,7 +266,7 @@
} catch (MaximumSizeExceededException msee) {
mcf = new MapCodedFont();
- _mapCodedFonts.add(mcf);
+ mapCodedFonts.add(mcf);
try {
@@ -291,7 +298,7 @@
if (mpo == null) {
mpo = new MapPageOverlay();
- _mapPageOverlays.add(mpo);
+ mapPageOverlays.add(mpo);
}
try {
@@ -300,7 +307,7 @@
} catch (MaximumSizeExceededException msee) {
mpo = new MapPageOverlay();
- _mapPageOverlays.add(mpo);
+ mapPageOverlays.add(mpo);
try {
mpo.addOverlay(name);
} catch (MaximumSizeExceededException ex) {
@@ -317,9 +324,9 @@
*/
private MapCodedFont getCurrentMapCodedFont() {
- int size = _mapCodedFonts.size();
+ int size = mapCodedFonts.size();
if (size > 0) {
- return (MapCodedFont) _mapCodedFonts.get(_mapCodedFonts.size() - 1);
+ return (MapCodedFont) mapCodedFonts.get(mapCodedFonts.size() - 1);
} else {
return null;
}
@@ -333,10 +340,10 @@
*/
private MapPageOverlay getCurrentMapPageOverlay() {
- int size = _mapPageOverlays.size();
+ int size = mapPageOverlays.size();
if (size > 0) {
- return (MapPageOverlay) _mapPageOverlays.get(
- _mapPageOverlays.size() - 1);
+ return (MapPageOverlay) mapPageOverlays.get(
+ mapPageOverlays.size() - 1);
} else {
return null;
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/Document.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/Document.java?rev=582131&r1=582130&r2=582131&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/Document.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/Document.java Fri Oct 5 01:48:15 2007
@@ -20,10 +20,8 @@
package org.apache.fop.render.afp.modca;
import java.io.IOException;
import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
-import java.util.ArrayList;
import java.util.Iterator;
-
+import java.util.List;
/**
* The document is the highest level of the MO:DCA data-stream document
@@ -55,22 +53,22 @@
/**
* Ststic default name reference
*/
- private final static String DEFAULT_NAME = "DOC00001";
+ private static final String DEFAULT_NAME = "DOC00001";
/**
* A list of the objects in the document
*/
- private ArrayList _objects = new ArrayList();
+ private List objects = new java.util.ArrayList();
/**
* The document started state
*/
- private boolean _started = false;
+ private boolean started = false;
/**
* The document completion state
*/
- private boolean _complete = false;
+ private boolean complete = false;
/**
* Default constructor for the document object.
@@ -94,8 +92,8 @@
* @param page - the Page object
*/
public void addPage(PageObject page) {
- if (!_objects.contains(page)) {
- _objects.add(page);
+ if (!objects.contains(page)) {
+ objects.add(page);
}
}
@@ -104,7 +102,7 @@
* @param pageGroup the PageGroup object
*/
public void addPageGroup(PageGroup pageGroup) {
- _objects.add(pageGroup);
+ objects.add(pageGroup);
}
/**
@@ -112,31 +110,32 @@
*/
public void endDocument() {
- _complete = true;
+ complete = true;
}
/**
* Returns an indication if the page group is complete
+ * @return whether or not this page group is complete
*/
public boolean isComplete() {
- return _complete;
+ return complete;
}
/**
* Accessor method to write the AFP datastream for document.
* @param os The stream to write to
- * @throws java.io.IOException
+ * @throws java.io.IOException thrown if an I/O exception of some sort has occurred
*/
public void writeDataStream(OutputStream os)
throws IOException {
- if (!_started) {
+ if (!started) {
writeStart(os);
- _started = true;
+ started = true;
}
- for (Iterator it = _objects.iterator(); it.hasNext(); ) {
+ for (Iterator it = objects.iterator(); it.hasNext();) {
AbstractAFPObject ao = (AbstractAFPObject)it.next();
if (ao instanceof PageObject && ((PageObject)ao).isComplete()
|| ao instanceof PageGroup && ((PageGroup)ao).isComplete()) {
@@ -147,7 +146,7 @@
}
}
- if (_complete) {
+ if (complete) {
writeEnd(os);
}
@@ -172,9 +171,9 @@
data[7] = 0x00; // Reserved
data[8] = 0x00; // Reserved
- for (int i = 0; i < _nameBytes.length; i++) {
+ for (int i = 0; i < nameBytes.length; i++) {
- data[9 + i] = _nameBytes[i];
+ data[9 + i] = nameBytes[i];
}
@@ -201,9 +200,9 @@
data[7] = 0x00; // Reserved
data[8] = 0x00; // Reserved
- for (int i = 0; i < _nameBytes.length; i++) {
+ for (int i = 0; i < nameBytes.length; i++) {
- data[9 + i] = _nameBytes[i];
+ data[9 + i] = nameBytes[i];
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/EndPageGroup.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/EndPageGroup.java?rev=582131&r1=582130&r2=582131&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/EndPageGroup.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/EndPageGroup.java Fri Oct 5 01:48:15 2007
@@ -21,7 +21,6 @@
import java.io.IOException;
import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
/**
* The End Named Page Group (ENG) structured field terminates a page group that was
@@ -36,18 +35,23 @@
*/
public class EndPageGroup extends AbstractNamedAFPObject {
+ /**
+ * Main constructor
+ * @param groupId the group id
+ */
public EndPageGroup(String groupId) {
super(groupId);
- log.debug("A ENG is being created for group: " + groupId);
-
+ if (log.isDebugEnabled()) {
+ log.debug("A ENG is being created for group: " + groupId);
+ }
}
/**
* Accessor method to write the AFP datastream for the End Page Group.
* @param os The stream to write to
- * @throws java.io.IOException
+ * @throws java.io.IOException thrown if an I/O exception of some sort has occurred
*/
public void writeDataStream(OutputStream os)
throws IOException {
@@ -63,9 +67,9 @@
data[7] = 0x00; // Reserved
data[8] = 0x00; // Reserved
- for (int i = 0; i < _nameBytes.length; i++) {
+ for (int i = 0; i < nameBytes.length; i++) {
- data[9 + i] = _nameBytes[i];
+ data[9 + i] = nameBytes[i];
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/IMImageObject.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/IMImageObject.java?rev=582131&r1=582130&r2=582131&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/IMImageObject.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/IMImageObject.java Fri Oct 5 01:48:15 2007
@@ -18,9 +18,9 @@
/* $Id$ */
package org.apache.fop.render.afp.modca;
+
import java.io.IOException;
import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
/**
* An IM image data object specifies the contents of a raster image and
@@ -40,22 +40,22 @@
/**
* The image output control
*/
- private ImageOutputControl _imageOutputControl = null;
+ private ImageOutputControl imageOutputControl = null;
/**
* The image input descriptor
*/
- private ImageInputDescriptor _imageInputDescriptor = null;
+ private ImageInputDescriptor imageInputDescriptor = null;
/**
* The image cell position
*/
- private ImageCellPosition _imageCellPosition = null;
+ private ImageCellPosition imageCellPosition = null;
/**
* The image rastor data
*/
- private ImageRasterData _imageRastorData = null;
+ private ImageRasterData imageRasterData = null;
/**
* Constructor for the image object with the specified name,
@@ -73,7 +73,7 @@
* @param imageOutputControl The imageOutputControl to set
*/
public void setImageOutputControl(ImageOutputControl imageOutputControl) {
- _imageOutputControl = imageOutputControl;
+ this.imageOutputControl = imageOutputControl;
}
/**
@@ -81,7 +81,7 @@
* @param imageCellPosition The imageCellPosition to set
*/
public void setImageCellPosition(ImageCellPosition imageCellPosition) {
- _imageCellPosition = imageCellPosition;
+ this.imageCellPosition = imageCellPosition;
}
/**
@@ -89,41 +89,41 @@
* @param imageInputDescriptor The imageInputDescriptor to set
*/
public void setImageInputDescriptor(ImageInputDescriptor imageInputDescriptor) {
- _imageInputDescriptor = imageInputDescriptor;
+ this.imageInputDescriptor = imageInputDescriptor;
}
/**
* Sets the ImageRastorData.
- * @param imageRastorData The imageRastorData to set
+ * @param imageRasterData The imageRasterData to set
*/
- public void setImageRasterData(ImageRasterData imageRastorData) {
- _imageRastorData = imageRastorData;
+ public void setImageRasterData(ImageRasterData imageRasterData) {
+ this.imageRasterData = imageRasterData;
}
/**
* Accessor method to write the AFP datastream for the IM Image Objetc
* @param os The stream to write to
- * @throws java.io.IOException
+ * @throws java.io.IOException thrown if an I/O exception of some sort has occurred
*/
public void writeDataStream(OutputStream os)
throws IOException {
writeStart(os);
- if (_imageOutputControl != null) {
- _imageOutputControl.writeDataStream(os);
+ if (imageOutputControl != null) {
+ imageOutputControl.writeDataStream(os);
}
- if (_imageInputDescriptor != null) {
- _imageInputDescriptor.writeDataStream(os);
+ if (imageInputDescriptor != null) {
+ imageInputDescriptor.writeDataStream(os);
}
- if (_imageCellPosition != null) {
- _imageCellPosition.writeDataStream(os);
+ if (imageCellPosition != null) {
+ imageCellPosition.writeDataStream(os);
}
- if (_imageRastorData != null) {
- _imageRastorData.writeDataStream(os);
+ if (imageRasterData != null) {
+ imageRasterData.writeDataStream(os);
}
writeEnd(os);
@@ -149,9 +149,9 @@
data[7] = 0x00; // Reserved
data[8] = 0x00; // Reserved
- for (int i = 0; i < _nameBytes.length; i++) {
+ for (int i = 0; i < nameBytes.length; i++) {
- data[9 + i] = _nameBytes[i];
+ data[9 + i] = nameBytes[i];
}
@@ -178,9 +178,9 @@
data[7] = 0x00; // Reserved
data[8] = 0x00; // Reserved
- for (int i = 0; i < _nameBytes.length; i++) {
+ for (int i = 0; i < nameBytes.length; i++) {
- data[9 + i] = _nameBytes[i];
+ data[9 + i] = nameBytes[i];
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/ImageObject.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/ImageObject.java?rev=582131&r1=582130&r2=582131&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/ImageObject.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/ImageObject.java Fri Oct 5 01:48:15 2007
@@ -22,7 +22,6 @@
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
import org.apache.fop.render.afp.tools.BinaryUtils;
/**
@@ -33,12 +32,12 @@
/**
* The object environment group
*/
- private ObjectEnvironmentGroup _objectEnvironmentGroup = null;
+ private ObjectEnvironmentGroup objectEnvironmentGroup = null;
/**
* The image segment
*/
- private ImageSegment _imageSegment = null;
+ private ImageSegment imageSegment = null;
/**
* Constructor for the image object with the specified name,
@@ -64,12 +63,16 @@
* the height of the image
* @param r
* the rotation of the image
- */
- public void setImageViewport(int x, int y, int w, int h, int r) {
- if (_objectEnvironmentGroup == null) {
- _objectEnvironmentGroup = new ObjectEnvironmentGroup();
+ * @param wr
+ * the width resolution of the image
+ * @param hr
+ * the height resolution of the image
+ */
+ public void setImageViewport(int x, int y, int w, int h, int r, int wr, int hr) {
+ if (objectEnvironmentGroup == null) {
+ objectEnvironmentGroup = new ObjectEnvironmentGroup();
}
- _objectEnvironmentGroup.setObjectArea(x, y, w, h, r);
+ objectEnvironmentGroup.setObjectArea(x, y, w, h, r, wr, hr);
}
/**
@@ -80,14 +83,14 @@
* @param height the image height
*/
public void setImageParameters(int xresol, int yresol, int width, int height) {
- if (_objectEnvironmentGroup == null) {
- _objectEnvironmentGroup = new ObjectEnvironmentGroup();
+ if (objectEnvironmentGroup == null) {
+ objectEnvironmentGroup = new ObjectEnvironmentGroup();
}
- _objectEnvironmentGroup.setImageData(xresol, yresol, width, height);
- if (_imageSegment == null) {
- _imageSegment = new ImageSegment();
+ objectEnvironmentGroup.setImageData(xresol, yresol, width, height);
+ if (imageSegment == null) {
+ imageSegment = new ImageSegment();
}
- _imageSegment.setImageSize(xresol, yresol, width, height);
+ imageSegment.setImageSize(xresol, yresol, width, height);
}
/**
@@ -95,10 +98,10 @@
* @param encoding The image encoding.
*/
public void setImageEncoding(byte encoding) {
- if (_imageSegment == null) {
- _imageSegment = new ImageSegment();
+ if (imageSegment == null) {
+ imageSegment = new ImageSegment();
}
- _imageSegment.setImageEncoding(encoding);
+ imageSegment.setImageEncoding(encoding);
}
/**
@@ -106,10 +109,10 @@
* @param compression The image compression.
*/
public void setImageCompression(byte compression) {
- if (_imageSegment == null) {
- _imageSegment = new ImageSegment();
+ if (imageSegment == null) {
+ imageSegment = new ImageSegment();
}
- _imageSegment.setImageCompression(compression);
+ imageSegment.setImageCompression(compression);
}
/**
@@ -117,10 +120,10 @@
* @param size The IDE size.
*/
public void setImageIDESize(byte size) {
- if (_imageSegment == null) {
- _imageSegment = new ImageSegment();
+ if (imageSegment == null) {
+ imageSegment = new ImageSegment();
}
- _imageSegment.setImageIDESize(size);
+ imageSegment.setImageIDESize(size);
}
/**
@@ -128,21 +131,21 @@
* @param colorModel the IDE color model.
*/
public void setImageIDEColorModel(byte colorModel) {
- if (_imageSegment == null) {
- _imageSegment = new ImageSegment();
+ if (imageSegment == null) {
+ imageSegment = new ImageSegment();
}
- _imageSegment.setImageIDEColorModel(colorModel);
+ imageSegment.setImageIDEColorModel(colorModel);
}
/**
* Set the data of the image.
* @param data The image data
*/
- public void setImageData(byte data[]) {
- if (_imageSegment == null) {
- _imageSegment = new ImageSegment();
+ public void setImageData(byte[] data) {
+ if (imageSegment == null) {
+ imageSegment = new ImageSegment();
}
- _imageSegment.setImageData(data);
+ imageSegment.setImageData(data);
}
/**
@@ -150,7 +153,7 @@
* @param objectEnvironmentGroup The objectEnvironmentGroup to set
*/
public void setObjectEnvironmentGroup(ObjectEnvironmentGroup objectEnvironmentGroup) {
- _objectEnvironmentGroup = objectEnvironmentGroup;
+ this.objectEnvironmentGroup = objectEnvironmentGroup;
}
/**
@@ -183,21 +186,21 @@
/**
* Accessor method to write the AFP datastream for the Image Object
* @param os The stream to write to
- * @throws java.io.IOException
+ * @throws java.io.IOException thrown if an I/O exception of some sort has occurred
*/
public void writeDataStream(OutputStream os)
throws IOException {
writeStart(os);
- if (_objectEnvironmentGroup != null) {
- _objectEnvironmentGroup.writeDataStream(os);
+ if (objectEnvironmentGroup != null) {
+ objectEnvironmentGroup.writeDataStream(os);
}
- if (_imageSegment != null) {
+ if (imageSegment != null) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
- _imageSegment.writeDataStream(baos);
- byte b[] = baos.toByteArray();
+ imageSegment.writeDataStream(baos);
+ byte[] b = baos.toByteArray();
int off = 0;
while (off < b.length) {
int len = Math.min(30000, b.length - off);
@@ -230,9 +233,9 @@
data[7] = 0x00; // Reserved
data[8] = 0x00; // Reserved
- for (int i = 0; i < _nameBytes.length; i++) {
+ for (int i = 0; i < nameBytes.length; i++) {
- data[9 + i] = _nameBytes[i];
+ data[9 + i] = nameBytes[i];
}
@@ -259,9 +262,9 @@
data[7] = 0x00; // Reserved
data[8] = 0x00; // Reserved
- for (int i = 0; i < _nameBytes.length; i++) {
+ for (int i = 0; i < nameBytes.length; i++) {
- data[9 + i] = _nameBytes[i];
+ data[9 + i] = nameBytes[i];
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/IncludeObject.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/IncludeObject.java?rev=582131&r1=582130&r2=582131&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/IncludeObject.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/IncludeObject.java Fri Oct 5 01:48:15 2007
@@ -21,7 +21,6 @@
import java.io.IOException;
import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
import org.apache.fop.render.afp.tools.BinaryUtils;
@@ -43,12 +42,12 @@
/**
* The object type
*/
- private byte _objectType = (byte) 0x92;
+ private byte objectType = (byte) 0x92;
/**
* The orientation on the include object
*/
- private int _orientation = 0;
+ private int orientation = 0;
/**
* Constructor for the include object with the specified name, the name must
@@ -61,12 +60,12 @@
public IncludeObject(String name) {
super(name);
- _objectType = (byte) 0xFB;
+ objectType = (byte) 0xFB;
}
/**
- * Sets the orienation to use for the Include Object.
+ * Sets the orientation to use for the Include Object.
*
* @param orientation
* The orientation (0,90, 180, 270)
@@ -75,7 +74,7 @@
if (orientation == 0 || orientation == 90 || orientation == 180
|| orientation == 270) {
- _orientation = orientation;
+ this.orientation = orientation;
} else {
throw new IllegalArgumentException(
"The orientation must be one of the values 0, 90, 180, 270");
@@ -86,7 +85,7 @@
/**
* Accessor method to write the AFP datastream for the Include Object
* @param os The stream to write to
- * @throws java.io.IOException
+ * @throws java.io.IOException thrown if an I/O exception of some sort has occurred
*/
public void writeDataStream(OutputStream os)
throws IOException {
@@ -109,12 +108,12 @@
data[7] = 0x00; // Reserved
data[8] = 0x00; // Reserved
- for (int i = 0; i < _nameBytes.length; i++) {
- data[9 + i] = _nameBytes[i];
+ for (int i = 0; i < nameBytes.length; i++) {
+ data[9 + i] = nameBytes[i];
}
data[17] = 0x00;
- data[18] = _objectType;
+ data[18] = objectType;
// XoaOset
data[20] = (byte) 0xFF;
@@ -126,7 +125,7 @@
data[24] = (byte) 0xFF;
data[25] = (byte) 0xFF;
- switch (_orientation) {
+ switch (orientation) {
case 90:
data[26] = 0x2D;
data[27] = 0x00;
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/IncludePageOverlay.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/IncludePageOverlay.java?rev=582131&r1=582130&r2=582131&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/IncludePageOverlay.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/IncludePageOverlay.java Fri Oct 5 01:48:15 2007
@@ -21,7 +21,6 @@
import java.io.IOException;
import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
import org.apache.fop.render.afp.tools.BinaryUtils;
@@ -43,17 +42,17 @@
/**
* The x coordinate
*/
- private int _xCoor = 0;
+ private int xCoor = 0;
/**
* The y coordinate
*/
- private int _yCoor = 0;
+ private int yCoor = 0;
/**
* The orientation
*/
- private int _orientation = 0;
+ private int orientation = 0;
/**
* Constructor for the Include Page Overlay
@@ -66,8 +65,8 @@
super(overlayName);
- _xCoor = x;
- _yCoor = y;
+ xCoor = x;
+ yCoor = y;
setOrientation(orientation);
}
@@ -81,7 +80,7 @@
if (orientation == 0 || orientation == 90 || orientation == 180
|| orientation == 270) {
- _orientation = orientation;
+ this.orientation = orientation;
} else {
throw new IllegalArgumentException(
"The orientation must be one of the values 0, 90, 180, 270");
@@ -92,7 +91,7 @@
/**
* Accessor method to write the AFP datastream for the Include Page Overlay
* @param os The stream to write to
- * @throws java.io.IOException
+ * @throws java.io.IOException thrown if an I/O exception of some sort has occurred
*/
public void writeDataStream(OutputStream os)
throws IOException {
@@ -115,23 +114,23 @@
data[7] = 0x00; // Reserved
data[8] = 0x00; // Reserved
- for (int i = 0; i < _nameBytes.length; i++) {
+ for (int i = 0; i < nameBytes.length; i++) {
- data[9 + i] = _nameBytes[i];
+ data[9 + i] = nameBytes[i];
}
- byte[] r2 = BinaryUtils.convert(_xCoor, 3);
+ byte[] r2 = BinaryUtils.convert(xCoor, 3);
data[17] = r2[0]; // x coordinate
data[18] = r2[1];
data[19] = r2[2];
- byte[] r3 = BinaryUtils.convert(_yCoor, 3);
+ byte[] r3 = BinaryUtils.convert(yCoor, 3);
data[20] = r3[0]; // y coordinate
data[21] = r3[1];
data[22] = r3[2];
- switch (_orientation) {
+ switch (orientation) {
case 90:
data[23] = 0x2D;
data[24] = 0x00;
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/IncludePageSegment.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/IncludePageSegment.java?rev=582131&r1=582130&r2=582131&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/IncludePageSegment.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/IncludePageSegment.java Fri Oct 5 01:48:15 2007
@@ -21,7 +21,6 @@
import java.io.IOException;
import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
import org.apache.fop.render.afp.tools.BinaryUtils;
@@ -41,17 +40,17 @@
* that may have to be placed at different positions on a document.
*
*/
-public class IncludePageSegment extends AbstractNamedAFPObject{
+public class IncludePageSegment extends AbstractNamedAFPObject {
/**
* The x position where we need to put this object on the page
*/
- private byte [] _xCoor;
+ private byte[] xCoor;
/**
* The y position where we need to put this object on the page
*/
- private byte [] _yCoor;
+ private byte[] yCoor;
/**
* Constructor for the Include Page Segment
@@ -59,18 +58,18 @@
* @param xVal The x position
* @param yVal The y position
*/
- public IncludePageSegment(String name, int xVal, int yVal){
+ public IncludePageSegment(String name, int xVal, int yVal) {
super(name);
- _xCoor = BinaryUtils.convert(xVal, 3);
- _yCoor = BinaryUtils.convert(yVal, 3);
+ this.xCoor = BinaryUtils.convert(xVal, 3);
+ this.yCoor = BinaryUtils.convert(yVal, 3);
}
/**
* Accessor method to write the AFP datastream for the Include Page Segment
* @param os The stream to write to
- * @throws java.io.IOException
+ * @throws java.io.IOException thrown if an I/O exception of some sort has occurred
*/
public void writeDataStream(OutputStream os)
throws IOException {
@@ -93,19 +92,19 @@
data[7] = 0x00; // Reserved
data[8] = 0x00; // Reserved
- for (int i = 0; i < _nameBytes.length; i++) {
+ for (int i = 0; i < nameBytes.length; i++) {
- data[9 + i] = _nameBytes[i];
+ data[9 + i] = nameBytes[i];
}
- data[17] = _xCoor[0]; // x coordinate
- data[18] = _xCoor[1];
- data[19] = _xCoor[2];
-
- data[20] = _yCoor[0]; // y coordinate
- data[21] = _yCoor[1];
- data[22] = _yCoor[2];
+ data[17] = xCoor[0]; // x coordinate
+ data[18] = xCoor[1];
+ data[19] = xCoor[2];
+
+ data[20] = yCoor[0]; // y coordinate
+ data[21] = yCoor[1];
+ data[22] = yCoor[2];
os.write(data);
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/InvokeMediumMap.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/InvokeMediumMap.java?rev=582131&r1=582130&r2=582131&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/InvokeMediumMap.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/InvokeMediumMap.java Fri Oct 5 01:48:15 2007
@@ -21,7 +21,6 @@
import java.io.IOException;
import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
import org.apache.fop.render.afp.tools.BinaryUtils;
@@ -46,7 +45,7 @@
/**
* Accessor method to write the AFP datastream for the Invoke Medium Map
* @param os The stream to write to
- * @throws java.io.IOException
+ * @throws java.io.IOException if an I/O exception of some sort has occurred
*/
public void writeDataStream(OutputStream os)
throws IOException {
@@ -69,9 +68,9 @@
data[7] = 0x00; // Reserved
data[8] = 0x00; // Reserved
- for (int i = 0; i < _nameBytes.length; i++) {
+ for (int i = 0; i < nameBytes.length; i++) {
- data[9 + i] = _nameBytes[i];
+ data[9 + i] = nameBytes[i];
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/ObjectAreaDescriptor.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/ObjectAreaDescriptor.java?rev=582131&r1=582130&r2=582131&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/ObjectAreaDescriptor.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/ObjectAreaDescriptor.java Fri Oct 5 01:48:15 2007
@@ -28,74 +28,69 @@
* of an object area presentation space.
*
*/
-public class ObjectAreaDescriptor extends AbstractAFPObject {
-
- private int _width = 0;
- private int _height = 0;
+public class ObjectAreaDescriptor extends AbstractDescriptor {
/**
* 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.
+ * @param heightResolution The page height resolution.
*/
- public ObjectAreaDescriptor(int width, int height) {
-
- _width = width;
- _height = height;
-
+ public ObjectAreaDescriptor(int width, int height, int widthResolution, int heightResolution) {
+ 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
+ * @throws java.io.IOException thrown if an I/O exception of some sort has occurred
*/
public void writeDataStream(OutputStream os)
throws IOException {
- byte[] data = new byte[] {
- 0x5A,
- 0x00, // Length
- 0x1C, // Length
- (byte) 0xD3,
- (byte) 0xA6,
- (byte) 0x6B,
- 0x00, // Flags
- 0x00, // Reserved
- 0x00, // Reserved
- 0x03, // Triplet length
- 0x43, // tid = Descriptor Position Triplet
- 0x01, // DesPosId = 1
- 0x08, // Triplet length
- 0x4B, // tid = Measurement Units Triplet
- 0x00, // XaoBase = 10 inches
- 0x00, // YaoBase = 10 inches
- 0x09, // XaoUnits = 2400
- 0x60, // XaoUnits =
- 0x09, // YaoUnits = 2400
- 0x60, // YaoUnits =
- 0x09, // Triplet length
- 0x4C, // tid = Object Area Size
- 0x02, // Size Type
- 0x00, // XoaSize
- 0x00,
- 0x00,
- 0x00, // YoaSize
- 0x00,
- 0x00,
- };
-
- byte[] l = BinaryUtils.convert(data.length - 1, 2);
- data[1] = l[0];
- data[2] = l[1];
+ byte[] data = new byte[29];
+ data[0] = 0x5A;
+
+ byte[] len = BinaryUtils.convert(data.length - 1, 2);
+ data[1] = len[0]; // Length
+ data[2] = len[1];
+
+ data[3] = (byte) 0xD3;
+ data[4] = (byte) 0xA6;
+ data[5] = (byte) 0x6B;
+ data[6] = 0x00; // Flags
+ data[7] = 0x00; // Reserved
+ data[8] = 0x00; // Reserved
+ data[9] = 0x03; // Triplet length
+ data[10] = 0x43; // tid = Descriptor Position Triplet
+ data[11] = 0x01; // DesPosId = 1
+ data[12] = 0x08; // Triplet length
+ data[13] = 0x4B; // tid = Measurement Units Triplet
+ data[14] = 0x00; // XaoBase = 10 inches
+ data[15] = 0x00; // YaoBase = 10 inches
+
+ // XaoUnits
+ byte[] xdpi = BinaryUtils.convert(widthResolution * 10, 2);
+ data[16] = xdpi[0];
+ data[17] = xdpi[1];
+
+ // YaoUnits
+ byte[] ydpi = BinaryUtils.convert(heightResolution * 10, 2);
+ data[18] = ydpi[0];
+ data[19] = ydpi[1];
+
+ data[20] = 0x09; // Triplet length
+ data[21] = 0x4C; // tid = Object Area Size
+ data[22] = 0x02; // Size Type
- byte[] x = BinaryUtils.convert(_width, 3);
+ byte[] x = BinaryUtils.convert(width, 3);
data[23] = x[0];
data[24] = x[1];
data[25] = x[2];
- byte[] y = BinaryUtils.convert(_height, 3);
+ byte[] y = BinaryUtils.convert(height, 3);
data[26] = y[0];
data[27] = y[1];
data[28] = y[2];
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/ObjectEnvironmentGroup.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/ObjectEnvironmentGroup.java?rev=582131&r1=582130&r2=582131&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/ObjectEnvironmentGroup.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/ObjectEnvironmentGroup.java Fri Oct 5 01:48:15 2007
@@ -20,7 +20,6 @@
package org.apache.fop.render.afp.modca;
import java.io.IOException;
import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
/**
@@ -44,17 +43,17 @@
/**
* The ObjectAreaDescriptor for the object environment group
*/
- private ObjectAreaDescriptor _objectAreaDescriptor = null;
+ private ObjectAreaDescriptor objectAreaDescriptor = null;
/**
* The ObjectAreaPosition for the object environment group
*/
- private ObjectAreaPosition _objectAreaPosition = null;
+ private ObjectAreaPosition objectAreaPosition = null;
/**
* The ImageDataDescriptor for the object environment group
*/
- private ImageDataDescriptor _imageDataDescriptor = null;
+ private ImageDataDescriptor imageDataDescriptor = null;
/**
* Default constructor for the ObjectEnvironmentGroup.
@@ -83,11 +82,15 @@
* @param width the object width
* @param height the object height
* @param rotation the object orientation
+ * @param widthResolution the object resolution width
+ * @param heightResolution the object resolution height
*/
- public void setObjectArea(int x, int y, int width, int height, int rotation) {
+ public void setObjectArea(int x, int y, int width, int height, int rotation,
+ int widthResolution, int heightResolution) {
- _objectAreaDescriptor = new ObjectAreaDescriptor(width, height);
- _objectAreaPosition = new ObjectAreaPosition(x, y, rotation);
+ objectAreaDescriptor = new ObjectAreaDescriptor(width, height,
+ widthResolution, heightResolution);
+ objectAreaPosition = new ObjectAreaPosition(x, y, rotation);
}
@@ -99,14 +102,14 @@
* @param height the image height
*/
public void setImageData(int xresol, int yresol, int width, int height) {
- _imageDataDescriptor = new ImageDataDescriptor(xresol, yresol, width, height);
+ imageDataDescriptor = new ImageDataDescriptor(xresol, yresol, width, height);
}
/**
* Accessor method to obtain write the AFP datastream for
* the object environment group.
* @param os The stream to write to
- * @throws java.io.IOException
+ * @throws java.io.IOException throw if an I/O exception of some sort has occurred
*/
public void writeDataStream(OutputStream os)
throws IOException {
@@ -114,12 +117,12 @@
writeStart(os);
- _objectAreaDescriptor.writeDataStream(os);
+ objectAreaDescriptor.writeDataStream(os);
- _objectAreaPosition.writeDataStream(os);
+ objectAreaPosition.writeDataStream(os);
- if (_imageDataDescriptor != null) {
- _imageDataDescriptor.writeDataStream(os);
+ if (imageDataDescriptor != null) {
+ imageDataDescriptor.writeDataStream(os);
}
writeEnd(os);
@@ -153,9 +156,9 @@
0x00, //
};
- for (int i = 0; i < _nameBytes.length; i++) {
+ for (int i = 0; i < nameBytes.length; i++) {
- data[9 + i] = _nameBytes[i];
+ data[9 + i] = nameBytes[i];
}
@@ -182,9 +185,9 @@
data[7] = 0x00; // Reserved
data[8] = 0x00; // Reserved
- for (int i = 0; i < _nameBytes.length; i++) {
+ for (int i = 0; i < nameBytes.length; i++) {
- data[9 + i] = _nameBytes[i];
+ data[9 + i] = nameBytes[i];
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/Overlay.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/Overlay.java?rev=582131&r1=582130&r2=582131&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/Overlay.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/Overlay.java Fri Oct 5 01:48:15 2007
@@ -19,14 +19,17 @@
package org.apache.fop.render.afp.modca;
-import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStream;
-import java.util.Iterator;
/**
+ * An overlay is a MO:DCA-P resource object.
+ *
+ * It may be stored in an external resource library or it may be
+ * carried in a resource group. An overlay is similar to a page in
+ * that it defines its own environment and carries the same data objects.
*/
-public class Overlay extends AbstractPageObject{
+public class Overlay extends AbstractPageObject {
/**
* Construct a new overlay object for the specified name argument, the overlay
@@ -40,10 +43,15 @@
* the height of the page.
* @param rotation
* the rotation of the page.
+ * @param widthResolution
+ * the width resolution of the page.
+ * @param heightResolution
+ * the height resolution of the page.
*/
- public Overlay(String name, int width, int height, int rotation) {
+ public Overlay(String name, int width, int height, int rotation,
+ int widthResolution, int heightResolution) {
- super(name, width, height, rotation);
+ super(name, width, height, rotation, widthResolution, heightResolution);
}
@@ -51,20 +59,20 @@
* Accessor method to write the AFP datastream for the overlay.
*
* @param os The stream to write to
- * @throws java.io.IOException
+ * @throws java.io.IOException thrown if an I/O exception of some sort has occurred
*/
public void writeDataStream(OutputStream os)
throws IOException {
writeStart(os);
- _activeEnvironmentGroup.writeDataStream(os);
+ activeEnvironmentGroup.writeDataStream(os);
- writeObjectList(_segments, os);
+ writeObjectList(segments, os);
- writeObjectList(_tagLogicalElements, os);
+ writeObjectList(tagLogicalElements, os);
- writeObjectList(_objects, os);
+ writeObjectList(objects, os);
writeEnd(os);
@@ -89,9 +97,9 @@
data[7] = 0x00; // Reserved
data[8] = 0x00; // Reserved
- for (int i = 0; i < _nameBytes.length; i++) {
+ for (int i = 0; i < nameBytes.length; i++) {
- data[9 + i] = _nameBytes[i];
+ data[9 + i] = nameBytes[i];
}
@@ -118,9 +126,9 @@
data[7] = 0x00; // Reserved
data[8] = 0x00; // Reserved
- for (int i = 0; i < _nameBytes.length; i++) {
+ for (int i = 0; i < nameBytes.length; i++) {
- data[9 + i] = _nameBytes[i];
+ data[9 + i] = nameBytes[i];
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/PageDescriptor.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/PageDescriptor.java?rev=582131&r1=582130&r2=582131&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/PageDescriptor.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/PageDescriptor.java Fri Oct 5 01:48:15 2007
@@ -28,71 +28,72 @@
* a page or overlay presentation space.
*
*/
-public class PageDescriptor extends AbstractAFPObject {
-
- private int _width = 0;
- private int _height = 0;
+public class PageDescriptor extends AbstractDescriptor {
/**
* 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
+ * @param heightResolution The page height resolution
*/
- public PageDescriptor(int width, int height) {
-
- _width = width;
- _height = height;
-
+ public PageDescriptor(int width, int height, int widthResolution, int heightResolution) {
+ 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
+ * @throws java.io.IOException in the event that an I/O Exception occurred
*/
public void writeDataStream(OutputStream os)
throws IOException {
- byte[] data = new byte[] {
- 0x5A,
- 0x00,
- 0x17,
- (byte) 0xD3,
- (byte) 0xA6,
- (byte) 0xAF,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x09,
- 0x60,
- 0x09,
- 0x60,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- };
-
- byte[] x = BinaryUtils.convert(_width, 3);
+ log.debug("width=" + width);
+ log.debug("height=" + height);
+ byte[] data = new byte[24];
+ data[0] = 0x5A;
+ data[1] = 0x00;
+ data[2] = 0x17;
+ data[3] = (byte) 0xD3;
+ data[4] = (byte) 0xA6;
+ data[5] = (byte) 0xAF;
+
+ data[6] = 0x00; // Flags
+ data[7] = 0x00; // Reserved
+ data[8] = 0x00; // Reserved
+
+ data[9] = 0x00; // XpgBase = 10 inches
+ data[10] = 0x00; // YpgBase = 10 inches
+
+ // XpgUnits
+ byte[] xdpi = BinaryUtils.convert(widthResolution * 10, 2);
+ data[11] = xdpi[0];
+ data[12] = xdpi[1];
+
+ // YpgUnits
+ byte[] ydpi = BinaryUtils.convert(heightResolution * 10, 2);
+ data[13] = ydpi[0];
+ data[14] = ydpi[1];
+
+ // XpgSize
+ byte[] x = BinaryUtils.convert(width, 3);
data[15] = x[0];
data[16] = x[1];
data[17] = x[2];
- byte[] y = BinaryUtils.convert(_height, 3);
+ // YpgSize
+ byte[] y = BinaryUtils.convert(height, 3);
data[18] = y[0];
data[19] = y[1];
data[20] = y[2];
- os.write(data);
+ data[21] = 0x00; // Reserved
+ data[22] = 0x00; // Reserved
+ data[23] = 0x00; // Reserved
+ os.write(data);
}
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/PageGroup.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/PageGroup.java?rev=582131&r1=582130&r2=582131&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/PageGroup.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/PageGroup.java Fri Oct 5 01:48:15 2007
@@ -20,7 +20,6 @@
package org.apache.fop.render.afp.modca;
import java.io.IOException;
import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
@@ -40,17 +39,17 @@
/**
* The pages contained within this group
*/
- private List _objects = new ArrayList();
+ private List objects = new ArrayList();
/**
* The tag logical elements contained within this group
*/
- private List _tagLogicalElements = new ArrayList();
+ private List tagLogicalElements = new ArrayList();
/**
* The page state
*/
- private boolean _complete = false;
+ private boolean complete = false;
/**
* Constructor for the PageGroup.
@@ -72,8 +71,8 @@
*/
public void addPage(PageObject page) {
- if (!_objects.contains(page)) {
- _objects.add(page);
+ if (!objects.contains(page)) {
+ objects.add(page);
}
}
@@ -82,7 +81,7 @@
* @return the name of the page group
*/
public String getName() {
- return _name;
+ return name;
}
/**
@@ -96,7 +95,7 @@
public void createTagLogicalElement(String name, String value) {
TagLogicalElement tle = new TagLogicalElement(name, value);
- _tagLogicalElements.add(tle);
+ tagLogicalElements.add(tle);
}
@@ -109,7 +108,7 @@
public void createInvokeMediumMap(String name) {
InvokeMediumMap imm = new InvokeMediumMap(name);
- _objects.add(imm);
+ objects.add(imm);
}
@@ -118,30 +117,31 @@
*/
public void endPageGroup() {
- _complete = true;
+ complete = true;
}
/**
* Returns an indication if the page group is complete
+ * @return whether or not this page group is complete or not
*/
public boolean isComplete() {
- return _complete;
+ return complete;
}
/**
* Accessor method to write the AFP datastream for the page group.
* @param os The stream to write to
- * @throws java.io.IOException
+ * @throws java.io.IOException thrown if an I/O exception of some sort has occurred
*/
public void writeDataStream(OutputStream os)
throws IOException {
writeStart(os);
- writeObjectList(_tagLogicalElements, os);
+ writeObjectList(tagLogicalElements, os);
- writeObjectList(_objects, os);
+ writeObjectList(objects, os);
writeEnd(os);
@@ -166,9 +166,9 @@
data[7] = 0x00; // Reserved
data[8] = 0x00; // Reserved
- for (int i = 0; i < _nameBytes.length; i++) {
+ for (int i = 0; i < nameBytes.length; i++) {
- data[9 + i] = _nameBytes[i];
+ data[9 + i] = nameBytes[i];
}
@@ -195,9 +195,9 @@
data[7] = 0x00; // Reserved
data[8] = 0x00; // Reserved
- for (int i = 0; i < _nameBytes.length; i++) {
+ for (int i = 0; i < nameBytes.length; i++) {
- data[9 + i] = _nameBytes[i];
+ data[9 + i] = nameBytes[i];
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/PageObject.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/PageObject.java?rev=582131&r1=582130&r2=582131&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/PageObject.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/PageObject.java Fri Oct 5 01:48:15 2007
@@ -48,7 +48,7 @@
/**
* The resource group object
*/
- private ResourceGroup _resourceGroup = null;
+ private ResourceGroup resourceGroup = null;
/**
* Construct a new page object for the specified name argument, the page
@@ -62,10 +62,15 @@
* the height of the page.
* @param rotation
* the rotation of the page.
+ * @param widthResolution
+ * the width resolution of the page.
+ * @param heightResolution
+ * the height resolution of the page.
*/
- public PageObject(String name, int width, int height, int rotation) {
+ public PageObject(String name, int width, int height, int rotation,
+ int widthResolution, int heightResolution) {
- super(name, width, height, rotation);
+ super(name, width, height, rotation, widthResolution, heightResolution);
}
@@ -74,10 +79,10 @@
* @param overlay the overlay to add
*/
public void addOverlay(Overlay overlay) {
- if (_resourceGroup == null) {
- _resourceGroup = new ResourceGroup();
+ if (resourceGroup == null) {
+ resourceGroup = new ResourceGroup();
}
- _resourceGroup.addOverlay(overlay);
+ resourceGroup.addOverlay(overlay);
}
/**
@@ -95,31 +100,31 @@
public void createIncludePageOverlay(String name, int x, int y, int orientation) {
IncludePageOverlay ipo = new IncludePageOverlay(name, x, y, orientation);
- _objects.add(ipo);
+ objects.add(ipo);
}
/**
* Accessor method to write the AFP datastream for the page.
* @param os The stream to write to
- * @throws java.io.IOException
+ * @throws java.io.IOException thrown if an I/O exception of some sort has occurred
*/
public void writeDataStream(OutputStream os)
throws IOException {
writeStart(os);
- if (_resourceGroup != null) {
- _resourceGroup.writeDataStream(os);
+ if (resourceGroup != null) {
+ resourceGroup.writeDataStream(os);
}
- _activeEnvironmentGroup.writeDataStream(os);
+ activeEnvironmentGroup.writeDataStream(os);
- writeObjectList(_segments, os);
+ writeObjectList(segments, os);
- writeObjectList(_tagLogicalElements, os);
+ writeObjectList(tagLogicalElements, os);
- writeObjectList(_objects, os);
+ writeObjectList(objects, os);
writeEnd(os);
@@ -144,9 +149,9 @@
data[7] = 0x00; // Reserved
data[8] = 0x00; // Reserved
- for (int i = 0; i < _nameBytes.length; i++) {
+ for (int i = 0; i < nameBytes.length; i++) {
- data[9 + i] = _nameBytes[i];
+ data[9 + i] = nameBytes[i];
}
@@ -173,9 +178,9 @@
data[7] = 0x00; // Reserved
data[8] = 0x00; // Reserved
- for (int i = 0; i < _nameBytes.length; i++) {
+ for (int i = 0; i < nameBytes.length; i++) {
- data[9 + i] = _nameBytes[i];
+ data[9 + i] = nameBytes[i];
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/PresentationTextDescriptor.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/PresentationTextDescriptor.java?rev=582131&r1=582130&r2=582131&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/PresentationTextDescriptor.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/PresentationTextDescriptor.java Fri Oct 5 01:48:15 2007
@@ -45,67 +45,62 @@
* in their semantic descriptions.
*
*/
-public class PresentationTextDescriptor extends AbstractAFPObject {
-
- private int _width = 0;
- private int _height = 0;
+public class PresentationTextDescriptor extends AbstractDescriptor {
/**
* 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.
+ * @param heightResolution The height resolution of the page.
*/
- public PresentationTextDescriptor(int width, int height) {
-
- _width = width;
- _height = height;
-
+ public PresentationTextDescriptor(int width, int height,
+ int widthResolution, int heightResolution) {
+ 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
+ * @throws java.io.IOException thrown if an I/O exception of some sort has occurred
*/
public void writeDataStream(OutputStream os)
throws IOException {
- byte[] data = new byte[] {
- 0x5A,
- 0x00,
- 0x16,
- (byte) 0xD3,
- (byte) 0xB1,
- (byte) 0x9B,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x09,
- 0x60,
- 0x09,
- 0x60,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- };
+ byte[] data = new byte[23];
+ data[0] = 0x5A;
+ data[1] = 0x00;
+ data[2] = 0x16;
+ data[3] = (byte) 0xD3;
+ data[4] = (byte) 0xB1;
+ data[5] = (byte) 0x9B;
+ data[6] = 0x00;
+ data[7] = 0x00;
+ data[8] = 0x00;
+ data[9] = 0x00;
+ data[10] = 0x00;
+
+ byte[] xdpi = BinaryUtils.convert(widthResolution * 10, 2);
+ data[11] = xdpi[0]; // xdpi
+ data[12] = xdpi[1];
+
+ byte[] ydpi = BinaryUtils.convert(heightResolution * 10, 2);
+ data[13] = ydpi[0]; // ydpi
+ data[14] = ydpi[1];
- byte[] x = BinaryUtils.convert(_width, 3);
+ byte[] x = BinaryUtils.convert(width, 3);
data[15] = x[0];
data[16] = x[1];
data[17] = x[2];
- byte[] y = BinaryUtils.convert(_height, 3);
+ byte[] y = BinaryUtils.convert(height, 3);
data[18] = y[0];
data[19] = y[1];
data[20] = y[2];
+
+ data[21] = 0x00;
+ data[22] = 0x00;
os.write(data);
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/PresentationTextObject.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/PresentationTextObject.java?rev=582131&r1=582130&r2=582131&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/PresentationTextObject.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/PresentationTextObject.java Fri Oct 5 01:48:15 2007
@@ -22,7 +22,6 @@
import java.awt.Color;
import java.io.IOException;
import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
/**
@@ -64,6 +63,7 @@
/**
* Construct a new PresentationTextObject for the specified name argument,
* the name should be an 8 character identifier.
+ * @param name the name of this presentation object
*/
public PresentationTextObject(String name) {
@@ -89,7 +89,8 @@
* @param data
* The text data to be created.
*/
- public void createTextData(int fontNumber, int x, int y, Color col, int vsci, int ica, byte[] data) {
+ public void createTextData(int fontNumber, int x, int y, Color col,
+ int vsci, int ica, byte[] data) {
// Use a default orientation of zero
createTextData(fontNumber, x, y, 0, col, vsci, ica, data);
@@ -225,7 +226,7 @@
/**
* Accessor method to write the AFP datastream for the PresentationTextObject.
* @param os The stream to write to
- * @throws java.io.IOException
+ * @throws java.io.IOException thrown if an I/O exception of some sort has occurred
*/
public void writeDataStream(OutputStream os)
throws IOException {
@@ -238,9 +239,13 @@
}
+ /**
+ * Returns the name of this presentation text object
+ * @return the name of this presentation text object
+ */
public String getName() {
- return _name;
+ return name;
}
@@ -263,9 +268,9 @@
data[7] = 0x00; // Reserved
data[8] = 0x00; // Reserved
- for (int i = 0; i < _nameBytes.length; i++) {
+ for (int i = 0; i < nameBytes.length; i++) {
- data[9 + i] = _nameBytes[i];
+ data[9 + i] = nameBytes[i];
}
@@ -293,9 +298,9 @@
data[7] = 0x00; // Reserved
data[8] = 0x00; // Reserved
- for (int i = 0; i < _nameBytes.length; i++) {
+ for (int i = 0; i < nameBytes.length; i++) {
- data[9 + i] = _nameBytes[i];
+ data[9 + i] = nameBytes[i];
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/ResourceGroup.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/ResourceGroup.java?rev=582131&r1=582130&r2=582131&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/ResourceGroup.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/modca/ResourceGroup.java Fri Oct 5 01:48:15 2007
@@ -21,7 +21,6 @@
import java.io.IOException;
import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
@@ -39,8 +38,11 @@
/**
* The overlays contained in this resource group
*/
- private List _overlays = new ArrayList();
+ private List overlays = new ArrayList();
+ /**
+ * Default constructor
+ */
public ResourceGroup() {
this(DEFAULT_NAME);
@@ -63,7 +65,7 @@
* @param overlay the overlay to add
*/
public void addOverlay(Overlay overlay) {
- _overlays.add(overlay);
+ overlays.add(overlay);
}
/**
@@ -71,21 +73,21 @@
* @return the list of overlays
*/
public List getOverlays() {
- return _overlays;
+ return overlays;
}
/**
* Accessor method to obtain write the AFP datastream for
* the resource group.
* @param os The stream to write to
- * @throws java.io.IOException
+ * @throws java.io.IOException if an I/O exception of some sort has occurred
*/
public void writeDataStream(OutputStream os)
throws IOException {
writeStart(os);
- writeObjectList(_overlays, os);
+ writeObjectList(overlays, os);
writeEnd(os);
@@ -110,9 +112,9 @@
data[7] = 0x00; // Reserved
data[8] = 0x00; // Reserved
- for (int i = 0; i < _nameBytes.length; i++) {
+ for (int i = 0; i < nameBytes.length; i++) {
- data[9 + i] = _nameBytes[i];
+ data[9 + i] = nameBytes[i];
}
@@ -139,9 +141,9 @@
data[7] = 0x00; // Reserved
data[8] = 0x00; // Reserved
- for (int i = 0; i < _nameBytes.length; i++) {
+ for (int i = 0; i < nameBytes.length; i++) {
- data[9 + i] = _nameBytes[i];
+ data[9 + i] = nameBytes[i];
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSTextPainter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSTextPainter.java?rev=582131&r1=582130&r2=582131&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSTextPainter.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSTextPainter.java Fri Oct 5 01:48:15 2007
@@ -40,6 +40,7 @@
import org.apache.commons.logging.LogFactory;
import org.apache.xmlgraphics.java2d.ps.PSGraphics2D;
+import org.apache.xmlgraphics.java2d.ps.TextHandler;
import org.apache.batik.dom.svg.SVGOMTextElement;
import org.apache.batik.gvt.text.Mark;
@@ -74,7 +75,7 @@
protected Log log = LogFactory.getLog(PSTextPainter.class);
private NativeTextHandler nativeTextHandler;
- //private FontInfo fontInfo;
+ private FontInfo fontInfo;
/**
* Use the stroking text painter to get the bounds and shape.
@@ -89,6 +90,7 @@
*/
public PSTextPainter(NativeTextHandler nativeTextHandler) {
this.nativeTextHandler = nativeTextHandler;
+ this.fontInfo = nativeTextHandler.getFontInfo();
}
/**
@@ -314,6 +316,12 @@
}
}
+ drawPrimitiveString(g2d, loc, font, txt, tx);
+ loc.setLocation(loc.getX() + (double)advance, loc.getY());
+ return loc;
+ }
+
+ protected void drawPrimitiveString(Graphics2D g2d, Point2D loc, Font font, String txt, float tx) {
//Finally draw text
nativeTextHandler.setOverrideFont(font);
try {
@@ -327,8 +335,6 @@
} finally {
nativeTextHandler.setOverrideFont(null);
}
- loc.setLocation(loc.getX() + (double)advance, loc.getY());
- return loc;
}
private void updateLocationFromACI(
@@ -380,7 +386,6 @@
int weight = getWeight(aci);
boolean found = false;
- FontInfo fontInfo = nativeTextHandler.getFontInfo();
String fontFamily = null;
List gvtFonts = (List) aci.getAttribute(
GVTAttributedCharacterIterator.TextAttribute.GVT_FONT_FAMILIES);
Modified: xmlgraphics/fop/trunk/status.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/status.xml?rev=582131&r1=582130&r2=582131&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/status.xml (original)
+++ xmlgraphics/fop/trunk/status.xml Fri Oct 5 01:48:15 2007
@@ -28,6 +28,9 @@
<changes>
<release version="FOP Trunk">
+ <action context="Code" dev="JM" type="add" fixes-bug="43041" due-to="Adrian Cumiskey">
+ Added a configuration setting for the renderer/device resolution to the AFP renderer.
+ </action>
<action context="code" dev="AD" type="update">
Facilitate the implementation for font-selection-strategy:
* Changed FontInfo.fontLookup to always return an array of FontTriplet
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org