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 vh...@apache.org on 2008/07/24 11:37:16 UTC
svn commit: r679326 [2/33] - in /xmlgraphics/fop/trunk:
examples/embedding/java/embedding/ examples/embedding/java/embedding/events/
examples/embedding/java/embedding/intermediate/
examples/embedding/java/embedding/model/ examples/embedding/java/embedd...
Modified: xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleAWTViewer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleAWTViewer.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleAWTViewer.java (original)
+++ xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleAWTViewer.java Thu Jul 24 02:35:34 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 embedding;
//Java
Modified: xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleDOM2PDF.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleDOM2PDF.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleDOM2PDF.java (original)
+++ xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleDOM2PDF.java Thu Jul 24 02:35:34 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 embedding;
// Java
@@ -55,7 +55,7 @@
// configure fopFactory as desired
private FopFactory fopFactory = FopFactory.newInstance();
-
+
/** xsl-fo namespace URI */
protected static String foNS = "http://www.w3.org/1999/XSL/Format";
@@ -68,31 +68,31 @@
try {
FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
// configure foUserAgent as desired
-
+
// Setup output
OutputStream out = new java.io.FileOutputStream(pdf);
out = new java.io.BufferedOutputStream(out);
-
+
try {
// Construct fop with desired output format and output stream
Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, out);
-
+
// Setup Identity Transformer
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer(); // identity transformer
-
+
// Setup input for XSLT transformation
Source src = new DOMSource(xslfoDoc);
-
+
// Resulting SAX events (the generated FO) must be piped through to FOP
Result res = new SAXResult(fop.getDefaultHandler());
-
+
// Start XSLT transformation and FOP processing
transformer.transform(src, res);
} finally {
out.close();
}
-
+
} catch (Exception e) {
e.printStackTrace(System.err);
System.exit(-1);
@@ -107,24 +107,24 @@
public static void main(String[] args) {
try {
System.out.println("FOP ExampleDOM2PDF\n");
-
+
//Setup directories
File baseDir = new File(".");
File outDir = new File(baseDir, "out");
outDir.mkdirs();
-
+
//Setup output file
File pdffile = new File(outDir, "ResultDOM2PDF.pdf");
System.out.println("PDF Output File: " + pdffile);
System.out.println();
-
+
Document foDoc = buildDOMDocument();
-
+
ExampleDOM2PDF app = new ExampleDOM2PDF();
app.convertDOM2PDF(foDoc, pdffile);
-
+
System.out.println("Success!");
-
+
} catch (Exception e) {
e.printStackTrace(System.err);
System.exit(-1);
@@ -140,15 +140,15 @@
// Create a sample XSL-FO DOM document
Document foDoc = null;
Element root = null, ele1 = null, ele2 = null, ele3 = null;
-
+
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
DocumentBuilder db = dbf.newDocumentBuilder();
foDoc = db.newDocument();
-
+
root = foDoc.createElementNS(foNS, "fo:root");
foDoc.appendChild(root);
-
+
ele1 = foDoc.createElementNS(foNS, "fo:layout-master-set");
root.appendChild(ele1);
ele2 = foDoc.createElementNS(foNS, "fo:simple-page-master");
@@ -178,7 +178,7 @@
* @param newNodeName name of the new node
* @param textVal content of the element
*/
- protected static void addElement(Node parent, String newNodeName,
+ protected static void addElement(Node parent, String newNodeName,
String textVal) {
if (textVal == null) {
return;
Modified: xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleFO2JPSPrint.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleFO2JPSPrint.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleFO2JPSPrint.java (original)
+++ xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleFO2JPSPrint.java Thu Jul 24 02:35:34 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 embedding;
// Java
@@ -54,12 +54,12 @@
// configure fopFactory as desired
private FopFactory fopFactory = FopFactory.newInstance();
-
+
private DocPrintJob createDocPrintJob() {
PrintService[] services = PrintServiceLookup.lookupPrintServices(
DocFlavor.SERVICE_FORMATTED.PAGEABLE, null);
PrintRequestAttributeSet attributes = new HashPrintRequestAttributeSet();
- PrintService printService = ServiceUI.printDialog(null, 50, 50,
+ PrintService printService = ServiceUI.printDialog(null, 50, 50,
services, services[0], null, attributes);
if (printService != null) {
return printService.createPrintJob();
@@ -67,7 +67,7 @@
return null;
}
}
-
+
/**
* Prints an FO file using JPS.
* @param fo the FO file
@@ -78,7 +78,7 @@
*/
public void printFO(File fo)
throws IOException, FOPException, TransformerException, PrintException {
-
+
//Set up DocPrintJob instance
DocPrintJob printJob = createDocPrintJob();
@@ -88,20 +88,20 @@
PageableRenderer renderer = new PageableRenderer();
renderer.setUserAgent(userAgent);
userAgent.setRendererOverride(renderer);
-
+
// Construct FOP with desired output format
Fop fop = fopFactory.newFop(userAgent);
// Setup JAXP using identity transformer
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer(); // identity transformer
-
+
// Setup input stream
Source src = new StreamSource(fo);
// Resulting SAX events (the generated FO) must be piped through to FOP
Result res = new SAXResult(fop.getDefaultHandler());
-
+
// Start XSLT transformation and FOP processing
transformer.transform(src, res);
@@ -117,23 +117,23 @@
try {
System.out.println("FOP ExampleFO2JPSPrint\n");
System.out.println("Preparing...");
-
+
//Setup directories
File baseDir = new File(".");
File outDir = new File(baseDir, "out");
outDir.mkdirs();
- //Setup input and output files
+ //Setup input and output files
File fofile = new File(baseDir, "xml/fo/helloworld.fo");
System.out.println("Input: XSL-FO (" + fofile + ")");
System.out.println("Output: JPS (Java Printing System)");
System.out.println();
System.out.println("Transforming...");
-
+
ExampleFO2JPSPrint app = new ExampleFO2JPSPrint();
app.printFO(fofile);
-
+
System.out.println("Success!");
} catch (Exception e) {
e.printStackTrace(System.err);
Modified: xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleFO2OldStylePrint.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleFO2OldStylePrint.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleFO2OldStylePrint.java (original)
+++ xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleFO2OldStylePrint.java Thu Jul 24 02:35:34 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 embedding;
// Java
@@ -44,7 +44,7 @@
// configure fopFactory as desired
private FopFactory fopFactory = FopFactory.newInstance();
-
+
/**
* Prints an FO file using an old-style PrinterJob.
* @param fo the FO file
@@ -52,7 +52,7 @@
* @throws FOPException In case of a FOP problem
*/
public void printFO(File fo) throws IOException, FOPException {
-
+
//Set up PrinterJob instance
PrinterJob printerJob = PrinterJob.getPrinterJob();
printerJob.setJobName("FOP Printing Example");
@@ -68,13 +68,13 @@
// Setup JAXP using identity transformer
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer(); // identity transformer
-
+
// Setup input stream
Source src = new StreamSource(fo);
// Resulting SAX events (the generated FO) must be piped through to FOP
Result res = new SAXResult(fop.getDefaultHandler());
-
+
// Start XSLT transformation and FOP processing
transformer.transform(src, res);
@@ -93,23 +93,23 @@
try {
System.out.println("FOP ExampleFO2OldStylePrint\n");
System.out.println("Preparing...");
-
+
//Setup directories
File baseDir = new File(".");
File outDir = new File(baseDir, "out");
outDir.mkdirs();
- //Setup input and output files
+ //Setup input and output files
File fofile = new File(baseDir, "xml/fo/helloworld.fo");
System.out.println("Input: XSL-FO (" + fofile + ")");
System.out.println("Output: old-style printing using PrinterJob");
System.out.println();
System.out.println("Transforming...");
-
+
ExampleFO2OldStylePrint app = new ExampleFO2OldStylePrint();
app.printFO(fofile);
-
+
System.out.println("Success!");
} catch (Exception e) {
e.printStackTrace(System.err);
Modified: xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleFO2PDF.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleFO2PDF.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleFO2PDF.java (original)
+++ xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleFO2PDF.java Thu Jul 24 02:35:34 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 embedding;
// Java
@@ -60,13 +60,13 @@
* @throws FOPException In case of a FOP problem
*/
public void convertFO2PDF(File fo, File pdf) throws IOException, FOPException {
-
+
OutputStream out = null;
-
+
try {
FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
// configure foUserAgent as desired
-
+
// Setup output stream. Note: Using BufferedOutputStream
// for performance reasons (helpful with FileOutputStreams).
out = new FileOutputStream(pdf);
@@ -78,24 +78,24 @@
// Setup JAXP using identity transformer
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer(); // identity transformer
-
+
// Setup input stream
Source src = new StreamSource(fo);
// Resulting SAX events (the generated FO) must be piped through to FOP
Result res = new SAXResult(fop.getDefaultHandler());
-
+
// Start XSLT transformation and FOP processing
transformer.transform(src, res);
-
+
// Result processing
FormattingResults foResults = fop.getResults();
java.util.List pageSequences = foResults.getPageSequences();
for (java.util.Iterator it = pageSequences.iterator(); it.hasNext();) {
PageSequenceResults pageSequenceResults = (PageSequenceResults)it.next();
- System.out.println("PageSequence "
- + (String.valueOf(pageSequenceResults.getID()).length() > 0
- ? pageSequenceResults.getID() : "<no id>")
+ System.out.println("PageSequence "
+ + (String.valueOf(pageSequenceResults.getID()).length() > 0
+ ? pageSequenceResults.getID() : "<no id>")
+ " generated " + pageSequenceResults.getPageCount() + " pages.");
}
System.out.println("Generated " + foResults.getPageCount() + " pages in total.");
@@ -117,13 +117,13 @@
try {
System.out.println("FOP ExampleFO2PDF\n");
System.out.println("Preparing...");
-
+
//Setup directories
File baseDir = new File(".");
File outDir = new File(baseDir, "out");
outDir.mkdirs();
- //Setup input and output files
+ //Setup input and output files
File fofile = new File(baseDir, "xml/fo/helloworld.fo");
//File fofile = new File(baseDir, "../fo/pagination/franklin_2pageseqs.fo");
File pdffile = new File(outDir, "ResultFO2PDF.pdf");
@@ -132,10 +132,10 @@
System.out.println("Output: PDF (" + pdffile + ")");
System.out.println();
System.out.println("Transforming...");
-
+
ExampleFO2PDF app = new ExampleFO2PDF();
app.convertFO2PDF(fofile, pdffile);
-
+
System.out.println("Success!");
} catch (Exception e) {
e.printStackTrace(System.err);
Modified: xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleFO2PDFUsingSAXParser.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleFO2PDFUsingSAXParser.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleFO2PDFUsingSAXParser.java (original)
+++ xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleFO2PDFUsingSAXParser.java Thu Jul 24 02:35:34 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 embedding;
// Java
@@ -69,13 +69,13 @@
// configure foUserAgent as desired
OutputStream out = null;
-
+
try {
// Setup output stream. Note: Using BufferedOutputStream
// for performance reasons (helpful with FileOutputStreams).
out = new FileOutputStream(pdf);
out = new BufferedOutputStream(out);
-
+
// Construct fop and setup output format
Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, out);
@@ -85,7 +85,7 @@
factory.setNamespaceAware(true);
// throws ParserConfigurationException
SAXParser parser = factory.newSAXParser();
-
+
// Obtain FOP's DefaultHandler
// throws FOPException
DefaultHandler dh = fop.getDefaultHandler();
@@ -108,13 +108,13 @@
try {
System.out.println("FOP ExampleFO2PDFUsingSAXParser\n");
System.out.println("Preparing...");
-
+
//Setup directories
File baseDir = new File(".");
File outDir = new File(baseDir, "out");
outDir.mkdirs();
- //Setup input and output files
+ //Setup input and output files
File fofile = new File(baseDir, "xml/fo/helloworld.fo");
File pdffile = new File(outDir, "ResultFO2PDFUsingSAXParser.pdf");
@@ -122,10 +122,10 @@
System.out.println("Output: PDF (" + pdffile + ")");
System.out.println();
System.out.println("Transforming...");
-
+
ExampleFO2PDFUsingSAXParser app = new ExampleFO2PDFUsingSAXParser();
app.convertFO2PDF(fofile, pdffile);
-
+
System.out.println("Success!");
} catch (Exception e) {
e.printStackTrace(System.err);
Modified: xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleFO2RTF.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleFO2RTF.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleFO2RTF.java (original)
+++ xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleFO2RTF.java Thu Jul 24 02:35:34 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 embedding;
// Java
@@ -60,12 +60,12 @@
* @throws FOPException In case of a FOP problem
*/
public void convertFO2RTF(File fo, File rtf) throws IOException, FOPException {
-
+
FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
// configure foUserAgent as desired
OutputStream out = null;
-
+
try {
// Setup output stream. Note: Using BufferedOutputStream
// for performance reasons (helpful with FileOutputStreams).
@@ -74,25 +74,25 @@
// Construct fop with desired output format
Fop fop = fopFactory.newFop(MimeConstants.MIME_RTF, foUserAgent, out);
-
+
// Setup JAXP using identity transformer
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer(); // identity transformer
-
+
// Setup input stream
Source src = new StreamSource(fo);
// Resulting SAX events (the generated FO) must be piped through to FOP
Result res = new SAXResult(fop.getDefaultHandler());
-
+
// Start XSLT transformation and FOP processing
transformer.transform(src, res);
-
+
// Please note: getResults() won't work for RTF and other flow formats (like MIF)
// as the layout engine is not involved in the conversion. The page-breaking
// is done by the application opening the generated file (like MS Word).
//FormattingResults foResults = fop.getResults();
-
+
} catch (Exception e) {
e.printStackTrace(System.err);
System.exit(-1);
@@ -110,13 +110,13 @@
try {
System.out.println("FOP ExampleFO2RTF\n");
System.out.println("Preparing...");
-
+
//Setup directories
File baseDir = new File(".");
File outDir = new File(baseDir, "out");
outDir.mkdirs();
- //Setup input and output files
+ //Setup input and output files
File fofile = new File(baseDir, "xml/fo/helloworld.fo");
File rtffile = new File(outDir, "ResultFO2RTF.rtf");
@@ -124,10 +124,10 @@
System.out.println("Output: PDF (" + rtffile + ")");
System.out.println();
System.out.println("Transforming...");
-
+
ExampleFO2RTF app = new ExampleFO2RTF();
app.convertFO2RTF(fofile, rtffile);
-
+
System.out.println("Success!");
} catch (Exception e) {
e.printStackTrace(System.err);
Modified: xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleObj2PDF.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleObj2PDF.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleObj2PDF.java (original)
+++ xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleObj2PDF.java Thu Jul 24 02:35:34 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 embedding;
// Java
@@ -43,7 +43,7 @@
import embedding.model.ProjectTeam;
/**
- * This class demonstrates the conversion of an arbitrary object file to a
+ * This class demonstrates the conversion of an arbitrary object file to a
* PDF using JAXP (XSLT) and FOP (XSL:FO).
*/
public class ExampleObj2PDF {
@@ -60,9 +60,9 @@
* @throws FOPException In case of a FOP problem
* @throws TransformerException In case of a XSL transformation problem
*/
- public void convertProjectTeam2PDF(ProjectTeam team, File xslt, File pdf)
+ public void convertProjectTeam2PDF(ProjectTeam team, File xslt, File pdf)
throws IOException, FOPException, TransformerException {
-
+
FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
// configure foUserAgent as desired
@@ -76,10 +76,10 @@
// Setup XSLT
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer(new StreamSource(xslt));
-
+
// Setup input for XSLT transformation
Source src = team.getSourceForProjectTeam();
-
+
// Resulting SAX events (the generated FO) must be piped through to FOP
Result res = new SAXResult(fop.getDefaultHandler());
@@ -99,7 +99,7 @@
try {
System.out.println("FOP ExampleObj2PDF\n");
System.out.println("Preparing...");
-
+
// Setup directories
File baseDir = new File(".");
File outDir = new File(baseDir, "out");
@@ -117,7 +117,7 @@
ExampleObj2PDF app = new ExampleObj2PDF();
app.convertProjectTeam2PDF(ExampleObj2XML.createSampleProjectTeam(), xsltfile, pdffile);
-
+
System.out.println("Success!");
} catch (Exception e) {
e.printStackTrace(System.err);
Modified: xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleObj2XML.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleObj2XML.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleObj2XML.java (original)
+++ xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleObj2XML.java Thu Jul 24 02:35:34 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 embedding;
//Hava
@@ -36,7 +36,7 @@
/**
- * This class demonstrates the conversion of an arbitrary object file to an
+ * This class demonstrates the conversion of an arbitrary object file to an
* XML file.
*/
public class ExampleObj2XML {
@@ -48,20 +48,20 @@
* @throws IOException In case of an I/O problem
* @throws TransformerException In case of a XSL transformation problem
*/
- public void convertProjectTeam2XML(ProjectTeam team, File xml)
+ public void convertProjectTeam2XML(ProjectTeam team, File xml)
throws IOException, TransformerException {
-
+
//Setup XSLT
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer();
/* Note:
We use the identity transformer, no XSL transformation is done.
- The transformer is basically just used to serialize the
+ The transformer is basically just used to serialize the
generated document to XML. */
-
+
//Setup input
Source src = team.getSourceForProjectTeam();
-
+
//Setup output
Result res = new StreamResult(xml);
@@ -97,7 +97,7 @@
try {
System.out.println("FOP ExampleObj2XML\n");
System.out.println("Preparing...");
-
+
//Setup directories
File baseDir = new File(".");
File outDir = new File(baseDir, "out");
@@ -113,7 +113,7 @@
ExampleObj2XML app = new ExampleObj2XML();
app.convertProjectTeam2XML(createSampleProjectTeam(), xmlfile);
-
+
System.out.println("Success!");
} catch (Exception e) {
e.printStackTrace(System.err);
Modified: xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleSVG2PDF.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleSVG2PDF.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleSVG2PDF.java (original)
+++ xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleSVG2PDF.java Thu Jul 24 02:35:34 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 embedding;
//Java
@@ -47,22 +47,22 @@
* @throws TranscoderException In case of a transcoding problem
*/
public void convertSVG2PDF(File svg, File pdf) throws IOException, TranscoderException {
-
+
//Create transcoder
Transcoder transcoder = new PDFTranscoder();
//Transcoder transcoder = new org.apache.fop.render.ps.PSTranscoder();
-
+
//Setup input
InputStream in = new java.io.FileInputStream(svg);
try {
TranscoderInput input = new TranscoderInput(in);
-
+
//Setup output
OutputStream out = new java.io.FileOutputStream(pdf);
out = new java.io.BufferedOutputStream(out);
try {
TranscoderOutput output = new TranscoderOutput(out);
-
+
//Do the transformation
transcoder.transcode(input, output);
} finally {
@@ -82,13 +82,13 @@
try {
System.out.println("FOP ExampleSVG2PDF\n");
System.out.println("Preparing...");
-
+
//Setup directories
File baseDir = new File(".");
File outDir = new File(baseDir, "out");
outDir.mkdirs();
- //Setup input and output files
+ //Setup input and output files
File svgfile = new File(baseDir, "xml/svg/helloworld.svg");
File pdffile = new File(outDir, "ResultSVG2PDF.pdf");
@@ -96,10 +96,10 @@
System.out.println("Output: PDF (" + pdffile + ")");
System.out.println();
System.out.println("Transforming...");
-
+
ExampleSVG2PDF app = new ExampleSVG2PDF();
app.convertSVG2PDF(svgfile, pdffile);
-
+
System.out.println("Success!");
} catch (Exception e) {
e.printStackTrace(System.err);
Modified: xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleXML2FO.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleXML2FO.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleXML2FO.java (original)
+++ xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleXML2FO.java Thu Jul 24 02:35:34 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 embedding;
//Java
@@ -47,19 +47,19 @@
* @throws IOException In case of an I/O problem
* @throws TransformerException In case of a XSL transformation problem
*/
- public void convertXML2FO(File xml, File xslt, File fo)
+ public void convertXML2FO(File xml, File xslt, File fo)
throws IOException, TransformerException {
-
+
//Setup output
OutputStream out = new java.io.FileOutputStream(fo);
try {
//Setup XSLT
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer(new StreamSource(xslt));
-
+
//Setup input for XSLT transformation
Source src = new StreamSource(xml);
-
+
//Resulting SAX events (the generated FO) must be piped through to FOP
Result res = new StreamResult(out);
@@ -85,7 +85,7 @@
File outDir = new File(baseDir, "out");
outDir.mkdirs();
- //Setup input and output files
+ //Setup input and output files
File xmlfile = new File(baseDir, "xml/xml/projectteam.xml");
File xsltfile = new File(baseDir, "xml/xslt/projectteam2fo.xsl");
File fofile = new File(outDir, "ResultXML2FO.fo");
@@ -95,10 +95,10 @@
System.out.println("Output: XSL-FO (" + fofile + ")");
System.out.println();
System.out.println("Transforming...");
-
+
ExampleXML2FO app = new ExampleXML2FO();
app.convertXML2FO(xmlfile, xsltfile, fofile);
-
+
System.out.println("Success!");
} catch (Exception e) {
e.printStackTrace(System.err);
Modified: xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleXML2PDF.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleXML2PDF.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleXML2PDF.java (original)
+++ xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleXML2PDF.java Thu Jul 24 02:35:34 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 embedding;
//Java
@@ -38,7 +38,7 @@
import org.apache.fop.apps.MimeConstants;
/**
- * This class demonstrates the conversion of an XML file to PDF using
+ * This class demonstrates the conversion of an XML file to PDF using
* JAXP (XSLT) and FOP (XSL-FO).
*/
public class ExampleXML2PDF {
@@ -57,7 +57,7 @@
File outDir = new File(baseDir, "out");
outDir.mkdirs();
- // Setup input and output files
+ // Setup input and output files
File xmlfile = new File(baseDir, "xml/xml/projectteam.xml");
File xsltfile = new File(baseDir, "xml/xslt/projectteam2fo.xsl");
File pdffile = new File(outDir, "ResultXML2PDF.pdf");
@@ -67,7 +67,7 @@
System.out.println("Output: PDF (" + pdffile + ")");
System.out.println();
System.out.println("Transforming...");
-
+
// configure fopFactory as desired
FopFactory fopFactory = FopFactory.newInstance();
@@ -77,30 +77,30 @@
// Setup output
OutputStream out = new java.io.FileOutputStream(pdffile);
out = new java.io.BufferedOutputStream(out);
-
+
try {
// Construct fop with desired output format
Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, out);
-
+
// Setup XSLT
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer(new StreamSource(xsltfile));
-
+
// Set the value of a <param> in the stylesheet
transformer.setParameter("versionParam", "2.0");
-
+
// Setup input for XSLT transformation
Source src = new StreamSource(xmlfile);
-
+
// Resulting SAX events (the generated FO) must be piped through to FOP
Result res = new SAXResult(fop.getDefaultHandler());
-
+
// Start XSLT transformation and FOP processing
transformer.transform(src, res);
} finally {
out.close();
}
-
+
System.out.println("Success!");
} catch (Exception e) {
e.printStackTrace(System.err);
Modified: xmlgraphics/fop/trunk/examples/embedding/java/embedding/MultipleFO2PDF.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/MultipleFO2PDF.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/examples/embedding/java/embedding/MultipleFO2PDF.java (original)
+++ xmlgraphics/fop/trunk/examples/embedding/java/embedding/MultipleFO2PDF.java Thu Jul 24 02:35:34 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 embedding;
// Java
@@ -59,26 +59,26 @@
// JAXP TransformerFactory can be reused, too
private TransformerFactory factory = TransformerFactory.newInstance();
-
+
/**
* Converts an FO file to a PDF file using FOP
* @param fo the FO file
* @param pdf the target PDF file
- * @throws TransformerException in case of a transformation problem
+ * @throws TransformerException in case of a transformation problem
* @throws IOException in case of an I/O problem
* @throws FOPException in case of a FOP problem
* @return the formatting results of the run
*/
- public FormattingResults convertFO2PDF(File fo, File pdf)
+ public FormattingResults convertFO2PDF(File fo, File pdf)
throws TransformerException, IOException, FOPException {
-
+
OutputStream out = null;
Fop fop;
-
+
try {
FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
// configure foUserAgent as desired
-
+
// Setup output stream. Note: Using BufferedOutputStream
// for performance reasons (helpful with FileOutputStreams).
out = new FileOutputStream(pdf);
@@ -89,13 +89,13 @@
// Setup JAXP using identity transformer
Transformer transformer = factory.newTransformer(); // identity transformer
-
+
// Setup input stream
Source src = new StreamSource(fo);
// Resulting SAX events (the generated FO) must be piped through to FOP
Result res = new SAXResult(fop.getDefaultHandler());
-
+
// Start XSLT transformation and FOP processing
transformer.transform(src, res);
} finally {
@@ -105,7 +105,7 @@
return fop.getResults();
}
- /**
+ /**
* Listens on standard in for names of fo files to be transformed to pdf.
* 'quit' or the null string (for piped input) cause the listener to stop listening.
*/
@@ -116,10 +116,10 @@
File outDir = new File(baseDir, "out");
outDir.mkdirs();
BufferedReader in = new BufferedReader(new java.io.InputStreamReader(System.in));
-
+
while (true) {
try {
- // Listen for the input file name
+ // Listen for the input file name
System.out.print("Input XSL-FO file ('quit' to stop): ");
String foname = in.readLine();
if (foname == null) {
@@ -146,9 +146,9 @@
java.util.List pageSequences = foResults.getPageSequences();
for (java.util.Iterator it = pageSequences.iterator(); it.hasNext();) {
PageSequenceResults pageSequenceResults = (PageSequenceResults)it.next();
- System.out.println("PageSequence "
- + (String.valueOf(pageSequenceResults.getID()).length() > 0
- ? pageSequenceResults.getID() : "<no id>")
+ System.out.println("PageSequence "
+ + (String.valueOf(pageSequenceResults.getID()).length() > 0
+ ? pageSequenceResults.getID() : "<no id>")
+ " generated " + pageSequenceResults.getPageCount() + " pages.");
}
System.out.println("Generated " + foResults.getPageCount() + " pages in total.");
@@ -161,7 +161,7 @@
}
}
}
-
+
/**
* Main method. Set up the listener.
* @param args command-line arguments
Modified: xmlgraphics/fop/trunk/examples/embedding/java/embedding/events/ExampleEvents.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/events/ExampleEvents.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/examples/embedding/java/embedding/events/ExampleEvents.java (original)
+++ xmlgraphics/fop/trunk/examples/embedding/java/embedding/events/ExampleEvents.java Thu Jul 24 02:35:34 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 embedding.events;
import java.io.BufferedOutputStream;
@@ -68,21 +68,21 @@
*/
public void convertFO2PDF(URL fo, File pdf)
throws IOException, FOPException, TransformerException {
-
+
OutputStream out = null;
-
+
try {
//Create the user agent for this processing run
FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
-
+
//Adding a simple logging listener that writes to stdout and stderr
foUserAgent.getEventBroadcaster().addEventListener(new SysOutEventListener());
-
+
// Add your own event listener
foUserAgent.getEventBroadcaster().addEventListener(new MyEventListener());
-
+
// configure foUserAgent further as desired
-
+
// Setup output stream. Note: Using BufferedOutputStream
// for performance reasons (helpful with FileOutputStreams).
out = new FileOutputStream(pdf);
@@ -94,13 +94,13 @@
// Setup JAXP using identity transformer
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer(); // identity transformer
-
+
// Setup input stream
Source src = new StreamSource(fo.toExternalForm());
// Resulting SAX events (the generated FO) must be piped through to FOP
Result res = new SAXResult(fop.getDefaultHandler());
-
+
// Start XSLT transformation and FOP processing
transformer.transform(src, res);
@@ -114,7 +114,7 @@
public void processEvent(Event event) {
if ("org.apache.fop.events.ResourceEventProducer.imageNotFound"
.equals(event.getEventID())) {
-
+
//Get the FileNotFoundException that's part of the event's parameters
FileNotFoundException fnfe = (FileNotFoundException)event.getParam("fnfe");
@@ -122,16 +122,16 @@
+ "!!! ===---");
//Stop processing when an image could not be found. Otherwise, FOP would just
//continue without the image!
-
+
System.out.println("Throwing a RuntimeException...");
throw new RuntimeException(EventFormatter.format(event), fnfe);
} else {
//ignore all other events
}
}
-
+
}
-
+
/** A simple event listener that writes the events to stdout and sterr. */
private static class SysOutEventListener implements EventListener {
@@ -152,7 +152,7 @@
}
}
}
-
+
/**
* This method extracts the original exception from some exception. The exception
@@ -185,7 +185,7 @@
try {
System.out.println("FOP ExampleEvents\n");
System.out.println("Preparing...");
-
+
//Setup directories
File baseDir = new File(".");
File outDir = new File(baseDir, "out");
@@ -199,9 +199,9 @@
System.out.println("Output: PDF (" + pdffile + ")");
System.out.println();
System.out.println("Transforming...");
-
+
ExampleEvents app = new ExampleEvents();
-
+
try {
app.convertFO2PDF(fo, pdffile);
} catch (TransformerException te) {
@@ -215,7 +215,7 @@
System.out.println("Aborted!");
System.exit(-1);
}
-
+
System.out.println("Success!");
} catch (Exception e) {
//Some other error (shouldn't happen in this example)
Modified: xmlgraphics/fop/trunk/examples/embedding/java/embedding/intermediate/ExampleConcat.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/intermediate/ExampleConcat.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/examples/embedding/java/embedding/intermediate/ExampleConcat.java (original)
+++ xmlgraphics/fop/trunk/examples/embedding/java/embedding/intermediate/ExampleConcat.java Thu Jul 24 02:35:34 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 embedding.intermediate;
import java.io.File;
@@ -81,26 +81,26 @@
* @throws FOPException In case of a FOP problem
* @throws TransformerException In case of a XSL transformation problem
*/
- public void convertToIntermediate(Source src, Source xslt, File intermediate)
+ public void convertToIntermediate(Source src, Source xslt, File intermediate)
throws IOException, FOPException, TransformerException {
-
+
//Create a user agent
FOUserAgent userAgent = fopFactory.newFOUserAgent();
-
+
//Create an instance of the target renderer so the XMLRenderer can use its font setup
Renderer targetRenderer = userAgent.getRendererFactory().createRenderer(
- userAgent, MimeConstants.MIME_PDF);
-
+ userAgent, MimeConstants.MIME_PDF);
+
//Create the XMLRenderer to create the intermediate format (area tree XML)
XMLRenderer xmlRenderer = new XMLRenderer();
xmlRenderer.setUserAgent(userAgent);
-
+
//Tell the XMLRenderer to mimic the target renderer
xmlRenderer.mimicRenderer(targetRenderer);
-
+
//Make sure the prepared XMLRenderer is used
userAgent.setRendererOverride(xmlRenderer);
-
+
// Setup output
OutputStream out = new java.io.FileOutputStream(intermediate);
out = new java.io.BufferedOutputStream(out);
@@ -117,7 +117,7 @@
} else {
transformer = factory.newTransformer();
}
-
+
// Resulting SAX events (the generated FO) must be piped through to FOP
Result res = new SAXResult(fop.getDefaultHandler());
@@ -136,7 +136,7 @@
* @throws TransformerException In case of a XSL transformation problem
* @throws SAXException In case of an XML-related problem
*/
- public void concatToPDF(File[] files, File pdffile)
+ public void concatToPDF(File[] files, File pdffile)
throws IOException, TransformerException, SAXException {
// Setup output
OutputStream out = new java.io.FileOutputStream(pdffile);
@@ -147,23 +147,23 @@
FOUserAgent userAgent = fopFactory.newFOUserAgent();
//Construct the AreaTreeModel that will received the individual pages
- AreaTreeModel treeModel = new RenderPagesModel(userAgent,
+ AreaTreeModel treeModel = new RenderPagesModel(userAgent,
MimeConstants.MIME_PDF, fontInfo, out);
-
+
//Iterate over all intermediate files
AreaTreeParser parser = new AreaTreeParser();
for (int i = 0; i < files.length; i++) {
Source src = new StreamSource(files[i]);
parser.parse(src, treeModel, userAgent);
}
-
+
//Signal the end of the processing. The renderer can finalize the target document.
treeModel.endDocument();
} finally {
out.close();
}
}
-
+
/**
* Main method.
* @param args command-line arguments
@@ -171,12 +171,12 @@
public static void main(String[] args) {
try {
System.out.println("FOP ExampleConcat\n");
-
+
//Setup directories
File baseDir = new File(".");
File outDir = new File(baseDir, "out");
outDir.mkdirs();
-
+
//Setup output file
File xsltfile = new File(baseDir, "xml/xslt/projectteam2fo.xsl");
File[] files = new File[] {
@@ -184,31 +184,31 @@
new File(outDir, "team2.at.xml")};
File pdffile = new File(outDir, "ResultConcat.pdf");
for (int i = 0; i < files.length; i++) {
- System.out.println("Intermediate file " + (i + 1) + ": "
+ System.out.println("Intermediate file " + (i + 1) + ": "
+ files[i].getCanonicalPath());
}
System.out.println("PDF Output File: " + pdffile.getCanonicalPath());
System.out.println();
-
+
ProjectTeam team1 = ExampleObj2XML.createSampleProjectTeam();
ProjectTeam team2 = createAnotherProjectTeam();
-
+
ExampleConcat app = new ExampleConcat();
-
+
//Create intermediate files
app.convertToIntermediate(
- team1.getSourceForProjectTeam(),
+ team1.getSourceForProjectTeam(),
new StreamSource(xsltfile), files[0]);
app.convertToIntermediate(
- team2.getSourceForProjectTeam(),
+ team2.getSourceForProjectTeam(),
new StreamSource(xsltfile), files[1]);
-
+
//Concatenate the individual intermediate files to one document
app.concatToPDF(files, pdffile);
-
+
System.out.println("Success!");
-
+
} catch (Exception e) {
e.printStackTrace(System.err);
System.exit(-1);
Modified: xmlgraphics/fop/trunk/examples/embedding/java/embedding/intermediate/ExampleStamp.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/intermediate/ExampleStamp.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/examples/embedding/java/embedding/intermediate/ExampleStamp.java (original)
+++ xmlgraphics/fop/trunk/examples/embedding/java/embedding/intermediate/ExampleStamp.java Thu Jul 24 02:35:34 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 embedding.intermediate;
import java.io.File;
@@ -50,7 +50,7 @@
// configure fopFactory as desired
private FopFactory fopFactory = FopFactory.newInstance();
-
+
/**
* Stamps an intermediate file and renders it to a PDF file.
* @param atfile the intermediate file (area tree XML)
@@ -60,7 +60,7 @@
* @throws TransformerException In case of a XSL transformation problem
* @throws SAXException In case of an XML-related problem
*/
- public void stampToPDF(File atfile, File stampSheet, File pdffile)
+ public void stampToPDF(File atfile, File stampSheet, File pdffile)
throws IOException, TransformerException, SAXException {
// Setup output
OutputStream out = new java.io.FileOutputStream(pdffile);
@@ -71,31 +71,31 @@
FOUserAgent userAgent = fopFactory.newFOUserAgent();
//Construct the AreaTreeModel that will received the individual pages
- AreaTreeModel treeModel = new RenderPagesModel(userAgent,
+ AreaTreeModel treeModel = new RenderPagesModel(userAgent,
MimeConstants.MIME_PDF, fontInfo, out);
-
+
//Iterate over all intermediate files
AreaTreeParser parser = new AreaTreeParser();
Source src = new StreamSource(atfile);
Source xslt = new StreamSource(stampSheet);
-
+
//Setup Transformer for XSLT processing
TransformerFactory tFactory = TransformerFactory.newInstance();
Transformer transformer = tFactory.newTransformer(xslt);
-
+
//Send XSLT result to AreaTreeParser
SAXResult res = new SAXResult(parser.getContentHandler(treeModel, userAgent));
-
+
//Start XSLT transformation and area tree parsing
transformer.transform(src, res);
-
+
//Signal the end of the processing. The renderer can finalize the target document.
treeModel.endDocument();
} finally {
out.close();
}
}
-
+
/**
* Main method.
* @param args command-line arguments
@@ -103,12 +103,12 @@
public static void main(String[] args) {
try {
System.out.println("FOP ExampleConcat\n");
-
+
//Setup directories
File baseDir = new File(".");
File outDir = new File(baseDir, "out");
outDir.mkdirs();
-
+
//Setup output file
File xsltfile = new File(baseDir, "xml/xslt/projectteam2fo.xsl");
File atfile = new File(outDir, "team.at.xml");
@@ -120,19 +120,19 @@
System.out.println();
ProjectTeam team1 = ExampleObj2XML.createSampleProjectTeam();
-
+
//Create intermediate file
ExampleConcat concatapp = new ExampleConcat();
concatapp.convertToIntermediate(
- team1.getSourceForProjectTeam(),
+ team1.getSourceForProjectTeam(),
new StreamSource(xsltfile), atfile);
-
+
//Stamp document and produce a PDF from the intermediate format
ExampleStamp app = new ExampleStamp();
app.stampToPDF(atfile, stampxsltfile, pdffile);
-
+
System.out.println("Success!");
-
+
} catch (Exception e) {
e.printStackTrace(System.err);
System.exit(-1);
Modified: xmlgraphics/fop/trunk/examples/embedding/java/embedding/model/ProjectMember.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/model/ProjectMember.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/examples/embedding/java/embedding/model/ProjectMember.java (original)
+++ xmlgraphics/fop/trunk/examples/embedding/java/embedding/model/ProjectMember.java Thu Jul 24 02:35:34 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 embedding.model;
/**
@@ -34,8 +34,8 @@
*/
public ProjectMember() {
}
-
-
+
+
/**
* Convenience constructor.
* @param name name of the project member
Modified: xmlgraphics/fop/trunk/examples/embedding/java/embedding/model/ProjectTeam.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/model/ProjectTeam.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/examples/embedding/java/embedding/model/ProjectTeam.java (original)
+++ xmlgraphics/fop/trunk/examples/embedding/java/embedding/model/ProjectTeam.java Thu Jul 24 02:35:34 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 embedding.model;
import java.util.List;
Modified: xmlgraphics/fop/trunk/examples/embedding/java/embedding/model/ProjectTeamInputSource.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/model/ProjectTeamInputSource.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/examples/embedding/java/embedding/model/ProjectTeamInputSource.java (original)
+++ xmlgraphics/fop/trunk/examples/embedding/java/embedding/model/ProjectTeamInputSource.java Thu Jul 24 02:35:34 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 embedding.model;
import org.xml.sax.InputSource;
Modified: xmlgraphics/fop/trunk/examples/embedding/java/embedding/model/ProjectTeamXMLReader.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/model/ProjectTeamXMLReader.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/examples/embedding/java/embedding/model/ProjectTeamXMLReader.java (original)
+++ xmlgraphics/fop/trunk/examples/embedding/java/embedding/model/ProjectTeamXMLReader.java Thu Jul 24 02:35:34 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 embedding.model;
//Java
@@ -60,18 +60,18 @@
if (handler == null) {
throw new IllegalStateException("ContentHandler not set");
}
-
+
//Start the document
handler.startDocument();
-
+
//Generate SAX events for the ProjectTeam
generateFor(projectTeam);
-
+
//End the document
- handler.endDocument();
+ handler.endDocument();
}
-
+
/**
* Generates SAX events for a ProjectTeam object.
* @param projectTeam ProjectTeam object to use
@@ -84,7 +84,7 @@
if (handler == null) {
throw new IllegalStateException("ContentHandler not set");
}
-
+
handler.startElement("projectteam");
handler.element("projectname", projectTeam.getProjectName());
Iterator i = projectTeam.getMembers().iterator();
@@ -107,7 +107,7 @@
if (handler == null) {
throw new IllegalStateException("ContentHandler not set");
}
-
+
handler.startElement("member");
handler.element("name", projectMember.getName());
handler.element("function", projectMember.getFunction());
Modified: xmlgraphics/fop/trunk/examples/embedding/java/embedding/tools/AbstractObjectReader.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/tools/AbstractObjectReader.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/examples/embedding/java/embedding/tools/AbstractObjectReader.java (original)
+++ xmlgraphics/fop/trunk/examples/embedding/java/embedding/tools/AbstractObjectReader.java Thu Jul 24 02:35:34 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 embedding.tools;
//Java
@@ -33,7 +33,7 @@
import org.xml.sax.EntityResolver;
/**
- * This class can be used as base class for XMLReaders that generate SAX
+ * This class can be used as base class for XMLReaders that generate SAX
* events from Java objects.
*/
@@ -43,10 +43,10 @@
"http://xml.org/sax/features/namespaces";
private static final String NS_PREFIXES =
"http://xml.org/sax/features/namespace-prefixes";
-
+
private Map features = new java.util.HashMap();
private ContentHandler orgHandler;
-
+
/** Proxy for easy SAX event generation */
protected EasyGenerationContentHandlerProxy handler;
/** Error handler */
@@ -60,7 +60,7 @@
setFeature(NAMESPACES, false);
setFeature(NS_PREFIXES, false);
}
-
+
/* ============ XMLReader interface ============ */
/**
Modified: xmlgraphics/fop/trunk/examples/embedding/java/embedding/tools/EasyGenerationContentHandlerProxy.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/tools/EasyGenerationContentHandlerProxy.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/examples/embedding/java/embedding/tools/EasyGenerationContentHandlerProxy.java (original)
+++ xmlgraphics/fop/trunk/examples/embedding/java/embedding/tools/EasyGenerationContentHandlerProxy.java Thu Jul 24 02:35:34 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 embedding.tools;
//SAX
@@ -28,10 +28,10 @@
/**
* This class is an implementation of ContentHandler which acts as a proxy to
- * another ContentHandler and has the purpose to provide a few handy methods
+ * another ContentHandler and has the purpose to provide a few handy methods
* that make life easier when generating SAX events.
* <br>
- * Note: This class is only useful for simple cases with no namespaces.
+ * Note: This class is only useful for simple cases with no namespaces.
*/
public class EasyGenerationContentHandlerProxy implements ContentHandler {
@@ -64,8 +64,8 @@
/**
* Sends the notification of the beginning of an element.
* @param name Name for the element.
- * @param atts The attributes attached to the element. If there are no
- * attributes, it shall be an empty Attributes object.
+ * @param atts The attributes attached to the element. If there are no
+ * attributes, it shall be an empty Attributes object.
* @throws SAXException Any SAX exception, possibly wrapping another exception.
*/
public void startElement(String name, Attributes atts) throws SAXException {
@@ -108,8 +108,8 @@
* Sends notifications for a whole element with some String content.
* @param name Name for the element.
* @param value Content of the element.
- * @param atts The attributes attached to the element. If there are no
- * attributes, it shall be an empty Attributes object.
+ * @param atts The attributes attached to the element. If there are no
+ * attributes, it shall be an empty Attributes object.
* @throws SAXException Any SAX exception, possibly wrapping another exception.
*/
public void element(String name, String value, Attributes atts) throws SAXException {
@@ -165,7 +165,7 @@
/**
* @see org.xml.sax.ContentHandler#startElement(String, String, String, Attributes)
*/
- public void startElement(String namespaceURI, String localName,
+ public void startElement(String namespaceURI, String localName,
String qName, Attributes atts) throws SAXException {
target.startElement(namespaceURI, localName, qName, atts);
}
@@ -174,7 +174,7 @@
/**
* @see org.xml.sax.ContentHandler#endElement(String, String, String)
*/
- public void endElement(String namespaceURI, String localName, String qName)
+ public void endElement(String namespaceURI, String localName, String qName)
throws SAXException {
target.endElement(namespaceURI, localName, qName);
}
Modified: xmlgraphics/fop/trunk/examples/hyphenation/src/org/apache/fop/hyphenation/HyphenationTreeAnalysis.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/hyphenation/src/org/apache/fop/hyphenation/HyphenationTreeAnalysis.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/examples/hyphenation/src/org/apache/fop/hyphenation/HyphenationTreeAnalysis.java (original)
+++ xmlgraphics/fop/trunk/examples/hyphenation/src/org/apache/fop/hyphenation/HyphenationTreeAnalysis.java Thu Jul 24 02:35:34 2008
@@ -33,15 +33,15 @@
import java.util.zip.ZipEntry;
/**
- * This class provides some useful methods to print the structure of a HyphenationTree object
+ * This class provides some useful methods to print the structure of a HyphenationTree object
*/
public class HyphenationTreeAnalysis extends TernaryTreeAnalysis {
/**
- * The HyphenationTree object to analyse
+ * The HyphenationTree object to analyse
*/
protected HyphenationTree ht;
-
+
/**
* @param ht the HyphenationTree object
*/
@@ -49,7 +49,7 @@
super(ht);
this.ht = ht;
}
-
+
/**
* Class representing a node of the HyphenationTree object
*/
@@ -65,7 +65,7 @@
value = readValue().toString();
}
}
-
+
private StringBuffer readValue() {
StringBuffer s = new StringBuffer();
int i = (int) ht.eq[index];
@@ -100,7 +100,7 @@
return super.toNodeString();
}
}
-
+
/* (non-Javadoc)
* @see org.apache.fop.hyphenation.TernaryTreeAnalysis.Node#toCompactString()
*/
@@ -118,7 +118,7 @@
return super.toCompactString();
}
}
-
+
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@@ -130,7 +130,7 @@
}
return s.toString();
}
-
+
}
private void addNode(int nodeIndex, List strings, NodeString ns) {
@@ -182,7 +182,7 @@
}
tree.append(indentString);
tree.append(ns.string + "\n");
-
+
if (i + 1 == strings.size()) {
continue;
}
@@ -199,10 +199,10 @@
}
tree.append(indentString + "\n");
}
-
+
return tree.toString();
}
-
+
/**
* Construct the tree representation of the HyphenationTree object
* @return the string representing the tree
@@ -214,7 +214,7 @@
addNode(1, strings, ns);
return toTree(strings);
}
-
+
/**
* Construct the compact node representation of the HyphenationTree object
* @return the string representing the tree
@@ -229,7 +229,7 @@
}
return s.toString();
}
-
+
/**
* Construct the node representation of the HyphenationTree object
* @return the string representing the tree
@@ -244,17 +244,17 @@
}
return s.toString();
}
-
+
/**
* Construct the printed representation of the HyphenationTree object
* @return the string representing the tree
*/
public String toString() {
StringBuffer s = new StringBuffer();
-
+
s.append("classes: \n");
s.append((new TernaryTreeAnalysis(ht.classmap)).toString());
-
+
s.append("\npatterns: \n");
s.append(super.toString());
s.append("vspace: ");
@@ -275,12 +275,12 @@
}
}
s.append("\n");
-
+
return s.toString();
}
/**
- * Provide interactive access to a HyphenationTree object and its representation methods
+ * Provide interactive access to a HyphenationTree object and its representation methods
* @param args the arguments
*/
public static void main(String[] args) {
@@ -327,7 +327,7 @@
System.out.print("Object file name: ");
token = in.readLine().trim();
try {
- String[] parts = token.split(":");
+ String[] parts = token.split(":");
InputStream is = null;
if (parts.length == 1) {
is = new FileInputStream(token);
@@ -399,7 +399,7 @@
try {
BufferedReader reader = new BufferedReader(new FileReader(token));
String line;
-
+
starttime = System.currentTimeMillis();
while ((line = reader.readLine()) != null) {
// System.out.print("\nline: ");
@@ -422,7 +422,7 @@
long result = endtime - starttime;
System.out.println(counter + " words in " + result
+ " Milliseconds hyphenated");
-
+
} else if (token.equals("q")) {
break;
}
Modified: xmlgraphics/fop/trunk/examples/hyphenation/src/org/apache/fop/hyphenation/TernaryTreeAnalysis.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/hyphenation/src/org/apache/fop/hyphenation/TernaryTreeAnalysis.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/examples/hyphenation/src/org/apache/fop/hyphenation/TernaryTreeAnalysis.java (original)
+++ xmlgraphics/fop/trunk/examples/hyphenation/src/org/apache/fop/hyphenation/TernaryTreeAnalysis.java Thu Jul 24 02:35:34 2008
@@ -23,15 +23,15 @@
import java.util.List;
/**
- * This class provides some useful methods to print the structure of a TernaryTree object
+ * This class provides some useful methods to print the structure of a TernaryTree object
*/
public class TernaryTreeAnalysis {
/**
- * The TernaryTree object to analyse
+ * The TernaryTree object to analyse
*/
protected TernaryTree tt;
-
+
/**
* @param tt the TernaryTree object
*/
@@ -43,27 +43,27 @@
* Class representing a string of nodes in the tree representation of a TernaryTree
*/
public static class NodeString {
-
+
/**
- * The node string being constructed
+ * The node string being constructed
*/
public StringBuffer string = new StringBuffer();
-
+
/**
- * The indent of the node string
+ * The indent of the node string
*/
public int indent;
-
+
/**
- * The list of branchpoints into the high direction
+ * The list of branchpoints into the high direction
*/
public List high = new ArrayList();
-
+
/**
- * The list of branchpoints into the low direction
+ * The list of branchpoints into the low direction
*/
public List low = new ArrayList();
-
+
/**
* @param indent the indent of the nodestring
*/
@@ -78,34 +78,34 @@
* Class representing a node of the TernaryTree object
*/
protected class Node {
-
+
/**
- * The index of the node
+ * The index of the node
*/
protected int index = 0;
-
+
/**
- * The index of the high node
+ * The index of the high node
*/
protected int high = 0;
-
+
/**
- * The index of the high node
+ * The index of the high node
*/
protected int low = 0;
-
+
/**
- * The index of the equal node
+ * The index of the equal node
*/
protected int equal = 0;
-
+
/**
- * The key following the node
+ * The key following the node
*/
protected String key = null;
-
+
/**
- * True if this is a leaf node
+ * True if this is a leaf node
*/
protected boolean isLeafNode = false;
@@ -132,7 +132,7 @@
equal = tt.eq[index];
}
}
-
+
private StringBuffer readKey() {
StringBuffer s = new StringBuffer();
int i = (int) tt.lo[index];
@@ -160,7 +160,7 @@
}
return s.toString();
}
-
+
/**
* Construct the compact string representation of the node
* @return the string representing the node
@@ -184,7 +184,7 @@
}
return s.toString();
}
-
+
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@@ -204,9 +204,9 @@
}
return s.toString();
}
-
+
}
-
+
/**
* Construct the compact node representation of the TernaryTree object
* @return the string representing the tree
@@ -221,7 +221,7 @@
}
return s.toString();
}
-
+
/**
* Construct the node representation of the TernaryTree object
* @return the string representing the tree
@@ -236,7 +236,7 @@
}
return s.toString();
}
-
+
private static StringBuffer toString(char[] c) {
StringBuffer s = new StringBuffer();
for (int i = 0; i < c.length; ++i) {
@@ -244,8 +244,8 @@
s.append(",");
}
return s;
- }
-
+ }
+
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@@ -255,15 +255,15 @@
s.append("hi: ");
s.append(toString(tt.hi));
s.append("\n");
-
+
s.append("eq: ");
s.append(toString(tt.eq));
s.append("\n");
-
+
s.append("lo: ");
s.append(toString(tt.lo));
s.append("\n");
-
+
s.append("sc: ");
for (int i = 0; i < tt.sc.length; ++i) {
if (tt.sc[i] == 0) {
@@ -275,7 +275,7 @@
}
}
s.append("\n");
-
+
s.append("kv: ");
for (int i = 0; i < tt.kv.length(); ++i) {
if (tt.kv.get(i) == 0) {
@@ -285,17 +285,17 @@
}
}
s.append("\n");
-
+
s.append("freenode: ");
s.append((int) tt.freenode);
s.append("\n");
-
+
s.append("root: ");
s.append((int) tt.root);
s.append("\n");
-
+
return s.toString();
}
-
+
}
Modified: xmlgraphics/fop/trunk/examples/mathml/src/org/apache/fop/mathml/ImageLoaderFactoryMathML.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/mathml/src/org/apache/fop/mathml/ImageLoaderFactoryMathML.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/examples/mathml/src/org/apache/fop/mathml/ImageLoaderFactoryMathML.java (original)
+++ xmlgraphics/fop/trunk/examples/mathml/src/org/apache/fop/mathml/ImageLoaderFactoryMathML.java Thu Jul 24 02:35:34 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.
@@ -30,28 +30,28 @@
/** MathML MIME type */
public static final String MIME_MATHML = "text/mathml";
-
+
private static final ImageFlavor[] FLAVORS = new ImageFlavor[] {
ImageFlavor.GRAPHICS2D};
-
+
private static final String[] MIMES = new String[] {
MIME_MATHML};
-
+
/** {@inheritDoc} */
public String[] getSupportedMIMETypes() {
return MIMES;
}
-
+
/** {@inheritDoc} */
public ImageFlavor[] getSupportedFlavors(String mime) {
return FLAVORS;
}
-
+
/** {@inheritDoc} */
public ImageLoader newImageLoader(ImageFlavor targetFlavor) {
return new ImageLoaderMathML(targetFlavor);
}
-
+
/** {@inheritDoc} */
public int getUsagePenalty(String mime, ImageFlavor flavor) {
return 0;
Modified: xmlgraphics/fop/trunk/examples/mathml/src/org/apache/fop/mathml/ImageLoaderMathML.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/mathml/src/org/apache/fop/mathml/ImageLoaderMathML.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/examples/mathml/src/org/apache/fop/mathml/ImageLoaderMathML.java (original)
+++ xmlgraphics/fop/trunk/examples/mathml/src/org/apache/fop/mathml/ImageLoaderMathML.java Thu Jul 24 02:35:34 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.
@@ -47,7 +47,7 @@
}
this.targetFlavor = targetFlavor;
}
-
+
/** {@inheritDoc} */
public ImageFlavor getTargetFlavor() {
return this.targetFlavor;
Modified: xmlgraphics/fop/trunk/examples/mathml/src/org/apache/fop/mathml/MathMLElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/mathml/src/org/apache/fop/mathml/MathMLElement.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/examples/mathml/src/org/apache/fop/mathml/MathMLElement.java (original)
+++ xmlgraphics/fop/trunk/examples/mathml/src/org/apache/fop/mathml/MathMLElement.java Thu Jul 24 02:35:34 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.mathml;
import java.awt.Color;
@@ -59,9 +59,9 @@
}
/** {@inheritDoc} */
- public void processNode(String elementName,
- Locator locator,
- Attributes attlist,
+ public void processNode(String elementName,
+ Locator locator,
+ Attributes attlist,
PropertyList propertyList) throws FOPException {
super.processNode(elementName, locator, attlist, propertyList);
createBasicDocument();
Modified: xmlgraphics/fop/trunk/examples/mathml/src/org/apache/fop/mathml/MathMLElementMapping.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/mathml/src/org/apache/fop/mathml/MathMLElementMapping.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/examples/mathml/src/org/apache/fop/mathml/MathMLElementMapping.java (original)
+++ xmlgraphics/fop/trunk/examples/mathml/src/org/apache/fop/mathml/MathMLElementMapping.java Thu Jul 24 02:35:34 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.mathml;
import java.util.HashMap;
@@ -32,7 +32,7 @@
public class MathMLElementMapping extends ElementMapping {
/** MathML Namespace */
- public static final String NAMESPACE = "http://www.w3.org/1998/Math/MathML";
+ public static final String NAMESPACE = "http://www.w3.org/1998/Math/MathML";
/** Main constructor. */
public MathMLElementMapping() {
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org