acumiskey
Mon, 21 Jul 2008 02:22:13 -0700
Author: acumiskey Date: Mon Jul 21 02:21:11 2008 New Revision: 678371 URL: http://svn.apache.org/viewvc?rev=678371&view=rev Log: Tidy up. Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPRendererConfigurator.java xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/fonts/AFPFontCollection.java xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/fonts/AFPFontInfo.java xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/AbstractPageObject.java xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/AbstractResourceGroupContainer.java Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPRendererConfigurator.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPRendererConfigurator.java?rev=678371&r1=678370&r2=678371&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPRendererConfigurator.java (original) +++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPRendererConfigurator.java Mon Jul 21 02:21:11 2008 @@ -57,16 +57,17 @@ throws ConfigurationException { Configuration[] triple = fontCfg.getChildren("font-triplet"); - List tripleList = new java.util.ArrayList(); + List/*<FontTriplet>*/ tripletList = new java.util.ArrayList(); if (triple.length == 0) { log.error("Mandatory font configuration element '<font-triplet...' is missing"); return null; } for (int j = 0; j < triple.length; j++) { int weight = FontUtil.parseCSS2FontWeight(triple[j].getAttribute("weight")); - tripleList.add(new FontTriplet(triple[j].getAttribute("name"), - triple[j].getAttribute("style"), - weight)); + FontTriplet triplet = new FontTriplet(triple[j].getAttribute("name"), + triple[j].getAttribute("style"), + weight); + tripletList.add(triplet); } //build the fonts @@ -140,7 +141,7 @@ codepage, encoding, characterset, path)); } } - return new AFPFontInfo(font, tripleList); + return new AFPFontInfo(font, tripletList); } else if ("outline".equalsIgnoreCase(type)) { String characterset = afpFontCfg.getAttribute("characterset"); @@ -174,7 +175,7 @@ } // Create a new font object OutlineFont font = new OutlineFont(name, characterSet); - return new AFPFontInfo(font, tripleList); + return new AFPFontInfo(font, tripletList); } else { log.error("No or incorrect type attribute"); } @@ -244,16 +245,6 @@ afpRenderer.setResolution(rendererResolutionCfg.getValueAsInteger(240)); } - // TODO: provide support for different MO:DCA interchange sets - // the MO:DCA interchange set in use (defaults to MO:DCA-L) -// Configuration modcaCfg = cfg.getChild("modca", false); -// if (modcaCfg != null) { -// String interchangeSetString = cfg.getAttribute( -// "interchange-set", InterchangeSet.MODCA_PRESENTATION_INTERCHANGE_SET_2); -// InterchangeSet interchangeSet = InterchangeSet.valueOf(interchangeSetString); -// afpRenderer.getAFPDataStream().setInterchangeSet(interchangeSet); -// } - // a default external resource group file setting Configuration resourceGroupFileCfg = cfg.getChild("resource-group-file", false); @@ -274,6 +265,16 @@ + resourceGroupDest + "'"); } } + + // TODO: provide support for different MO:DCA interchange sets + // the MO:DCA interchange set in use (defaults to MO:DCA-L) +// Configuration modcaCfg = cfg.getChild("modca", false); +// if (modcaCfg != null) { +// String interchangeSetString = cfg.getAttribute( +// "interchange-set", InterchangeSet.MODCA_PRESENTATION_INTERCHANGE_SET_2); +// InterchangeSet interchangeSet = InterchangeSet.valueOf(interchangeSetString); +// afpRenderer.getAFPDataStream().setInterchangeSet(interchangeSet); +// } } } } Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/fonts/AFPFontCollection.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/fonts/AFPFontCollection.java?rev=678371&r1=678370&r2=678371&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/fonts/AFPFontCollection.java (original) +++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/fonts/AFPFontCollection.java Mon Jul 21 02:21:11 2008 @@ -57,13 +57,14 @@ int num = 1; if (embedFontInfoList != null && embedFontInfoList.size() > 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/*<FontTriplet>*/ 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 @@ 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()); Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/fonts/AFPFontInfo.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/fonts/AFPFontInfo.java?rev=678371&r1=678370&r2=678371&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/fonts/AFPFontInfo.java (original) +++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/fonts/AFPFontInfo.java Mon Jul 21 02:21:11 2008 @@ -27,20 +27,22 @@ public class AFPFontInfo { private AFPFont font; - private List fontTriplets; + private List/*<FontTriplet>*/ 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/*<FontTriplet>*/ 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 @@ /** * Returns the list of font triplets associated with this font. + * * @return List of font triplets */ - public List getFontTriplets() { - return fontTriplets; + public List/*<FontTriplet>*/ getFontTriplets() { + return tripletList; } } Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/AbstractPageObject.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/AbstractPageObject.java?rev=678371&r1=678370&r2=678371&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/AbstractPageObject.java (original) +++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/AbstractPageObject.java Mon Jul 21 02:21:11 2008 @@ -382,12 +382,4 @@ objects.add(obj); } -// /** [EMAIL PROTECTED] */ -// protected void addObject(AbstractAFPObject obj) { -// if (obj instanceof DataObjectAccessor) { -// DataObjectAccessor dataObjectAccessor = (DataObjectAccessor)obj; -// getActiveEnvironmentGroup().createMapDataResource(dataObjectAccessor); -// } -// endPresentationObject(); -// } } Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/AbstractResourceGroupContainer.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/AbstractResourceGroupContainer.java?rev=678371&r1=678370&r2=678371&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/AbstractResourceGroupContainer.java (original) +++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/AbstractResourceGroupContainer.java Mon Jul 21 02:21:11 2008 @@ -22,12 +22,11 @@ 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 @@ } /** + * Return the number of resources in this container + * * @return the number of resources in this container */ protected int getResourceCount() { @@ -82,6 +83,8 @@ } /** + * 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 @@ 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); -// } - - /** - * [EMAIL PROTECTED] - */ + /** [EMAIL PROTECTED] */ protected void writeContent(OutputStream os) throws IOException { if (resourceGroup != null) { resourceGroup.write(os); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]