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 2008/07/25 14:46:22 UTC
svn commit: r679781 [23/34] - in
/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign: ./
examples/embedding/java/embedding/ examples/embedding/java/embedding/events/
examples/embedding/java/embedding/intermediate/
examples/embedding/java/embedding/model/ ...
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/AbstractPathOrientedRenderer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/AbstractPathOrientedRenderer.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/AbstractPathOrientedRenderer.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/AbstractPathOrientedRenderer.java Fri Jul 25 05:44:20 2008
@@ -66,7 +66,7 @@
protected void handleBlockTraits(Block block) {
int borderPaddingStart = block.getBorderAndPaddingWidthStart();
int borderPaddingBefore = block.getBorderAndPaddingWidthBefore();
-
+
float startx = currentIPPosition / 1000f;
float starty = currentBPPosition / 1000f;
float width = block.getIPD() / 1000f;
@@ -151,10 +151,10 @@
BorderProps bpsEnd = (BorderProps)borderArea.getTrait(Trait.BORDER_END);
drawBackground(startx, starty, width, height,
- (Trait.Background) backgroundArea.getTrait(Trait.BACKGROUND),
+ (Trait.Background) backgroundArea.getTrait(Trait.BACKGROUND),
bpsBefore, bpsAfter, bpsStart, bpsEnd);
drawBorders(startx, starty, width, height,
- bpsBefore, bpsAfter, bpsStart, bpsEnd);
+ bpsBefore, bpsAfter, bpsStart, bpsEnd);
}
/**
@@ -204,13 +204,13 @@
fillRect(sx, sy, paddRectWidth, paddRectHeight);
}
if (back.getImageInfo() != null) {
- ImageSize imageSize = back.getImageInfo().getSize();
+ ImageSize imageSize = back.getImageInfo().getSize();
saveGraphicsState();
clipRect(sx, sy, paddRectWidth, paddRectHeight);
- int horzCount = (int)((paddRectWidth
- * 1000 / imageSize.getWidthMpt()) + 1.0f);
- int vertCount = (int)((paddRectHeight
- * 1000 / imageSize.getHeightMpt()) + 1.0f);
+ int horzCount = (int)((paddRectWidth
+ * 1000 / imageSize.getWidthMpt()) + 1.0f);
+ int vertCount = (int)((paddRectHeight
+ * 1000 / imageSize.getHeightMpt()) + 1.0f);
if (back.getRepeat() == EN_NOREPEAT) {
horzCount = 1;
vertCount = 1;
@@ -233,7 +233,7 @@
// place once
Rectangle2D pos;
// Image positions are relative to the currentIP/BP
- pos = new Rectangle2D.Float(sx - currentIPPosition
+ pos = new Rectangle2D.Float(sx - currentIPPosition
+ (x * imageSize.getWidthMpt()),
sy - currentBPPosition
+ (y * imageSize.getHeightMpt()),
@@ -242,7 +242,7 @@
drawImage(back.getURL(), pos);
}
}
-
+
restoreGraphicsState();
}
}
@@ -277,14 +277,14 @@
* @param bpsStart the border specification on the start side
* @param bpsEnd the border specification on the end side
*/
- protected void drawBorders(Rectangle2D.Float borderRect,
+ protected void drawBorders(Rectangle2D.Float borderRect,
BorderProps bpsBefore, BorderProps bpsAfter, BorderProps bpsStart, BorderProps bpsEnd) {
float startx = borderRect.x;
float starty = borderRect.y;
float width = borderRect.width;
float height = borderRect.height;
boolean[] b = new boolean[] {
- (bpsBefore != null), (bpsEnd != null),
+ (bpsBefore != null), (bpsEnd != null),
(bpsAfter != null), (bpsStart != null)};
if (!b[0] && !b[1] && !b[2] && !b[3]) {
return;
@@ -295,9 +295,9 @@
(b[2] ? bpsAfter.width / 1000f : 0.0f),
(b[3] ? bpsStart.width / 1000f : 0.0f)};
float[] clipw = new float[] {
- BorderProps.getClippedWidth(bpsBefore) / 1000f,
- BorderProps.getClippedWidth(bpsEnd) / 1000f,
- BorderProps.getClippedWidth(bpsAfter) / 1000f,
+ BorderProps.getClippedWidth(bpsBefore) / 1000f,
+ BorderProps.getClippedWidth(bpsEnd) / 1000f,
+ BorderProps.getClippedWidth(bpsAfter) / 1000f,
BorderProps.getClippedWidth(bpsStart) / 1000f};
starty += clipw[0];
height -= clipw[0];
@@ -305,7 +305,7 @@
startx += clipw[3];
width -= clipw[3];
width -= clipw[1];
-
+
boolean[] slant = new boolean[] {
(b[3] && b[0]), (b[0] && b[1]), (b[1] && b[2]), (b[2] && b[3])};
if (bpsBefore != null) {
@@ -338,7 +338,7 @@
lineTo(sx2, innery);
closePath();
clip();
- drawBorderLine(sx1a, outery, ex1a, innery, true, true,
+ drawBorderLine(sx1a, outery, ex1a, innery, true, true,
bpsBefore.style, bpsBefore.color);
restoreGraphicsState();
}
@@ -352,7 +352,7 @@
float outerx = startx + width + clipw[1];
float clipx = outerx - clipw[1];
float innerx = outerx - bw[1];
-
+
saveGraphicsState();
moveTo(clipx, sy1);
float sy1a = sy1;
@@ -442,8 +442,8 @@
restoreGraphicsState();
}
}
-
- /**
+
+ /**
* Common method to render the background and borders for any inline area.
* The all borders and padding are drawn outside the specified area.
* @param area the inline area for which the background, border and padding is to be
@@ -456,22 +456,22 @@
float height = area.getBPD() / 1000f;
float borderPaddingStart = area.getBorderAndPaddingWidthStart() / 1000f;
float borderPaddingBefore = area.getBorderAndPaddingWidthBefore() / 1000f;
- float bpwidth = borderPaddingStart
+ float bpwidth = borderPaddingStart
+ (area.getBorderAndPaddingWidthEnd() / 1000f);
float bpheight = borderPaddingBefore
+ (area.getBorderAndPaddingWidthAfter() / 1000f);
-
+
if (height != 0.0f || bpheight != 0.0f && bpwidth != 0.0f) {
drawBackAndBorders(area, x, y - borderPaddingBefore
, width + bpwidth
, height + bpheight);
}
-
+
}
-
+
private static final QName FOX_TRANSFORM
= new QName(ExtensionElementMapping.URI, "fox:transform");
-
+
/** {@inheritDoc} */
protected void renderBlockViewport(BlockViewport bv, List children) {
// clip and position viewport if necessary
@@ -497,10 +497,10 @@
if (bv.getPositioning() == Block.FIXED) {
breakOutList = breakOutOfStateStack();
}
-
+
AffineTransform positionTransform = new AffineTransform();
positionTransform.translate(bv.getXOffset(), bv.getYOffset());
-
+
//"left/"top" (bv.getX/YOffset()) specify the position of the content rectangle
positionTransform.translate(-borderPaddingStart, -borderPaddingBefore);
@@ -515,7 +515,7 @@
saveGraphicsState();
//Viewport position
concatenateTransformationMatrix(mptToPt(positionTransform));
-
+
//Background and borders
float bpwidth = (borderPaddingStart + bv.getBorderAndPaddingWidthEnd()) / 1000f;
float bpheight = (borderPaddingBefore + bv.getBorderAndPaddingWidthAfter()) / 1000f;
@@ -525,7 +525,7 @@
AffineTransform contentRectTransform = new AffineTransform();
contentRectTransform.translate(borderPaddingStart, borderPaddingBefore);
concatenateTransformationMatrix(mptToPt(contentRectTransform));
-
+
//Clipping
if (bv.getClip()) {
clipRect(0f, 0f, width, height);
@@ -535,18 +535,18 @@
//Set up coordinate system for content rectangle
AffineTransform contentTransform = ctm.toAffineTransform();
concatenateTransformationMatrix(mptToPt(contentTransform));
-
+
currentIPPosition = 0;
currentBPPosition = 0;
renderBlocks(bv, children);
restoreGraphicsState();
restoreGraphicsState();
-
+
if (breakOutList != null) {
restoreStateStackAfterBreakOut(breakOutList);
}
-
+
currentIPPosition = saveIP;
currentBPPosition = saveBP;
} else {
@@ -561,16 +561,16 @@
CTM tempctm = new CTM(containingIPPosition, currentBPPosition);
ctm = tempctm.multiply(ctm);
-
+
//Now adjust for border/padding
currentBPPosition += borderPaddingBefore;
Rectangle2D clippingRect = null;
if (bv.getClip()) {
- clippingRect = new Rectangle(currentIPPosition, currentBPPosition,
+ clippingRect = new Rectangle(currentIPPosition, currentBPPosition,
bv.getIPD(), bv.getBPD());
}
-
+
startVParea(ctm, clippingRect);
currentIPPosition = 0;
currentBPPosition = 0;
@@ -579,7 +579,7 @@
currentIPPosition = saveIP;
currentBPPosition = saveBP;
-
+
currentBPPosition += (int)(bv.getAllocBPD());
}
}
@@ -595,7 +595,7 @@
at.translate(currentIPPosition, currentBPPosition);
at.translate(block.getXOffset(), block.getYOffset());
at.translate(0, block.getSpaceBefore());
-
+
if (!at.isIdentity()) {
saveGraphicsState();
concatenateTransformationMatrix(mptToPt(at));
@@ -613,12 +613,12 @@
if (!at.isIdentity()) {
restoreGraphicsState();
}
-
+
// stacked and relative blocks effect stacking
currentIPPosition = saveIP;
currentBPPosition = saveBP;
}
-
+
/** {@inheritDoc} */
protected void renderFlow(NormalFlow flow) {
// save position and offset
@@ -628,7 +628,7 @@
//Establish a new coordinate system
AffineTransform at = new AffineTransform();
at.translate(currentIPPosition, currentBPPosition);
-
+
if (!at.isIdentity()) {
saveGraphicsState();
concatenateTransformationMatrix(mptToPt(at));
@@ -637,23 +637,23 @@
currentIPPosition = 0;
currentBPPosition = 0;
super.renderFlow(flow);
-
+
if (!at.isIdentity()) {
restoreGraphicsState();
}
-
+
// stacked and relative blocks effect stacking
currentIPPosition = saveIP;
currentBPPosition = saveBP;
}
-
+
/**
* Concatenates the current transformation matrix with the given one, therefore establishing
* a new coordinate system.
* @param at the transformation matrix to process (coordinates in points)
*/
protected abstract void concatenateTransformationMatrix(AffineTransform at);
-
+
/**
* Render an inline viewport.
* This renders an inline viewport by clipping if necessary.
@@ -665,10 +665,10 @@
float y = (currentBPPosition + viewport.getOffset()) / 1000f;
float width = viewport.getIPD() / 1000f;
float height = viewport.getBPD() / 1000f;
- // TODO: Calculate the border rect correctly.
+ // TODO: Calculate the border rect correctly.
float borderPaddingStart = viewport.getBorderAndPaddingWidthStart() / 1000f;
float borderPaddingBefore = viewport.getBorderAndPaddingWidthBefore() / 1000f;
- float bpwidth = borderPaddingStart
+ float bpwidth = borderPaddingStart
+ (viewport.getBorderAndPaddingWidthEnd() / 1000f);
float bpheight = borderPaddingBefore
+ (viewport.getBorderAndPaddingWidthAfter() / 1000f);
@@ -692,7 +692,7 @@
* @param breakOutList the state stack to restore.
*/
protected abstract void restoreStateStackAfterBreakOut(List breakOutList);
-
+
/**
* Breaks out of the state stack to handle fixed block-containers.
* @return the saved state stack to recreate later
@@ -701,16 +701,16 @@
/** Saves the graphics state of the rendering engine. */
protected abstract void saveGraphicsState();
-
+
/** Restores the last graphics state of the rendering engine. */
protected abstract void restoreGraphicsState();
/** Indicates the beginning of a text object. */
protected abstract void beginTextObject();
-
+
/** Indicates the end of a text object. */
protected abstract void endTextObject();
-
+
/**
* Paints the text decoration marks.
* @param fm Current typeface
@@ -719,10 +719,10 @@
* @param baseline position of the baseline
* @param startx start IPD
*/
- protected void renderTextDecoration(FontMetrics fm, int fontsize, InlineArea inline,
+ protected void renderTextDecoration(FontMetrics fm, int fontsize, InlineArea inline,
int baseline, int startx) {
- boolean hasTextDeco = inline.hasUnderline()
- || inline.hasOverline()
+ boolean hasTextDeco = inline.hasUnderline()
+ || inline.hasOverline()
|| inline.hasLineThrough();
if (hasTextDeco) {
endTextObject();
@@ -733,22 +733,22 @@
if (inline.hasUnderline()) {
Color ct = (Color) inline.getTrait(Trait.UNDERLINE_COLOR);
float y = baseline - descender / 2f;
- drawBorderLine(startx / 1000f, (y - halfLineWidth) / 1000f,
- endx, (y + halfLineWidth) / 1000f,
+ drawBorderLine(startx / 1000f, (y - halfLineWidth) / 1000f,
+ endx, (y + halfLineWidth) / 1000f,
true, true, Constants.EN_SOLID, ct);
}
if (inline.hasOverline()) {
Color ct = (Color) inline.getTrait(Trait.OVERLINE_COLOR);
float y = (float)(baseline - (1.1 * capHeight));
- drawBorderLine(startx / 1000f, (y - halfLineWidth) / 1000f,
- endx, (y + halfLineWidth) / 1000f,
+ drawBorderLine(startx / 1000f, (y - halfLineWidth) / 1000f,
+ endx, (y + halfLineWidth) / 1000f,
true, true, Constants.EN_SOLID, ct);
}
if (inline.hasLineThrough()) {
Color ct = (Color) inline.getTrait(Trait.LINETHROUGH_COLOR);
float y = (float)(baseline - (0.45 * capHeight));
- drawBorderLine(startx / 1000f, (y - halfLineWidth) / 1000f,
- endx, (y + halfLineWidth) / 1000f,
+ drawBorderLine(startx / 1000f, (y - halfLineWidth) / 1000f,
+ endx, (y + halfLineWidth) / 1000f,
true, true, Constants.EN_SOLID, ct);
}
}
@@ -756,7 +756,7 @@
/** Clip using the current path. */
protected abstract void clip();
-
+
/**
* Clip using a rectangular area.
* @param x the x coordinate (in points)
@@ -765,28 +765,28 @@
* @param height the height of the rectangle (in points)
*/
protected abstract void clipRect(float x, float y, float width, float height);
-
+
/**
- * Moves the current point to (x, y), omitting any connecting line segment.
+ * Moves the current point to (x, y), omitting any connecting line segment.
* @param x x coordinate
* @param y y coordinate
*/
protected abstract void moveTo(float x, float y);
-
+
/**
- * Appends a straight line segment from the current point to (x, y). The
- * new current point is (x, y).
+ * Appends a straight line segment from the current point to (x, y). The
+ * new current point is (x, y).
* @param x x coordinate
* @param y y coordinate
*/
protected abstract void lineTo(float x, float y);
-
+
/**
- * Closes the current subpath by appending a straight line segment from
+ * Closes the current subpath by appending a straight line segment from
* the current point to the starting point of the subpath.
*/
protected abstract void closePath();
-
+
/**
* Fill a rectangular area.
* @param x the x coordinate
@@ -802,7 +802,7 @@
* @param fill true to set the fill color, false for the foreground color
*/
protected abstract void updateColor(Color col, boolean fill);
-
+
/**
* Draw an image at the indicated location.
* @param url the URI/URL of the image
@@ -810,7 +810,7 @@
* @param foreignAttributes an optional Map with foreign attributes, may be null
*/
protected abstract void drawImage(String url, Rectangle2D pos, Map foreignAttributes);
-
+
/**
* Draw an image at the indicated location.
* @param url the URI/URL of the image
@@ -819,7 +819,7 @@
protected final void drawImage(String url, Rectangle2D pos) {
drawImage(url, pos, null);
}
-
+
/**
* Draw a border segment of an XSL-FO style border.
* @param x1 starting x coordinate
@@ -827,12 +827,12 @@
* @param x2 ending x coordinate
* @param y2 ending y coordinate
* @param horz true for horizontal border segments, false for vertical border segments
- * @param startOrBefore true for border segments on the start or before edge,
+ * @param startOrBefore true for border segments on the start or before edge,
* false for end or after.
* @param style the border style (one of Constants.EN_DASHED etc.)
* @param col the color for the border segment
*/
- protected abstract void drawBorderLine(float x1, float y1, float x2, float y2,
+ protected abstract void drawBorderLine(float x1, float y1, float x2, float y2,
boolean horz, boolean startOrBefore, int style, Color col);
/** {@inheritDoc} */
@@ -842,5 +842,5 @@
String ns = fo.getNameSpace();
renderDocument(doc, ns, pos, fo.getForeignAttributes());
}
-
+
}
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/AbstractRenderer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/AbstractRenderer.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/AbstractRenderer.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/AbstractRenderer.java Fri Jul 25 05:44:20 2008
@@ -5,9 +5,9 @@
* 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.
@@ -75,12 +75,12 @@
* top level processing of the area tree and adds some abstract methods to
* handle viewports. This keeps track of the current block and inline position.
*/
-public abstract class AbstractRenderer
+public abstract class AbstractRenderer
implements Renderer, Constants {
/** logging instance */
protected static Log log = LogFactory.getLog("org.apache.fop.render");
-
+
/**
* user agent
*/
@@ -110,9 +110,9 @@
/** the currently active PageViewport */
protected PageViewport currentPageViewport;
-
+
private Set warnedXMLHandlers;
-
+
/** {@inheritDoc} */
public abstract void setupFontInfo(FontInfo fontInfo);
@@ -153,7 +153,7 @@
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public void processOffDocumentItem(OffDocumentItem odi) { }
@@ -161,17 +161,17 @@
public Graphics2DAdapter getGraphics2DAdapter() {
return null;
}
-
+
/** {@inheritDoc} */
public ImageAdapter getImageAdapter() {
return null;
}
-
+
/** @return the current PageViewport or null, if none is active */
protected PageViewport getCurrentPageViewport() {
return this.currentPageViewport;
}
-
+
/** {@inheritDoc} */
public void preparePage(PageViewport page) { }
@@ -212,7 +212,7 @@
public void startPageSequence(LineArea seqTitle) {
//do nothing
}
-
+
/** {@inheritDoc} */
public void startPageSequence(PageSequence pageSequence) {
startPageSequence(pageSequence.getTitle());
@@ -300,7 +300,7 @@
* Establishes a new viewport area.
*
* @param ctm the coordinate transformation matrix to use
- * @param clippingRect the clipping rectangle if the viewport should be clipping,
+ * @param clippingRect the clipping rectangle if the viewport should be clipping,
* null if no clipping is performed.
*/
protected abstract void startVParea(CTM ctm, Rectangle2D clippingRect);
@@ -462,7 +462,7 @@
if (bv.getClip()) {
clippingRect = new Rectangle(saveIP, saveBP, bv.getIPD(), bv.getBPD());
}
-
+
CTM ctm = bv.getCTM();
currentIPPosition = 0;
currentBPPosition = 0;
@@ -495,12 +495,12 @@
* @param block the block area
*/
protected abstract void renderReferenceArea(Block block);
-
+
/**
* Renders a list of block areas.
*
* @param parent the parent block if the parent is a block, otherwise
- * a null value.
+ * a null value.
* @param blocks The block areas
*/
protected void renderBlocks(Block parent, List blocks) {
@@ -517,7 +517,7 @@
currentIPPosition += spaceStart.intValue();
}*/
}
-
+
// the position of the containing block is used for
// absolutely positioned areas
int contBP = currentBPPosition;
@@ -538,8 +538,8 @@
// a line area is rendered from the top left position
// of the line, each inline object is offset from there
LineArea line = (LineArea) obj;
- currentIPPosition = contIP
- + parent.getStartIndent()
+ currentIPPosition = contIP
+ + parent.getStartIndent()
+ line.getStartIndent();
renderLineArea(line);
//InlineArea child = (InlineArea) line.getInlineAreas().get(0);
@@ -637,14 +637,14 @@
}
}
- /**
+ /**
* Common method to render the background and borders for any inline area.
* The all borders and padding are drawn outside the specified area.
* @param area the inline area for which the background, border and padding is to be
* rendered
*/
protected abstract void renderInlineAreaBackAndBorders(InlineArea area);
-
+
/**
* Render the given Space.
* @param space the space to render
@@ -676,7 +676,7 @@
int saveBP = currentBPPosition;
Iterator iter = text.getChildAreas().iterator();
while (iter.hasNext()) {
- renderInlineArea((InlineArea) iter.next());
+ renderInlineArea((InlineArea) iter.next());
}
currentIPPosition = saveIP + text.getAllocIPD();
}
@@ -709,7 +709,7 @@
currentBPPosition += ip.getOffset();
Iterator iter = ip.getChildAreas().iterator();
while (iter.hasNext()) {
- renderInlineArea((InlineArea) iter.next());
+ renderInlineArea((InlineArea) iter.next());
}
currentIPPosition = saveIP + ip.getAllocIPD();
currentBPPosition = saveBP;
@@ -809,7 +809,7 @@
handler.handleXML(ctx, doc, namespace);
} catch (Exception e) {
// could not handle document
- ResourceEventProducer eventProducer
+ ResourceEventProducer eventProducer
= ResourceEventProducer.Provider.get(
ctx.getUserAgent().getEventBroadcaster());
eventProducer.foreignXMLProcessingError(this, doc, namespace, e);
@@ -830,7 +830,7 @@
/**
* Get the MIME type of the renderer.
- *
+ *
* @return The MIME type of the renderer
*/
public String getMimeType() {
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/AbstractRendererMaker.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/AbstractRendererMaker.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/AbstractRendererMaker.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/AbstractRendererMaker.java Fri Jul 25 05:44:20 2008
@@ -5,9 +5,9 @@
* 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.
@@ -26,7 +26,7 @@
* about them.
*/
public abstract class AbstractRendererMaker {
-
+
/**
* Instantiates a new renderer.
* @param userAgent the user agent
@@ -38,7 +38,7 @@
* @return Indicates whether this renderer requires an OutputStream to work with.
*/
public abstract boolean needsOutputStream();
-
+
/**
* @return an array of MIME types the renderer supports.
*/
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/DefaultFontResolver.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/DefaultFontResolver.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/DefaultFontResolver.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/DefaultFontResolver.java Fri Jul 25 05:44:20 2008
@@ -30,7 +30,7 @@
public class DefaultFontResolver implements FontResolver {
private FOUserAgent userAgent;
-
+
/**
* Main constructor.
* @param userAgent the user agent
@@ -38,10 +38,10 @@
public DefaultFontResolver(FOUserAgent userAgent) {
this.userAgent = userAgent;
}
-
+
/** {@inheritDoc} */
public Source resolve(String href) {
return userAgent.resolveURI(href, userAgent.getFontBaseURL());
}
-
+
}
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/Graphics2DAdapter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/Graphics2DAdapter.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/Graphics2DAdapter.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/Graphics2DAdapter.java Fri Jul 25 05:44:20 2008
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.render;
import java.io.IOException;
@@ -43,10 +43,10 @@
* @param height height of the image
* @throws IOException In case of an I/O error while writing the output format
*/
- void paintImage(org.apache.xmlgraphics.java2d.Graphics2DImagePainter painter,
+ void paintImage(org.apache.xmlgraphics.java2d.Graphics2DImagePainter painter,
RendererContext context,
int x, int y, int width, int height) throws IOException;
-
+
/**
* Paints an arbitrary images on a given Graphics2D instance. The renderer
* providing this functionality must set up a Graphics2D instance so that
@@ -62,8 +62,8 @@
* @throws IOException In case of an I/O error while writing the output format
* @deprecated Use the variant with the Graphics2DImagePainter from XML Graphics Commons instead
*/
- void paintImage(Graphics2DImagePainter painter,
+ void paintImage(Graphics2DImagePainter painter,
RendererContext context,
int x, int y, int width, int height) throws IOException;
-
+
}
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/Graphics2DImagePainter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/Graphics2DImagePainter.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/Graphics2DImagePainter.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/Graphics2DImagePainter.java Fri Jul 25 05:44:20 2008
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.render;
/**
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/ImageAdapter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/ImageAdapter.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/ImageAdapter.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/ImageAdapter.java Fri Jul 25 05:44:20 2008
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.render;
import java.awt.image.RenderedImage;
@@ -40,8 +40,8 @@
* @param height height of the image
* @throws IOException In case of an I/O error while writing the output format
*/
- void paintImage(RenderedImage image,
+ void paintImage(RenderedImage image,
RendererContext context,
int x, int y, int width, int height) throws IOException;
-
+
}
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/Renderer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/Renderer.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/Renderer.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/Renderer.java Fri Jul 25 05:44:20 2008
@@ -5,9 +5,9 @@
* 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.
@@ -54,7 +54,7 @@
/**
* Get the MIME type of the renderer.
- *
+ *
* @return The MIME type of the renderer, may return null if not applicable.
*/
String getMimeType();
@@ -93,7 +93,7 @@
* @return the user agent
*/
FOUserAgent getUserAgent();
-
+
/**
* Set up the given FontInfo.
*
@@ -115,7 +115,7 @@
boolean supportsOutOfOrder();
/**
- * Tells the renderer to process an item not explicitly placed on the
+ * Tells the renderer to process an item not explicitly placed on the
* document (e.g., PDF bookmarks). Note - not all renderers will process
* all off-document items.
*
@@ -127,12 +127,12 @@
* @return the adapter for painting Java2D images (or null if not supported)
*/
Graphics2DAdapter getGraphics2DAdapter();
-
+
/**
* @return the adapter for painting RenderedImages (or null if not supported)
*/
ImageAdapter getImageAdapter();
-
+
/**
* This is called if the renderer supports out of order rendering. The
* renderer should prepare the page so that a page further on in the set of
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/RendererConfigurator.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/RendererConfigurator.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/RendererConfigurator.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/RendererConfigurator.java Fri Jul 25 05:44:20 2008
@@ -5,9 +5,9 @@
* 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.
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/RendererContext.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/RendererContext.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/RendererContext.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/RendererContext.java Fri Jul 25 05:44:20 2008
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.render;
//Java
@@ -54,7 +54,7 @@
public AbstractRenderer getRenderer() {
return renderer;
}
-
+
/**
* Returns the MIME type associated with this RendererContext.
*
@@ -121,7 +121,7 @@
/** The wrapped RendererContext */
protected RendererContext context;
-
+
/**
* Main constructor
* @param context the RendererContent instance
@@ -129,7 +129,7 @@
public RendererContextWrapper(RendererContext context) {
this.context = context;
}
-
+
/** @return the user agent */
public FOUserAgent getUserAgent() {
return context.getUserAgent();
@@ -158,7 +158,7 @@
/** @return the foreign attributes */
public Map getForeignAttributes() {
return (Map)context.getProperty(RendererContextConstants.FOREIGN_ATTRIBUTES);
- }
- }
+ }
+ }
}
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/RendererContextConstants.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/RendererContextConstants.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/RendererContextConstants.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/RendererContextConstants.java Fri Jul 25 05:44:20 2008
@@ -26,10 +26,10 @@
/** The output stream that the document is being sent to. */
String OUTPUT_STREAM = "outputStream";
-
+
/** The current PageViewport being rendered. */
String PAGE_VIEWPORT = "pageViewport";
-
+
/** The target width of the image being painted. */
String WIDTH = "width";
@@ -44,11 +44,11 @@
/** The configuration for the XMLHandler. */
String HANDLER_CONFIGURATION = "cfg";
-
+
/**
- * An optional Map (keys: QName, values: String) with attributes containing additional hints
+ * An optional Map (keys: QName, values: String) with attributes containing additional hints
* for rendering.
*/
String FOREIGN_ATTRIBUTES = "foreign-attributes";
-
+
}
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/RendererEventProducer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/RendererEventProducer.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/RendererEventProducer.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/RendererEventProducer.java Fri Jul 25 05:44:20 2008
@@ -31,7 +31,7 @@
/** Provider class for the event producer. */
class Provider {
-
+
/**
* Returns an event producer.
* @param broadcaster the event broadcaster to use
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/XMLHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/XMLHandler.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/XMLHandler.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/XMLHandler.java Fri Jul 25 05:44:20 2008
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.render;
import org.w3c.dom.Document;
@@ -46,9 +46,9 @@
* @param ns The Namespace of the foreign object
* @exception Exception If an error occurs during processing.
*/
- void handleXML(RendererContext context,
+ void handleXML(RendererContext context,
Document doc, String ns) throws Exception;
-
+
/**
* Checks if this XMLHandler supports handling an XML namespace for a particular renderer.
* @param renderer the renderer for which to check.
@@ -57,7 +57,7 @@
boolean supportsRenderer(Renderer renderer);
/**
- * @return the XML namespace for the XML dialect this XMLHandler supports,
+ * @return the XML namespace for the XML dialect this XMLHandler supports,
* null if all XML content is handled by this instance.
*/
String getNamespace();
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/XMLHandlerConfigurator.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/XMLHandlerConfigurator.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/XMLHandlerConfigurator.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/XMLHandlerConfigurator.java Fri Jul 25 05:44:20 2008
@@ -5,9 +5,9 @@
* 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.
@@ -27,13 +27,13 @@
import org.apache.fop.apps.FOUserAgent;
/**
- * Configurator for XMLHandler objects.
+ * Configurator for XMLHandler objects.
*/
public class XMLHandlerConfigurator extends AbstractRendererConfigurator {
/** logger instance */
protected static Log log = LogFactory.getLog(XMLHandlerConfigurator.class);
-
+
/**
* Default constructor
* @param userAgent the user agent
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/XMLHandlerRegistry.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/XMLHandlerRegistry.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/XMLHandlerRegistry.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/XMLHandlerRegistry.java Fri Jul 25 05:44:20 2008
@@ -5,9 +5,9 @@
* 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.
@@ -37,17 +37,17 @@
/** the logger */
private static Log log = LogFactory.getLog(XMLHandlerRegistry.class);
-
+
/** Map containing XML handlers for various document types */
private Map handlers = new java.util.HashMap();
-
+
/**
* Default constructor.
*/
public XMLHandlerRegistry() {
discoverXMLHandlers();
}
-
+
/**
* Add a default XML handler which is able to handle any namespace.
* @param handler XMLHandler to use
@@ -55,7 +55,7 @@
private void setDefaultXMLHandler(XMLHandler handler) {
addXMLHandler(XMLHandler.HANDLE_ALL, handler);
}
-
+
/**
* Add an XML handler. The handler itself is inspected to find out what it supports.
* @param classname the fully qualified class name
@@ -75,11 +75,11 @@
+ classname);
} catch (ClassCastException e) {
throw new IllegalArgumentException(classname
- + " is not an "
+ + " is not an "
+ XMLHandler.class.getName());
}
}
-
+
/**
* Add an XML handler. The handler itself is inspected to find out what it supports.
* @param handler the XMLHandler instance
@@ -92,7 +92,7 @@
addXMLHandler(ns, handler);
}
}
-
+
/**
* Add an XML handler for the given MIME type and XML namespace.
* @param ns Namespace URI
@@ -107,7 +107,7 @@
}
lst.add(handler);
}
-
+
/**
* Returns an XMLHandler which handles an XML dialect of the given namespace and for
* a specified output format defined by its MIME type.
@@ -140,7 +140,7 @@
}
return null; //No handler found
}
-
+
/**
* Discovers XMLHandler implementations through the classpath and dynamically
* registers them.
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/AFPEventProducer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/AFPEventProducer.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/AFPEventProducer.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/AFPEventProducer.java Fri Jul 25 05:44:20 2008
@@ -31,7 +31,7 @@
/** Provider class for the event producer. */
class Provider {
-
+
/**
* Returns an event producer.
* @param broadcaster the event broadcaster to use
@@ -50,14 +50,14 @@
public EventModel createEventModel() {
return loadModel(getClass(), "event-model.xml");
}
-
+
}
-
+
/**
* Warn about using default font setup.
* @param source the event source
* @event.severity WARN
*/
void warnDefaultFontSetup(Object source);
-
+
}
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/AFPEventProducer.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/AFPEventProducer.xml?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/AFPEventProducer.xml (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/AFPEventProducer.xml Fri Jul 25 05:44:20 2008
@@ -1,4 +1,3 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<catalogue xml:lang="en">
+<?xml version="1.0" encoding="UTF-8"?><catalogue xml:lang="en">
<message key="org.apache.fop.render.afp.AFPEventProducer.warnDefaultFontSetup">No AFP fonts configured. Using default setup.</message>
</catalogue>
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/AFPGraphics2DAdapter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/AFPGraphics2DAdapter.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/AFPGraphics2DAdapter.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/AFPGraphics2DAdapter.java Fri Jul 25 05:44:20 2008
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.render.afp;
import java.awt.image.BufferedImage;
@@ -37,9 +37,9 @@
*/
public AFPGraphics2DAdapter() {
}
-
+
/** {@inheritDoc} */
- public void paintImage(Graphics2DImagePainter painter,
+ public void paintImage(Graphics2DImagePainter painter,
RendererContext context,
int x, int y, int width, int height) throws IOException {
RendererContext.RendererContextWrapper wrappedContext
@@ -47,7 +47,7 @@
AFPRenderer afp = (AFPRenderer)context.getRenderer();
Boolean grayObj = (Boolean)context.getProperty(AFPRendererContextConstants.AFP_GRAYSCALE);
boolean gray = (grayObj != null ? grayObj.booleanValue() : false);
-
+
//Paint to a BufferedImage
int resolution = (int)Math.round(context.getUserAgent().getTargetResolution());
BufferedImage bi = paintToBufferedImage(painter, wrappedContext, resolution, gray, false);
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/AFPRenderer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/AFPRenderer.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/AFPRenderer.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/AFPRenderer.java Fri Jul 25 05:44:20 2008
@@ -74,21 +74,16 @@
import org.apache.fop.events.ResourceEventProducer;
import org.apache.fop.fo.Constants;
import org.apache.fop.fo.extensions.ExtensionAttachment;
+import org.apache.fop.fonts.FontCollection;
import org.apache.fop.fonts.FontInfo;
-import org.apache.fop.fonts.FontTriplet;
-import org.apache.fop.fonts.base14.Courier;
-import org.apache.fop.fonts.base14.Helvetica;
-import org.apache.fop.fonts.base14.TimesRoman;
+import org.apache.fop.fonts.FontManager;
import org.apache.fop.render.AbstractPathOrientedRenderer;
import org.apache.fop.render.Graphics2DAdapter;
import org.apache.fop.render.RendererContext;
import org.apache.fop.render.afp.extensions.AFPElementMapping;
import org.apache.fop.render.afp.extensions.AFPPageSetup;
import org.apache.fop.render.afp.fonts.AFPFont;
-import org.apache.fop.render.afp.fonts.AFPFontInfo;
-import org.apache.fop.render.afp.fonts.CharacterSet;
-import org.apache.fop.render.afp.fonts.FopCharacterSet;
-import org.apache.fop.render.afp.fonts.OutlineFont;
+import org.apache.fop.render.afp.fonts.AFPFontCollection;
import org.apache.fop.render.afp.modca.AFPConstants;
import org.apache.fop.render.afp.modca.AFPDataStream;
import org.apache.fop.render.afp.modca.ImageObject;
@@ -279,53 +274,11 @@
*/
public void setupFontInfo(FontInfo inFontInfo) {
this.fontInfo = inFontInfo;
- int num = 1;
- if (super.embedFontInfoList != null && super.embedFontInfoList.size() > 0) {
- for (Iterator it = super.embedFontInfoList.iterator(); it.hasNext();) {
- AFPFontInfo afi = (AFPFontInfo)it.next();
- AFPFont bf = (AFPFont)afi.getAFPFont();
- for (Iterator it2 = afi.getFontTriplets().iterator(); it2.hasNext();) {
- FontTriplet ft = (FontTriplet)it2.next();
- this.fontInfo.addFontProperties("F" + num, ft.getName()
- , ft.getStyle(), ft.getWeight());
- this.fontInfo.addMetrics("F" + num, bf);
- num++;
- }
- }
- } else {
- AFPEventProducer eventProducer = AFPEventProducer.Provider.get(
- getUserAgent().getEventBroadcaster());
- eventProducer.warnDefaultFontSetup(this);
- }
- if (this.fontInfo.fontLookup("sans-serif", "normal", 400) == null) {
- CharacterSet cs = new FopCharacterSet("T1V10500", "Cp500", "CZH200 ",
- 1, new Helvetica());
- AFPFont bf = new OutlineFont("Helvetica", cs);
- this.fontInfo.addFontProperties("F" + num, "sans-serif", "normal", 400);
- this.fontInfo.addMetrics("F" + num, bf);
- num++;
- }
- if (this.fontInfo.fontLookup("serif", "normal", 400) == null) {
- CharacterSet cs = new FopCharacterSet("T1V10500", "Cp500", "CZN200 ",
- 1, new TimesRoman());
- AFPFont bf = new OutlineFont("Helvetica", cs);
- this.fontInfo.addFontProperties("F" + num, "serif", "normal", 400);
- this.fontInfo.addMetrics("F" + num, bf);
- num++;
- }
- if (this.fontInfo.fontLookup("monospace", "normal", 400) == null) {
- CharacterSet cs = new FopCharacterSet("T1V10500", "Cp500", "CZ4200 ",
- 1, new Courier());
- AFPFont bf = new OutlineFont("Helvetica", cs);
- this.fontInfo.addFontProperties("F" + num, "monospace", "normal", 400);
- this.fontInfo.addMetrics("F" + num, bf);
- num++;
- }
- if (this.fontInfo.fontLookup("any", "normal", 400) == null) {
- FontTriplet ft = this.fontInfo.fontLookup("sans-serif", "normal", 400);
- this.fontInfo.addFontProperties(
- this.fontInfo.getInternalFontKey(ft), "any", "normal", 400);
- }
+ FontManager fontManager = userAgent.getFactory().getFontManager();
+ FontCollection[] fontCollections = new FontCollection[] {
+ new AFPFontCollection(userAgent.getEventBroadcaster(), getFontList())
+ };
+ fontManager.setup(getFontInfo(), fontCollections);
}
/**
@@ -591,8 +544,8 @@
/** {@inheritDoc} */
protected void renderReferenceArea(Block block) {
- //TODO Remove this method once concatenateTransformationMatrix() is implemented
-
+ //TODO Remove this method once concatenateTransformationMatrix() is implemented
+
// save position and offset
int saveIP = currentIPPosition;
int saveBP = currentBPPosition;
@@ -602,7 +555,7 @@
at.translate(currentIPPosition, currentBPPosition);
at.translate(block.getXOffset(), block.getYOffset());
at.translate(0, block.getSpaceBefore());
-
+
if (!at.isIdentity()) {
Rectangle2D contentRect
= new Rectangle2D.Double(at.getTranslateX(), at.getTranslateY(),
@@ -622,12 +575,12 @@
if (!at.isIdentity()) {
popViewPortPos();
}
-
+
// stacked and relative blocks effect stacking
currentIPPosition = saveIP;
currentBPPosition = saveBP;
}
-
+
/** {@inheritDoc} */
protected void renderFlow(NormalFlow flow) {
// save position and offset
@@ -637,7 +590,7 @@
//Establish a new coordinate system
AffineTransform at = new AffineTransform();
at.translate(currentIPPosition, currentBPPosition);
-
+
if (!at.isIdentity()) {
Rectangle2D contentRect
= new Rectangle2D.Double(at.getTranslateX(), at.getTranslateY(),
@@ -648,17 +601,17 @@
currentIPPosition = 0;
currentBPPosition = 0;
super.renderFlow(flow);
-
+
if (!at.isIdentity()) {
popViewPortPos();
}
-
+
// stacked and relative blocks effect stacking
currentIPPosition = saveIP;
currentBPPosition = saveBP;
}
-
-
+
+
/** {@inheritDoc} */
protected void concatenateTransformationMatrix(AffineTransform at) {
//Not used here since AFPRenderer defines its own renderBlockViewport() method.
@@ -1124,7 +1077,7 @@
* } else if (MimeConstants.MIME_JPEG.equals(mime)) { if
* (!fopimage.load(FopImage.ORIGINAL_DATA)) { return; }
* fact.releaseImage(url, userAgent);
- *
+ *
* int x = mpts2units(pos.getX() + currentIPPosition); int y =
* mpts2units(pos.getY() + currentBPPosition); int w =
* mpts2units(pos.getWidth()); int h =
@@ -1212,7 +1165,7 @@
/**
* Writes a RenderedImage to an OutputStream as raw sRGB bitmaps.
- *
+ *
* @param image
* the RenderedImage
* @param out
@@ -1227,7 +1180,7 @@
/**
* Draws a BufferedImage to AFP.
- *
+ *
* @param image
* the RenderedImage
* @param imageResolution
@@ -1533,7 +1486,7 @@
/**
* Sets the rotation to be used for portrait pages, valid values are 0
* (default), 90, 180, 270.
- *
+ *
* @param rotation
* The rotation in degrees.
*/
@@ -1555,7 +1508,7 @@
/**
* Sets the rotation to be used for landsacpe pages, valid values are 0, 90,
* 180, 270 (default).
- *
+ *
* @param rotation
* The rotation in degrees.
*/
@@ -1575,7 +1528,7 @@
/**
* Get the MIME type of the renderer.
- *
+ *
* @return The MIME type of the renderer
*/
public String getMimeType() {
@@ -1585,7 +1538,7 @@
/**
* Method to render the page extension.
* <p>
- *
+ *
* @param pageViewport the page object
*/
private void renderPageObjectExtensions(PageViewport pageViewport) {
@@ -1652,7 +1605,7 @@
/**
* Converts FOP mpt measurement to afp measurement units
- *
+ *
* @param mpt
* the millipoints value
* @return afp measurement unit value
@@ -1664,7 +1617,7 @@
/**
* Converts a byte array containing 24 bit RGB image data to a grayscale
* image.
- *
+ *
* @param io
* the target image object
* @param raw
@@ -1839,7 +1792,7 @@
/**
* Sets the number of bits used per pixel
- *
+ *
* @param bitsPerPixel
* number of bits per pixel
*/
@@ -1859,7 +1812,7 @@
/**
* Sets whether images are color or not
- *
+ *
* @param colorImages
* color image output
*/
@@ -1869,7 +1822,7 @@
/**
* Sets the output/device resolution
- *
+ *
* @param resolution
* the output resolution (dpi)
*/
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/AFPRendererConfigurator.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/AFPRendererConfigurator.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/AFPRendererConfigurator.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/AFPRendererConfigurator.java Fri Jul 25 05:44:20 2008
@@ -5,9 +5,9 @@
* 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.
@@ -38,10 +38,10 @@
import org.apache.fop.util.LogUtil;
/**
- * AFP Renderer configurator
+ * AFP Renderer configurator
*/
public class AFPRendererConfigurator extends PrintRendererConfigurator {
-
+
/**
* Default constructor
* @param userAgent user agent
@@ -181,7 +181,7 @@
}
return null;
}
-
+
/**
* Builds a list of AFPFontInfo objects for use with the setup() method.
* @param cfg Configuration object
@@ -229,14 +229,14 @@
LogUtil.handleException(log, e,
userAgent.getFactory().validateUserConfigStrictly());
}
-
+
Configuration imagesCfg = cfg.getChild("images");
if (!"color".equalsIgnoreCase(imagesCfg.getAttribute("mode", "b+w"))) {
afpRenderer.setBitsPerPixel(imagesCfg.getAttributeAsInteger("bits-per-pixel", 8));
} else {
afpRenderer.setColorImages(true);
}
-
+
Configuration rendererResolutionCfg = cfg.getChild("renderer-resolution", false);
if (rendererResolutionCfg != null) {
afpRenderer.setResolution(rendererResolutionCfg.getValueAsInteger(240));
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/AFPRendererContextConstants.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/AFPRendererContextConstants.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/AFPRendererContextConstants.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/AFPRendererContextConstants.java Fri Jul 25 05:44:20 2008
@@ -27,7 +27,7 @@
public interface AFPRendererContextConstants extends RendererContextConstants {
/**
- * Key for a Boolean value that enables grayscale processing instead of color
+ * Key for a Boolean value that enables grayscale processing instead of color
* processing.
*/
String AFP_GRAYSCALE = "afpGrayscale";
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/AFPSVGHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/AFPSVGHandler.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/AFPSVGHandler.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/AFPSVGHandler.java Fri Jul 25 05:44:20 2008
@@ -5,9 +5,9 @@
* 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.
@@ -35,13 +35,13 @@
public boolean supportsRenderer(Renderer renderer) {
return (renderer instanceof AFPRenderer);
}
-
+
/** {@inheritDoc} */
protected void updateRendererContext(RendererContext context) {
//Work around a problem in Batik: Gradients cannot be done in ColorSpace.CS_GRAY
context.setProperty(AFPRendererContextConstants.AFP_GRAYSCALE,
Boolean.FALSE);
}
-
+
}
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/exceptions/NestedRuntimeException.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/exceptions/NestedRuntimeException.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/exceptions/NestedRuntimeException.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/exceptions/NestedRuntimeException.java Fri Jul 25 05:44:20 2008
@@ -30,10 +30,10 @@
*
*/
public abstract class NestedRuntimeException extends RuntimeException {
-
+
/** Root cause of this nested exception */
private Throwable underlyingException;
-
+
/**
* Construct a <code>NestedRuntimeException</code> with the specified detail message.
* @param msg The detail message.
@@ -41,7 +41,7 @@
public NestedRuntimeException(String msg) {
super(msg);
}
-
+
/**
* Construct a <code>NestedRuntimeException</code> with the specified
* detail message and nested exception.
@@ -51,26 +51,26 @@
public NestedRuntimeException(String msg, Throwable t) {
super(msg);
underlyingException = t;
-
+
}
-
+
/**
* Gets the original triggering exception
* @return The original exception as a throwable.
*/
public Throwable getUnderlyingException() {
-
+
return underlyingException;
-
+
}
-
+
/**
* Return the detail message, including the message from the nested
* exception if there is one.
* @return The detail message.
*/
public String getMessage() {
-
+
if (underlyingException == null) {
return super.getMessage();
} else {
@@ -78,9 +78,9 @@
+ "; nested exception is "
+ underlyingException.getClass().getName();
}
-
+
}
-
+
/**
* Print the composite message and the embedded stack trace to the specified stream.
* @param ps the print stream
@@ -93,7 +93,7 @@
underlyingException.printStackTrace(ps);
}
}
-
+
/**
* Print the composite message and the embedded stack trace to the specified writer.
* @param pw the print writer
@@ -106,5 +106,5 @@
underlyingException.printStackTrace(pw);
}
}
-
+
}
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/exceptions/RendererRuntimeException.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/exceptions/RendererRuntimeException.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/exceptions/RendererRuntimeException.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/exceptions/RendererRuntimeException.java Fri Jul 25 05:44:20 2008
@@ -24,7 +24,7 @@
* <p/>
*/
public class RendererRuntimeException extends NestedRuntimeException {
-
+
/**
* Constructs a RendererRuntimeException with the specified message.
* @param msg the exception mesaage
@@ -32,7 +32,7 @@
public RendererRuntimeException(String msg) {
super(msg);
}
-
+
/**
* Constructs a RendererRuntimeException with the specified message
* wrapping the underlying exception.
@@ -42,5 +42,5 @@
public RendererRuntimeException(String msg, Throwable t) {
super(msg, t);
}
-
+
}
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/extensions/AFPExtensionHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/extensions/AFPExtensionHandler.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/extensions/AFPExtensionHandler.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/extensions/AFPExtensionHandler.java Fri Jul 25 05:44:20 2008
@@ -30,7 +30,7 @@
/**
* ContentHandler (parser) for restoring AFPExtension objects from XML.
*/
-public class AFPExtensionHandler extends DefaultHandler
+public class AFPExtensionHandler extends DefaultHandler
implements ContentHandlerFactory.ObjectSource {
/** Logger instance */
@@ -38,12 +38,12 @@
private StringBuffer content = new StringBuffer();
private Attributes lastAttributes;
-
+
private AFPPageSetup returnedObject;
private ObjectBuiltListener listener;
-
+
/** {@inheritDoc} */
- public void startElement(String uri, String localName, String qName, Attributes attributes)
+ public void startElement(String uri, String localName, String qName, Attributes attributes)
throws SAXException {
boolean handled = false;
if (AFPPageSetup.CATEGORY.equals(uri)) {
@@ -62,10 +62,10 @@
}
if (!handled) {
if (AFPPageSetup.CATEGORY.equals(uri)) {
- throw new SAXException("Unhandled element " + localName
+ throw new SAXException("Unhandled element " + localName
+ " in namespace: " + uri);
} else {
- log.warn("Unhandled element " + localName
+ log.warn("Unhandled element " + localName
+ " in namespace: " + uri);
}
}
@@ -87,7 +87,7 @@
returnedObject.setContent(content.toString());
content.setLength(0); //Reset text buffer (see characters())
}
- }
+ }
}
/** {@inheritDoc} */
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/extensions/AFPExtensionHandlerFactory.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/extensions/AFPExtensionHandlerFactory.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/extensions/AFPExtensionHandlerFactory.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/extensions/AFPExtensionHandlerFactory.java Fri Jul 25 05:44:20 2008
@@ -28,7 +28,7 @@
public class AFPExtensionHandlerFactory implements ContentHandlerFactory {
private static final String[] NAMESPACES = new String[] {AFPPageSetup.CATEGORY};
-
+
/** {@inheritDoc} */
public String[] getSupportedNamespaces() {
return NAMESPACES;
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/extensions/AFPPageSetup.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/extensions/AFPPageSetup.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/extensions/AFPPageSetup.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/extensions/AFPPageSetup.java Fri Jul 25 05:44:20 2008
@@ -49,7 +49,7 @@
/**
* Default constructor.
- *
+ *
* @param elementName the name of the setup code object, may be null
*/
public AFPPageSetup(String elementName) {
@@ -75,7 +75,7 @@
}
/**
- * @return the value
+ * @return the value
*/
public String getValue() {
return value;
@@ -88,7 +88,7 @@
public void setValue(String source) {
this.value = source;
}
-
+
/** {@inheritDoc} */
public String getCategory() {
return CATEGORY;
@@ -111,7 +111,7 @@
/** {@inheritDoc} */
public String toString() {
- return "AFPPageSetup(element-name=" + getElementName()
+ return "AFPPageSetup(element-name=" + getElementName()
+ " name=" + getName() + " value=" + getValue() + ")";
}
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/extensions/AbstractAFPExtensionObject.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/extensions/AbstractAFPExtensionObject.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/extensions/AbstractAFPExtensionObject.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/extensions/AbstractAFPExtensionObject.java Fri Jul 25 05:44:20 2008
@@ -37,9 +37,9 @@
* AFP setup code
*/
private AFPPageSetup setupCode;
-
+
private String name;
-
+
/**
* @see org.apache.fop.fo.FONode#FONode(FONode)
* @param parent the parent formatting object
@@ -62,7 +62,7 @@
/** {@inheritDoc} */
protected void addCharacters(char[] data, int start, int end,
PropertyList pList, Locator locator) {
- setupCode.setContent(new String(data, start, end - start));
+ setupCode.setContent(new String(data, start, end - start));
}
/** {@inheritDoc} */
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/fonts/CharacterSet.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/fonts/CharacterSet.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/fonts/CharacterSet.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/fonts/CharacterSet.java Fri Jul 25 05:44:20 2008
@@ -20,7 +20,6 @@
package org.apache.fop.render.afp.fonts;
import java.io.UnsupportedEncodingException;
-import java.util.HashMap;
import java.util.Map;
import org.apache.commons.logging.Log;
@@ -47,54 +46,34 @@
*/
public class CharacterSet {
- /**
- * Static logging instance
- */
+ /** Static logging instance */
protected static final Log log = LogFactory.getLog(CharacterSet.class.getName());
- /**
- * The code page to which the character set relates
- */
+ /** The code page to which the character set relates */
protected String codePage;
- /**
- * The encoding used for the code page
- */
+ /** The encoding used for the code page */
protected String encoding;
- /**
- * The character set relating to the font
- */
+ /** The character set relating to the font */
protected String name;
- /**
- * The name of the character set as EBCIDIC bytes
- */
- private byte[] nameBytes;
-
- /**
- * The path to the installed fonts
- */
+ /** The path to the installed fonts */
protected String path;
- /**
- * Indicator as to whether to metrics have been loaded
- */
+ /** Indicator as to whether to metrics have been loaded */
private boolean isMetricsLoaded = false;
- /**
- * The current orientation (currently only 0 is suppoted by FOP)
- */
+ /** The current orientation (currently only 0 is suppoted by FOP) */
private String currentOrientation = "0";
- /**
- * The collection of objects for each orientation
- */
+ /** The collection of objects for each orientation */
private Map characterSetOrientations = null;
/**
* Constructor for the CharacterSetMetric object, the character set is used
* to load the font information from the actual AFP font.
+ *
* @param codePage the code page identifier
* @param encoding the encoding of the font
* @param name the character set name
@@ -118,36 +97,21 @@
this.name = name;
}
- try {
-
- this.nameBytes = name.getBytes(AFPConstants.EBCIDIC_ENCODING);
-
- } catch (UnsupportedEncodingException usee) {
-
- this.nameBytes = name.getBytes();
- log.warn(
- "Constructor:: UnsupportedEncodingException translating the name "
- + name);
-
- }
-
this.codePage = codePage;
this.encoding = encoding;
this.path = path;
- this.characterSetOrientations = new HashMap(4);
-
+ this.characterSetOrientations = new java.util.HashMap(4);
}
/**
* Add character set metric information for the different orientations
+ *
* @param cso the metrics for the orientation
*/
public void addCharacterSetOrientation(CharacterSetOrientation cso) {
-
characterSetOrientations.put(
String.valueOf(cso.getOrientation()),
cso);
-
}
/**
@@ -160,6 +124,7 @@
* Ascender Height is the character�s most positive y-axis value.
* For bounded character boxes, for a given character having an
* ascender, ascender height and baseline offset are equal.
+ *
* @return the ascender value in millipoints
*/
public int getAscender() {
@@ -171,6 +136,7 @@
* Cap height is the average height of the uppercase characters in
* a font. This value is specified by the designer of a font and is
* usually the height of the uppercase M.
+ *
* @return the cap height value in millipoints
*/
public int getCapHeight() {
@@ -182,6 +148,7 @@
* Descender depth is the distance from the character baseline to
* the bottom of a character box. A negative descender depth signifies
* that all of the graphic character is above the character baseline.
+ *
* @return the descender value in millipoints
*/
public int getDescender() {
@@ -191,6 +158,7 @@
/**
* The first character in the character set
+ *
* @return the first character
*/
public int getFirstChar() {
@@ -199,7 +167,8 @@
}
/**
- * The last character in the character set
+ * Returns the last character in the character set
+ *
* @return the last character
*/
public int getLastChar() {
@@ -208,6 +177,8 @@
}
/**
+ * Returns the path where the font resources are installed
+ *
* @return the path where the font resources are installed
*/
public String getPath() {
@@ -216,6 +187,7 @@
/**
* Get the width (in 1/1000ths of a point size) of all characters
+ *
* @return the widths of all characters
*/
public int[] getWidths() {
@@ -235,6 +207,7 @@
/**
* Get the width (in 1/1000ths of a point size) of the character
* identified by the parameter passed.
+ *
* @param character the character from which the width will be calculated
* @return the width of the character
*/
@@ -248,19 +221,16 @@
* be processed on a method call requiring the metric information.
*/
private void load() {
-
if (!isMetricsLoaded) {
-
AFPFontReader afpFontReader = new AFPFontReader();
afpFontReader.loadCharacterSetMetric(this);
isMetricsLoaded = true;
-
}
-
}
/**
* Returns the AFP character set identifier
+ *
* @return String
*/
public String getName() {
@@ -269,15 +239,26 @@
/**
* Returns the AFP character set identifier
- * @return byte[]
+ *
+ * @return the AFP character set identifier
*/
public byte[] getNameBytes() {
+ byte[] nameBytes = null;
+ try {
+ nameBytes = name.getBytes(AFPConstants.EBCIDIC_ENCODING);
+ } catch (UnsupportedEncodingException usee) {
+ nameBytes = name.getBytes();
+ log.warn(
+ "UnsupportedEncodingException translating the name "
+ + name);
+ }
return nameBytes;
}
/**
* Returns the AFP code page identifier
- * @return String
+ *
+ * @return the AFP code page identifier
*/
public String getCodePage() {
return codePage;
@@ -285,7 +266,8 @@
/**
* Returns the AFP code page encoding
- * @return String
+ *
+ * @return the AFP code page encoding
*/
public String getEncoding() {
return encoding;
@@ -300,6 +282,7 @@
* the case for landscape prints which use an orientation of 270 degrees,
* in 99.9% of cases the font metrics will be the same as the 0 degrees
* therefore the implementation currely will always use 0 degrees.
+ *
* @return characterSetOrentation The current orientation metrics.
*/
private CharacterSetOrientation getCharacterSetOrientation() {
@@ -314,6 +297,7 @@
* Map a Unicode character to a code point in the font.
* The code tables are already converted to Unicode therefore
* we can use the identity mapping.
+ *
* @param c character to map
* @return the mapped character
*/
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/fonts/FopCharacterSet.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/fonts/FopCharacterSet.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/fonts/FopCharacterSet.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/fonts/FopCharacterSet.java Fri Jul 25 05:44:20 2008
@@ -45,7 +45,7 @@
String name,
int size,
Typeface charSet) {
-
+
super(codePage, encoding, name, null);
this.charSet = charSet;
this.size = size * 1000;
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org