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 [14/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/fonts/type1/AFMWritingDirectionMetrics.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fonts/type1/AFMWritingDirectionMetrics.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fonts/type1/AFMWritingDirectionMetrics.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fonts/type1/AFMWritingDirectionMetrics.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.
@@ -28,7 +28,7 @@
private Number underlineThickness;
private double italicAngle;
private boolean isFixedPitch;
-
+
/**
* Returns the UnderlinePosition value.
* @return the underlinePosition
@@ -36,15 +36,15 @@
public Number getUnderlinePosition() {
return underlinePosition;
}
-
+
/**
- * Sets the UnderlinePosition value.
+ * Sets the UnderlinePosition value.
* @param underlinePosition the underlinePosition to set
*/
public void setUnderlinePosition(Number underlinePosition) {
this.underlinePosition = underlinePosition;
}
-
+
/**
* Returns the UnderlineThickness value.
* @return the underlineThickness
@@ -52,7 +52,7 @@
public Number getUnderlineThickness() {
return underlineThickness;
}
-
+
/**
* Sets the UnderlineThickness value.
* @param underlineThickness the underlineThickness to set
@@ -60,7 +60,7 @@
public void setUnderlineThickness(Number underlineThickness) {
this.underlineThickness = underlineThickness;
}
-
+
/**
* Returns the ItalicAngle value.
* @return the italicAngle
@@ -68,7 +68,7 @@
public double getItalicAngle() {
return italicAngle;
}
-
+
/**
* Sets the ItalicAngle value.
* @param italicAngle the italicAngle to set
@@ -76,7 +76,7 @@
public void setItalicAngle(double italicAngle) {
this.italicAngle = italicAngle;
}
-
+
/**
* Returns the IsFixedPitch value.
* @return the isFixedPitch
@@ -84,7 +84,7 @@
public boolean isFixedPitch() {
return isFixedPitch;
}
-
+
/**
* Set the IsFixedPitch value.
* @param value the isFixedPitch to set
@@ -92,5 +92,5 @@
public void setFixedPitch(boolean value) {
this.isFixedPitch = value;
}
-
+
}
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fonts/type1/PFBData.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fonts/type1/PFBData.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fonts/type1/PFBData.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fonts/type1/PFBData.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.fonts.type1;
import java.io.OutputStream;
@@ -24,7 +24,7 @@
/**
* Class that represents the contents of a PFB file.
- *
+ *
* @see PFBParser
*/
public class PFBData {
@@ -33,12 +33,12 @@
* Raw format, no special file structure
*/
public static final int PFB_RAW = 0;
-
+
/**
* PC format
*/
public static final int PFB_PC = 1;
-
+
/**
* MAC Format (unsupported, yet)
*/
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fonts/type1/PFBParser.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fonts/type1/PFBParser.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fonts/type1/PFBParser.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fonts/type1/PFBParser.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.fonts.type1;
import java.io.IOException;
@@ -29,7 +29,7 @@
/**
* This class represents a parser for Adobe Type 1 PFB files.
- *
+ *
* @see PFBData
*/
public class PFBParser {
@@ -104,7 +104,7 @@
private static int swapInteger(final int value) {
- return (((value >> 0) & 0xff) << 24)
+ return (((value >> 0) & 0xff) << 24)
+ (((value >> 8) & 0xff) << 16)
+ (((value >> 16) & 0xff) << 8)
+ (((value >> 24) & 0xff) << 0);
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fonts/type1/PFMFile.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fonts/type1/PFMFile.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fonts/type1/PFMFile.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fonts/type1/PFMFile.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.
@@ -315,7 +315,7 @@
+ ", 0x" + Integer.toHexString(dfCharSet)
+ "). Trying fallback to WinAnsi.");
}
- return "WinAnsi";
+ return "WinAnsi";
}
/**
@@ -406,14 +406,14 @@
}
/**
- * Indicates whether the font is non-symbolic (Font uses the Adobe standard Latin character
+ * Indicates whether the font is non-symbolic (Font uses the Adobe standard Latin character
* set or a subset of it).
* @return true if the font is non-symbolic
*/
public boolean isNonSymbolic() {
return (dfCharSet != 2); //!= Symbol fonts
}
-
+
/**
* Returns the characteristics flags for the font as
* needed for a PDF font descriptor (See PDF specs).
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fonts/type1/PFMInputStream.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fonts/type1/PFMInputStream.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fonts/type1/PFMInputStream.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fonts/type1/PFMInputStream.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.fonts.type1;
import java.io.IOException;
@@ -33,7 +33,7 @@
private DataInputStream datain;
/**
- * Constructs a PFMInputStream based on an InputStream representing the
+ * Constructs a PFMInputStream based on an InputStream representing the
* PFM file.
*
* @param in The stream from which to read the PFM file
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fonts/type1/Type1FontLoader.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fonts/type1/Type1FontLoader.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fonts/type1/Type1FontLoader.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fonts/type1/Type1FontLoader.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.
@@ -40,7 +40,7 @@
public class Type1FontLoader extends FontLoader {
private SingleByteFont singleFont;
-
+
/**
* Constructs a new Type 1 font loader.
* @param fontFileURI the URI to the PFB file of a Type 1 font
@@ -48,7 +48,7 @@
* @param resolver the font resolver used to resolve URIs
* @throws IOException In case of an I/O error
*/
- public Type1FontLoader(String fontFileURI, boolean embedded, FontResolver resolver)
+ public Type1FontLoader(String fontFileURI, boolean embedded, FontResolver resolver)
throws IOException {
super(fontFileURI, embedded, resolver);
}
@@ -59,14 +59,14 @@
+ (Character.isUpperCase(pfbExt.charAt(2)) ? "M" : "m");
return pfbURI.substring(0, pfbURI.length() - 4) + "." + pfmExt;
}
-
+
private static final String[] AFM_EXTENSIONS = new String[] {".AFM", ".afm", ".Afm"};
-
+
/** {@inheritDoc} */
protected void read() throws IOException {
AFMFile afm = null;
PFMFile pfm = null;
-
+
InputStream afmIn = null;
for (int i = 0; i < AFM_EXTENSIONS.length; i++) {
try {
@@ -88,7 +88,7 @@
IOUtils.closeQuietly(afmIn);
}
}
-
+
String pfmUri = getPFMURI(this.fontFileURI);
InputStream pfmIn = null;
try {
@@ -104,7 +104,7 @@
IOUtils.closeQuietly(pfmIn);
}
}
-
+
if (afm == null && pfm == null) {
throw new java.io.FileNotFoundException(
"Neither an AFM nor a PFM file was found for " + this.fontFileURI);
@@ -124,7 +124,7 @@
singleFont.setEmbedFileName(this.fontFileURI);
}
returnFont = singleFont;
-
+
handleEncoding(afm, pfm);
handleFontName(afm, pfm);
handleMetrics(afm, pfm);
@@ -162,7 +162,7 @@
if (pfm.getCharSet() >= 0 && pfm.getCharSet() <= 2) {
singleFont.setEncoding(pfm.getCharSetName() + "Encoding");
} else {
- log.warn("The PFM reports an unsupported encoding ("
+ log.warn("The PFM reports an unsupported encoding ("
+ pfm.getCharSetName() + "). The font may not work as expected.");
singleFont.setEncoding("WinAnsiEncoding"); //Try fallback, no guarantees!
}
@@ -203,7 +203,7 @@
if (afm.getDescender() != null) {
returnFont.setDescender(afm.getDescender().intValue());
}
-
+
returnFont.setFontBBox(afm.getFontBBoxAsIntArray());
if (afm.getStdVW() != null) {
returnFont.setStemV(afm.getStdVW().intValue());
@@ -231,7 +231,7 @@
returnFont.setDescender(pfm.getLowerCaseDescent());
}
}
-
+
//Fallbacks when some crucial font metrics aren't available
//(the following are all optional in AFM, but FontBBox is always available)
if (returnFont.getXHeight(1) == 0) {
@@ -285,7 +285,7 @@
if (returnFont.getCapHeight() == 0) {
returnFont.setCapHeight(returnFont.getAscender());
}
-
+
if (afm != null) {
String charSet = afm.getCharacterSet();
int flags = 0;
@@ -306,7 +306,7 @@
flags |= 64; //bit 7: Italic
}
returnFont.setFlags(flags);
-
+
returnFont.setFirstChar(afm.getFirstChar());
returnFont.setLastChar(afm.getLastChar());
Iterator iter = afm.getCharMetrics().iterator();
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/ByteVector.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/ByteVector.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/ByteVector.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/ByteVector.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.hyphenation;
import java.io.Serializable;
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/CharVector.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/CharVector.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/CharVector.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/CharVector.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.hyphenation;
import java.io.Serializable;
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/Hyphen.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/Hyphen.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/Hyphen.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/Hyphen.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.hyphenation;
import java.io.Serializable;
@@ -52,8 +52,8 @@
}
public String toString() {
- if (noBreak == null
- && postBreak == null
+ if (noBreak == null
+ && postBreak == null
&& preBreak != null
&& preBreak.equals("-")) {
return "-";
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/Hyphenation.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/Hyphenation.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/Hyphenation.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/Hyphenation.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.hyphenation;
/**
@@ -25,7 +25,7 @@
* @author Carlos Villegas <ca...@uniscope.co.jp>
*/
public class Hyphenation {
-
+
private int[] hyphenPoints;
private String word;
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/HyphenationException.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/HyphenationException.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/HyphenationException.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/HyphenationException.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/hyphenation/HyphenationTree.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/HyphenationTree.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/HyphenationTree.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/HyphenationTree.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.hyphenation;
import java.io.BufferedReader;
@@ -41,7 +41,7 @@
*
* @author Carlos Villegas <ca...@uniscope.co.jp>
*/
-public class HyphenationTree extends TernaryTree
+public class HyphenationTree extends TernaryTree
implements PatternConsumer, Serializable {
private static final long serialVersionUID = -7842107987915665573L;
@@ -128,7 +128,7 @@
InputSource src = new InputSource(f.toURI().toURL().toExternalForm());
loadPatterns(src);
} catch (MalformedURLException e) {
- throw new HyphenationException("Error converting the File '" + f + "' to a URL: "
+ throw new HyphenationException("Error converting the File '" + f + "' to a URL: "
+ e.getMessage());
}
}
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/HyphenationTreeCache.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/HyphenationTreeCache.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/HyphenationTreeCache.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/HyphenationTreeCache.java Fri Jul 25 05:44:20 2008
@@ -31,7 +31,7 @@
private Hashtable hyphenTrees = new Hashtable();
/** Used to avoid multiple error messages for the same language if a pattern file is missing. */
private Set missingHyphenationTrees;
-
+
/**
* Looks in the cache if a hyphenation tree is available and returns it if it is found.
* @param lang the language
@@ -40,7 +40,7 @@
*/
public HyphenationTree getHyphenationTree(String lang, String country) {
String key = constructKey(lang, country);
-
+
// first try to find it in the cache
if (hyphenTrees.containsKey(key)) {
return (HyphenationTree)hyphenTrees.get(key);
@@ -50,7 +50,7 @@
return null;
}
}
-
+
/**
* Constructs the key for the hyphenation pattern file.
* @param lang the language
@@ -65,7 +65,7 @@
}
return key;
}
-
+
/**
* Cache a hyphenation tree under its key.
* @param key the key (ex. "de_CH" or "en")
@@ -74,10 +74,10 @@
public void cache(String key, HyphenationTree hTree) {
hyphenTrees.put(key, hTree);
}
-
+
/**
* Notes a key to a hyphenation tree as missing.
- * This is to avoid searching a second time for a hyphneation pattern file which is not
+ * This is to avoid searching a second time for a hyphneation pattern file which is not
* available.
* @param key the key (ex. "de_CH" or "en")
*/
@@ -87,10 +87,10 @@
}
missingHyphenationTrees.add(key);
}
-
+
/**
* Indicates whether a hyphenation file has been requested before but it wasn't available.
- * This is to avoid searching a second time for a hyphneation pattern file which is not
+ * This is to avoid searching a second time for a hyphneation pattern file which is not
* available.
* @param key the key (ex. "de_CH" or "en")
* @return true if the hyphenation tree is unavailable
@@ -98,5 +98,5 @@
public boolean isMissing(String key) {
return (missingHyphenationTrees != null && missingHyphenationTrees.contains(key));
}
-
+
}
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/HyphenationTreeResolver.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/HyphenationTreeResolver.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/HyphenationTreeResolver.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/HyphenationTreeResolver.java Fri Jul 25 05:44:20 2008
@@ -34,5 +34,5 @@
* @return A Source object, or null if the href could not resolved.
*/
Source resolve(String href);
-
+
}
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/Hyphenator.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/Hyphenator.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/Hyphenator.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/Hyphenator.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.hyphenation;
import java.io.BufferedInputStream;
@@ -40,12 +40,12 @@
* @author Carlos Villegas <ca...@uniscope.co.jp>
*/
public class Hyphenator {
-
+
/** logging instance */
protected static Log log = LogFactory.getLog(Hyphenator.class);
private static HyphenationTreeCache hTreeCache = null;
-
+
private HyphenationTree hyphenTree = null;
private int remainCharCount = 2;
private int pushCharCount = 2;
@@ -73,7 +73,7 @@
}
return hTreeCache;
}
-
+
/**
* Returns a hyphenation tree for a given language and country. The hyphenation trees are
* cached.
@@ -83,9 +83,9 @@
*/
public static HyphenationTree getHyphenationTree(String lang,
String country) {
- return getHyphenationTree(lang, country, null);
+ return getHyphenationTree(lang, country, null);
}
-
+
/**
* Returns a hyphenation tree for a given language and country. The hyphenation trees are
* cached.
@@ -98,12 +98,12 @@
String country, HyphenationTreeResolver resolver) {
String key = HyphenationTreeCache.constructKey(lang, country);
HyphenationTreeCache cache = getHyphenationTreeCache();
-
+
// See if there was an error finding this hyphenation tree before
if (cache.isMissing(key)) {
return null;
}
-
+
HyphenationTree hTree;
// first try to find it in the cache
hTree = getHyphenationTreeCache().getHyphenationTree(lang, country);
@@ -117,7 +117,7 @@
if (hTree == null) {
hTree = getFopHyphenationTree(key);
}
-
+
// put it into the pattern cache
if (hTree != null) {
cache.cache(key, hTree);
@@ -165,7 +165,7 @@
}
return hTree;
}
-
+
/**
* Returns a hyphenation tree. This method looks in the resources (getResourceStream) for
* the hyphenation patterns.
@@ -230,7 +230,7 @@
};
return getUserHyphenationTree(key, resolver);
}
-
+
/**
* Load tree from serialized file or xml file
* using configuration settings
@@ -301,7 +301,7 @@
}
try {
InputSource src = new InputSource(in);
- src.setSystemId(source.getSystemId());
+ src.setSystemId(source.getSystemId());
hTree.loadPatterns(src);
} finally {
IOUtils.closeQuietly(in);
@@ -341,7 +341,7 @@
*/
public static Hyphenation hyphenate(String lang, String country,
HyphenationTreeResolver resolver,
- String word,
+ String word,
int leftMin, int rightMin) {
HyphenationTree hTree = getHyphenationTree(lang, country, resolver);
if (hTree == null) {
@@ -360,7 +360,7 @@
* @return the hyphenation result
*/
public static Hyphenation hyphenate(String lang, String country,
- String word,
+ String word,
int leftMin, int rightMin) {
return hyphenate(lang, country, null, word, leftMin, rightMin);
}
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/PatternConsumer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/PatternConsumer.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/PatternConsumer.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/PatternConsumer.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.hyphenation;
import java.util.ArrayList;
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/PatternParser.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/PatternParser.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/PatternParser.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/PatternParser.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.hyphenation;
// SAX
@@ -84,7 +84,7 @@
public void parse(String filename) throws HyphenationException {
parse(new File(filename));
}
-
+
/**
* Parses a hyphenation pattern file.
* @param file the pattern file
@@ -95,7 +95,7 @@
InputSource src = new InputSource(file.toURI().toURL().toExternalForm());
parse(src);
} catch (MalformedURLException e) {
- throw new HyphenationException("Error converting the File '" + file + "' to a URL: "
+ throw new HyphenationException("Error converting the File '" + file + "' to a URL: "
+ e.getMessage());
}
}
@@ -116,7 +116,7 @@
throw new HyphenationException(errMsg);
}
}
-
+
/**
* Creates a SAX parser using JAXP
* @return the created SAX parser
@@ -254,7 +254,7 @@
//
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public void startElement(String uri, String local, String raw,
Attributes attrs) {
@@ -283,7 +283,7 @@
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public void endElement(String uri, String local, String raw) {
@@ -320,7 +320,7 @@
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public void characters(char ch[], int start, int length) {
StringBuffer chars = new StringBuffer(length);
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/TernaryTree.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/TernaryTree.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/TernaryTree.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/TernaryTree.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/image/loader/batik/BatikUtil.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/image/loader/batik/BatikUtil.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/image/loader/batik/BatikUtil.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/image/loader/batik/BatikUtil.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,5 +37,5 @@
}
return false;
}
-
+
}
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/image/loader/batik/ImageConverterSVG2G2D.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/image/loader/batik/ImageConverterSVG2G2D.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/image/loader/batik/ImageConverterSVG2G2D.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/image/loader/batik/ImageConverterSVG2G2D.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.image.loader.batik;
import java.awt.Dimension;
@@ -51,7 +51,7 @@
* Note: The target flavor is "generic" Java2D. No Batik-specific bridges are hooked into the
* conversion process. Specialized renderers may want to provide specialized adapters to profit
* from target-format features (for example with PDF or PS). This converter is mainly for formats
- * which only support bitmap images or rudimentary Java2D support.
+ * which only support bitmap images or rudimentary Java2D support.
*/
public class ImageConverterSVG2G2D extends AbstractImageConverter {
@@ -126,7 +126,7 @@
//TODO Refine and pipe through to caller
log.debug(message);
}
-
+
};
}
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/image/loader/batik/ImageConverterWMF2G2D.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/image/loader/batik/ImageConverterWMF2G2D.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/image/loader/batik/ImageConverterWMF2G2D.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/image/loader/batik/ImageConverterWMF2G2D.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.image.loader.batik;
import java.awt.Dimension;
@@ -51,7 +51,7 @@
Graphics2DImagePainter painter;
painter = new Graphics2DImagePainterWMF(wmf);
-
+
ImageGraphics2D g2dImage = new ImageGraphics2D(src.getInfo(), painter);
return g2dImage;
}
@@ -69,11 +69,11 @@
private static class Graphics2DImagePainterWMF implements Graphics2DImagePainter {
private ImageWMF wmf;
-
+
public Graphics2DImagePainterWMF(ImageWMF wmf) {
this.wmf = wmf;
}
-
+
/** {@inheritDoc} */
public Dimension getImageSize() {
return wmf.getSize().getDimensionMpt();
@@ -84,7 +84,7 @@
WMFRecordStore wmfStore = wmf.getRecordStore();
double w = area.getWidth();
double h = area.getHeight();
-
+
//Fit in paint area
g2d.translate(area.getX(), area.getY());
double sx = w / wmfStore.getWidthPixels();
@@ -101,7 +101,7 @@
log.debug("Painting WMF took " + duration + " ms.");
}
}
-
+
}
-
+
}
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/image/loader/batik/ImageLoaderFactorySVG.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/image/loader/batik/ImageLoaderFactorySVG.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/image/loader/batik/ImageLoaderFactorySVG.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/image/loader/batik/ImageLoaderFactorySVG.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.
@@ -31,25 +31,25 @@
private static final ImageFlavor[] FLAVORS = new ImageFlavor[] {
ImageFlavor.XML_DOM};
-
+
private static final String[] MIMES = new String[] {
MimeConstants.MIME_SVG};
-
+
/** {@inheritDoc} */
public String[] getSupportedMIMETypes() {
return MIMES;
}
-
+
/** {@inheritDoc} */
public ImageFlavor[] getSupportedFlavors(String mime) {
return FLAVORS;
}
-
+
/** {@inheritDoc} */
public ImageLoader newImageLoader(ImageFlavor targetFlavor) {
return new ImageLoaderSVG(targetFlavor);
}
-
+
/** {@inheritDoc} */
public int getUsagePenalty(String mime, ImageFlavor flavor) {
return 0;
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/image/loader/batik/ImageLoaderFactoryWMF.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/image/loader/batik/ImageLoaderFactoryWMF.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/image/loader/batik/ImageLoaderFactoryWMF.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/image/loader/batik/ImageLoaderFactoryWMF.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.
@@ -30,25 +30,25 @@
private static final ImageFlavor[] FLAVORS = new ImageFlavor[] {
ImageWMF.WMF_IMAGE};
-
+
private static final String[] MIMES = new String[] {
ImageWMF.MIME_WMF};
-
+
/** {@inheritDoc} */
public String[] getSupportedMIMETypes() {
return MIMES;
}
-
+
/** {@inheritDoc} */
public ImageFlavor[] getSupportedFlavors(String mime) {
return FLAVORS;
}
-
+
/** {@inheritDoc} */
public ImageLoader newImageLoader(ImageFlavor targetFlavor) {
return new ImageLoaderWMF(targetFlavor);
}
-
+
/** {@inheritDoc} */
public int getUsagePenalty(String mime, ImageFlavor flavor) {
return 0;
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/image/loader/batik/ImageLoaderSVG.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/image/loader/batik/ImageLoaderSVG.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/image/loader/batik/ImageLoaderSVG.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/image/loader/batik/ImageLoaderSVG.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.
@@ -50,7 +50,7 @@
}
this.targetFlavor = targetFlavor;
}
-
+
/** {@inheritDoc} */
public ImageFlavor getTargetFlavor() {
return this.targetFlavor;
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/image/loader/batik/ImageLoaderWMF.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/image/loader/batik/ImageLoaderWMF.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/image/loader/batik/ImageLoaderWMF.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/image/loader/batik/ImageLoaderWMF.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.
@@ -46,7 +46,7 @@
}
this.targetFlavor = targetFlavor;
}
-
+
/** {@inheritDoc} */
public ImageFlavor getTargetFlavor() {
return this.targetFlavor;
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/image/loader/batik/ImageWMF.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/image/loader/batik/ImageWMF.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/image/loader/batik/ImageWMF.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/image/loader/batik/ImageWMF.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,9 +35,9 @@
/** ImageFlavor for Batik's WMFRecordStore */
public static final ImageFlavor WMF_IMAGE = new ImageFlavor("WMFRecordStore");
-
+
private WMFRecordStore store;
-
+
/**
* Main constructor.
* @param info the image info object
@@ -47,7 +47,7 @@
super(info);
this.store = store;
}
-
+
/** {@inheritDoc} */
public ImageFlavor getFlavor() {
return WMF_IMAGE;
@@ -57,7 +57,7 @@
public boolean isCacheable() {
return true;
}
-
+
/**
* Returns the contained WMF record store.
* @return the WMFRecordStore
@@ -65,5 +65,5 @@
public WMFRecordStore getRecordStore() {
return this.store;
}
-
+
}
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/image/loader/batik/PreloaderSVG.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/image/loader/batik/PreloaderSVG.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/image/loader/batik/PreloaderSVG.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/image/loader/batik/PreloaderSVG.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.image.loader.batik;
import java.awt.geom.AffineTransform;
@@ -59,8 +59,8 @@
private static Log log = LogFactory.getLog(PreloaderSVG.class);
private boolean batikAvailable = true;
-
- /** {@inheritDoc} */
+
+ /** {@inheritDoc} */
public ImageInfo preloadImage(String uri, Source src, ImageContext context)
throws IOException {
ImageInfo info = null;
@@ -122,7 +122,7 @@
doc = (SVGDocument) factory.createSVGDocument(src.getSystemId(), in);
}
ImageInfo info = createImageInfo(uri, context, doc);
-
+
return info;
} catch (NoClassDefFoundError ncdfe) {
if (in != null) {
@@ -154,7 +154,7 @@
private ImageInfo createImageInfo(String uri, ImageContext context, SVGDocument doc) {
Element e = doc.getRootElement();
- float pxUnitToMillimeter = 25.4f / context.getSourceResolution();
+ float pxUnitToMillimeter = 25.4f / context.getSourceResolution();
UserAgent userAg = new SimpleSVGUserAgent(pxUnitToMillimeter,
new AffineTransform()) {
@@ -162,7 +162,7 @@
public void displayMessage(String message) {
log.debug(message);
}
-
+
};
BridgeContext ctx = new BridgeContext(userAg);
UnitProcessor.Context uctx = UnitProcessor.createContext(ctx, e);
@@ -198,7 +198,7 @@
info.getCustomObjects().put(ImageInfo.ORIGINAL_IMAGE, xmlImage);
return info;
}
-
+
private boolean isSupportedSource(Source src) {
if (src instanceof DOMSource) {
DOMSource domSrc = (DOMSource)src;
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/image/loader/batik/PreloaderWMF.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/image/loader/batik/PreloaderWMF.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/image/loader/batik/PreloaderWMF.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/image/loader/batik/PreloaderWMF.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.image.loader.batik;
import java.io.DataInputStream;
@@ -49,8 +49,8 @@
private static Log log = LogFactory.getLog(PreloaderWMF.class);
private boolean batikAvailable = true;
-
- /** {@inheritDoc} */
+
+ /** {@inheritDoc} */
public ImageInfo preloadImage(String uri, Source src, ImageContext context)
throws IOException {
if (!ImageUtil.hasInputStream(src)) {
@@ -86,7 +86,7 @@
InputStream in = new UnclosableInputStream(ImageUtil.needInputStream(src));
try {
in.mark(4 + 1);
-
+
DataInputStream din = new DataInputStream(in);
int magic = EndianUtils.swapInteger(din.readInt());
din.reset();
@@ -97,11 +97,11 @@
WMFRecordStore wmfStore = new WMFRecordStore();
wmfStore.read(din);
IOUtils.closeQuietly(din);
-
+
int width = wmfStore.getWidthUnits();
int height = wmfStore.getHeightUnits();
int dpi = wmfStore.getMetaFileUnitsPerInch();
-
+
ImageInfo info = new ImageInfo(uri, "image/x-wmf");
ImageSize size = new ImageSize();
size.setSizeInPixels(width, height);
@@ -110,7 +110,7 @@
info.setSize(size);
ImageWMF img = new ImageWMF(info, wmfStore);
info.getCustomObjects().put(ImageInfo.ORIGINAL_IMAGE, img);
-
+
return info;
} catch (NoClassDefFoundError ncdfe) {
try {
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/AbstractBaseLayoutManager.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/AbstractBaseLayoutManager.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/AbstractBaseLayoutManager.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/AbstractBaseLayoutManager.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.
@@ -31,9 +31,9 @@
* and the {@link org.apache.fop.datatypes.PercentBaseContext} interfaces
* into a common base class for all higher LayoutManagers.
*/
-public abstract class AbstractBaseLayoutManager
+public abstract class AbstractBaseLayoutManager
implements LayoutManager, PercentBaseContext {
-
+
/** Indicator if this LM generates reference areas. */
protected boolean generatesReferenceArea = false;
/** Indicator if this LM generates block areas. */
@@ -67,7 +67,7 @@
}
// --------- Property Resolution related functions --------- //
-
+
/** {@inheritDoc} */
public int getBaseLength(int lengthBase, FObj fobjx) {
if (fobjx == this.fobj) {
@@ -201,7 +201,7 @@
throw new UnsupportedOperationException(
"getContentAreaIPD() called when it should have been overridden");
}
-
+
/**
* {@inheritDoc}
* <i>NOTE: Should be overridden by subclasses.
@@ -211,27 +211,27 @@
throw new UnsupportedOperationException(
"getContentAreaBPD() called when it should have been overridden");
}
-
+
/** {@inheritDoc} */
public boolean getGeneratesReferenceArea() {
return generatesReferenceArea;
}
-
+
/**
* Lets implementing LM set the flag indicating if they
* generate reference areas.
- * @param generatesReferenceArea if true the areas generates by this LM are
+ * @param generatesReferenceArea if true the areas generates by this LM are
* reference areas.
*/
protected void setGeneratesReferenceArea(boolean generatesReferenceArea) {
this.generatesReferenceArea = generatesReferenceArea;
}
-
+
/** {@inheritDoc} */
public boolean getGeneratesBlockArea() {
return generatesBlockArea;
}
-
+
/**
* Lets implementing LM set the flag indicating if they
* generate block areas.
@@ -240,17 +240,17 @@
protected void setGeneratesBlockArea(boolean generatesBlockArea) {
this.generatesBlockArea = generatesBlockArea;
}
-
+
/** {@inheritDoc} */
public boolean getGeneratesLineArea() {
return false;
}
-
+
/**
* {@inheritDoc}
*/
public FObj getFObj() {
return fobj;
}
-
+
}
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/AbstractBreaker.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/AbstractBreaker.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/AbstractBreaker.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/AbstractBreaker.java Fri Jul 25 05:44:20 2008
@@ -61,7 +61,7 @@
public class BlockSequence extends BlockKnuthSequence {
- /** Number of elements to ignore at the beginning of the list. */
+ /** Number of elements to ignore at the beginning of the list. */
public int ignoreAtStart = 0;
/** Number of elements to ignore at the end of the list. */
public int ignoreAtEnd = 0;
@@ -69,17 +69,17 @@
/**
* startOn represents where on the page/which page layout
* should start for this BlockSequence. Acceptable values:
- * Constants.EN_ANY (can continue from finished location
- * of previous BlockSequence?), EN_COLUMN, EN_ODD_PAGE,
- * EN_EVEN_PAGE.
+ * Constants.EN_ANY (can continue from finished location
+ * of previous BlockSequence?), EN_COLUMN, EN_ODD_PAGE,
+ * EN_EVEN_PAGE.
*/
private int startOn;
private int displayAlign;
-
+
/**
* Creates a new BlockSequence.
- * @param iStartOn the kind of page the sequence should start on. One of EN_ANY, EN_COLUMN,
+ * @param iStartOn the kind of page the sequence should start on. One of EN_ANY, EN_COLUMN,
* EN_ODD_PAGE, EN_EVEN_PAGE.
* @param displayAlign the value for the display-align property
*/
@@ -88,9 +88,9 @@
startOn = iStartOn;
this.displayAlign = displayAlign;
}
-
+
/**
- * @return the kind of page the sequence should start on. One of EN_ANY, EN_COLUMN,
+ * @return the kind of page the sequence should start on. One of EN_ANY, EN_COLUMN,
* EN_ODD_PAGE, EN_EVEN_PAGE.
*/
public int getStartOn() {
@@ -108,7 +108,7 @@
public KnuthSequence endSequence() {
return endSequence(null);
}
-
+
/**
* Finalizes a Knuth sequence.
* @param breakPosition a Position instance for the last penalty (may be null)
@@ -124,14 +124,14 @@
// add the elements representing the space at the end of the last line
// and the forced break
if (getDisplayAlign() == Constants.EN_X_DISTRIBUTE && isSinglePartFavored()) {
- this.add(new KnuthPenalty(0, -KnuthElement.INFINITE,
+ this.add(new KnuthPenalty(0, -KnuthElement.INFINITE,
false, breakPosition, false));
ignoreAtEnd = 1;
} else {
- this.add(new KnuthPenalty(0, KnuthElement.INFINITE,
+ this.add(new KnuthPenalty(0, KnuthElement.INFINITE,
false, null, false));
this.add(new KnuthGlue(0, 10000000, 0, null, false));
- this.add(new KnuthPenalty(0, -KnuthElement.INFINITE,
+ this.add(new KnuthPenalty(0, -KnuthElement.INFINITE,
false, breakPosition, false));
ignoreAtEnd = 3;
}
@@ -171,10 +171,10 @@
protected abstract void addAreas(PositionIterator posIter, LayoutContext context);
protected abstract LayoutManager getTopLevelLM();
protected abstract LayoutManager getCurrentChildLM();
-
+
/**
* Controls the behaviour of the algorithm in cases where the first element of a part
- * overflows a line/page.
+ * overflows a line/page.
* @return true if the algorithm should try to send the element to the next line/page.
*/
protected boolean isPartOverflowRecoveryActivated() {
@@ -187,7 +187,7 @@
protected boolean isSinglePartFavored() {
return false;
}
-
+
/**
* Returns the PageProvider if any. PageBreaker overrides this method because each
* page may have a different available BPD which needs to be accessible to the breaking
@@ -197,7 +197,7 @@
protected PageProvider getPageProvider() {
return null;
}
-
+
/**
* Creates and returns a PageBreakingLayoutListener for the PageBreakingAlgorithm to
* notify about layout problems.
@@ -206,11 +206,11 @@
protected PageBreakingAlgorithm.PageBreakingLayoutListener createLayoutListener() {
return null;
}
-
+
/*
* This method is to contain the logic to determine the LM's
- * getNextKnuthElements() implementation(s) that are to be called.
- * @return LinkedList of Knuth elements.
+ * getNextKnuthElements() implementation(s) that are to be called.
+ * @return LinkedList of Knuth elements.
*/
protected abstract List getNextKnuthElements(LayoutContext context, int alignment);
@@ -218,18 +218,18 @@
public boolean isEmpty() {
return (this.blockLists.isEmpty());
}
-
+
protected void startPart(BlockSequence list, int breakClass) {
//nop
}
-
+
/**
* This method is called when no content is available for a part. Used to force empty pages.
*/
protected void handleEmptyContent() {
- //nop
+ //nop
}
-
+
protected abstract void finishPart(PageBreakingAlgorithm alg, PageBreakPosition pbp);
/**
@@ -239,7 +239,7 @@
protected LayoutContext createLayoutContext() {
return new LayoutContext(0);
}
-
+
/**
* Used to update the LayoutContext in subclasses prior to starting a new element list.
* @param context the LayoutContext to update
@@ -247,7 +247,7 @@
protected void updateLayoutContext(LayoutContext context) {
//nop
}
-
+
/**
* Used for debugging purposes. Notifies all registered observers about the element list.
* Override to set different parameters.
@@ -256,7 +256,7 @@
protected void observeElementList(List elementList) {
ElementListObserver.observe(elementList, "breaker", null);
}
-
+
/**
* Starts the page breaking process.
* @param flowBPD the constant available block-progression-dimension (used for every part)
@@ -264,7 +264,7 @@
public void doLayout(int flowBPD) {
doLayout(flowBPD, false);
}
-
+
/**
* Starts the page breaking process.
* @param flowBPD the constant available block-progression-dimension (used for every part)
@@ -294,7 +294,7 @@
this.blockLists = new java.util.ArrayList();
log.debug("PLM> flow BPD =" + flowBPD);
-
+
//*** Phase 1: Get Knuth elements ***
int nextSequenceStartsOn = Constants.EN_ANY;
while (hasMoreContent()) {
@@ -306,7 +306,7 @@
log.debug("PLM> blockLists.size() = " + blockLists.size());
for (blockListIndex = 0; blockListIndex < blockLists.size(); blockListIndex++) {
blockList = (BlockSequence) blockLists.get(blockListIndex);
-
+
//debug code start
if (log.isDebugEnabled()) {
log.debug(" blockListIndex = " + blockListIndex);
@@ -318,7 +318,7 @@
observeElementList(blockList);
//debug code end
- log.debug("PLM> start of algorithm (" + this.getClass().getName()
+ log.debug("PLM> start of algorithm (" + this.getClass().getName()
+ "), flow BPD =" + flowBPD);
PageBreakingAlgorithm alg = new PageBreakingAlgorithm(getTopLevelLM(),
getPageProvider(), createLayoutListener(),
@@ -342,7 +342,7 @@
log.debug("PLM> iOptPageCount= " + iOptPageCount
+ " pageBreaks.size()= " + alg.getPageBreaks().size());
-
+
//*** Phase 3: Add areas ***
doPhase3(alg, iOptPageCount, blockList, effectiveList);
}
@@ -351,36 +351,36 @@
}
/**
- * Phase 3 of Knuth algorithm: Adds the areas
+ * Phase 3 of Knuth algorithm: Adds the areas
* @param alg PageBreakingAlgorithm instance which determined the breaks
* @param partCount number of parts (pages) to be rendered
* @param originalList original Knuth element list
* @param effectiveList effective Knuth element list (after adjustments)
*/
- protected abstract void doPhase3(PageBreakingAlgorithm alg, int partCount,
+ protected abstract void doPhase3(PageBreakingAlgorithm alg, int partCount,
BlockSequence originalList, BlockSequence effectiveList);
-
+
/**
- * Phase 3 of Knuth algorithm: Adds the areas
+ * Phase 3 of Knuth algorithm: Adds the areas
* @param alg PageBreakingAlgorithm instance which determined the breaks
* @param partCount number of parts (pages) to be rendered
* @param originalList original Knuth element list
* @param effectiveList effective Knuth element list (after adjustments)
*/
- protected void addAreas(PageBreakingAlgorithm alg, int partCount,
+ protected void addAreas(PageBreakingAlgorithm alg, int partCount,
BlockSequence originalList, BlockSequence effectiveList) {
addAreas(alg, 0, partCount, originalList, effectiveList);
}
-
+
/**
- * Phase 3 of Knuth algorithm: Adds the areas
+ * Phase 3 of Knuth algorithm: Adds the areas
* @param alg PageBreakingAlgorithm instance which determined the breaks
* @param startPart index of the first part (page) to be rendered
* @param partCount number of parts (pages) to be rendered
* @param originalList original Knuth element list
* @param effectiveList effective Knuth element list (after adjustments)
*/
- protected void addAreas(PageBreakingAlgorithm alg, int startPart, int partCount,
+ protected void addAreas(PageBreakingAlgorithm alg, int startPart, int partCount,
BlockSequence originalList, BlockSequence effectiveList) {
LayoutContext childLC;
// add areas
@@ -404,13 +404,13 @@
lastBreakClass = Constants.EN_COLUMN;
}
}
-
+
//the end of the new part
endElementIndex = pbp.getLeafPos();
// ignore the first elements added by the
// PageSequenceLayoutManager
- startElementIndex += (startElementIndex == 0)
+ startElementIndex += (startElementIndex == 0)
? effectiveList.ignoreAtStart
: 0;
@@ -420,16 +420,16 @@
+ ", break class = " + lastBreakClass);
startPart(effectiveList, lastBreakClass);
-
+
int displayAlign = getCurrentDisplayAlign();
-
+
//The following is needed by SpaceResolver.performConditionalsNotification()
//further down as there may be important Position elements in the element list trailer
int notificationEndElementIndex = endElementIndex;
// ignore the last elements added by the
// PageSequenceLayoutManager
- endElementIndex -= (endElementIndex == (originalList.size() - 1))
+ endElementIndex -= (endElementIndex == (originalList.size() - 1))
? effectiveList.ignoreAtEnd
: 0;
@@ -493,7 +493,7 @@
/* *** *** non-standard extension *** *** */
if (displayAlign == Constants.EN_X_FILL) {
- int averageLineLength = optimizeLineLength(effectiveList,
+ int averageLineLength = optimizeLineLength(effectiveList,
startElementIndex, endElementIndex);
if (averageLineLength != 0) {
childLC.setStackLimitBP(new MinOptMax(averageLineLength));
@@ -502,9 +502,9 @@
/* *** *** non-standard extension *** *** */
// Handle SpaceHandling(Break)Positions, see SpaceResolver!
- SpaceResolver.performConditionalsNotification(effectiveList,
+ SpaceResolver.performConditionalsNotification(effectiveList,
startElementIndex, notificationEndElementIndex, lastBreak);
-
+
// Add areas now!
addAreas(new KnuthPossPosIter(effectiveList,
startElementIndex, endElementIndex + 1), childLC);
@@ -528,7 +528,7 @@
* @param lastBreak index of the last break element
*/
/**
- * Handles span changes reported through the <code>LayoutContext</code>.
+ * Handles span changes reported through the <code>LayoutContext</code>.
* Only used by the PSLM and called by <code>getNextBlockList()</code>.
* @param childLC the LayoutContext
* @param nextSequenceStartsOn previous value for break handling
@@ -543,12 +543,12 @@
* @param nextSequenceStartsOn indicates on what page the next sequence should start
* @return the page on which the next content should appear after a hard break
*/
- protected int getNextBlockList(LayoutContext childLC,
+ protected int getNextBlockList(LayoutContext childLC,
int nextSequenceStartsOn) {
updateLayoutContext(childLC);
//Make sure the span change signal is reset
childLC.signalSpanChange(Constants.NOT_SET);
-
+
BlockSequence blockList;
List returnedList = getNextKnuthElements(childLC, alignment);
if (returnedList != null) {
@@ -557,10 +557,10 @@
return nextSequenceStartsOn;
}
blockList = new BlockSequence(nextSequenceStartsOn, getCurrentDisplayAlign());
-
+
//Only implemented by the PSLM
nextSequenceStartsOn = handleSpanChange(childLC, nextSequenceStartsOn);
-
+
Position breakPosition = null;
if (((KnuthElement) ListUtil.getLast(returnedList)).isForcedBreak()) {
KnuthPenalty breakPenalty = (KnuthPenalty) ListUtil
@@ -585,7 +585,7 @@
nextSequenceStartsOn = Constants.EN_EVEN_PAGE;
break;
default:
- throw new IllegalStateException("Invalid break class: "
+ throw new IllegalStateException("Invalid break class: "
+ breakPenalty.getBreakClass());
}
}
@@ -649,7 +649,7 @@
* Justifies the boxes and returns them as a new KnuthSequence.
* @param blockList block list to justify
* @param alg reference to the algorithm instance
- * @param availableBPD the available BPD
+ * @param availableBPD the available BPD
* @return the effective list
*/
private BlockSequence justifyBoxes(BlockSequence blockList, PageBreakingAlgorithm alg, int availableBPD) {
@@ -659,7 +659,7 @@
1, true, BreakingAlgorithm.ALL_BREAKS);
log.debug("PLM> iOptPageNumber= " + iOptPageNumber);
- //
+ //
ListIterator sequenceIterator = blockList.listIterator();
ListIterator breakIterator = alg.getPageBreaks().listIterator();
KnuthElement thisElement = null;
@@ -687,7 +687,7 @@
KnuthElement firstElement;
while (!(firstElement = (KnuthElement) sequenceIterator
.next()).isBox()) {
- //
+ //
log.debug("PLM> ignoring glue or penalty element "
+ "at the beginning of the sequence");
if (firstElement.isGlue()) {
@@ -811,7 +811,7 @@
// create a new sequence: the new elements will contain the
// Positions
// which will be used in the addAreas() phase
- BlockSequence effectiveList = new BlockSequence(blockList.getStartOn(),
+ BlockSequence effectiveList = new BlockSequence(blockList.getStartOn(),
blockList.getDisplayAlign());
effectiveList.addAll(getCurrentChildLM().getChangedKnuthElements(
blockList.subList(0, blockList.size() - blockList.ignoreAtEnd),
@@ -828,7 +828,7 @@
private int adjustBlockSpaces(LinkedList spaceList, int difference, int total) {
if (log.isDebugEnabled()) {
- log.debug("AdjustBlockSpaces: difference " + difference + " / " + total
+ log.debug("AdjustBlockSpaces: difference " + difference + " / " + total
+ " on " + spaceList.size() + " spaces in block");
}
ListIterator spaceListIterator = spaceList.listIterator();
@@ -839,8 +839,8 @@
partial += (difference > 0 ? blockSpace.getY() : blockSpace.getZ());
if (log.isDebugEnabled()) {
log.debug("available = " + partial + " / " + total);
- log.debug("competenza = "
- + (((int)((float) partial * difference / total)) - adjustedDiff)
+ log.debug("competenza = "
+ + (((int)((float) partial * difference / total)) - adjustedDiff)
+ " / " + difference);
}
int newAdjust = ((BlockLevelLayoutManager) blockSpace.getLayoutManager()).negotiateBPDAdjustment(((int) ((float) partial * difference / total)) - adjustedDiff, blockSpace);
@@ -888,5 +888,5 @@
}
return adjustedDiff;
}
-
+
}
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.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.
@@ -294,7 +294,7 @@
if (pos.getIndex() >= 0) {
throw new IllegalStateException("Position already got its index");
}
-
+
lastGeneratedPosition++;
pos.setIndex(lastGeneratedPosition);
return pos;
@@ -383,27 +383,27 @@
* Checks to see if the incoming {@link Position}
* is the last one for this LM, and if so, calls
* {@link #notifyEndOfLayout()} and cleans up.
- *
+ *
* @param pos the {@link Position} to check
*/
protected void checkEndOfLayout(Position pos) {
if (pos != null
&& pos.getLM() == this
&& this.isLast(pos)) {
-
+
notifyEndOfLayout();
-
+
/* References to the child LMs are no longer needed
*/
childLMs = null;
curChildLM = null;
childLMiter = null;
-
+
/* markers that qualify have been transferred to the page
*/
markers = null;
-
- /* References to the FO's children can be released if the
+
+ /* References to the FO's children can be released if the
* LM is a descendant of the FlowLM. For static-content
* the FO may still be needed on following pages.
*/
@@ -418,7 +418,7 @@
}
}
}
-
+
/** {@inheritDoc} */
public String toString() {
return (super.toString() + (fobj != null ? "[fobj=" + fobj.toString() + "]" : ""));
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/AbstractPageSequenceLayoutManager.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/AbstractPageSequenceLayoutManager.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/AbstractPageSequenceLayoutManager.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/AbstractPageSequenceLayoutManager.java Fri Jul 25 05:44:20 2008
@@ -43,15 +43,15 @@
private static Log log = LogFactory.getLog(AbstractPageSequenceLayoutManager.class);
- /**
+ /**
* AreaTreeHandler which activates the PSLM and controls
* the rendering of its pages.
*/
protected AreaTreeHandler areaTreeHandler;
-
+
/** ID tracker supplied by the AreaTreeHandler */
protected IDTracker idTracker;
-
+
/** page sequence formatting object being processed by this class */
protected AbstractPageSequence pageSeq;
@@ -62,7 +62,7 @@
protected int currentPageNum = 0;
/** The stating page number */
protected int startPageNum = 0;
-
+
/**
* Constructor
*
@@ -112,12 +112,12 @@
startPageNum = pageSeq.getStartingPageNumber();
currentPageNum = startPageNum - 1;
}
-
+
/**
* This returns the first PageViewport that contains an id trait
* matching the idref argument, or null if no such PV exists.
*
- * @param idref the idref trait needing to be resolved
+ * @param idref the idref trait needing to be resolved
* @return the first PageViewport that contains the ID trait
*/
public PageViewport getFirstPVWithID(String idref) {
@@ -132,7 +132,7 @@
* This returns the last PageViewport that contains an id trait
* matching the idref argument, or null if no such PV exists.
*
- * @param idref the idref trait needing to be resolved
+ * @param idref the idref trait needing to be resolved
* @return the last PageViewport that contains the ID trait
*/
public PageViewport getLastPVWithID(String idref) {
@@ -142,7 +142,7 @@
}
return null;
}
-
+
/**
* Add an ID reference to the current page.
* When adding areas the area adds its ID reference.
@@ -156,7 +156,7 @@
idTracker.associateIDWithPageViewport(id, curPage.getPageViewport());
}
}
-
+
/**
* Add an id reference of the layout manager in the AreaTreeHandler,
* if the id hasn't been resolved yet
@@ -175,7 +175,7 @@
return true;
}
}
-
+
/**
* Notify the areaTreeHandler that the LayoutManagers containing
* idrefs have finished creating areas
@@ -184,16 +184,16 @@
public void notifyEndOfLayout(String id) {
idTracker.signalIDProcessed(id);
}
-
+
/**
- * Identify an unresolved area (one needing an idref to be
+ * Identify an unresolved area (one needing an idref to be
* resolved, e.g. the internal-destination of an fo:basic-link)
* for both the AreaTreeHandler and PageViewport object.
- *
+ *
* The IDTracker keeps a document-wide list of idref's
- * and the PV's needing them to be resolved. It uses this to
+ * and the PV's needing them to be resolved. It uses this to
* send notifications to the PV's when an id has been resolved.
- *
+ *
* The PageViewport keeps lists of id's needing resolving, along
* with the child areas (page-number-citation, basic-link, etc.)
* of the PV needing their resolution.
@@ -216,7 +216,7 @@
* then the containing page does not have a qualifying area,
* and all qualifying areas have ended.
* Therefore we use last-ending-within-page (Constants.EN_LEWP)
- * as the position.
+ * as the position.
*
* @param rm the RetrieveMarker instance whose properties are to
* used to find the matching Marker.
@@ -227,8 +227,8 @@
AreaTreeModel areaTreeModel = areaTreeHandler.getAreaTreeModel();
String name = rm.getRetrieveClassName();
int pos = rm.getRetrievePosition();
- int boundary = rm.getRetrieveBoundary();
-
+ int boundary = rm.getRetrieveBoundary();
+
// get marker from the current markers on area tree
Marker mark = (Marker)getCurrentPV().getMarker(name, pos);
if (mark == null && boundary != EN_PAGE) {
@@ -271,10 +271,10 @@
* @return the newly created page
*/
protected abstract Page createPage(int pageNumber, boolean isBlank);
-
+
/**
* Makes a new page
- *
+ *
* @param bIsBlank whether this page is blank or not
* @param bIsLast whether this page is the last page or not
* @return a new page
@@ -289,14 +289,14 @@
curPage = createPage(currentPageNum, isBlank);
if (log.isDebugEnabled()) {
- log.debug("[" + curPage.getPageViewport().getPageNumberString()
+ log.debug("[" + curPage.getPageViewport().getPageNumberString()
+ (isBlank ? "*" : "") + "]");
}
-
+
addIDToPage(pageSeq.getId());
return curPage;
}
-
+
/**
* Finishes a page in preparation for a new page.
*/
@@ -304,19 +304,19 @@
if (log.isTraceEnabled()) {
curPage.getPageViewport().dumpMarkers();
}
-
+
// Try to resolve any unresolved IDs for the current page.
- //
+ //
idTracker.tryIDResolution(curPage.getPageViewport());
// Queue for ID resolution and rendering
areaTreeHandler.getAreaTreeModel().addPage(curPage.getPageViewport());
if (log.isDebugEnabled()) {
- log.debug("page finished: " + curPage.getPageViewport().getPageNumberString()
+ log.debug("page finished: " + curPage.getPageViewport().getPageNumberString()
+ ", current num: " + currentPageNum);
}
curPage = null;
}
-
+
/** {@inheritDoc} */
public void doForcePageCount(Numeric nextPageSeqInitialPageNumber) {
@@ -325,14 +325,14 @@
// xsl-spec version 1.0 (15.oct 2001)
// auto | even | odd | end-on-even | end-on-odd | no-force | inherit
// auto:
- // Force the last page in this page-sequence to be an odd-page
- // if the initial-page-number of the next page-sequence is even.
- // Force it to be an even-page
- // if the initial-page-number of the next page-sequence is odd.
- // If there is no next page-sequence
+ // Force the last page in this page-sequence to be an odd-page
+ // if the initial-page-number of the next page-sequence is even.
+ // Force it to be an even-page
+ // if the initial-page-number of the next page-sequence is odd.
+ // If there is no next page-sequence
// or if the value of its initial-page-number is "auto" do not force any page.
-
- // if force-page-count is auto then set the value of forcePageCount
+
+ // if force-page-count is auto then set the value of forcePageCount
// depending on the initial-page-number of the next page-sequence
if (nextPageSeqInitialPageNumber != null && forcePageCount == Constants.EN_AUTO) {
if (nextPageSeqInitialPageNumber.getEnum() != 0) {
@@ -381,5 +381,5 @@
finishPage();
}
}
-
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org