* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
private int widthRes;
private int heightRes;
private int rotation = 0;
-
+
/**
* Sets the x position of the data object
* @param x the x position of the data object
*/
- protected void setX(int x) {
+ public void setX(int x) {
this.x = x;
}
* Sets the y position of the data object
* @param y the y position of the data object
*/
- protected void setY(int y) {
+ public void setY(int y) {
this.y = y;
}
* Sets the data object width
* @param width the width of the data object
*/
- protected void setWidth(int width) {
+ public void setWidth(int width) {
this.width = width;
}
* Sets the data object height
* @param height the height of the data object
*/
- protected void setHeight(int height) {
+ public void setHeight(int height) {
this.height = height;
}
* Sets the width resolution
* @param widthRes the width resolution
*/
- protected void setWidthRes(int widthRes) {
+ public void setWidthRes(int widthRes) {
this.widthRes = widthRes;
}
* Sets the height resolution
* @param heightRes the height resolution
*/
- protected void setHeightRes(int heightRes) {
+ public void setHeightRes(int heightRes) {
this.heightRes = heightRes;
}
-
+
/**
* @return the x coordinate of this data object
*/
public int getHeightRes() {
return heightRes;
}
-
+
/**
* @return the rotation of this data object
*/
* Sets the data object rotation
* @param rotation the data object rotation
*/
- protected void setRotation(int rotation) {
+ public void setRotation(int rotation) {
this.rotation = rotation;
}
-
+
/**
* {@inheritDoc}
*/
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+
import org.apache.fop.render.afp.AFPFontAttributes;
import org.apache.fop.render.afp.DataObjectInfo;
+import org.apache.fop.render.afp.ObjectAreaInfo;
import org.apache.fop.render.afp.ResourceInfo;
import org.apache.fop.render.afp.ResourceLevel;
import org.apache.fop.render.afp.fonts.AFPFont;
* destined for a presentation service, archive library, presentation device or
* another application program. The strategic presentation data stream
* architectures used is Mixed Object Document Content Architecture (MO:DCA).
- *
+ *
* The MO:DCA architecture defines the data stream used by applications to
* describe documents and object envelopes for interchange with other
* applications and application services. Documents defined in the MO:DCA format
/**
* The document is started by invoking this method which creates an instance
* of the AFP Document object.
- *
+ *
* @param name
* the name of this document.
*/
/**
* Sets the OutputStream
- *
+ *
* @param outputStream
* the AFP OutputStream
*/
* instance of the AFP Document object and registers the start with a
* validation map which ensures that methods are not invoked out of the
* correct sequence.
- *
+ *
* @throws java.io.IOException
* throws an I/O exception of some sort has occurred
*/
if (interchangeSet.supportsLevel2()) {
// Write out any external resource groups
getExternalResourceGroupManager().writeExternalResources();
-
+
// Write out any print-file level resources
if (hasResources()) {
getResourceGroup().write(this.outputStream);
}
}
-
+
// Write out document
if (document != null) {
document.endDocument();
/**
* Start a new page. When processing has finished on the current page, the
* {@link #endPage()}method must be invoked to mark the page ending.
- *
+ *
* @param pageWidth
* the width of the page
* @param pageHeight
* Start a new overlay. When processing has finished on the current overlay,
* the {@link #endOverlay()}method must be invoked to mark the overlay
* ending.
- *
+ *
* @param x
* the x position of the overlay on the page
* @param y
/**
* Helper method to save the current page.
- *
+ *
* @return current page object that was saved
*/
public PageObject savePage() {
/**
* Helper method to restore the current page.
- *
+ *
* @param pageObject
* page object
*/
/**
* Sets the offsets to be used for element positioning
- *
+ *
* @param xOff
* the offset in the x direction
* @param yOff
/**
* Creates the given page fonts in the current page
- *
+ *
* @param pageFonts
* a collection of AFP font attributes
*/
* Helper method to create a map coded font object on the current page, this
* method delegates the construction of the map coded font object to the
* active environment group on the current page.
- *
+ *
* @param fontReference
* the font number used as the resource identifier
* @param font
/**
* Helper method to create text on the current page, this method delegates
* to the current presentation text object in order to construct the text.
- *
+ *
* @param fontReference
* the font reference used as the resource identifier
* @param x
/**
* Creates a data object in the datastream. The data object resides
* according to its type, info and MO:DCA-L (resource) support.
- *
+ *
* @param dataObjectInfo
* the data object info
* @return a data object
dataObjectInfo.setUri(uri);
}
+ //Update placement with current state
+ ObjectAreaInfo areaInfo = dataObjectInfo.getObjectAreaInfo();
+ areaInfo.setX(areaInfo.getX() + this.xOffset);
+ areaInfo.setY(areaInfo.getY() + this.yOffset);
+ areaInfo.setRotation(this.rotation);
+
Registry registry = Registry.getInstance();
Registry.ObjectType objectType = registry.getObjectType(dataObjectInfo);
// recognised object type
ResourceInfo resourceInfo = dataObjectInfo.getResourceInfo();
ResourceLevel resourceLevel = resourceInfo.getLevel();
-
+
// is MO:DCA-L available?
if (interchangeSet.supportsLevel2()) {
// can this data object use the include object (IOB) referencing
if (resourceLevel.isExternal()) {
log.warn(interchangeSet
+ ": not available, object " + getName() + " will reside inline");
- }
+ }
}
}
// unrecognised/unsupported object type so create/embed data object
// /**
// * Sets the object view port taking into account rotation.
-// *
+// *
// * @param x
// * the x position of the object
// * @param y
/**
* Method to create a line on the current page.
- *
+ *
* @param x1
* the first x coordinate of the line
* @param y1
* This method will create shading on the page using the specified
* coordinates (the shading contrast is controlled via the red, green, blue
* parameters, by converting this to grey scale).
- *
+ *
* @param x
* the x coordinate of the shading
* @param y
/**
* Helper method which allows creation of the MPO object, via the AEG. And
* the IPO via the Page. (See actual object for descriptions.)
- *
+ *
* @param name
* the name of the static overlay
*/
/**
* Helper method which allows creation of the IMM object.
- *
+ *
* @param name
* the name of the medium map
*/
/**
* Creates an IncludePageSegment on the current page.
- *
+ *
* @param name
* the name of the include page segment
* @param x
/**
* Creates a TagLogicalElement on the current page.
- *
+ *
* @param attributes
* the array of key value pairs.
*/
/**
* Creates a TagLogicalElement on the current page group.
- *
+ *
* @param attributes
* the array of key value pairs.
*/
/**
* Creates a TagLogicalElement on the current page or page group
- *
+ *
* @param name
* The tag name
* @param value
/**
* Creates a NoOperation item
- *
+ *
* @param content
* byte data
*/
/**
* Sets the rotation to be used for portrait pages, valid values are 0
* (default), 90, 180, 270.
- *
+ *
* @param pageRotation
* The rotation in degrees.
*/
/**
* Sets the rotation to be used for landscape pages, valid values are 0, 90,
* 180, 270 (default).
- *
+ *
* @param pageRotation
* The rotation in degrees.
*/
/**
* Returns the resource group for a given resource into
- *
+ *
* @param level
* resource info
* @return a resource group container for the given resource info
/**
* Sets the default resource group file
- *
+ *
* @param resourceGroupFile
* the default resource group file
*/
/**
* Main constructor
- *
+ *
* @param container
* the container of this manager
*/
/**
* Sets the default resource group file
- *
+ *
* @param resourceGroupFile
* the default resource group file
*/
/**
* Returns the corresponding resource group for the given resource level
- *
+ *
* @param level
* the resource level
* @return the corresponding resource group for the given resource level
}
/**
- * @return the MO:DCA interchange set in use
+ * @return the MO:DCA interchange set in use
*/
public InterchangeSet getInterchangeSet() {
return this.interchangeSet;