From: Adrian Cumiskey Date: Mon, 21 Jul 2008 09:21:11 +0000 (+0000) Subject: Tidy up. X-Git-Tag: fop-1_0~376^2~126 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c442df1c208fd7eeb17a3bc1eb1aad750d9be333;p=xmlgraphics-fop.git Tidy up. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AFPGOCAResources@678371 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/render/afp/AFPRendererConfigurator.java b/src/java/org/apache/fop/render/afp/AFPRendererConfigurator.java index 30d59c4ae..3b3a1c522 100644 --- a/src/java/org/apache/fop/render/afp/AFPRendererConfigurator.java +++ b/src/java/org/apache/fop/render/afp/AFPRendererConfigurator.java @@ -57,16 +57,17 @@ public class AFPRendererConfigurator extends PrintRendererConfigurator { throws ConfigurationException { Configuration[] triple = fontCfg.getChildren("font-triplet"); - List tripleList = new java.util.ArrayList(); + List/**/ tripletList = new java.util.ArrayList(); if (triple.length == 0) { log.error("Mandatory font configuration element ' 0) { for (Iterator it = 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(); - fontInfo.addFontProperties("F" + num, ft.getName() - , ft.getStyle(), ft.getWeight()); - fontInfo.addMetrics("F" + num, bf); + AFPFontInfo afpFontInfo = (AFPFontInfo)it.next(); + AFPFont afpFont = (AFPFont)afpFontInfo.getAFPFont(); + List/**/ tripletList = afpFontInfo.getFontTriplets(); + for (Iterator it2 = tripletList.iterator(); it2.hasNext();) { + FontTriplet triplet = (FontTriplet)it2.next(); + fontInfo.addFontProperties("F" + num, + triplet.getName(), triplet.getStyle(), triplet.getWeight()); + fontInfo.addMetrics("F" + num, afpFont); num++; } } @@ -71,6 +72,8 @@ public class AFPFontCollection implements FontCollection { AFPEventProducer eventProducer = AFPEventProducer.Provider.get(eventBroadcaster); eventProducer.warnDefaultFontSetup(this); } + + // note: these fonts may not exist on your AFP installation if (fontInfo.fontLookup("sans-serif", Font.STYLE_NORMAL, Font.WEIGHT_NORMAL) == null) { CharacterSet cs = new FopCharacterSet("T1V10500", "Cp500", "CZH200 ", 1, new Helvetica()); diff --git a/src/java/org/apache/fop/render/afp/fonts/AFPFontInfo.java b/src/java/org/apache/fop/render/afp/fonts/AFPFontInfo.java index 42f333a66..a70dce4b9 100644 --- a/src/java/org/apache/fop/render/afp/fonts/AFPFontInfo.java +++ b/src/java/org/apache/fop/render/afp/fonts/AFPFontInfo.java @@ -27,20 +27,22 @@ import java.util.List; public class AFPFontInfo { private AFPFont font; - private List fontTriplets; + private List/**/ tripletList; /** * Main constructor + * * @param afpFont The AFP Font - * @param fontTriplets List of font triplets to associate with this font + * @param tripletList List of font triplets to associate with this font */ - public AFPFontInfo(AFPFont afpFont, List fontTriplets) { + public AFPFontInfo(AFPFont afpFont, List/**/ tripletList) { this.font = afpFont; - this.fontTriplets = fontTriplets; + this.tripletList = tripletList; } /** * Returns the afp font + * * @return the afp font */ public AFPFont getAFPFont() { @@ -49,10 +51,11 @@ public class AFPFontInfo { /** * Returns the list of font triplets associated with this font. + * * @return List of font triplets */ - public List getFontTriplets() { - return fontTriplets; + public List/**/ getFontTriplets() { + return tripletList; } } diff --git a/src/java/org/apache/fop/render/afp/modca/AbstractPageObject.java b/src/java/org/apache/fop/render/afp/modca/AbstractPageObject.java index 73c4b6821..d3b4d10a9 100644 --- a/src/java/org/apache/fop/render/afp/modca/AbstractPageObject.java +++ b/src/java/org/apache/fop/render/afp/modca/AbstractPageObject.java @@ -382,12 +382,4 @@ public abstract class AbstractPageObject extends AbstractNamedAFPObject { objects.add(obj); } -// /** {@inheritDoc} */ -// protected void addObject(AbstractAFPObject obj) { -// if (obj instanceof DataObjectAccessor) { -// DataObjectAccessor dataObjectAccessor = (DataObjectAccessor)obj; -// getActiveEnvironmentGroup().createMapDataResource(dataObjectAccessor); -// } -// endPresentationObject(); -// } } diff --git a/src/java/org/apache/fop/render/afp/modca/AbstractResourceGroupContainer.java b/src/java/org/apache/fop/render/afp/modca/AbstractResourceGroupContainer.java index 55f3a89b1..b1d4980a8 100644 --- a/src/java/org/apache/fop/render/afp/modca/AbstractResourceGroupContainer.java +++ b/src/java/org/apache/fop/render/afp/modca/AbstractResourceGroupContainer.java @@ -22,12 +22,11 @@ package org.apache.fop.render.afp.modca; import java.io.IOException; import java.io.OutputStream; -//import org.apache.fop.render.afp.DataObjectInfo; - /** * An abstract container of resource objects */ public abstract class AbstractResourceGroupContainer extends AbstractPageObject { + /** * The resource group object */ @@ -72,6 +71,8 @@ public abstract class AbstractResourceGroupContainer extends AbstractPageObject } /** + * Return the number of resources in this container + * * @return the number of resources in this container */ protected int getResourceCount() { @@ -82,6 +83,8 @@ public abstract class AbstractResourceGroupContainer extends AbstractPageObject } /** + * Returns true if this resource group container contains resources + * * @return true if this resource group container contains resources */ protected boolean hasResources() { @@ -98,18 +101,7 @@ public abstract class AbstractResourceGroupContainer extends AbstractPageObject return resourceGroup; } -// /** -// * Creates and returns a new data object -// * @param dataObjectInfo the data object info -// * @return a newly created data object -// */ -// public AbstractNamedAFPObject createObject(DataObjectInfo dataObjectInfo) { -// return dataObjectFactory.create(dataObjectInfo); -// } - - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ protected void writeContent(OutputStream os) throws IOException { if (resourceGroup != null) { resourceGroup.write(os);