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 fo...@locus.apache.org on 2000/06/28 00:14:40 UTC
cvs commit: xml-fop/src/org/apache/fop/viewer Command.java LoadableProperties.java SecureResourceBundle.java UserMessage.java
fotis 00/06/27 15:14:38
Modified: src/codegen charlist.xml properties.xsl
src/org/apache/fop/apps AWTCommandLine.java CommandLine.java
Driver.java PDFOutputHandler.java
PrintCommandLine.java XTCommandLine.java
src/org/apache/fop/datatypes ColorType.java Length.java
src/org/apache/fop/fo FOText.java FOTreeBuilder.java
PropertyList.java PropertyListBuilder.java
src/org/apache/fop/fo/flow Block.java DisplayGraphic.java
InlineGraphic.java ListBlock.java PageNumber.java
PageNumberCitation.java Table.java TableRow.java
src/org/apache/fop/fo/pagination PageSequence.java Root.java
SimplePageMaster.java
src/org/apache/fop/image FopImageConsumer.java
FopImageFactory.java
src/org/apache/fop/layout FontInfo.java LineArea.java
src/org/apache/fop/pdf PDFPages.java PDFXObject.java
src/org/apache/fop/render/awt AWTRenderer.java
src/org/apache/fop/render/pdf FontSetup.java
PDFRenderer.java
src/org/apache/fop/render/xml XMLRenderer.java
src/org/apache/fop/svg Line.java Rect.java Text.java
src/org/apache/fop/viewer Command.java
LoadableProperties.java SecureResourceBundle.java
UserMessage.java
Log:
replaces calls of System.err.println etc. with calls to the new MessageHandler methods
Revision Changes Path
1.4 +178 -190 xml-fop/src/codegen/charlist.xml
Index: charlist.xml
===================================================================
RCS file: /home/cvs/xml-fop/src/codegen/charlist.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- charlist.xml 2000/06/22 00:18:20 1.3
+++ charlist.xml 2000/06/27 22:12:59 1.4
@@ -450,196 +450,184 @@
<map adobe-name="a191" win-ansi="0x00FE" unicode="0x27BE" unicodeName="OPEN-OUTLINED RIGHTWARDS ARROW"/>
<!-- the following mappings are used for the Symbol font
- TBD: remove doublettes and fill in unicode values -->
- <map adobe-name="space" win-ansi="0x20" unicode="0x0000"/>
- <map adobe-name="exclam" win-ansi="0x21" unicode="0x0000"/>
- <map adobe-name="universal" win-ansi="0x22" unicode="0x0000"/>
- <map adobe-name="numbersign" win-ansi="0x23" unicode="0x0000"/>
- <map adobe-name="existential" win-ansi="0x24" unicode="0x0000"/>
- <map adobe-name="percent" win-ansi="0x25" unicode="0x0000"/>
- <map adobe-name="ampersand" win-ansi="0x26" unicode="0x0000"/>
- <map adobe-name="suchthat" win-ansi="0x27" unicode="0x0000"/>
- <map adobe-name="parenleft" win-ansi="0x28" unicode="0x0000"/>
- <map adobe-name="parenright" win-ansi="0x29" unicode="0x0000"/>
- <map adobe-name="asteriskmath" win-ansi="0x2A" unicode="0x0000"/>
- <map adobe-name="plus" win-ansi="0x2B" unicode="0x0000"/>
- <map adobe-name="comma" win-ansi="0x2C" unicode="0x0000"/>
- <map adobe-name="minus" win-ansi="0x2D" unicode="0x0000"/>
- <map adobe-name="period" win-ansi="0x2E" unicode="0x0000"/>
- <map adobe-name="slash" win-ansi="0x2F" unicode="0x0000"/>
- <map adobe-name="zero" win-ansi="0x30" unicode="0x0000"/>
- <map adobe-name="one" win-ansi="0x31" unicode="0x0000"/>
- <map adobe-name="two" win-ansi="0x32" unicode="0x0000"/>
- <map adobe-name="three" win-ansi="0x33" unicode="0x0000"/>
- <map adobe-name="four" win-ansi="0x34" unicode="0x0000"/>
- <map adobe-name="five" win-ansi="0x35" unicode="0x0000"/>
- <map adobe-name="six" win-ansi="0x36" unicode="0x0000"/>
- <map adobe-name="seven" win-ansi="0x37" unicode="0x0000"/>
- <map adobe-name="eight" win-ansi="0x38" unicode="0x0000"/>
- <map adobe-name="nine" win-ansi="0x39" unicode="0x0000"/>
- <map adobe-name="colon" win-ansi="0x3A" unicode="0x0000"/>
- <map adobe-name="semicolon" win-ansi="0x3B" unicode="0x0000"/>
- <map adobe-name="less" win-ansi="0x3C" unicode="0x0000"/>
- <map adobe-name="equal" win-ansi="0x3D" unicode="0x0000"/>
- <map adobe-name="greater" win-ansi="0x3E" unicode="0x0000"/>
- <map adobe-name="question" win-ansi="0x3F" unicode="0x0000"/>
- <map adobe-name="congruent" win-ansi="0x40" unicode="0x0000"/>
- <map adobe-name="Alpha" win-ansi="0x41" unicode="0x0000"/>
- <map adobe-name="Beta" win-ansi="0x42" unicode="0x0000"/>
- <map adobe-name="Chi" win-ansi="0x43" unicode="0x0000"/>
- <map adobe-name="Delta" win-ansi="0x44" unicode="0x0000"/>
- <map adobe-name="Epsilon" win-ansi="0x45" unicode="0x0000"/>
- <map adobe-name="Phi" win-ansi="0x46" unicode="0x0000"/>
- <map adobe-name="Gamma" win-ansi="0x47" unicode="0x0000"/>
- <map adobe-name="Eta" win-ansi="0x48" unicode="0x0000"/>
- <map adobe-name="Iota" win-ansi="0x49" unicode="0x0000"/>
- <map adobe-name="theta1" win-ansi="0x4A" unicode="0x0000"/>
- <map adobe-name="Kappa" win-ansi="0x4B" unicode="0x0000"/>
- <map adobe-name="Lambda" win-ansi="0x4C" unicode="0x0000"/>
- <map adobe-name="Mu" win-ansi="0x4D" unicode="0x0000"/>
- <map adobe-name="Nu" win-ansi="0x4E" unicode="0x0000"/>
- <map adobe-name="Omicron" win-ansi="0x4F" unicode="0x0000"/>
- <map adobe-name="Pi" win-ansi="0x50" unicode="0x0000"/>
- <map adobe-name="Theta" win-ansi="0x51" unicode="0x0000"/>
- <map adobe-name="Rho" win-ansi="0x52" unicode="0x0000"/>
- <map adobe-name="Sigma" win-ansi="0x53" unicode="0x0000"/>
- <map adobe-name="Tau" win-ansi="0x54" unicode="0x0000"/>
- <map adobe-name="Upsilon" win-ansi="0x55" unicode="0x0000"/>
- <map adobe-name="sigma1" win-ansi="0x56" unicode="0x0000"/>
- <map adobe-name="Omega" win-ansi="0x57" unicode="0x0000"/>
- <map adobe-name="Xi" win-ansi="0x58" unicode="0x0000"/>
- <map adobe-name="Psi" win-ansi="0x59" unicode="0x0000"/>
- <map adobe-name="Zeta" win-ansi="0x5A" unicode="0x0000"/>
- <map adobe-name="bracketleft" win-ansi="0x5B" unicode="0x0000"/>
- <map adobe-name="therefore" win-ansi="0x5C" unicode="0x0000"/>
- <map adobe-name="bracketright" win-ansi="0x5D" unicode="0x0000"/>
- <map adobe-name="perpendicular" win-ansi="0x5E" unicode="0x0000"/>
- <map adobe-name="underscore" win-ansi="0x5F" unicode="0x0000"/>
- <map adobe-name="radicalex" win-ansi="0x60" unicode="0x0000"/>
- <map adobe-name="alpha" win-ansi="0x61" unicode="0x0000"/>
- <map adobe-name="beta" win-ansi="0x62" unicode="0x0000"/>
- <map adobe-name="chi" win-ansi="0x63" unicode="0x0000"/>
- <map adobe-name="delta" win-ansi="0x64" unicode="0x0000"/>
- <map adobe-name="epsilon" win-ansi="0x65" unicode="0x0000"/>
- <map adobe-name="phi" win-ansi="0x66" unicode="0x0000"/>
- <map adobe-name="gamma" win-ansi="0x67" unicode="0x0000"/>
- <map adobe-name="eta" win-ansi="0x68" unicode="0x0000"/>
- <map adobe-name="iota" win-ansi="0x69" unicode="0x0000"/>
- <map adobe-name="phi1" win-ansi="0x6A" unicode="0x0000"/>
- <map adobe-name="kappa" win-ansi="0x6B" unicode="0x0000"/>
- <map adobe-name="lambda" win-ansi="0x6C" unicode="0x0000"/>
- <map adobe-name="mu" win-ansi="0x6D" unicode="0x0000"/>
- <map adobe-name="nu" win-ansi="0x6E" unicode="0x0000"/>
- <map adobe-name="omicron" win-ansi="0x6F" unicode="0x0000"/>
- <map adobe-name="pi" win-ansi="0x70" unicode="0x0000"/>
- <map adobe-name="theta" win-ansi="0x71" unicode="0x0000"/>
- <map adobe-name="rho" win-ansi="0x72" unicode="0x0000"/>
- <map adobe-name="sigma" win-ansi="0x73" unicode="0x0000"/>
- <map adobe-name="tau" win-ansi="0x74" unicode="0x0000"/>
- <map adobe-name="upsilon" win-ansi="0x75" unicode="0x0000"/>
- <map adobe-name="omega1" win-ansi="0x76" unicode="0x0000"/>
- <map adobe-name="omega" win-ansi="0x77" unicode="0x0000"/>
- <map adobe-name="xi" win-ansi="0x78" unicode="0x0000"/>
- <map adobe-name="psi" win-ansi="0x79" unicode="0x0000"/>
- <map adobe-name="zeta" win-ansi="0x7A" unicode="0x0000"/>
- <map adobe-name="braceleft" win-ansi="0x7B" unicode="0x0000"/>
- <map adobe-name="bar" win-ansi="0x7C" unicode="0x0000"/>
- <map adobe-name="braceright" win-ansi="0x7D" unicode="0x0000"/>
- <map adobe-name="similar" win-ansi="0x7E" unicode="0x0000"/>
- <map adobe-name="Upsilon1" win-ansi="0xA1" unicode="0x0000"/>
- <map adobe-name="minute" win-ansi="0xA2" unicode="0x0000"/>
- <map adobe-name="lessequal" win-ansi="0xA3" unicode="0x0000"/>
- <map adobe-name="fraction" win-ansi="0xA4" unicode="0x0000"/>
- <map adobe-name="infinity" win-ansi="0xA5" unicode="0x0000"/>
- <map adobe-name="florin" win-ansi="0xA6" unicode="0x0000"/>
- <map adobe-name="club" win-ansi="0xA7" unicode="0x0000"/>
- <map adobe-name="diamond" win-ansi="0xA8" unicode="0x0000"/>
- <map adobe-name="heart" win-ansi="0xA9" unicode="0x0000"/>
- <map adobe-name="spade" win-ansi="0xAA" unicode="0x0000"/>
- <map adobe-name="arrowboth" win-ansi="0xAB" unicode="0x0000"/>
- <map adobe-name="arrowleft" win-ansi="0xAC" unicode="0x0000"/>
- <map adobe-name="arrowup" win-ansi="0xAD" unicode="0x0000"/>
- <map adobe-name="arrowright" win-ansi="0xAE" unicode="0x0000"/>
- <map adobe-name="arrowdown" win-ansi="0xAF" unicode="0x0000"/>
- <map adobe-name="degree" win-ansi="0xB0" unicode="0x0000"/>
- <map adobe-name="plusminus" win-ansi="0xB1" unicode="0x0000"/>
- <map adobe-name="second" win-ansi="0xB2" unicode="0x0000"/>
- <map adobe-name="greaterequal" win-ansi="0xB3" unicode="0x0000"/>
- <map adobe-name="multiply" win-ansi="0xB4" unicode="0x0000"/>
- <map adobe-name="proportional" win-ansi="0xB5" unicode="0x0000"/>
- <map adobe-name="partialdiff" win-ansi="0xB6" unicode="0x0000"/>
- <map adobe-name="bullet" win-ansi="0xB7" unicode="0x0000"/>
- <map adobe-name="divide" win-ansi="0xB8" unicode="0x0000"/>
- <map adobe-name="notequal" win-ansi="0xB9" unicode="0x0000"/>
- <map adobe-name="equivalence" win-ansi="0xBA" unicode="0x0000"/>
- <map adobe-name="approxequal" win-ansi="0xBB" unicode="0x0000"/>
- <map adobe-name="ellipsis" win-ansi="0xBC" unicode="0x0000"/>
- <map adobe-name="arrowvertex" win-ansi="0xBD" unicode="0x0000"/>
- <map adobe-name="arrowhorizex" win-ansi="0xBE" unicode="0x0000"/>
- <map adobe-name="carriagereturn" win-ansi="0xBF" unicode="0x0000"/>
- <map adobe-name="aleph" win-ansi="0xC0" unicode="0x0000"/>
- <map adobe-name="Ifraktur" win-ansi="0xC1" unicode="0x0000"/>
- <map adobe-name="Rfraktur" win-ansi="0xC2" unicode="0x0000"/>
- <map adobe-name="weierstrass" win-ansi="0xC3" unicode="0x0000"/>
- <map adobe-name="circlemultiply" win-ansi="0xC4" unicode="0x0000"/>
- <map adobe-name="circleplus" win-ansi="0xC5" unicode="0x0000"/>
- <map adobe-name="emptyset" win-ansi="0xC6" unicode="0x0000"/>
- <map adobe-name="intersection" win-ansi="0xC7" unicode="0x0000"/>
- <map adobe-name="union" win-ansi="0xC8" unicode="0x0000"/>
- <map adobe-name="propersuperset" win-ansi="0xC9" unicode="0x0000"/>
- <map adobe-name="reflexsuperset" win-ansi="0xCA" unicode="0x0000"/>
- <map adobe-name="notsubset" win-ansi="0xCB" unicode="0x0000"/>
- <map adobe-name="propersubset" win-ansi="0xCC" unicode="0x0000"/>
- <map adobe-name="reflexsubset" win-ansi="0xCD" unicode="0x0000"/>
- <map adobe-name="element" win-ansi="0xCE" unicode="0x0000"/>
- <map adobe-name="notelement" win-ansi="0xCF" unicode="0x0000"/>
- <map adobe-name="angle" win-ansi="0xD0" unicode="0x0000"/>
- <map adobe-name="gradient" win-ansi="0xD1" unicode="0x0000"/>
- <map adobe-name="registerserif" win-ansi="0xD2" unicode="0x0000"/>
- <map adobe-name="copyrightserif" win-ansi="0xD3" unicode="0x0000"/>
- <map adobe-name="trademarkserif" win-ansi="0xD4" unicode="0x0000"/>
- <map adobe-name="product" win-ansi="0xD5" unicode="0x0000"/>
- <map adobe-name="radical" win-ansi="0xD6" unicode="0x0000"/>
- <map adobe-name="dotmath" win-ansi="0xD7" unicode="0x0000"/>
- <map adobe-name="logicalnot" win-ansi="0xD8" unicode="0x0000"/>
- <map adobe-name="logicaland" win-ansi="0xD9" unicode="0x0000"/>
- <map adobe-name="logicalor" win-ansi="0xDA" unicode="0x0000"/>
- <map adobe-name="arrowdblboth" win-ansi="0xDB" unicode="0x0000"/>
- <map adobe-name="arrowdblleft" win-ansi="0xDC" unicode="0x0000"/>
- <map adobe-name="arrowdblup" win-ansi="0xDD" unicode="0x0000"/>
- <map adobe-name="arrowdblright" win-ansi="0xDE" unicode="0x0000"/>
- <map adobe-name="arrowdbldown" win-ansi="0xDF" unicode="0x0000"/>
- <map adobe-name="lozenge" win-ansi="0xE0" unicode="0x0000"/>
- <map adobe-name="angleleft" win-ansi="0xE1" unicode="0x0000"/>
- <map adobe-name="registersans" win-ansi="0xE2" unicode="0x0000"/>
- <map adobe-name="copyrightsans" win-ansi="0xE3" unicode="0x0000"/>
- <map adobe-name="trademarksans" win-ansi="0xE4" unicode="0x0000"/>
- <map adobe-name="summation" win-ansi="0xE5" unicode="0x0000"/>
- <map adobe-name="parenlefttp" win-ansi="0xE6" unicode="0x0000"/>
- <map adobe-name="parenleftex" win-ansi="0xE7" unicode="0x0000"/>
- <map adobe-name="parenleftbt" win-ansi="0xE8" unicode="0x0000"/>
- <map adobe-name="bracketlefttp" win-ansi="0xE9" unicode="0x0000"/>
- <map adobe-name="bracketleftex" win-ansi="0xEA" unicode="0x0000"/>
- <map adobe-name="bracketleftbt" win-ansi="0xEB" unicode="0x0000"/>
- <map adobe-name="bracelefttp" win-ansi="0xEC" unicode="0x0000"/>
- <map adobe-name="braceleftmid" win-ansi="0xED" unicode="0x0000"/>
- <map adobe-name="braceleftbt" win-ansi="0xEE" unicode="0x0000"/>
- <map adobe-name="braceex" win-ansi="0xEF" unicode="0x0000"/>
- <map adobe-name="angleright" win-ansi="0xF1" unicode="0x0000"/>
- <map adobe-name="integral" win-ansi="0xF2" unicode="0x0000"/>
- <map adobe-name="integraltp" win-ansi="0xF3" unicode="0x0000"/>
- <map adobe-name="integralex" win-ansi="0xF4" unicode="0x0000"/>
- <map adobe-name="integralbt" win-ansi="0xF5" unicode="0x0000"/>
- <map adobe-name="parenrighttp" win-ansi="0xF6" unicode="0x0000"/>
- <map adobe-name="parenrightex" win-ansi="0xF7" unicode="0x0000"/>
- <map adobe-name="parenrightbt" win-ansi="0xF8" unicode="0x0000"/>
- <map adobe-name="bracketrighttp" win-ansi="0xF9" unicode="0x0000"/>
- <map adobe-name="bracketrightex" win-ansi="0xFA" unicode="0x0000"/>
- <map adobe-name="bracketrightbt" win-ansi="0xFB" unicode="0x0000"/>
- <map adobe-name="bracerighttp" win-ansi="0xFC" unicode="0x0000"/>
- <map adobe-name="bracerightmid" win-ansi="0xFD" unicode="0x0000"/>
- <map adobe-name="bracerightbt" win-ansi="0xFE" unicode="0x0000"/>
- <map adobe-name="apple" win-ansi="-1" unicode="0x0000"/>
+ TBD: remove doublettes -->
+ <map adobe-name="universal" win-ansi="0x22" unicode="0x2200"/>
+ <map adobe-name="numbersign" win-ansi="0x23" unicode="0x0023"/>
+ <map adobe-name="existential" win-ansi="0x24" unicode="0x2203"/>
+ <map adobe-name="percent" win-ansi="0x25" unicode="0x0025"/>
+ <map adobe-name="ampersand" win-ansi="0x26" unicode="0x0026"/>
+ <map adobe-name="suchthat" win-ansi="0x27" unicode="0x220B"/>
+ <map adobe-name="parenleft" win-ansi="0x28" unicode="0x0028"/>
+ <map adobe-name="parenright" win-ansi="0x29" unicode="0x0029"/>
+ <map adobe-name="asteriskmath" win-ansi="0x2A" unicode="0x2217"/>
+ <map adobe-name="plus" win-ansi="0x2B" unicode="0x002B"/>
+ <map adobe-name="comma" win-ansi="0x2C" unicode="0x002C"/>
+ <map adobe-name="minus" win-ansi="0x2D" unicode="0x2212"/>
+ <map adobe-name="period" win-ansi="0x2E" unicode="0x002E"/>
+ <map adobe-name="slash" win-ansi="0x2F" unicode="0x002F"/>
+ <map adobe-name="colon" win-ansi="0x3A" unicode="0x003A"/>
+ <map adobe-name="semicolon" win-ansi="0x3B" unicode="0x003B"/>
+ <map adobe-name="less" win-ansi="0x3C" unicode="0x003C"/>
+ <map adobe-name="equal" win-ansi="0x3D" unicode="0x003D"/>
+ <map adobe-name="greater" win-ansi="0x3E" unicode="0x003E"/>
+ <map adobe-name="question" win-ansi="0x3F" unicode="0x003F"/>
+ <map adobe-name="congruent" win-ansi="0x40" unicode="0x2245"/>
+ <map adobe-name="Alpha" win-ansi="0x41" unicode="0x0391"/>
+ <map adobe-name="Beta" win-ansi="0x42" unicode="0x0392"/>
+ <map adobe-name="Chi" win-ansi="0x43" unicode="0x03A7"/>
+ <map adobe-name="Delta" win-ansi="0x44" unicode="0x2206"/>
+ <map adobe-name="Epsilon" win-ansi="0x45" unicode="0x0395"/>
+ <map adobe-name="Phi" win-ansi="0x46" unicode="0x03A6"/>
+ <map adobe-name="Gamma" win-ansi="0x47" unicode="0x0393"/>
+ <map adobe-name="Eta" win-ansi="0x48" unicode="0x0397"/>
+ <map adobe-name="Iota" win-ansi="0x49" unicode="0x0399"/>
+ <map adobe-name="theta1" win-ansi="0x4A" unicode="0x03D1"/>
+ <map adobe-name="Kappa" win-ansi="0x4B" unicode="0x039A"/>
+ <map adobe-name="Lambda" win-ansi="0x4C" unicode="0x039B"/>
+ <map adobe-name="Mu" win-ansi="0x4D" unicode="0x039C"/>
+ <map adobe-name="Nu" win-ansi="0x4E" unicode="0x039D"/>
+ <map adobe-name="Omicron" win-ansi="0x4F" unicode="0x039F"/>
+ <map adobe-name="Pi" win-ansi="0x50" unicode="0x03A0"/>
+ <map adobe-name="Theta" win-ansi="0x51" unicode="0x0398"/>
+ <map adobe-name="Rho" win-ansi="0x52" unicode="0x03A1"/>
+ <map adobe-name="Sigma" win-ansi="0x53" unicode="0x03A3"/>
+ <map adobe-name="Tau" win-ansi="0x54" unicode="0x03A4"/>
+ <map adobe-name="Upsilon" win-ansi="0x55" unicode="0x03A5"/>
+ <map adobe-name="sigma1" win-ansi="0x56" unicode="0x03C2"/>
+ <map adobe-name="Omega" win-ansi="0x57" unicode="0x2126"/>
+ <map adobe-name="Xi" win-ansi="0x58" unicode="0x039E"/>
+ <map adobe-name="Psi" win-ansi="0x59" unicode="0x03A8"/>
+ <map adobe-name="Zeta" win-ansi="0x5A" unicode="0x0396"/>
+ <map adobe-name="bracketleft" win-ansi="0x5B" unicode="0x005B"/>
+ <map adobe-name="therefore" win-ansi="0x5C" unicode="0x2234"/>
+ <map adobe-name="bracketright" win-ansi="0x5D" unicode="0x005D"/>
+ <map adobe-name="perpendicular" win-ansi="0x5E" unicode="0x22A5"/>
+ <map adobe-name="underscore" win-ansi="0x5F" unicode="0x005F"/>
+ <map adobe-name="radicalex" win-ansi="0x60" unicode="0xF8E5"/>
+ <map adobe-name="alpha" win-ansi="0x61" unicode="0x03B1"/>
+ <map adobe-name="beta" win-ansi="0x62" unicode="0x03B2"/>
+ <map adobe-name="chi" win-ansi="0x63" unicode="0x03C7"/>
+ <map adobe-name="delta" win-ansi="0x64" unicode="0x03B4"/>
+ <map adobe-name="epsilon" win-ansi="0x65" unicode="0x03B5"/>
+ <map adobe-name="phi" win-ansi="0x66" unicode="0x03C6"/>
+ <map adobe-name="gamma" win-ansi="0x67" unicode="0x03B3"/>
+ <map adobe-name="eta" win-ansi="0x68" unicode="0x03B7"/>
+ <map adobe-name="iota" win-ansi="0x69" unicode="0x03B9"/>
+ <map adobe-name="phi1" win-ansi="0x6A" unicode="0x03D5"/>
+ <map adobe-name="kappa" win-ansi="0x6B" unicode="0x03BA"/>
+ <map adobe-name="lambda" win-ansi="0x6C" unicode="0x03BB"/>
+ <map adobe-name="mu" win-ansi="0x6D" unicode="0x00B5"/>
+ <map adobe-name="nu" win-ansi="0x6E" unicode="0x03BD"/>
+ <map adobe-name="omicron" win-ansi="0x6F" unicode="0x03BF"/>
+ <map adobe-name="pi" win-ansi="0x70" unicode="0x03C0"/>
+ <map adobe-name="theta" win-ansi="0x71" unicode="0x03B8"/>
+ <map adobe-name="rho" win-ansi="0x72" unicode="0x03C1"/>
+ <map adobe-name="sigma" win-ansi="0x73" unicode="0x03C3"/>
+ <map adobe-name="tau" win-ansi="0x74" unicode="0x03C4"/>
+ <map adobe-name="upsilon" win-ansi="0x75" unicode="0x03C5"/>
+ <map adobe-name="omega1" win-ansi="0x76" unicode="0x03D6"/>
+ <map adobe-name="omega" win-ansi="0x77" unicode="0x03C9"/>
+ <map adobe-name="xi" win-ansi="0x78" unicode="0x03BE"/>
+ <map adobe-name="psi" win-ansi="0x79" unicode="0x03C8"/>
+ <map adobe-name="zeta" win-ansi="0x7A" unicode="0x03B6"/>
+ <map adobe-name="braceleft" win-ansi="0x7B" unicode="0x007B"/>
+ <map adobe-name="bar" win-ansi="0x7C" unicode="0x007C"/>
+ <map adobe-name="braceright" win-ansi="0x7D" unicode="0x007D"/>
+ <map adobe-name="similar" win-ansi="0x7E" unicode="0x223C"/>
+ <map adobe-name="Upsilon1" win-ansi="0xA1" unicode="0x03D2"/>
+ <map adobe-name="minute" win-ansi="0xA2" unicode="0x2032"/>
+ <map adobe-name="lessequal" win-ansi="0xA3" unicode="0x2264"/>
+ <map adobe-name="fraction" win-ansi="0xA4" unicode="0x2044"/>
+ <map adobe-name="infinity" win-ansi="0xA5" unicode="0x221E"/>
+ <map adobe-name="florin" win-ansi="0xA6" unicode="0x0192"/>
+ <map adobe-name="club" win-ansi="0xA7" unicode="0x2663"/>
+ <map adobe-name="diamond" win-ansi="0xA8" unicode="0x2666"/>
+ <map adobe-name="heart" win-ansi="0xA9" unicode="0x2665"/>
+ <map adobe-name="spade" win-ansi="0xAA" unicode="0x2660"/>
+ <map adobe-name="arrowboth" win-ansi="0xAB" unicode="0x2194"/>
+ <map adobe-name="arrowleft" win-ansi="0xAC" unicode="0x2190"/>
+ <map adobe-name="arrowup" win-ansi="0xAD" unicode="0x2191"/>
+ <map adobe-name="arrowright" win-ansi="0xAE" unicode="0x2192"/>
+ <map adobe-name="arrowdown" win-ansi="0xAF" unicode="0x2193"/>
+ <map adobe-name="degree" win-ansi="0xB0" unicode="0x00B0"/>
+ <map adobe-name="plusminus" win-ansi="0xB1" unicode="0x00B1"/>
+ <map adobe-name="second" win-ansi="0xB2" unicode="0x2033"/>
+ <map adobe-name="greaterequal" win-ansi="0xB3" unicode="0x2265"/>
+ <map adobe-name="multiply" win-ansi="0xB4" unicode="0x00D7"/>
+ <map adobe-name="proportional" win-ansi="0xB5" unicode="0x221D"/>
+ <map adobe-name="partialdiff" win-ansi="0xB6" unicode="0x2202"/>
+ <map adobe-name="bullet" win-ansi="0xB7" unicode="0x2022"/>
+ <map adobe-name="divide" win-ansi="0xB8" unicode="0x00F7"/>
+ <map adobe-name="notequal" win-ansi="0xB9" unicode="0x2260"/>
+ <map adobe-name="equivalence" win-ansi="0xBA" unicode="0x2261"/>
+ <map adobe-name="approxequal" win-ansi="0xBB" unicode="0x2248"/>
+ <map adobe-name="ellipsis" win-ansi="0xBC" unicode="0x2026"/>
+ <map adobe-name="arrowvertex" win-ansi="0xBD" unicode="0xF8E6"/>
+ <map adobe-name="arrowhorizex" win-ansi="0xBE" unicode="0xF8E7"/>
+ <map adobe-name="carriagereturn" win-ansi="0xBF" unicode="0x21B5"/>
+ <map adobe-name="aleph" win-ansi="0xC0" unicode="0x2135"/>
+ <map adobe-name="Ifraktur" win-ansi="0xC1" unicode="0x2111"/>
+ <map adobe-name="Rfraktur" win-ansi="0xC2" unicode="0x211C"/>
+ <map adobe-name="weierstrass" win-ansi="0xC3" unicode="0x2118"/>
+ <map adobe-name="circlemultiply" win-ansi="0xC4" unicode="0x2297"/>
+ <map adobe-name="circleplus" win-ansi="0xC5" unicode="0x2295"/>
+ <map adobe-name="emptyset" win-ansi="0xC6" unicode="0x2205"/>
+ <map adobe-name="intersection" win-ansi="0xC7" unicode="0x2229"/>
+ <map adobe-name="union" win-ansi="0xC8" unicode="0x222A"/>
+ <map adobe-name="propersuperset" win-ansi="0xC9" unicode="0x2283"/>
+ <map adobe-name="reflexsuperset" win-ansi="0xCA" unicode="0x2287"/>
+ <map adobe-name="notsubset" win-ansi="0xCB" unicode="0x2284"/>
+ <map adobe-name="propersubset" win-ansi="0xCC" unicode="0x2282"/>
+ <map adobe-name="reflexsubset" win-ansi="0xCD" unicode="0x2286"/>
+ <map adobe-name="element" win-ansi="0xCE" unicode="0x2208"/>
+ <map adobe-name="notelement" win-ansi="0xCF" unicode="0x2209"/>
+ <map adobe-name="angle" win-ansi="0xD0" unicode="0x2220"/>
+ <map adobe-name="gradient" win-ansi="0xD1" unicode="0x2207"/>
+ <map adobe-name="registerserif" win-ansi="0xD2" unicode="0xF6DA"/>
+ <map adobe-name="copyrightserif" win-ansi="0xD3" unicode="0xF6D9"/>
+ <map adobe-name="trademarkserif" win-ansi="0xD4" unicode="0xF6DB"/>
+ <map adobe-name="product" win-ansi="0xD5" unicode="0x220F"/>
+ <map adobe-name="radical" win-ansi="0xD6" unicode="0x221A"/>
+ <map adobe-name="dotmath" win-ansi="0xD7" unicode="0x22C5"/>
+ <map adobe-name="logicalnot" win-ansi="0xD8" unicode="0x00AC"/>
+ <map adobe-name="logicaland" win-ansi="0xD9" unicode="0x2227"/>
+ <map adobe-name="logicalor" win-ansi="0xDA" unicode="0x2228"/>
+ <map adobe-name="arrowdblboth" win-ansi="0xDB" unicode="0x21D4"/>
+ <map adobe-name="arrowdblleft" win-ansi="0xDC" unicode="0x21D0"/>
+ <map adobe-name="arrowdblup" win-ansi="0xDD" unicode="0x21D1"/>
+ <map adobe-name="arrowdblright" win-ansi="0xDE" unicode="0x21D2"/>
+ <map adobe-name="arrowdbldown" win-ansi="0xDF" unicode="0x21D3"/>
+ <map adobe-name="lozenge" win-ansi="0xE0" unicode="0x25CA"/>
+ <map adobe-name="angleleft" win-ansi="0xE1" unicode="0x2329"/>
+ <map adobe-name="registersans" win-ansi="0xE2" unicode="0xF8E8"/>
+ <map adobe-name="copyrightsans" win-ansi="0xE3" unicode="0xF8E9"/>
+ <map adobe-name="trademarksans" win-ansi="0xE4" unicode="0xF8EA"/>
+ <map adobe-name="summation" win-ansi="0xE5" unicode="0x2211"/>
+ <map adobe-name="parenlefttp" win-ansi="0xE6" unicode="0xF8EB"/>
+ <map adobe-name="parenleftex" win-ansi="0xE7" unicode="0xF8EC"/>
+ <map adobe-name="parenleftbt" win-ansi="0xE8" unicode="0xF8ED"/>
+ <map adobe-name="bracketlefttp" win-ansi="0xE9" unicode="0xF8EE"/>
+ <map adobe-name="bracketleftex" win-ansi="0xEA" unicode="0xF8EF"/>
+ <map adobe-name="bracketleftbt" win-ansi="0xEB" unicode="0xF8F0"/>
+ <map adobe-name="bracelefttp" win-ansi="0xEC" unicode="0xF8F1"/>
+ <map adobe-name="braceleftmid" win-ansi="0xED" unicode="0xF8F2"/>
+ <map adobe-name="braceleftbt" win-ansi="0xEE" unicode="0xF8F3"/>
+ <map adobe-name="braceex" win-ansi="0xEF" unicode="0xF8F4"/>
+ <map adobe-name="angleright" win-ansi="0xF1" unicode="0x232A"/>
+ <map adobe-name="integral" win-ansi="0xF2" unicode="0x222B"/>
+ <map adobe-name="integraltp" win-ansi="0xF3" unicode="0x2320"/>
+ <map adobe-name="integralex" win-ansi="0xF4" unicode="0xF8F5"/>
+ <map adobe-name="integralbt" win-ansi="0xF5" unicode="0x2321"/>
+ <map adobe-name="parenrighttp" win-ansi="0xF6" unicode="0xF8F6"/>
+ <map adobe-name="parenrightex" win-ansi="0xF7" unicode="0xF8F7"/>
+ <map adobe-name="parenrightbt" win-ansi="0xF8" unicode="0xF8F8"/>
+ <map adobe-name="bracketrighttp" win-ansi="0xF9" unicode="0xF8F9"/>
+ <map adobe-name="bracketrightex" win-ansi="0xFA" unicode="0xF8FA"/>
+ <map adobe-name="bracketrightbt" win-ansi="0xFB" unicode="0xF8FB"/>
+ <map adobe-name="bracerighttp" win-ansi="0xFC" unicode="0xF8FC"/>
+ <map adobe-name="bracerightmid" win-ansi="0xFD" unicode="0xF8FD"/>
+ <map adobe-name="bracerightbt" win-ansi="0xFE" unicode="0xF8FE"/>
+ <map adobe-name="apple" win-ansi="-1" unicode="0xF8FE"/>
</font-mappings>
1.6 +3 -1 xml-fop/src/codegen/properties.xsl
Index: properties.xsl
===================================================================
RCS file: /home/cvs/xml-fop/src/codegen/properties.xsl,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- properties.xsl 2000/03/06 21:34:41 1.5
+++ properties.xsl 2000/06/27 22:13:00 1.6
@@ -13,6 +13,7 @@
import org.apache.fop.datatypes.*;
import org.apache.fop.fo.*;
import org.apache.fop.apps.FOPException;
+import org.apache.fop.messaging.MessageHandler;
public class <xsl:value-of select="class-name"/> extends Property {
@@ -80,6 +81,7 @@
import org.apache.fop.datatypes.*;
import org.apache.fop.fo.*;
import org.apache.fop.apps.FOPException;
+import org.apache.fop.messaging.MessageHandler;
public class <xsl:value-of select="class-name"/> extends Property {
<xsl:for-each select="datatype/enumeration/value">
@@ -94,7 +96,7 @@
if (value.equals("<xsl:value-of select="."/>")) { v = <xsl:value-of select="@const"/>; }
else</xsl:for-each>
{
- System.err.println("WARNING: Unknown value for <xsl:value-of select="name"/>: " + value);
+ MessageHandler.errorln("WARNING: Unknown value for <xsl:value-of select="name"/>: " + value);
return make(propertyList, "<xsl:value-of select="default"/>");
}
return new <xsl:value-of select="class-name"/>(propertyList, v);
1.5 +13 -13 xml-fop/src/org/apache/fop/apps/AWTCommandLine.java
Index: AWTCommandLine.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/apps/AWTCommandLine.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- AWTCommandLine.java 2000/04/04 09:46:57 1.4
+++ AWTCommandLine.java 2000/06/27 22:13:02 1.5
@@ -6,11 +6,11 @@
Rainer Steinkuhle: Rainer.Steinkuhle@jcatalog.com,
Stanislav Gorkhover: Stanislav.Gorkhover@jcatalog.com
*/
-
-
+import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.viewer.*;
import org.apache.fop.render.awt.*;
+
import javax.swing.UIManager;
import java.awt.*;
@@ -72,7 +72,7 @@
if (parser == null) {
- System.err.println("ERROR: Unable to create SAX parser");
+ MessageHandler.errorln("ERROR: Unable to create SAX parser");
System.exit(1);
}
@@ -102,8 +102,8 @@
frame.progress(resource.getString("Show"));
} catch (Exception e) {
- System.err.println("FATAL ERROR: " + e.getMessage());
- e.printStackTrace();
+ MessageHandler.errorln("FATAL ERROR: " + e.getMessage());
+ e.printStackTrace();
System.exit(1);
}
}
@@ -115,20 +115,20 @@
if (parserClassName == null) {
parserClassName = "com.jclark.xml.sax.Driver";
}
- System.err.println("using SAX parser " + parserClassName);
+ MessageHandler.errorln("using SAX parser " + parserClassName);
try {
return (Parser)
Class.forName(parserClassName).newInstance();
} catch (ClassNotFoundException e) {
- System.err.println("Could not find " + parserClassName);
+ MessageHandler.errorln("Could not find " + parserClassName);
} catch (InstantiationException e) {
- System.err.println("Could not instantiate "
+ MessageHandler.errorln("Could not instantiate "
+ parserClassName);
} catch (IllegalAccessException e) {
- System.err.println("Could not access " + parserClassName);
+ MessageHandler.errorln("Could not access " + parserClassName);
} catch (ClassCastException e) {
- System.err.println(parserClassName + " is not a SAX driver");
+ MessageHandler.errorln(parserClassName + " is not a SAX driver");
}
return null;
}
@@ -186,7 +186,7 @@
URL url = getClass().getResource(path);
in = url.openStream();
} catch(Exception ex) {
- System.out.println("Can't find URL to: <" + path + "> " + ex.getMessage());
+ MessageHandler.logln("Can't find URL to: <" + path + "> " + ex.getMessage());
}
return new SecureResourceBundle(in);
}
@@ -205,9 +205,9 @@
String language = null;
String imageDir = null;
- System.err.println(Version.getVersion());
+ MessageHandler.errorln(Version.getVersion());
if (args.length < 1 || args.length > 3) {
- System.err.println("usage: java AWTCommandLine " +
+ MessageHandler.errorln("usage: java AWTCommandLine " +
"formatting-object-file [language] ");
System.exit(1);
}
1.8 +16 -10 xml-fop/src/org/apache/fop/apps/CommandLine.java
Index: CommandLine.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/apps/CommandLine.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- CommandLine.java 2000/01/25 13:51:17 1.7
+++ CommandLine.java 2000/06/27 22:13:02 1.8
@@ -1,4 +1,4 @@
-/*-- $Id: CommandLine.java,v 1.7 2000/01/25 13:51:17 fotis Exp $ --
+/*-- $Id: CommandLine.java,v 1.8 2000/06/27 22:13:02 fotis Exp $ --
============================================================================
The Apache Software License, Version 1.1
@@ -65,6 +65,10 @@
import java.io.FileNotFoundException;
import java.net.URL;
+// FOP
+import org.apache.fop.messaging.MessageHandler;
+
+
/**
* mainline class.
*
@@ -86,20 +90,20 @@
if (parserClassName == null) {
parserClassName = "org.apache.xerces.parsers.SAXParser";
}
- System.err.println("using SAX parser " + parserClassName);
+ org.apache.fop.messaging.MessageHandler.logln("using SAX parser " + parserClassName);
try {
return (Parser)
Class.forName(parserClassName).newInstance();
} catch (ClassNotFoundException e) {
- System.err.println("Could not find " + parserClassName);
+ org.apache.fop.messaging.MessageHandler.errorln("Could not find " + parserClassName);
} catch (InstantiationException e) {
- System.err.println("Could not instantiate "
+ org.apache.fop.messaging.MessageHandler.errorln("Could not instantiate "
+ parserClassName);
} catch (IllegalAccessException e) {
- System.err.println("Could not access " + parserClassName);
+ org.apache.fop.messaging.MessageHandler.errorln("Could not access " + parserClassName);
} catch (ClassCastException e) {
- System.err.println(parserClassName + " is not a SAX driver");
+ org.apache.fop.messaging.MessageHandler.errorln(parserClassName + " is not a SAX driver");
}
return null;
}
@@ -139,10 +143,12 @@
*/
public static void main(String[] args) {
String version = Version.getVersion();
- System.err.println(version);
+ MessageHandler.errorln(version);
+
+
if (args.length != 2) {
- System.err.println("usage: java "
+ MessageHandler.errorln("usage: java "
+ "org.apache.fop.apps.CommandLine "
+ "formatting-object-file pdf-file");
System.exit(1);
@@ -151,7 +157,7 @@
Parser parser = createParser();
if (parser == null) {
- System.err.println("ERROR: Unable to create SAX parser");
+ MessageHandler.errorln("ERROR: Unable to create SAX parser");
System.exit(1);
}
@@ -165,7 +171,7 @@
driver.format();
driver.render();
} catch (Exception e) {
- System.err.println("FATAL ERROR: " + e.getMessage());
+ MessageHandler.errorln("FATAL ERROR: " + e.getMessage());
System.exit(1);
}
}
1.8 +12 -11 xml-fop/src/org/apache/fop/apps/Driver.java
Index: Driver.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/apps/Driver.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- Driver.java 2000/06/21 01:18:03 1.7
+++ Driver.java 2000/06/27 22:13:03 1.8
@@ -1,4 +1,4 @@
-/*-- $Id: Driver.java,v 1.7 2000/06/21 01:18:03 jordan Exp $ --
+/*-- $Id: Driver.java,v 1.8 2000/06/27 22:13:03 fotis Exp $ --
============================================================================
The Apache Software License, Version 1.1
@@ -57,6 +57,7 @@
import org.apache.fop.layout.AreaTree;
import org.apache.fop.layout.FontInfo;
import org.apache.fop.render.Renderer;
+import org.apache.fop.messaging.MessageHandler;
// DOM
import org.w3c.dom.Document;
@@ -149,20 +150,20 @@
* instantiate the Renderer class
*/
protected Renderer createRenderer(String rendererClassName) {
- System.err.println("using renderer " + rendererClassName);
+ MessageHandler.logln("using renderer " + rendererClassName);
try {
return (Renderer)
Class.forName(rendererClassName).newInstance();
} catch (ClassNotFoundException e) {
- System.err.println("Could not find " + rendererClassName);
+ MessageHandler.errorln("Could not find " + rendererClassName);
} catch (InstantiationException e) {
- System.err.println("Could not instantiate "
+ MessageHandler.errorln("Could not instantiate "
+ rendererClassName);
} catch (IllegalAccessException e) {
- System.err.println("Could not access " + rendererClassName);
+ MessageHandler.errorln("Could not access " + rendererClassName);
} catch (ClassCastException e) {
- System.err.println(rendererClassName + " is not a renderer");
+ MessageHandler.errorln(rendererClassName + " is not a renderer");
}
return null;
}
@@ -188,20 +189,20 @@
* instantiate element mapping class
*/
protected ElementMapping createElementMapping(String mappingClassName) {
- System.err.println("using element mapping " + mappingClassName);
+ MessageHandler.logln("using element mapping " + mappingClassName);
try {
return (ElementMapping)
Class.forName(mappingClassName).newInstance();
} catch (ClassNotFoundException e) {
- System.err.println("Could not find " + mappingClassName);
+ MessageHandler.errorln("Could not find " + mappingClassName);
} catch (InstantiationException e) {
- System.err.println("Could not instantiate "
+ MessageHandler.errorln("Could not instantiate "
+ mappingClassName);
} catch (IllegalAccessException e) {
- System.err.println("Could not access " + mappingClassName);
+ MessageHandler.errorln("Could not access " + mappingClassName);
} catch (ClassCastException e) {
- System.err.println(mappingClassName + " is not an element mapping");
+ MessageHandler.errorln(mappingClassName + " is not an element mapping");
}
return null;
}
1.3 +11 -10 xml-fop/src/org/apache/fop/apps/PDFOutputHandler.java
Index: PDFOutputHandler.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/apps/PDFOutputHandler.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- PDFOutputHandler.java 2000/06/21 01:19:11 1.2
+++ PDFOutputHandler.java 2000/06/27 22:13:04 1.3
@@ -10,6 +10,7 @@
import org.apache.fop.layout.AreaTree;
import org.apache.fop.layout.FontInfo;
import org.apache.fop.render.Renderer;
+import org.apache.fop.messaging.MessageHandler;
//////////////////////////////////////////////////////////////////////////////////////
/**
@@ -138,20 +139,20 @@
* instantiate element mapping class
*/
protected ElementMapping createElementMapping(String mappingClassName) {
- System.err.println("using element mapping " + mappingClassName);
+ MessageHandler.logln("using element mapping " + mappingClassName);
try {
return (ElementMapping)
Class.forName(mappingClassName).newInstance();
} catch (ClassNotFoundException e) {
- System.err.println("Could not find " + mappingClassName);
+ MessageHandler.errorln("Could not find " + mappingClassName);
} catch (InstantiationException e) {
- System.err.println("Could not instantiate "
+ MessageHandler.errorln("Could not instantiate "
+ mappingClassName);
} catch (IllegalAccessException e) {
- System.err.println("Could not access " + mappingClassName);
+ MessageHandler.errorln("Could not access " + mappingClassName);
} catch (ClassCastException e) {
- System.err.println(mappingClassName + " is not an element mapping");
+ MessageHandler.errorln(mappingClassName + " is not an element mapping");
}
return null;
}
@@ -162,20 +163,20 @@
* instantiate the Renderer class
*/
protected Renderer createRenderer(String rendererClassName) {
- System.err.println("using renderer " + rendererClassName);
+ MessageHandler.logln("using renderer " + rendererClassName);
try {
return (Renderer)
Class.forName(rendererClassName).newInstance();
} catch (ClassNotFoundException e) {
- System.err.println("Could not find " + rendererClassName);
+ MessageHandler.errorln("Could not find " + rendererClassName);
} catch (InstantiationException e) {
- System.err.println("Could not instantiate "
+ MessageHandler.errorln("Could not instantiate "
+ rendererClassName);
} catch (IllegalAccessException e) {
- System.err.println("Could not access " + rendererClassName);
+ MessageHandler.errorln("Could not access " + rendererClassName);
} catch (ClassCastException e) {
- System.err.println(rendererClassName + " is not a renderer");
+ MessageHandler.errorln(rendererClassName + " is not a renderer");
}
return null;
}
1.2 +187 -186 xml-fop/src/org/apache/fop/apps/PrintCommandLine.java
Index: PrintCommandLine.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/apps/PrintCommandLine.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- PrintCommandLine.java 2000/04/04 09:45:11 1.1
+++ PrintCommandLine.java 2000/06/27 22:13:05 1.2
@@ -1,186 +1,187 @@
-package org.apache.fop.apps;
-
-/*
- originally contributed by
- Stanislav Gorkhover: stanislav.gorkhover@jcatalog.com
- jCatalog Software AG
- */
-
-
-import org.xml.sax.Parser;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-import java.awt.Graphics;
-import java.awt.print.*;
-import java.io.PrintWriter;
-import java.io.IOException;
-import java.util.Vector;
-
-import org.apache.fop.render.awt.AWTRenderer;
-import org.apache.fop.layout.AreaTree;
-import org.apache.fop.layout.Page;
-
-
-/**
- * This class prints a xsl-fo dokument without interaction.
- * At the moment java has not the possibility to configure the printer and it's
- * options without interaction (30.03.2000).
- * This class allows to print a set of pages (from-to), even/odd pages and many copies.
- * - Print from page xxx: property name - start, value int
- * - Print to page xxx: property name - end, value int
- * - Print even/odd pages: property name - even, value boolean
- * - Print xxx copies: property name - copies, value int
- *
- */
-public class PrintCommandLine extends CommandLine {
-
-
- public static void main(String[] args) {
-
- String version = Version.getVersion();
- System.err.println(version);
-
- if (args.length != 1) {
- System.err.println("usage: java [-Dstart=i] [-Dend=i]"
- + " [-Dcopies=i] [-Deven=true|false]"
- + " org.apache.fop.apps.PrintCommandLine formatting-object-file");
- System.exit(1);
- }
-
- Parser parser = createParser();
-
- if (parser == null) {
- System.err.println("ERROR: Unable to create SAX parser");
- System.exit(1);
- }
-
- PrintRenderer renderer = new PrintRenderer();
- try {
- Driver driver = new Driver();
-
- driver.setRenderer(renderer);
- driver.addElementMapping("org.apache.fop.fo.StandardElementMapping");
- driver.addElementMapping("org.apache.fop.svg.SVGElementMapping");
- driver.buildFOTree(parser, fileInputSource(args[0]));
- driver.format();
- driver.render();
- } catch (Exception e) {
- System.err.println("FATAL ERROR: " + e.getMessage());
- System.exit(1);
- }
-
- int copies = PrintRenderer.getIntProperty("copies", 1);
- renderer.setCopies(copies);
-
- PrinterJob pj = PrinterJob.getPrinterJob();
- pj.setPageable(renderer);
-
- pj.setCopies(copies);
- try {
- pj.print();
- } catch(PrinterException pe) {
- pe.printStackTrace();
- }
- }
-
-
- static class PrintRenderer extends AWTRenderer {
-
- static int EVEN_AND_ALL = 0;
- static int EVEN = 1;
- static int ODD = 2;
-
- int startNumber;
- int endNumber;
- int mode = EVEN_AND_ALL;
- int copies = 1;
-
- PrintRenderer() {
- super(null);
-
- startNumber = getIntProperty("start", 1) - 1;
- endNumber = getIntProperty("end", -1);
-
- mode = EVEN_AND_ALL;
- String str = System.getProperty("even");
- if (str != null) {
- try {
- mode = Boolean.valueOf(str).booleanValue() ? EVEN : ODD;
- } catch (Exception e) {
- }
- }
-
- }
-
-
- static int getIntProperty(String name, int def) {
- String propValue = System.getProperty(name);
- if (propValue != null) {
- try {
- return Integer.parseInt(propValue);
- } catch(Exception e) {
- return def;
- }
- }
- else {
- return def;
- }
- }
-
- public void render(AreaTree areaTree, PrintWriter writer) throws IOException {
- tree = areaTree;
- if (endNumber == -1) {
- endNumber = tree.getPages().size();
- }
-
- Vector numbers = getInvalidPageNumbers();
- for (int i = numbers.size() - 1; i > -1; i--)
- tree.getPages().removeElementAt(Integer.parseInt((String)numbers.elementAt(i)));
-
- }
-
- public void renderPage(Page page) {
- pageWidth = (int)((float)page.getWidth() / 1000f);
- pageHeight = (int)((float)page.getHeight() / 1000f);
- super.renderPage(page);
- }
-
-
- private Vector getInvalidPageNumbers() {
-
- Vector vec = new Vector();
- int max = tree.getPages().size();
- boolean isValid;
- for (int i = 0; i < max; i++) {
- isValid = true;
- if (i < startNumber || i > endNumber) {
- isValid = false;
- }
- else if (mode != EVEN_AND_ALL) {
- if (mode == EVEN && ((i + 1) % 2 != 0))
- isValid = false;
- else if (mode == ODD && ((i + 1) % 2 != 1))
- isValid = false;
- }
-
- if (!isValid)
- vec.add(i + "");
- }
-
- return vec;
- }
-
- void setCopies(int val) {
- copies = val;
- Vector copie = tree.getPages();
- for (int i = 1; i < copies; i++) {
- tree.getPages().addAll(copie);
- }
-
- }
-
- } // class PrintRenderer
-} // class PrintCommandLine
-
+package org.apache.fop.apps;
+
+/*
+ originally contributed by
+ Stanislav Gorkhover: stanislav.gorkhover@jcatalog.com
+ jCatalog Software AG
+ */
+
+
+import org.xml.sax.Parser;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
+import java.awt.Graphics;
+import java.awt.print.*;
+import java.io.PrintWriter;
+import java.io.IOException;
+import java.util.Vector;
+
+import org.apache.fop.render.awt.AWTRenderer;
+import org.apache.fop.layout.AreaTree;
+import org.apache.fop.layout.Page;
+import org.apache.fop.messaging.MessageHandler;
+
+
+/**
+ * This class prints a xsl-fo dokument without interaction.
+ * At the moment java has not the possibility to configure the printer and it's
+ * options without interaction (30.03.2000).
+ * This class allows to print a set of pages (from-to), even/odd pages and many copies.
+ * - Print from page xxx: property name - start, value int
+ * - Print to page xxx: property name - end, value int
+ * - Print even/odd pages: property name - even, value boolean
+ * - Print xxx copies: property name - copies, value int
+ *
+ */
+public class PrintCommandLine extends CommandLine {
+
+
+ public static void main(String[] args) {
+
+ String version = Version.getVersion();
+ MessageHandler.errorln(version);
+
+ if (args.length != 1) {
+ MessageHandler.errorln("usage: java [-Dstart=i] [-Dend=i]"
+ + " [-Dcopies=i] [-Deven=true|false]"
+ + " org.apache.fop.apps.PrintCommandLine formatting-object-file");
+ System.exit(1);
+ }
+
+ Parser parser = createParser();
+
+ if (parser == null) {
+ MessageHandler.errorln("ERROR: Unable to create SAX parser");
+ System.exit(1);
+ }
+
+ PrintRenderer renderer = new PrintRenderer();
+ try {
+ Driver driver = new Driver();
+
+ driver.setRenderer(renderer);
+ driver.addElementMapping("org.apache.fop.fo.StandardElementMapping");
+ driver.addElementMapping("org.apache.fop.svg.SVGElementMapping");
+ driver.buildFOTree(parser, fileInputSource(args[0]));
+ driver.format();
+ driver.render();
+ } catch (Exception e) {
+ MessageHandler.errorln("FATAL ERROR: " + e.getMessage());
+ System.exit(1);
+ }
+
+ int copies = PrintRenderer.getIntProperty("copies", 1);
+ renderer.setCopies(copies);
+
+ PrinterJob pj = PrinterJob.getPrinterJob();
+ pj.setPageable(renderer);
+
+ pj.setCopies(copies);
+ try {
+ pj.print();
+ } catch(PrinterException pe) {
+ pe.printStackTrace();
+ }
+ }
+
+
+ static class PrintRenderer extends AWTRenderer {
+
+ static int EVEN_AND_ALL = 0;
+ static int EVEN = 1;
+ static int ODD = 2;
+
+ int startNumber;
+ int endNumber;
+ int mode = EVEN_AND_ALL;
+ int copies = 1;
+
+ PrintRenderer() {
+ super(null);
+
+ startNumber = getIntProperty("start", 1) - 1;
+ endNumber = getIntProperty("end", -1);
+
+ mode = EVEN_AND_ALL;
+ String str = System.getProperty("even");
+ if (str != null) {
+ try {
+ mode = Boolean.valueOf(str).booleanValue() ? EVEN : ODD;
+ } catch (Exception e) {
+ }
+ }
+
+ }
+
+
+ static int getIntProperty(String name, int def) {
+ String propValue = System.getProperty(name);
+ if (propValue != null) {
+ try {
+ return Integer.parseInt(propValue);
+ } catch(Exception e) {
+ return def;
+ }
+ }
+ else {
+ return def;
+ }
+ }
+
+ public void render(AreaTree areaTree, PrintWriter writer) throws IOException {
+ tree = areaTree;
+ if (endNumber == -1) {
+ endNumber = tree.getPages().size();
+ }
+
+ Vector numbers = getInvalidPageNumbers();
+ for (int i = numbers.size() - 1; i > -1; i--)
+ tree.getPages().removeElementAt(Integer.parseInt((String)numbers.elementAt(i)));
+
+ }
+
+ public void renderPage(Page page) {
+ pageWidth = (int)((float)page.getWidth() / 1000f);
+ pageHeight = (int)((float)page.getHeight() / 1000f);
+ super.renderPage(page);
+ }
+
+
+ private Vector getInvalidPageNumbers() {
+
+ Vector vec = new Vector();
+ int max = tree.getPages().size();
+ boolean isValid;
+ for (int i = 0; i < max; i++) {
+ isValid = true;
+ if (i < startNumber || i > endNumber) {
+ isValid = false;
+ }
+ else if (mode != EVEN_AND_ALL) {
+ if (mode == EVEN && ((i + 1) % 2 != 0))
+ isValid = false;
+ else if (mode == ODD && ((i + 1) % 2 != 1))
+ isValid = false;
+ }
+
+ if (!isValid)
+ vec.add(i + "");
+ }
+
+ return vec;
+ }
+
+ void setCopies(int val) {
+ copies = val;
+ Vector copie = tree.getPages();
+ for (int i = 1; i < copies; i++) {
+ tree.getPages().addAll(copie);
+ }
+
+ }
+
+ } // class PrintRenderer
+} // class PrintCommandLine
+
1.7 +6 -5 xml-fop/src/org/apache/fop/apps/XTCommandLine.java
Index: XTCommandLine.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/apps/XTCommandLine.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- XTCommandLine.java 1999/12/03 08:36:49 1.6
+++ XTCommandLine.java 2000/06/27 22:13:06 1.7
@@ -1,4 +1,4 @@
-/*-- $Id: XTCommandLine.java,v 1.6 1999/12/03 08:36:49 jtauber Exp $ --
+/*-- $Id: XTCommandLine.java,v 1.7 2000/06/27 22:13:06 fotis Exp $ --
============================================================================
The Apache Software License, Version 1.1
@@ -54,6 +54,7 @@
import org.apache.fop.render.pdf.PDFRenderer;
import org.apache.fop.fo.StandardElementMapping;
import org.apache.fop.svg.SVGElementMapping;
+import org.apache.fop.messaging.MessageHandler;
// James Clark
import com.jclark.xsl.sax.XSLProcessor;
@@ -92,17 +93,17 @@
*/
public static void main(String[] args) {
String version = Version.getVersion();
- System.err.println(version);
+ MessageHandler.errorln(version);
if (args.length != 3) {
- System.err.println("usage: java org.apache.fop.apps.XTCommandLine xml-file xsl-stylesheet pdf-file");
+ MessageHandler.errorln("usage: java org.apache.fop.apps.XTCommandLine xml-file xsl-stylesheet pdf-file");
System.exit(1);
}
Parser parser = createParser();
if (parser == null) {
- System.err.println("ERROR: Unable to create SAX parser");
+ MessageHandler.errorln("ERROR: Unable to create SAX parser");
System.exit(1);
}
@@ -122,7 +123,7 @@
driver.format();
driver.render();
} catch (Exception e) {
- System.err.println("FATAL ERROR: " + e.getMessage());
+ MessageHandler.errorln("FATAL ERROR: " + e.getMessage());
System.exit(1);
}
}
1.8 +6 -5 xml-fop/src/org/apache/fop/datatypes/ColorType.java
Index: ColorType.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/datatypes/ColorType.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ColorType.java 2000/04/17 19:07:31 1.7
+++ ColorType.java 2000/06/27 22:13:10 1.8
@@ -1,4 +1,4 @@
-/*-- $Id: ColorType.java,v 1.7 2000/04/17 19:07:31 gears Exp $ --
+/*-- $Id: ColorType.java,v 1.8 2000/06/27 22:13:10 fotis Exp $ --
============================================================================
The Apache Software License, Version 1.1
@@ -51,6 +51,7 @@
package org.apache.fop.datatypes;
import java.util.*;
+import org.apache.fop.messaging.MessageHandler;
/**
* a colour quantity in XSL
@@ -90,13 +91,13 @@
this.red = 0;
this.green = 0;
this.blue = 0;
- System.err.println("ERROR: unknown colour format. Must be #RGB or #RRGGBB");
+ MessageHandler.errorln("ERROR: unknown colour format. Must be #RGB or #RRGGBB");
}
} catch (Exception e) {
this.red = 0;
this.green = 0;
this.blue = 0;
- System.err.println("ERROR: unknown colour format. Must be #RGB or #RRGGBB");
+ MessageHandler.errorln("ERROR: unknown colour format. Must be #RGB or #RRGGBB");
}
} else if (value.startsWith("rgb(")) {
int poss = value.indexOf("(");
@@ -133,7 +134,7 @@
this.red = 0;
this.green = 0;
this.blue = 0;
- System.err.println("ERROR: unknown colour format. Must be #RGB or #RRGGBB");
+ MessageHandler.errorln("ERROR: unknown colour format. Must be #RGB or #RRGGBB");
}
}
} else if (value.startsWith("url(")) {
@@ -217,7 +218,7 @@
this.red = 0;
this.green = 0;
this.blue = 0;
- System.err.println("ERROR: unknown colour name: " + value);
+ MessageHandler.errorln("ERROR: unknown colour name: " + value);
}
}
}
1.7 +4 -3 xml-fop/src/org/apache/fop/datatypes/Length.java
Index: Length.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/datatypes/Length.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- Length.java 2000/03/07 09:47:31 1.6
+++ Length.java 2000/06/27 22:13:10 1.7
@@ -1,4 +1,4 @@
-/*-- $Id: Length.java,v 1.6 2000/03/07 09:47:31 fotis Exp $ --
+/*-- $Id: Length.java,v 1.7 2000/06/27 22:13:10 fotis Exp $ --
============================================================================
The Apache Software License, Version 1.1
@@ -51,6 +51,7 @@
package org.apache.fop.datatypes;
import org.apache.fop.fo.Property;
+import org.apache.fop.messaging.MessageHandler;
/**
* a length quantity in XSL
@@ -95,7 +96,7 @@
int l = len.length();
if (l == 0) {
- System.err.println("WARNING: empty length");
+ MessageHandler.errorln("WARNING: empty length");
this.millipoints = 0;
} else if (len.equals("auto")) {
this.auto = true;
@@ -120,7 +121,7 @@
dvalue = dvalue * assumed_resolution;
else {
dvalue = 0;
- System.err.println("ERROR: unknown length units in "
+ MessageHandler.errorln("ERROR: unknown length units in "
+ len);
}
1.8 +3 -2 xml-fop/src/org/apache/fop/fo/FOText.java
Index: FOText.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/FOText.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- FOText.java 1999/12/03 08:12:57 1.7
+++ FOText.java 2000/06/27 22:13:15 1.8
@@ -1,4 +1,4 @@
-/*-- $Id: FOText.java,v 1.7 1999/12/03 08:12:57 jtauber Exp $ --
+/*-- $Id: FOText.java,v 1.8 2000/06/27 22:13:15 fotis Exp $ --
============================================================================
The Apache Software License, Version 1.1
@@ -53,6 +53,7 @@
// FOP
import org.apache.fop.layout.Area;
+import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.layout.BlockArea;
import org.apache.fop.layout.FontState;
import org.apache.fop.datatypes.*;
@@ -86,7 +87,7 @@
public Status layout(Area area) throws FOPException {
if (!(area instanceof BlockArea)) {
- System.err.println("WARNING: text outside block area" + new String(ca, start, length));
+ MessageHandler.errorln("WARNING: text outside block area" + new String(ca, start, length));
return new Status(Status.OK);
}
if (this.marker == START) {
1.6 +5 -4 xml-fop/src/org/apache/fop/fo/FOTreeBuilder.java
Index: FOTreeBuilder.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/FOTreeBuilder.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- FOTreeBuilder.java 1999/11/22 02:31:24 1.5
+++ FOTreeBuilder.java 2000/06/27 22:13:16 1.6
@@ -1,4 +1,4 @@
-/*-- $Id: FOTreeBuilder.java,v 1.5 1999/11/22 02:31:24 jtauber Exp $ --
+/*-- $Id: FOTreeBuilder.java,v 1.6 2000/06/27 22:13:16 fotis Exp $ --
============================================================================
The Apache Software License, Version 1.1
@@ -52,6 +52,7 @@
// FOP
import org.apache.fop.layout.AreaTree;
+import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.apps.FOPException;
import org.apache.fop.fo.pagination.Root;
@@ -178,7 +179,7 @@
/** SAX Handler for the start of the document */
public void startDocument() {
- System.err.println("building formatting object tree");
+ MessageHandler.logln("building formatting object tree");
}
/** SAX Handler for the start of an element */
@@ -212,7 +213,7 @@
if (fobjMaker == null) {
if (!this.unknownFOs.containsKey(fullName)) {
this.unknownFOs.put(fullName, "");
- System.err.println("WARNING: Unknown formatting object "
+ MessageHandler.errorln("WARNING: Unknown formatting object "
+ fullName);
}
fobjMaker = new FObjMixed.Maker(); // fall back
@@ -248,7 +249,7 @@
*/
public void format(AreaTree areaTree)
throws FOPException {
- System.err.println("formatting FOs into areas");
+ MessageHandler.logln("formatting FOs into areas");
((Root) this.rootFObj).format(areaTree);
}
}
1.6 +3 -2 xml-fop/src/org/apache/fop/fo/PropertyList.java
Index: PropertyList.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/PropertyList.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- PropertyList.java 1999/11/22 02:31:27 1.5
+++ PropertyList.java 2000/06/27 22:13:16 1.6
@@ -1,4 +1,4 @@
-/*-- $Id: PropertyList.java,v 1.5 1999/11/22 02:31:27 jtauber Exp $ --
+/*-- $Id: PropertyList.java,v 1.6 2000/06/27 22:13:16 fotis Exp $ --
============================================================================
The Apache Software License, Version 1.1
@@ -51,6 +51,7 @@
package org.apache.fop.fo;
import java.util.Hashtable;
+import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.apps.FOPException;
@@ -65,7 +66,7 @@
public Property get(String propertyName) {
if (builder == null)
- System.err.println("OH OH, builder has not been set");
+ MessageHandler.errorln("OH OH, builder has not been set");
Property p = (Property)super.get(propertyName);
if (p == null) { // if not explicit
1.14 +6 -5 xml-fop/src/org/apache/fop/fo/PropertyListBuilder.java
Index: PropertyListBuilder.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/PropertyListBuilder.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- PropertyListBuilder.java 2000/06/21 01:22:09 1.13
+++ PropertyListBuilder.java 2000/06/27 22:13:17 1.14
@@ -1,4 +1,4 @@
-/*-- $Id: PropertyListBuilder.java,v 1.13 2000/06/21 01:22:09 jordan Exp $ --
+/*-- $Id: PropertyListBuilder.java,v 1.14 2000/06/27 22:13:17 fotis Exp $ --
============================================================================
The Apache Software License, Version 1.1
@@ -52,6 +52,7 @@
package org.apache.fop.fo;
import org.apache.fop.fo.properties.*;
+import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.svg.*;
import org.apache.fop.apps.FOPException;
@@ -177,7 +178,7 @@
if (propertyMaker != null) {
p = propertyMaker.compute(propertyList);
} else {
- System.err.println("WARNING: property " + propertyName + " ignored");
+ MessageHandler.errorln("WARNING: property " + propertyName + " ignored");
}
return p;
}
@@ -189,7 +190,7 @@
if (propertyMaker != null) {
b = propertyMaker.isInherited();
} else {
- //System.err.println("WARNING: Unknown property " + propertyName);
+ //MessageHandler.errorln("WARNING: Unknown property " + propertyName);
b = true;
}
return b;
@@ -206,7 +207,7 @@
if (propertyMaker != null) {
p.put(attributeName,propertyMaker.make(p,attributes.getValue(i)));
} else {
- //System.err.println("WARNING: property " + attributeName + " ignored");
+ //MessageHandler.errorln("WARNING: property " + attributeName + " ignored");
}
}
@@ -221,7 +222,7 @@
if (propertyMaker != null) {
p = propertyMaker.make(propertyList);
} else {
- System.err.println("WARNING: property " + propertyName + " ignored");
+ MessageHandler.errorln("WARNING: property " + propertyName + " ignored");
}
return p;
}
1.14 +4 -3 xml-fop/src/org/apache/fop/fo/flow/Block.java
Index: Block.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/Block.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- Block.java 2000/06/22 00:05:59 1.13
+++ Block.java 2000/06/27 22:13:32 1.14
@@ -1,4 +1,4 @@
-/*-- $Id: Block.java,v 1.13 2000/06/22 00:05:59 jordan Exp $ --
+/*-- $Id: Block.java,v 1.14 2000/06/27 22:13:32 fotis Exp $ --
============================================================================
The Apache Software License, Version 1.1
@@ -53,6 +53,7 @@
// FOP
import org.apache.fop.fo.*;
+import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.fo.properties.*;
import org.apache.fop.layout.*;
import org.apache.fop.datatypes.*;
@@ -104,7 +105,7 @@
}
public Status layout(Area area) throws FOPException {
- // System.err.print(" b:LAY[" + marker + "] ");
+ // MessageHandler.error(" b:LAY[" + marker + "] ");
if (this.marker == BREAK_AFTER) {
return new Status(Status.OK);
@@ -289,7 +290,7 @@
return new Status(Status.KEEP_WITH_NEXT);
}
- //System.err.print(" b:OK" + marker + " ");
+ //MessageHandler.error(" b:OK" + marker + " ");
return new Status(Status.OK);
}
1.11 +5 -4 xml-fop/src/org/apache/fop/fo/flow/DisplayGraphic.java
Index: DisplayGraphic.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/DisplayGraphic.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- DisplayGraphic.java 2000/06/22 00:11:33 1.10
+++ DisplayGraphic.java 2000/06/27 22:13:36 1.11
@@ -1,4 +1,4 @@
-/*-- $Id: DisplayGraphic.java,v 1.10 2000/06/22 00:11:33 jordan Exp $ --
+/*-- $Id: DisplayGraphic.java,v 1.11 2000/06/27 22:13:36 fotis Exp $ --
============================================================================
The Apache Software License, Version 1.1
@@ -54,6 +54,7 @@
// FOP
import org.apache.fop.fo.*;
+import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.fo.properties.*;
import org.apache.fop.layout.Area;
import org.apache.fop.layout.BlockArea;
@@ -169,7 +170,7 @@
} else if (width == 0) {
width = (int) ((imgWidth * ((double) height)) / imgHeight);
}
-//System.err.println("DisplayGraphic: imgW=" + imgWidth + " imgH=" + imgHeight + " w=" + width + " h=" + height);
+//MessageHandler.errorln("DisplayGraphic: imgW=" + imgWidth + " imgH=" + imgHeight + " w=" + width + " h=" + height);
}
if (area.spaceLeft() < (height + spaceBefore)) {
@@ -208,10 +209,10 @@
} catch (MalformedURLException urlex) {
// bad URL
-System.err.println("Error while creating area : " + urlex.getMessage());
+MessageHandler.errorln("Error while creating area : " + urlex.getMessage());
} catch (FopImageException imgex) {
// image error
-System.err.println("Error while creating area : " + imgex.getMessage());
+MessageHandler.errorln("Error while creating area : " + imgex.getMessage());
}
if (area instanceof BlockArea) {
1.5 +5 -4 xml-fop/src/org/apache/fop/fo/flow/InlineGraphic.java
Index: InlineGraphic.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/InlineGraphic.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- InlineGraphic.java 2000/06/22 00:22:09 1.4
+++ InlineGraphic.java 2000/06/27 22:13:36 1.5
@@ -1,4 +1,4 @@
-/*-- $Id: InlineGraphic.java,v 1.4 2000/06/22 00:22:09 jordan Exp $ --
+/*-- $Id: InlineGraphic.java,v 1.5 2000/06/27 22:13:36 fotis Exp $ --
============================================================================
The Apache Software License, Version 1.1
@@ -54,6 +54,7 @@
// FOP
import org.apache.fop.fo.*;
+import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.fo.properties.*;
import org.apache.fop.layout.Area;
import org.apache.fop.layout.BlockArea;
@@ -172,7 +173,7 @@
} else if (width == 0) {
width = (int) ((imgWidth * ((double) height)) / imgHeight);
}
-//System.err.println("DisplayGraphic: imgW=" + imgWidth + " imgH=" + imgHeight + " w=" + width + " h=" + height);
+//MessageHandler.errorln("DisplayGraphic: imgW=" + imgWidth + " imgH=" + imgHeight + " w=" + width + " h=" + height);
}
if (area.spaceLeft() < (height + spaceBefore)) {
@@ -211,10 +212,10 @@
} catch (MalformedURLException urlex) {
// bad URL
-System.err.println("Error while creating area : " + urlex.getMessage());
+MessageHandler.errorln("Error while creating area : " + urlex.getMessage());
} catch (FopImageException imgex) {
// image error
-System.err.println("Error while creating area : " + imgex.getMessage());
+MessageHandler.errorln("Error while creating area : " + imgex.getMessage());
}
if (area instanceof BlockArea) {
1.11 +3 -2 xml-fop/src/org/apache/fop/fo/flow/ListBlock.java
Index: ListBlock.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/ListBlock.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- ListBlock.java 2000/06/22 00:25:44 1.10
+++ ListBlock.java 2000/06/27 22:13:36 1.11
@@ -1,4 +1,4 @@
-/*-- $Id: ListBlock.java,v 1.10 2000/06/22 00:25:44 jordan Exp $ --
+/*-- $Id: ListBlock.java,v 1.11 2000/06/27 22:13:36 fotis Exp $ --
============================================================================
The Apache Software License, Version 1.1
@@ -53,6 +53,7 @@
// FOP
import org.apache.fop.fo.*;
+import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.fo.properties.*;
import org.apache.fop.datatypes.*;
import org.apache.fop.layout.Area;
@@ -171,7 +172,7 @@
int numChildren = this.children.size();
for (int i = this.marker; i < numChildren; i++) {
if (!(children.elementAt(i) instanceof ListItem)) {
- System.err.println("WARNING: This version of FOP requires list-items inside list-blocks");
+ MessageHandler.errorln("WARNING: This version of FOP requires list-items inside list-blocks");
return new Status(Status.OK);
}
ListItem listItem = (ListItem) children.elementAt(i);
1.9 +3 -2 xml-fop/src/org/apache/fop/fo/flow/PageNumber.java
Index: PageNumber.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/PageNumber.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- PageNumber.java 2000/06/22 00:17:00 1.8
+++ PageNumber.java 2000/06/27 22:13:36 1.9
@@ -1,4 +1,4 @@
-/*-- $Id: PageNumber.java,v 1.8 2000/06/22 00:17:00 jordan Exp $ --
+/*-- $Id: PageNumber.java,v 1.9 2000/06/27 22:13:36 fotis Exp $ --
============================================================================
The Apache Software License, Version 1.1
@@ -53,6 +53,7 @@
// FOP
import org.apache.fop.fo.*;
+import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.datatypes.*;
import org.apache.fop.fo.properties.*;
import org.apache.fop.layout.*;
@@ -88,7 +89,7 @@
public Status layout(Area area) throws FOPException {
if (!(area instanceof BlockArea)) {
- System.err.println("WARNING: page-number outside block area");
+ MessageHandler.errorln("WARNING: page-number outside block area");
return new Status(Status.OK);
}
if (this.marker == START) {
1.3 +7 -6 xml-fop/src/org/apache/fop/fo/flow/PageNumberCitation.java
Index: PageNumberCitation.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/PageNumberCitation.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- PageNumberCitation.java 2000/06/22 00:17:00 1.2
+++ PageNumberCitation.java 2000/06/27 22:13:36 1.3
@@ -1,4 +1,4 @@
-/*-- $Id: PageNumberCitation.java,v 1.2 2000/06/22 00:17:00 jordan Exp $ --
+/*-- $Id: PageNumberCitation.java,v 1.3 2000/06/27 22:13:36 fotis Exp $ --
============================================================================
The Apache Software License, Version 1.1
@@ -53,6 +53,7 @@
// FOP
import org.apache.fop.fo.*;
+import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.fo.pagination.*;
import org.apache.fop.datatypes.*;
import org.apache.fop.fo.properties.*;
@@ -170,7 +171,7 @@
{
if(!(area instanceof BlockArea))
{
- System.err.println("WARNING: page-number-citation outside block area");
+ MessageHandler.errorln("WARNING: page-number-citation outside block area");
return new Status(Status.OK);
}
this.area = area;
@@ -202,7 +203,7 @@
{
FObj root;
refId = this.properties.get("ref-id").getString();
-//System.out.println("PageNumberCitation.layout() ref-id: "+refId);
+//MessageHandler.logln("PageNumberCitation.layout() ref-id: "+refId);
// find the reference number citation here, what to do if not found?
// to do this, get the root document, and do a search for the id that matches ref-id
@@ -217,7 +218,7 @@
citation = searchForId(root);
if(citation != null)
{
-//System.out.println("PageNumberCitation.layout() found citation");
+//MessageHandler.logln("PageNumberCitation.layout() found citation");
Status s = resolvePageNumber();
if(s.isIncomplete())
{
@@ -228,7 +229,7 @@
}
else
{
-//System.out.println("PageNumberCitation.layout() found citation");
+//MessageHandler.logln("PageNumberCitation.layout() found citation");
Status s = resolvePageNumber();
if(s.isIncomplete())
{
@@ -248,7 +249,7 @@
public Status resolvePageNumber()
{
idPageNumber = citation.getPageNumber();
-//System.out.println("PageNumberCitation: citation page #: "+idPageNumber);
+//MessageHandler.logln("PageNumberCitation: citation page #: "+idPageNumber);
if(idPageNumber <0) return new Status(Status.AREA_FULL_NONE);
return new Status(Status.OK);
1.13 +3 -2 xml-fop/src/org/apache/fop/fo/flow/Table.java
Index: Table.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/Table.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- Table.java 2000/06/22 00:25:45 1.12
+++ Table.java 2000/06/27 22:13:36 1.13
@@ -1,4 +1,4 @@
-/*-- $Id: Table.java,v 1.12 2000/06/22 00:25:45 jordan Exp $ --
+/*-- $Id: Table.java,v 1.13 2000/06/27 22:13:36 fotis Exp $ --
============================================================================
The Apache Software License, Version 1.1
@@ -53,6 +53,7 @@
// FOP
import org.apache.fop.fo.*;
+import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.fo.properties.*;
import org.apache.fop.layout.*;
import org.apache.fop.datatypes.*;
@@ -201,7 +202,7 @@
offset += c.getColumnWidth();
} else if (fo instanceof TableBody) {
if (columns.size() == 0) {
- System.err.println("WARNING: current implementation of tables requires a table-column for each column, indicating column-width");
+ MessageHandler.errorln("WARNING: current implementation of tables requires a table-column for each column, indicating column-width");
return new Status(Status.OK);
}
1.15 +3 -2 xml-fop/src/org/apache/fop/fo/flow/TableRow.java
Index: TableRow.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/TableRow.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- TableRow.java 2000/06/22 00:25:45 1.14
+++ TableRow.java 2000/06/27 22:13:37 1.15
@@ -1,4 +1,4 @@
-/*-- $Id: TableRow.java,v 1.14 2000/06/22 00:25:45 jordan Exp $ --
+/*-- $Id: TableRow.java,v 1.15 2000/06/27 22:13:37 fotis Exp $ --
============================================================================
The Apache Software License, Version 1.1
@@ -53,6 +53,7 @@
// FOP
import org.apache.fop.fo.*;
+import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.fo.properties.*;
import org.apache.fop.datatypes.*;
import org.apache.fop.layout.*;
@@ -163,7 +164,7 @@
int numChildren = this.children.size();
if (numChildren != columns.size()) {
- System.err.println("WARNING: Number of children under table-row not equal to number of table-columns");
+ MessageHandler.errorln("WARNING: Number of children under table-row not equal to number of table-columns");
return new Status(Status.OK);
}
1.14 +6 -5 xml-fop/src/org/apache/fop/fo/pagination/PageSequence.java
Index: PageSequence.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/pagination/PageSequence.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- PageSequence.java 2000/06/22 00:03:54 1.13
+++ PageSequence.java 2000/06/27 22:13:59 1.14
@@ -1,4 +1,4 @@
-/*-- $Id: PageSequence.java,v 1.13 2000/06/22 00:03:54 jordan Exp $ --
+/*-- $Id: PageSequence.java,v 1.14 2000/06/27 22:13:59 fotis Exp $ --
============================================================================
The Apache Software License, Version 1.1
@@ -53,6 +53,7 @@
// FOP
import org.apache.fop.fo.*;
+import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.fo.properties.*;
import org.apache.fop.fo.flow.Flow;
import org.apache.fop.fo.flow.StaticContent;
@@ -217,7 +218,7 @@
currentPage.setNumber(++this.currentPageNumber);
this.runningPageNumberCounter=this.currentPageNumber;
- System.err.print(" [" + currentPageNumber);
+ MessageHandler.log(" [" + currentPageNumber);
if ( (this.staticBefore != null) &&
(currentPage.getBefore() != null) )
{
@@ -246,10 +247,10 @@
bodyArea.setIDReferences(areaTree.getIDReferences());
status = this.flow.layout(bodyArea);
}
- System.err.print("]");
+ MessageHandler.log("]");
areaTree.addPage(currentPage);
} while ( status.isIncomplete() );
- System.err.println();
+ MessageHandler.errorln("");
}
public void setFlow(Flow flow) {
@@ -272,7 +273,7 @@
}
else
{
- System.err.println("WARNING: this version of FOP only supports "
+ MessageHandler.errorln("WARNING: this version of FOP only supports "
+ "static-content in region-before and region-after");
}
}
1.7 +3 -2 xml-fop/src/org/apache/fop/fo/pagination/Root.java
Index: Root.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/pagination/Root.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- Root.java 2000/06/18 21:05:08 1.6
+++ Root.java 2000/06/27 22:14:00 1.7
@@ -1,4 +1,4 @@
-/*-- $Id: Root.java,v 1.6 2000/06/18 21:05:08 fotis Exp $ --
+/*-- $Id: Root.java,v 1.7 2000/06/27 22:14:00 fotis Exp $ --
============================================================================
The Apache Software License, Version 1.1
@@ -52,6 +52,7 @@
// FOP
import org.apache.fop.fo.*;
+import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.fo.flow.*;
import org.apache.fop.fo.properties.*;
import org.apache.fop.layout.AreaTree;
@@ -104,7 +105,7 @@
public void format(AreaTree areaTree) throws FOPException
{
-// System.err.println(" Root[" + marker + "] ");
+// MessageHandler.errorln(" Root[" + marker + "] ");
if(layoutMasterSet == null)
{
throw new FOPException("No layout master set.");
1.6 +3 -2 xml-fop/src/org/apache/fop/fo/pagination/SimplePageMaster.java
Index: SimplePageMaster.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/pagination/SimplePageMaster.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- SimplePageMaster.java 1999/11/22 02:31:40 1.5
+++ SimplePageMaster.java 2000/06/27 22:14:00 1.6
@@ -1,4 +1,4 @@
-/*-- $Id: SimplePageMaster.java,v 1.5 1999/11/22 02:31:40 jtauber Exp $ --
+/*-- $Id: SimplePageMaster.java,v 1.6 2000/06/27 22:14:00 fotis Exp $ --
============================================================================
The Apache Software License, Version 1.1
@@ -52,6 +52,7 @@
// FOP
import org.apache.fop.fo.*;
+import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.fo.properties.*;
import org.apache.fop.layout.PageMaster;
import org.apache.fop.layout.Region;
@@ -86,7 +87,7 @@
this.layoutMasterSet = (LayoutMasterSet) parent;
String pm = this.properties.get("page-master-name").getString();
if (pm == null) {
- System.err.println("WARNING: simple-page-master does not have "
+ MessageHandler.errorln("WARNING: simple-page-master does not have "
+ "a page-master-name and so is being ignored");
} else {
this.layoutMasterSet.addLayoutMaster(pm, this);
1.2 +184 -183 xml-fop/src/org/apache/fop/image/FopImageConsumer.java
Index: FopImageConsumer.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/image/FopImageConsumer.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- FopImageConsumer.java 2000/05/29 09:22:53 1.1
+++ FopImageConsumer.java 2000/06/27 22:14:05 1.2
@@ -1,183 +1,184 @@
-/*
-
- ============================================================================
- The Apache Software License, Version 1.1
- ============================================================================
-
- Copyright (C) 1999 The Apache Software Foundation. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without modifica-
- tion, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- 3. The end-user documentation included with the redistribution, if any, must
- include the following acknowledgment: "This product includes software
- developed by the Apache Software Foundation (http://www.apache.org/)."
- Alternately, this acknowledgment may appear in the software itself, if
- and wherever such third-party acknowledgments normally appear.
-
- 4. The names "Fop" and "Apache Software Foundation" must not be used to
- endorse or promote products derived from this software without prior
- written permission. For written permission, please contact
- apache@apache.org.
-
- 5. Products derived from this software may not be called "Apache", nor may
- "Apache" appear in their name, without prior written permission of the
- Apache Software Foundation.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
- DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
- This software consists of voluntary contributions made by many individuals
- on behalf of the Apache Software Foundation and was originally created by
- James Tauber <jt...@jtauber.com>. For more information on the Apache
- Software Foundation, please see <http://www.apache.org/>.
-
- */
-
-//Author: Eric SCHAEFFER
-//Description: implement ImageConsumer for FopImage classes
-
-package org.apache.fop.image;
-
-// Java
-import java.util.Hashtable;
-import java.awt.image.*;
-import java.awt.*;
-
-import java.lang.reflect.Array;
-
-// CONSUMER CLASS
-public class FopImageConsumer implements ImageConsumer {
- protected int width = -1;
- protected int height = -1;
- protected Integer imageStatus = new Integer(-1);
- protected int hints = 0;
- protected Hashtable properties = null;
- protected ColorModel cm = null;
- protected ImageProducer ip = null;
-
- public FopImageConsumer(ImageProducer iprod) {
- this.ip = iprod;
- }
-
- public void imageComplete(int status) {
-/*
-System.err.print("Status ");
-if (status == ImageConsumer.COMPLETESCANLINES) {
- System.err.println("CompleteScanLines");
-} else if (status == ImageConsumer.IMAGEABORTED) {
- System.err.println("ImageAborted");
-} else if (status == ImageConsumer.IMAGEERROR) {
- System.err.println("ImageError");
-} else if (status == ImageConsumer.RANDOMPIXELORDER) {
- System.err.println("RandomPixelOrder");
-} else if (status == ImageConsumer.SINGLEFRAME) {
- System.err.println("SingleFrame");
-} else if (status == ImageConsumer.SINGLEFRAMEDONE) {
- System.err.println("SingleFrameDone");
-} else if (status == ImageConsumer.SINGLEPASS) {
- System.err.println("SinglePass");
-} else if (status == ImageConsumer.STATICIMAGEDONE) {
- System.err.println("StaticImageDone");
-} else if (status == ImageConsumer.TOPDOWNLEFTRIGHT) {
- System.err.println("TopDownLeftRight");
-}
-*/
- synchronized(this.imageStatus) {
- // Need to stop status if image done
- if (this.imageStatus.intValue() != ImageConsumer.STATICIMAGEDONE)
- this.imageStatus = new Integer(status);
- }
- }
-
- public void setColorModel(ColorModel model) {
-//System.err.println("setColorModel: " + model);
- this.cm = model;
- }
-
- public void setDimensions(int width, int height) {
-//System.err.println("setDimension: w=" + width + " h=" + height);
- this.width = width;
- this.height = height;
- }
-
- public void setHints(int hintflags) {
-//System.err.println("setHints: " + hintflags);
- this.hints = hintflags;
- }
-
- public void setProperties(Hashtable props) {
-//System.err.println("setProperties: " + props);
- this.properties = props;
- }
-
- public void setPixels(int x, int y, int w, int h,
- ColorModel model, byte[] pixels,int off,
- int scansize) {}
-
- public void setPixels(int x, int y, int w, int h,
- ColorModel model, int[] pixels, int off,
- int scansize) {}
-
- public boolean isImageReady() throws Exception {
- synchronized(this.imageStatus) {
- if (this.imageStatus.intValue() == ImageConsumer.IMAGEABORTED)
- throw new Exception("Image aborted");
- if (this.imageStatus.intValue() == ImageConsumer.IMAGEERROR)
- throw new Exception("Image error");
-
- if (this.imageStatus.intValue() == ImageConsumer.STATICIMAGEDONE)
- return true;
-
- return false;
- }
- }
-
- public int getWidth() {
- return this.width;
- }
-
- public int getHeight() {
- return this.height;
- }
-
- public ColorModel getColorModel() {
- return this.cm;
- }
-
- public int[] getImage() throws Exception {
- int tmpMap[] = new int[this.width * this.height];
- PixelGrabber pg = new PixelGrabber(
- this.ip,
- 0, 0,
- this.width, this.height,
- tmpMap,
- 0, this.width
- );
- pg.setDimensions(this.width, this.height);
- pg.setColorModel(this.cm);
- pg.setHints(this.hints);
- pg.setProperties(this.properties);
- try {
- pg.grabPixels();
- } catch (InterruptedException intex) {
- throw new Exception("Image grabbing interrupted : " + intex.getMessage());
- }
- return tmpMap;
- }
-}
+/*
+
+ ============================================================================
+ The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ 3. The end-user documentation included with the redistribution, if any, must
+ include the following acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Fop" and "Apache Software Foundation" must not be used to
+ endorse or promote products derived from this software without prior
+ written permission. For written permission, please contact
+ apache@apache.org.
+
+ 5. Products derived from this software may not be called "Apache", nor may
+ "Apache" appear in their name, without prior written permission of the
+ Apache Software Foundation.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
+ DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ This software consists of voluntary contributions made by many individuals
+ on behalf of the Apache Software Foundation and was originally created by
+ James Tauber <jt...@jtauber.com>. For more information on the Apache
+ Software Foundation, please see <http://www.apache.org/>.
+
+ */
+
+//Author: Eric SCHAEFFER
+//Description: implement ImageConsumer for FopImage classes
+
+package org.apache.fop.image;
+
+// Java
+import java.util.Hashtable;
+import org.apache.fop.messaging.MessageHandler;
+import java.awt.image.*;
+import java.awt.*;
+
+import java.lang.reflect.Array;
+
+// CONSUMER CLASS
+public class FopImageConsumer implements ImageConsumer {
+ protected int width = -1;
+ protected int height = -1;
+ protected Integer imageStatus = new Integer(-1);
+ protected int hints = 0;
+ protected Hashtable properties = null;
+ protected ColorModel cm = null;
+ protected ImageProducer ip = null;
+
+ public FopImageConsumer(ImageProducer iprod) {
+ this.ip = iprod;
+ }
+
+ public void imageComplete(int status) {
+/*
+MessageHandler.error("Status ");
+if (status == ImageConsumer.COMPLETESCANLINES) {
+ MessageHandler.errorln("CompleteScanLines");
+} else if (status == ImageConsumer.IMAGEABORTED) {
+ MessageHandler.errorln("ImageAborted");
+} else if (status == ImageConsumer.IMAGEERROR) {
+ MessageHandler.errorln("ImageError");
+} else if (status == ImageConsumer.RANDOMPIXELORDER) {
+ MessageHandler.errorln("RandomPixelOrder");
+} else if (status == ImageConsumer.SINGLEFRAME) {
+ MessageHandler.errorln("SingleFrame");
+} else if (status == ImageConsumer.SINGLEFRAMEDONE) {
+ MessageHandler.errorln("SingleFrameDone");
+} else if (status == ImageConsumer.SINGLEPASS) {
+ MessageHandler.errorln("SinglePass");
+} else if (status == ImageConsumer.STATICIMAGEDONE) {
+ MessageHandler.errorln("StaticImageDone");
+} else if (status == ImageConsumer.TOPDOWNLEFTRIGHT) {
+ MessageHandler.errorln("TopDownLeftRight");
+}
+*/
+ synchronized(this.imageStatus) {
+ // Need to stop status if image done
+ if (this.imageStatus.intValue() != ImageConsumer.STATICIMAGEDONE)
+ this.imageStatus = new Integer(status);
+ }
+ }
+
+ public void setColorModel(ColorModel model) {
+//MessageHandler.errorln("setColorModel: " + model);
+ this.cm = model;
+ }
+
+ public void setDimensions(int width, int height) {
+//MessageHandler.errorln("setDimension: w=" + width + " h=" + height);
+ this.width = width;
+ this.height = height;
+ }
+
+ public void setHints(int hintflags) {
+//MessageHandler.errorln("setHints: " + hintflags);
+ this.hints = hintflags;
+ }
+
+ public void setProperties(Hashtable props) {
+//MessageHandler.errorln("setProperties: " + props);
+ this.properties = props;
+ }
+
+ public void setPixels(int x, int y, int w, int h,
+ ColorModel model, byte[] pixels,int off,
+ int scansize) {}
+
+ public void setPixels(int x, int y, int w, int h,
+ ColorModel model, int[] pixels, int off,
+ int scansize) {}
+
+ public boolean isImageReady() throws Exception {
+ synchronized(this.imageStatus) {
+ if (this.imageStatus.intValue() == ImageConsumer.IMAGEABORTED)
+ throw new Exception("Image aborted");
+ if (this.imageStatus.intValue() == ImageConsumer.IMAGEERROR)
+ throw new Exception("Image error");
+
+ if (this.imageStatus.intValue() == ImageConsumer.STATICIMAGEDONE)
+ return true;
+
+ return false;
+ }
+ }
+
+ public int getWidth() {
+ return this.width;
+ }
+
+ public int getHeight() {
+ return this.height;
+ }
+
+ public ColorModel getColorModel() {
+ return this.cm;
+ }
+
+ public int[] getImage() throws Exception {
+ int tmpMap[] = new int[this.width * this.height];
+ PixelGrabber pg = new PixelGrabber(
+ this.ip,
+ 0, 0,
+ this.width, this.height,
+ tmpMap,
+ 0, this.width
+ );
+ pg.setDimensions(this.width, this.height);
+ pg.setColorModel(this.cm);
+ pg.setHints(this.hints);
+ pg.setProperties(this.properties);
+ try {
+ pg.grabPixels();
+ } catch (InterruptedException intex) {
+ throw new Exception("Image grabbing interrupted : " + intex.getMessage());
+ }
+ return tmpMap;
+ }
+}
1.8 +4 -3 xml-fop/src/org/apache/fop/image/FopImageFactory.java
Index: FopImageFactory.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/image/FopImageFactory.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- FopImageFactory.java 2000/05/24 10:46:28 1.7
+++ FopImageFactory.java 2000/06/27 22:14:06 1.8
@@ -1,4 +1,4 @@
-/*-- $Id: FopImageFactory.java,v 1.7 2000/05/24 10:46:28 eschaeffer Exp $ --
+/*-- $Id: FopImageFactory.java,v 1.8 2000/06/27 22:14:06 fotis Exp $ --
============================================================================
The Apache Software License, Version 1.1
@@ -56,6 +56,7 @@
// Java
import java.io.IOException;
+import org.apache.fop.messaging.MessageHandler;
import java.net.*;
import java.lang.reflect.*;
import java.util.Hashtable;
@@ -82,13 +83,13 @@
}
catch (MalformedURLException e_abs) {
// not found
- System.err.println("Invalid Image URL : " + e_abs.getMessage() + "(base URL " + context_url.toString() + ")");
+ MessageHandler.errorln("Invalid Image URL : " + e_abs.getMessage() + "(base URL " + context_url.toString() + ")");
return null;
}
}
catch (MalformedURLException e_context) {
// pb context url
- System.err.println("Invalid Image URL - error on relative URL : " + e_context.getMessage());
+ MessageHandler.errorln("Invalid Image URL - error on relative URL : " + e_context.getMessage());
return null;
}
}
1.6 +4 -3 xml-fop/src/org/apache/fop/layout/FontInfo.java
Index: FontInfo.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/layout/FontInfo.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- FontInfo.java 1999/11/22 02:31:50 1.5
+++ FontInfo.java 2000/06/27 22:14:09 1.6
@@ -1,4 +1,4 @@
-/*-- $Id: FontInfo.java,v 1.5 1999/11/22 02:31:50 jtauber Exp $ --
+/*-- $Id: FontInfo.java,v 1.6 2000/06/27 22:14:09 fotis Exp $ --
============================================================================
The Apache Software License, Version 1.1
@@ -51,6 +51,7 @@
package org.apache.fop.layout;
import java.util.Hashtable;
+import org.apache.fop.messaging.MessageHandler;
import java.util.Enumeration;
import org.apache.fop.apps.FOPException;
@@ -104,9 +105,9 @@
if (f == null) {
throw new FOPException("no default font defined by OutputConverter");
}
- System.err.println("WARNING: defaulted font to any,normal,normal");
+ MessageHandler.errorln("WARNING: defaulted font to any,normal,normal");
}
- System.err.println("WARNING: unknown font "+family+" so defaulted font to any");
+ MessageHandler.errorln("WARNING: unknown font "+family+" so defaulted font to any");
}
return f;
}
1.13 +499 -498 xml-fop/src/org/apache/fop/layout/LineArea.java
Index: LineArea.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/layout/LineArea.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- LineArea.java 2000/06/14 01:56:14 1.12
+++ LineArea.java 2000/06/27 22:14:09 1.13
@@ -1,498 +1,499 @@
-/*-- $Id: LineArea.java,v 1.12 2000/06/14 01:56:14 arved Exp $ --
-
- ============================================================================
- The Apache Software License, Version 1.1
- ============================================================================
-
- Copyright (C) 1999 The Apache Software Foundation. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without modifica-
- tion, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- 3. The end-user documentation included with the redistribution, if any, must
- include the following acknowledgment: "This product includes software
- developed by the Apache Software Foundation (http://www.apache.org/)."
- Alternately, this acknowledgment may appear in the software itself, if
- and wherever such third-party acknowledgments normally appear.
-
- 4. The names "FOP" and "Apache Software Foundation" must not be used to
- endorse or promote products derived from this software without prior
- written permission. For written permission, please contact
- apache@apache.org.
-
- 5. Products derived from this software may not be called "Apache", nor may
- "Apache" appear in their name, without prior written permission of the
- Apache Software Foundation.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
- DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
- This software consists of voluntary contributions made by many individuals
- on behalf of the Apache Software Foundation and was originally created by
- James Tauber <jt...@jtauber.com>. For more information on the Apache
- Software Foundation, please see <http://www.apache.org/>.
-
- */
-
-package org.apache.fop.layout;
-
-import org.apache.fop.render.Renderer;
-
-import java.util.Vector;
-import java.util.Enumeration;
-import java.awt.Rectangle;
-
-import org.apache.fop.fo.properties.WrapOption; // for enumerated
-// values
-import org.apache.fop.fo.properties.WhiteSpaceTreatment; // for
-// enumerated values
-import org.apache.fop.fo.properties.TextAlign; // for enumerated
-// values
-import org.apache.fop.fo.properties.TextAlignLast; // for enumerated
-// values
-
-public class LineArea extends Area {
-
- protected int lineHeight;
- protected int halfLeading;
- protected int nominalFontSize;
- protected int nominalGlyphHeight;
-
- protected int allocationHeight;
- protected int startIndent;
- protected int endIndent;
-
- private int placementOffset;
-
- private FontState currentFontState; // not the nominal, which is
- // in this.fontState
- private float red, green, blue;
- private int wrapOption;
- private int whiteSpaceTreatment;
-
- /* the width of text that has definitely made it into the line
- area */
- protected int finalWidth = 0;
-
- /* the position to shift a link rectangle in order to compensate for links embedded within a word*/
- protected int embeddedLinkStart=0;
-
- /* the width of the current word so far */
- protected int wordWidth = 0;
-
- /* values that prev (below) may take */
- protected static final int NOTHING = 0;
- protected static final int WHITESPACE = 1;
- protected static final int TEXT = 2;
-
- /* the character type of the previous character */
- protected int prev = NOTHING;
-
- /* the position in data[] of the start of the current word */
- protected int wordStart;
-
- /* the length (in characters) of the current word */
- protected int wordLength = 0;
-
- /* width of spaces before current word */
- protected int spaceWidth = 0;
-
- /* the inline areas that have not yet been added to the line
- because subsequent characters to come (in a different addText)
- may be part of the same word */
- protected Vector pendingAreas = new Vector();
-
- /* the width of the pendingAreas */
- protected int pendingWidth = 0;
-
- public LineArea(FontState fontState, int lineHeight, int
- halfLeading, int allocationWidth, int startIndent,
- int endIndent) {
- super(fontState);
-
- this.currentFontState = fontState;
- this.lineHeight = lineHeight;
- this.nominalFontSize = fontState.getFontSize();
- this.nominalGlyphHeight = fontState.getAscender() -
- fontState.getDescender();
-
- this.placementOffset = fontState.getAscender();
- this.contentRectangleWidth = allocationWidth - startIndent -
- endIndent;
- this.fontState = fontState;
-
- this.allocationHeight = this.nominalGlyphHeight;
- this.halfLeading = this.lineHeight - this.allocationHeight;
-
- this.startIndent = startIndent;
- this.endIndent = endIndent;
-
- }
-
- public void render(Renderer renderer) {
- renderer.renderLineArea(this);
- }
-
- public int addText(char odata[], int start, int end, LinkSet ls) {
- boolean overrun = false;
-
- wordStart = start;
- wordLength = 0;
- wordWidth = 0;
- char[] data = new char[odata.length];
- for(int count=0;count <odata.length; count++) {
- data[count] = odata[count];
- }
-
- /* iterate over each character */
- for (int i = start; i < end; i++) {
- int charWidth;
- /* get the character */
- char c = data[i];
-
- if (c > 127) {
- /* this class shouldn't be hard coded */
- char d =
- org.apache.fop.render.pdf.CodePointMapping.map[c];
- if (d != 0) {
- c = data[i] = d;
- } else {
- System.err.print("ch"
- + (int)c + "?");
- c = data[i] = '#';
- }
- }
-
- charWidth = currentFontState.width(c);
-
- if ((c == ' ') ||
- (c == '\n') ||
- (c == '\r') ||
- (c == '\t')) { // whitespace
-
- if (prev == WHITESPACE) {
-
- // if current & previous are WHITESPACE
-
- if (this.whiteSpaceTreatment ==
- WhiteSpaceTreatment.PRESERVE) {
- if (c == ' ') {
- spaceWidth += currentFontState.width(32);
- } else if (c == '\n') {
- // force line break
- return i;
- } else if (c == '\t') {
- spaceWidth += 8 * currentFontState.width(32);
- }
- } // else ignore it
-
- } else if (prev == TEXT) {
-
- // if current is WHITESPACE and previous TEXT
-
- // the current word made it, so
-
- // add the space before the current word (if there
- // was some)
-
- if (spaceWidth > 0) {
- addChild(new InlineSpace(spaceWidth));
- finalWidth += spaceWidth;
- spaceWidth = 0;
- }
-
- // add any pending areas
-
- Enumeration e = pendingAreas.elements();
- while (e.hasMoreElements()) {
- InlineArea inlineArea = (InlineArea) e.nextElement();
- if (ls != null) {
- Rectangle lr =
- new Rectangle(startIndent +
- finalWidth,
- 0,
- inlineArea.getContentWidth(),
- fontState.getFontSize());
- ls.addRect(lr, this);
- }
-
- addChild(inlineArea);
- }
- finalWidth += pendingWidth;
-
- // reset pending areas array
- pendingWidth = 0;
- pendingAreas = new Vector();
-
- // add the current word
-
- if (wordLength > 0) {
- InlineArea ia = new InlineArea(currentFontState,
- this.red, this.green,
- this.blue, new
- String(data, wordStart,
- wordLength),
- wordWidth);
- addChild(ia);
- if (ls != null) {
- Rectangle lr =
- new Rectangle(startIndent +
- finalWidth,
- 0,
- ia.getContentWidth(),
- fontState.getFontSize());
- ls.addRect(lr, this);
- }
- finalWidth += wordWidth;
-
- // reset word width
- wordWidth = 0;
- }
-
- // deal with this new whitespace following the
- // word we just added
-
- prev = WHITESPACE;
-
- embeddedLinkStart=0; //reset embeddedLinkStart since a space was encountered
-
- if (this.whiteSpaceTreatment ==
- WhiteSpaceTreatment.IGNORE) {
- // do nothing
- } else {
- spaceWidth = currentFontState.width(32);
- }
- if (this.whiteSpaceTreatment ==
- WhiteSpaceTreatment.PRESERVE) {
- if (c == '\n') {
- // force a line break
- return i;
- } else if (c == '\t') {
- spaceWidth = currentFontState.width(32);
- }
- }
-
- } else {
-
- // if current is WHITESPACE and no previous
-
- if (this.whiteSpaceTreatment ==
- WhiteSpaceTreatment.PRESERVE) {
- prev = WHITESPACE;
- spaceWidth = currentFontState.width(32);
- } else {
- // skip over it
- start++;
- }
- }
-
- } else { // current is TEXT
-
- if (prev == WHITESPACE) {
-
- // if current is TEXT and previous WHITESPACE
-
- wordWidth = charWidth;
- if ((finalWidth + spaceWidth + wordWidth) >
- this.getContentWidth()) {
- if (overrun)
- System.err.print(">");
- if (this.wrapOption == WrapOption.WRAP)
- return i;
- }
- prev = TEXT;
- wordStart = i;
- wordLength = 1;
- } else if (prev == TEXT) {
-
- wordLength++;
- wordWidth += charWidth;
- } else { // nothing previous
-
- prev = TEXT;
- wordStart = i;
- wordLength = 1;
- wordWidth = charWidth;
- }
-
- if ((finalWidth + spaceWidth + pendingWidth + wordWidth) >
- this.getContentWidth()) {
-
- // BREAK MID WORD
- if (wordStart == start) { // if couldn't even fit
- // first word
- overrun = true;
- // if not at start of line, return word start
- // to try again on a new line
- if (finalWidth > 0) {
- return wordStart;
- }
- } else if (this.wrapOption == WrapOption.WRAP) {
- return wordStart;
- }
- }
-
- }
- } // end of iteration over text
-
- if (prev == TEXT) {
-
- InlineArea pia = new InlineArea(currentFontState, this.red,
- this.green, this.blue, new
- String(data, wordStart,
- wordLength), wordWidth);
-
- if (ls != null) {
- Rectangle lr =
- new Rectangle(startIndent + finalWidth + spaceWidth + embeddedLinkStart,
- spaceWidth,
- pia.getContentWidth(),
- fontState.getFontSize());
- ls.addRect(lr, this);
- }
-
- embeddedLinkStart += wordWidth;
- pendingAreas.addElement(pia);
- pendingWidth += wordWidth;
- wordWidth = 0;
- }
-
- if (overrun)
- System.err.print(">");
- return -1;
- }
-
- public void addPending() {
- if (spaceWidth > 0) {
- addChild(new InlineSpace(spaceWidth));
- finalWidth += spaceWidth;
- spaceWidth = 0;
- }
-
- Enumeration e = pendingAreas.elements();
- while (e.hasMoreElements()) {
- InlineArea inlineArea = (InlineArea) e.nextElement();
- addChild(inlineArea);
- }
- finalWidth += pendingWidth;
-
- // reset pending areas array
- pendingWidth = 0;
- pendingAreas = new Vector();
- }
-
- public void align(int type) {
- int padding = 0;
-
- switch (type) {
- case TextAlign.START: // left
- padding = this.getContentWidth() - finalWidth;
- endIndent += padding;
- break;
- case TextAlign.END: // right
- padding = this.getContentWidth() - finalWidth;
- startIndent += padding;
- break;
- case TextAlign.CENTERED: // center
- padding = (this.getContentWidth() - finalWidth)/2;
- startIndent += padding;
- endIndent += padding;
- break;
- case TextAlign.JUSTIFIED: // justify
- Vector spaceList = new Vector();
-
- int spaceCount = 0;
- Enumeration e = children.elements();
- while (e.hasMoreElements()) {
- Box b = (Box)e.nextElement();
- if (b instanceof InlineSpace) {
- InlineSpace space = (InlineSpace)b;
- spaceList.addElement(space);
- spaceCount++;
- }
- }
- if (spaceCount > 0) {
- padding = (this.getContentWidth() - finalWidth) /
- spaceCount;
- } else { // no spaces
- padding = 0;
- }
- Enumeration f = spaceList.elements();
- while (f.hasMoreElements()) {
- InlineSpace space2 = (InlineSpace)f.nextElement();
- int i = space2.getSize();
- space2.setSize(i + padding);
- }
- }
- }
-
- public void changeColor(float red, float green, float blue) {
- this.red = red;
- this.green = green;
- this.blue = blue;
- }
-
- public void changeFont(FontState fontState) {
- this.currentFontState = fontState;
- }
-
- public void changeWhiteSpaceTreatment(int whiteSpaceTreatment) {
- this.whiteSpaceTreatment = whiteSpaceTreatment;
- }
-
- public void changeWrapOption(int wrapOption) {
- this.wrapOption = wrapOption;
- }
-
- public int getEndIndent() {
- return endIndent;
- }
-
- public int getHeight() {
- return this.allocationHeight;
- }
-
- public int getPlacementOffset() {
- return this.placementOffset;
- }
-
- public int getStartIndent() {
- return startIndent;
- }
-
- public boolean isEmpty() {
- return (prev==0);
- }
-
- public Vector getPendingAreas() {
- return pendingAreas;
- }
-
- public int getPendingWidth() {
- return pendingWidth;
- }
-
- public void setPendingAreas(Vector areas) {
- pendingAreas = areas;
- }
-
- public void setPendingWidth(int width) {
- pendingWidth = width;
- }
-
-}
+/*-- $Id: LineArea.java,v 1.13 2000/06/27 22:14:09 fotis Exp $ --
+
+ ============================================================================
+ The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ 3. The end-user documentation included with the redistribution, if any, must
+ include the following acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "FOP" and "Apache Software Foundation" must not be used to
+ endorse or promote products derived from this software without prior
+ written permission. For written permission, please contact
+ apache@apache.org.
+
+ 5. Products derived from this software may not be called "Apache", nor may
+ "Apache" appear in their name, without prior written permission of the
+ Apache Software Foundation.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
+ DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ This software consists of voluntary contributions made by many individuals
+ on behalf of the Apache Software Foundation and was originally created by
+ James Tauber <jt...@jtauber.com>. For more information on the Apache
+ Software Foundation, please see <http://www.apache.org/>.
+
+ */
+
+package org.apache.fop.layout;
+
+import org.apache.fop.render.Renderer;
+import org.apache.fop.messaging.MessageHandler;
+
+import java.util.Vector;
+import java.util.Enumeration;
+import java.awt.Rectangle;
+
+import org.apache.fop.fo.properties.WrapOption; // for enumerated
+// values
+import org.apache.fop.fo.properties.WhiteSpaceTreatment; // for
+// enumerated values
+import org.apache.fop.fo.properties.TextAlign; // for enumerated
+// values
+import org.apache.fop.fo.properties.TextAlignLast; // for enumerated
+// values
+
+public class LineArea extends Area {
+
+ protected int lineHeight;
+ protected int halfLeading;
+ protected int nominalFontSize;
+ protected int nominalGlyphHeight;
+
+ protected int allocationHeight;
+ protected int startIndent;
+ protected int endIndent;
+
+ private int placementOffset;
+
+ private FontState currentFontState; // not the nominal, which is
+ // in this.fontState
+ private float red, green, blue;
+ private int wrapOption;
+ private int whiteSpaceTreatment;
+
+ /* the width of text that has definitely made it into the line
+ area */
+ protected int finalWidth = 0;
+
+ /* the position to shift a link rectangle in order to compensate for links embedded within a word*/
+ protected int embeddedLinkStart=0;
+
+ /* the width of the current word so far */
+ protected int wordWidth = 0;
+
+ /* values that prev (below) may take */
+ protected static final int NOTHING = 0;
+ protected static final int WHITESPACE = 1;
+ protected static final int TEXT = 2;
+
+ /* the character type of the previous character */
+ protected int prev = NOTHING;
+
+ /* the position in data[] of the start of the current word */
+ protected int wordStart;
+
+ /* the length (in characters) of the current word */
+ protected int wordLength = 0;
+
+ /* width of spaces before current word */
+ protected int spaceWidth = 0;
+
+ /* the inline areas that have not yet been added to the line
+ because subsequent characters to come (in a different addText)
+ may be part of the same word */
+ protected Vector pendingAreas = new Vector();
+
+ /* the width of the pendingAreas */
+ protected int pendingWidth = 0;
+
+ public LineArea(FontState fontState, int lineHeight, int
+ halfLeading, int allocationWidth, int startIndent,
+ int endIndent) {
+ super(fontState);
+
+ this.currentFontState = fontState;
+ this.lineHeight = lineHeight;
+ this.nominalFontSize = fontState.getFontSize();
+ this.nominalGlyphHeight = fontState.getAscender() -
+ fontState.getDescender();
+
+ this.placementOffset = fontState.getAscender();
+ this.contentRectangleWidth = allocationWidth - startIndent -
+ endIndent;
+ this.fontState = fontState;
+
+ this.allocationHeight = this.nominalGlyphHeight;
+ this.halfLeading = this.lineHeight - this.allocationHeight;
+
+ this.startIndent = startIndent;
+ this.endIndent = endIndent;
+
+ }
+
+ public void render(Renderer renderer) {
+ renderer.renderLineArea(this);
+ }
+
+ public int addText(char odata[], int start, int end, LinkSet ls) {
+ boolean overrun = false;
+
+ wordStart = start;
+ wordLength = 0;
+ wordWidth = 0;
+ char[] data = new char[odata.length];
+ for(int count=0;count <odata.length; count++) {
+ data[count] = odata[count];
+ }
+
+ /* iterate over each character */
+ for (int i = start; i < end; i++) {
+ int charWidth;
+ /* get the character */
+ char c = data[i];
+
+ if (c > 127) {
+ /* this class shouldn't be hard coded */
+ char d =
+ org.apache.fop.render.pdf.CodePointMapping.map[c];
+ if (d != 0) {
+ c = data[i] = d;
+ } else {
+ MessageHandler.error("ch"
+ + (int)c + "?");
+ c = data[i] = '#';
+ }
+ }
+
+ charWidth = currentFontState.width(c);
+
+ if ((c == ' ') ||
+ (c == '\n') ||
+ (c == '\r') ||
+ (c == '\t')) { // whitespace
+
+ if (prev == WHITESPACE) {
+
+ // if current & previous are WHITESPACE
+
+ if (this.whiteSpaceTreatment ==
+ WhiteSpaceTreatment.PRESERVE) {
+ if (c == ' ') {
+ spaceWidth += currentFontState.width(32);
+ } else if (c == '\n') {
+ // force line break
+ return i;
+ } else if (c == '\t') {
+ spaceWidth += 8 * currentFontState.width(32);
+ }
+ } // else ignore it
+
+ } else if (prev == TEXT) {
+
+ // if current is WHITESPACE and previous TEXT
+
+ // the current word made it, so
+
+ // add the space before the current word (if there
+ // was some)
+
+ if (spaceWidth > 0) {
+ addChild(new InlineSpace(spaceWidth));
+ finalWidth += spaceWidth;
+ spaceWidth = 0;
+ }
+
+ // add any pending areas
+
+ Enumeration e = pendingAreas.elements();
+ while (e.hasMoreElements()) {
+ InlineArea inlineArea = (InlineArea) e.nextElement();
+ if (ls != null) {
+ Rectangle lr =
+ new Rectangle(startIndent +
+ finalWidth,
+ 0,
+ inlineArea.getContentWidth(),
+ fontState.getFontSize());
+ ls.addRect(lr, this);
+ }
+
+ addChild(inlineArea);
+ }
+ finalWidth += pendingWidth;
+
+ // reset pending areas array
+ pendingWidth = 0;
+ pendingAreas = new Vector();
+
+ // add the current word
+
+ if (wordLength > 0) {
+ InlineArea ia = new InlineArea(currentFontState,
+ this.red, this.green,
+ this.blue, new
+ String(data, wordStart,
+ wordLength),
+ wordWidth);
+ addChild(ia);
+ if (ls != null) {
+ Rectangle lr =
+ new Rectangle(startIndent +
+ finalWidth,
+ 0,
+ ia.getContentWidth(),
+ fontState.getFontSize());
+ ls.addRect(lr, this);
+ }
+ finalWidth += wordWidth;
+
+ // reset word width
+ wordWidth = 0;
+ }
+
+ // deal with this new whitespace following the
+ // word we just added
+
+ prev = WHITESPACE;
+
+ embeddedLinkStart=0; //reset embeddedLinkStart since a space was encountered
+
+ if (this.whiteSpaceTreatment ==
+ WhiteSpaceTreatment.IGNORE) {
+ // do nothing
+ } else {
+ spaceWidth = currentFontState.width(32);
+ }
+ if (this.whiteSpaceTreatment ==
+ WhiteSpaceTreatment.PRESERVE) {
+ if (c == '\n') {
+ // force a line break
+ return i;
+ } else if (c == '\t') {
+ spaceWidth = currentFontState.width(32);
+ }
+ }
+
+ } else {
+
+ // if current is WHITESPACE and no previous
+
+ if (this.whiteSpaceTreatment ==
+ WhiteSpaceTreatment.PRESERVE) {
+ prev = WHITESPACE;
+ spaceWidth = currentFontState.width(32);
+ } else {
+ // skip over it
+ start++;
+ }
+ }
+
+ } else { // current is TEXT
+
+ if (prev == WHITESPACE) {
+
+ // if current is TEXT and previous WHITESPACE
+
+ wordWidth = charWidth;
+ if ((finalWidth + spaceWidth + wordWidth) >
+ this.getContentWidth()) {
+ if (overrun)
+ MessageHandler.error(">");
+ if (this.wrapOption == WrapOption.WRAP)
+ return i;
+ }
+ prev = TEXT;
+ wordStart = i;
+ wordLength = 1;
+ } else if (prev == TEXT) {
+
+ wordLength++;
+ wordWidth += charWidth;
+ } else { // nothing previous
+
+ prev = TEXT;
+ wordStart = i;
+ wordLength = 1;
+ wordWidth = charWidth;
+ }
+
+ if ((finalWidth + spaceWidth + pendingWidth + wordWidth) >
+ this.getContentWidth()) {
+
+ // BREAK MID WORD
+ if (wordStart == start) { // if couldn't even fit
+ // first word
+ overrun = true;
+ // if not at start of line, return word start
+ // to try again on a new line
+ if (finalWidth > 0) {
+ return wordStart;
+ }
+ } else if (this.wrapOption == WrapOption.WRAP) {
+ return wordStart;
+ }
+ }
+
+ }
+ } // end of iteration over text
+
+ if (prev == TEXT) {
+
+ InlineArea pia = new InlineArea(currentFontState, this.red,
+ this.green, this.blue, new
+ String(data, wordStart,
+ wordLength), wordWidth);
+
+ if (ls != null) {
+ Rectangle lr =
+ new Rectangle(startIndent + finalWidth + spaceWidth + embeddedLinkStart,
+ spaceWidth,
+ pia.getContentWidth(),
+ fontState.getFontSize());
+ ls.addRect(lr, this);
+ }
+
+ embeddedLinkStart += wordWidth;
+ pendingAreas.addElement(pia);
+ pendingWidth += wordWidth;
+ wordWidth = 0;
+ }
+
+ if (overrun)
+ MessageHandler.error(">");
+ return -1;
+ }
+
+ public void addPending() {
+ if (spaceWidth > 0) {
+ addChild(new InlineSpace(spaceWidth));
+ finalWidth += spaceWidth;
+ spaceWidth = 0;
+ }
+
+ Enumeration e = pendingAreas.elements();
+ while (e.hasMoreElements()) {
+ InlineArea inlineArea = (InlineArea) e.nextElement();
+ addChild(inlineArea);
+ }
+ finalWidth += pendingWidth;
+
+ // reset pending areas array
+ pendingWidth = 0;
+ pendingAreas = new Vector();
+ }
+
+ public void align(int type) {
+ int padding = 0;
+
+ switch (type) {
+ case TextAlign.START: // left
+ padding = this.getContentWidth() - finalWidth;
+ endIndent += padding;
+ break;
+ case TextAlign.END: // right
+ padding = this.getContentWidth() - finalWidth;
+ startIndent += padding;
+ break;
+ case TextAlign.CENTERED: // center
+ padding = (this.getContentWidth() - finalWidth)/2;
+ startIndent += padding;
+ endIndent += padding;
+ break;
+ case TextAlign.JUSTIFIED: // justify
+ Vector spaceList = new Vector();
+
+ int spaceCount = 0;
+ Enumeration e = children.elements();
+ while (e.hasMoreElements()) {
+ Box b = (Box)e.nextElement();
+ if (b instanceof InlineSpace) {
+ InlineSpace space = (InlineSpace)b;
+ spaceList.addElement(space);
+ spaceCount++;
+ }
+ }
+ if (spaceCount > 0) {
+ padding = (this.getContentWidth() - finalWidth) /
+ spaceCount;
+ } else { // no spaces
+ padding = 0;
+ }
+ Enumeration f = spaceList.elements();
+ while (f.hasMoreElements()) {
+ InlineSpace space2 = (InlineSpace)f.nextElement();
+ int i = space2.getSize();
+ space2.setSize(i + padding);
+ }
+ }
+ }
+
+ public void changeColor(float red, float green, float blue) {
+ this.red = red;
+ this.green = green;
+ this.blue = blue;
+ }
+
+ public void changeFont(FontState fontState) {
+ this.currentFontState = fontState;
+ }
+
+ public void changeWhiteSpaceTreatment(int whiteSpaceTreatment) {
+ this.whiteSpaceTreatment = whiteSpaceTreatment;
+ }
+
+ public void changeWrapOption(int wrapOption) {
+ this.wrapOption = wrapOption;
+ }
+
+ public int getEndIndent() {
+ return endIndent;
+ }
+
+ public int getHeight() {
+ return this.allocationHeight;
+ }
+
+ public int getPlacementOffset() {
+ return this.placementOffset;
+ }
+
+ public int getStartIndent() {
+ return startIndent;
+ }
+
+ public boolean isEmpty() {
+ return (prev==0);
+ }
+
+ public Vector getPendingAreas() {
+ return pendingAreas;
+ }
+
+ public int getPendingWidth() {
+ return pendingWidth;
+ }
+
+ public void setPendingAreas(Vector areas) {
+ pendingAreas = areas;
+ }
+
+ public void setPendingWidth(int width) {
+ pendingWidth = width;
+ }
+
+}
1.8 +3 -2 xml-fop/src/org/apache/fop/pdf/PDFPages.java
Index: PDFPages.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/pdf/PDFPages.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- PDFPages.java 2000/03/26 10:39:04 1.7
+++ PDFPages.java 2000/06/27 22:14:14 1.8
@@ -1,4 +1,4 @@
-/*-- $Id: PDFPages.java,v 1.7 2000/03/26 10:39:04 fotis Exp $ --
+/*-- $Id: PDFPages.java,v 1.8 2000/06/27 22:14:14 fotis Exp $ --
============================================================================
The Apache Software License, Version 1.1
@@ -52,6 +52,7 @@
// Java
import java.io.PrintWriter;
+import org.apache.fop.messaging.MessageHandler;
import java.util.Vector;
/**
@@ -107,7 +108,7 @@
*/
public void incrementCount() {
this.count++;
- // System.out.println("Incrementing count to " + this.getCount());
+ // MessageHandler.logln("Incrementing count to " + this.getCount());
}
/**
1.9 +5 -4 xml-fop/src/org/apache/fop/pdf/PDFXObject.java
Index: PDFXObject.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/pdf/PDFXObject.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- PDFXObject.java 2000/05/29 09:20:52 1.8
+++ PDFXObject.java 2000/06/27 22:14:15 1.9
@@ -1,4 +1,4 @@
-/*-- $Id: PDFXObject.java,v 1.8 2000/05/29 09:20:52 eschaeffer Exp $ --
+/*-- $Id: PDFXObject.java,v 1.9 2000/06/27 22:14:15 fotis Exp $ --
============================================================================
The Apache Software License, Version 1.1
@@ -55,6 +55,7 @@
// Java
import java.io.IOException;
+import org.apache.fop.messaging.MessageHandler;
import java.io.PrintWriter;
// FOP
@@ -83,7 +84,7 @@
super(number);
this.Xnum=Xnumber;
if (img == null)
- System.err.println("FISH");
+ MessageHandler.errorln("FISH");
fopimage=img;
}
@@ -137,9 +138,9 @@
writer.write(p);
length += p.length();
} catch (FopImageException imgex) {
-System.err.println("Error in XObject : " + imgex.getMessage());
+MessageHandler.errorln("Error in XObject : " + imgex.getMessage());
} catch (PDFFilterException filterex) {
-System.err.println("Error in XObject : " + filterex.getMessage());
+MessageHandler.errorln("Error in XObject : " + filterex.getMessage());
}
return length;
}
1.6 +3 -2 xml-fop/src/org/apache/fop/render/awt/AWTRenderer.java
Index: AWTRenderer.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/render/awt/AWTRenderer.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- AWTRenderer.java 2000/05/23 09:25:53 1.5
+++ AWTRenderer.java 2000/06/27 22:14:16 1.6
@@ -10,6 +10,7 @@
*/
import org.apache.fop.layout.*;
+import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.datatypes.*;
import org.apache.fop.image.*;
import org.apache.fop.svg.*;
@@ -450,7 +451,7 @@
FopImage img = area.getImage();
if (img == null) {
- System.out.println("area.getImage() is null");
+ MessageHandler.logln("area.getImage() is null");
}
try {
@@ -470,7 +471,7 @@
currentYPosition -= h;
} catch (FopImageException imgex) {
// ?
- System.out.println("Error while loading image : " + imgex.getMessage());
+ MessageHandler.logln("Error while loading image : " + imgex.getMessage());
}
}
1.7 +3 -2 xml-fop/src/org/apache/fop/render/pdf/FontSetup.java
Index: FontSetup.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/render/pdf/FontSetup.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- FontSetup.java 2000/06/22 00:16:09 1.6
+++ FontSetup.java 2000/06/27 22:14:19 1.7
@@ -1,4 +1,4 @@
-/*-- $Id: FontSetup.java,v 1.6 2000/06/22 00:16:09 fotis Exp $ --
+/*-- $Id: FontSetup.java,v 1.7 2000/06/27 22:14:19 fotis Exp $ --
============================================================================
The Apache Software License, Version 1.1
@@ -52,6 +52,7 @@
// FOP
import org.apache.fop.render.pdf.fonts.*;
+import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.layout.FontInfo;
import org.apache.fop.pdf.PDFDocument;
import org.apache.fop.pdf.PDFResources;
@@ -77,7 +78,7 @@
* @param fontInfo the font info object to set up
*/
public static void setup(FontInfo fontInfo) {
- System.err.println("setting up fonts");
+ MessageHandler.logln("setting up fonts");
fontInfo.addMetrics("F1", new Helvetica());
fontInfo.addMetrics("F2", new HelveticaOblique());
1.18 +4 -3 xml-fop/src/org/apache/fop/render/pdf/PDFRenderer.java
Index: PDFRenderer.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/render/pdf/PDFRenderer.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- PDFRenderer.java 2000/06/21 01:47:18 1.17
+++ PDFRenderer.java 2000/06/27 22:14:20 1.18
@@ -1,4 +1,4 @@
-/*-- $Id: PDFRenderer.java,v 1.17 2000/06/21 01:47:18 jordan Exp $ --
+/*-- $Id: PDFRenderer.java,v 1.18 2000/06/27 22:14:20 fotis Exp $ --
============================================================================
The Apache Software License, Version 1.1
@@ -53,6 +53,7 @@
// FOP
import org.apache.fop.render.Renderer;
+import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.image.ImageArea;
import org.apache.fop.image.FopImage;
import org.apache.fop.apps.FOPException;
@@ -143,7 +144,7 @@
*/
public void render(AreaTree areaTree, PrintWriter writer)
throws IOException, FOPException {
- System.err.println("rendering areas to PDF");
+ MessageHandler.logln("rendering areas to PDF");
IDReferences idReferences=areaTree.getIDReferences();
this.pdfResources = this.pdfDoc.getResources();
this.pdfDoc.setIDReferences(idReferences);
@@ -156,7 +157,7 @@
throw new FOPException("The id \""+idReferences.getNextInvalidId()+"\" was referenced but does not exist\n");
}
- System.err.println("writing out PDF");
+ MessageHandler.logln("writing out PDF");
this.pdfDoc.output(writer);
}
1.7 +4 -3 xml-fop/src/org/apache/fop/render/xml/XMLRenderer.java
Index: XMLRenderer.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/render/xml/XMLRenderer.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- XMLRenderer.java 1999/11/22 02:32:15 1.6
+++ XMLRenderer.java 2000/06/27 22:14:27 1.7
@@ -1,4 +1,4 @@
-/*-- $Id: XMLRenderer.java,v 1.6 1999/11/22 02:32:15 jtauber Exp $ --
+/*-- $Id: XMLRenderer.java,v 1.7 2000/06/27 22:14:27 fotis Exp $ --
============================================================================
The Apache Software License, Version 1.1
@@ -52,6 +52,7 @@
// FOP
import org.apache.fop.svg.*;
+import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.render.Renderer;
import org.apache.fop.image.ImageArea;
import org.apache.fop.layout.*;
@@ -93,7 +94,7 @@
*/
public void render(AreaTree areaTree, PrintWriter writer)
throws IOException {
- System.err.println("rendering areas to XML");
+ MessageHandler.logln("rendering areas to XML");
this.writer = writer;
this.writer.write("<?xml version=\"1.0\"?>\n<!-- produced by "
+ this.producer + " -->\n");
@@ -104,7 +105,7 @@
}
writeEndTag("</AreaTree>");
this.writer.flush();
- System.err.println("written out XML");
+ MessageHandler.errorln("written out XML");
}
/**
1.7 +3 -2 xml-fop/src/org/apache/fop/svg/Line.java
Index: Line.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/svg/Line.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- Line.java 1999/11/25 17:33:15 1.6
+++ Line.java 2000/06/27 22:14:30 1.7
@@ -1,4 +1,4 @@
-/*-- $Id: Line.java,v 1.6 1999/11/25 17:33:15 jtauber Exp $ --
+/*-- $Id: Line.java,v 1.7 2000/06/27 22:14:30 fotis Exp $ --
============================================================================
The Apache Software License, Version 1.1
@@ -53,6 +53,7 @@
// FOP
import org.apache.fop.fo.*;
+import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.fo.properties.*;
import org.apache.fop.layout.Area;
import org.apache.fop.layout.FontState;
@@ -123,7 +124,7 @@
((SVGArea) area).addGraphic(new LineGraphic(x1, y1, x2, y2));
} else {
/* otherwise generate a warning */
- System.err.println("WARNING: svg:line outside svg:svg");
+ MessageHandler.errorln("WARNING: svg:line outside svg:svg");
}
/* return status */
1.7 +3 -2 xml-fop/src/org/apache/fop/svg/Rect.java
Index: Rect.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/svg/Rect.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- Rect.java 1999/11/25 17:33:15 1.6
+++ Rect.java 2000/06/27 22:14:30 1.7
@@ -1,4 +1,4 @@
-/*-- $Id: Rect.java,v 1.6 1999/11/25 17:33:15 jtauber Exp $ --
+/*-- $Id: Rect.java,v 1.7 2000/06/27 22:14:30 fotis Exp $ --
============================================================================
The Apache Software License, Version 1.1
@@ -53,6 +53,7 @@
// FOP
import org.apache.fop.fo.*;
+import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.fo.properties.*;
import org.apache.fop.layout.Area;
import org.apache.fop.layout.FontState;
@@ -123,7 +124,7 @@
((SVGArea) area).addGraphic(new RectGraphic(x, y, width, height));
} else {
/* otherwise generate a warning */
- System.err.println("WARNING: svg:rect outside svg:svg");
+ MessageHandler.errorln("WARNING: svg:rect outside svg:svg");
}
/* return status */
1.7 +3 -2 xml-fop/src/org/apache/fop/svg/Text.java
Index: Text.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/svg/Text.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- Text.java 1999/11/25 17:33:16 1.6
+++ Text.java 2000/06/27 22:14:31 1.7
@@ -1,4 +1,4 @@
-/*-- $Id: Text.java,v 1.6 1999/11/25 17:33:16 jtauber Exp $ --
+/*-- $Id: Text.java,v 1.7 2000/06/27 22:14:31 fotis Exp $ --
============================================================================
The Apache Software License, Version 1.1
@@ -53,6 +53,7 @@
// FOP
import org.apache.fop.fo.*;
+import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.fo.properties.*;
import org.apache.fop.layout.Area;
import org.apache.fop.layout.FontState;
@@ -137,7 +138,7 @@
((SVGArea) area).addGraphic(new TextGraphic(x, y, text));
} else {
/* otherwise generate a warning */
- System.err.println("WARNING: svg:text outside svg:svg");
+ MessageHandler.errorln("WARNING: svg:text outside svg:svg");
}
/* return status */
1.4 +4 -3 xml-fop/src/org/apache/fop/viewer/Command.java
Index: Command.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/viewer/Command.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Command.java 2000/04/04 09:47:52 1.3
+++ Command.java 2000/06/27 22:14:33 1.4
@@ -6,6 +6,7 @@
*/
import java.awt.event.ActionEvent;
+import org.apache.fop.messaging.MessageHandler;
import javax.swing.AbstractAction;
import javax.swing.ImageIcon;
import java.net.*;
@@ -39,7 +40,7 @@
String path = IMAGE_DIR + iconName + ".gif";
URL url = getClass().getResource(path);
if (url == null) {
- System.err.println("Icon not found: " + path);
+ MessageHandler.errorln("Icon not found: " + path);
}
else
putValue(SMALL_ICON, new ImageIcon(url));
@@ -51,10 +52,10 @@
}
public void doit() {
- System.err.println("Not implemented.");
+ MessageHandler.errorln("Not implemented.");
}
public void undoit() {
- System.err.println("Not implemented.");
+ MessageHandler.errorln("Not implemented.");
}
}
1.2 +2 -1 xml-fop/src/org/apache/fop/viewer/LoadableProperties.java
Index: LoadableProperties.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/viewer/LoadableProperties.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- LoadableProperties.java 2000/01/25 13:58:04 1.1
+++ LoadableProperties.java 2000/06/27 22:14:33 1.2
@@ -1,6 +1,7 @@
package org.apache.fop.viewer;
import java.io.*;
+import org.apache.fop.messaging.MessageHandler;
import java.util.*;
/**
@@ -60,7 +61,7 @@
return true;
}
else {
- System.out.println(getClass().getName() + ": load(): invalid line " +
+ MessageHandler.logln(getClass().getName() + ": load(): invalid line " +
str + "." + " Character '=' missed.");
return false;
}
1.2 +3 -2 xml-fop/src/org/apache/fop/viewer/SecureResourceBundle.java
Index: SecureResourceBundle.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/viewer/SecureResourceBundle.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- SecureResourceBundle.java 2000/01/25 13:58:04 1.1
+++ SecureResourceBundle.java 2000/06/27 22:14:34 1.2
@@ -1,6 +1,7 @@
package org.apache.fop.viewer;
import java.util.*;
+import org.apache.fop.messaging.MessageHandler;
import java.io.*;
@@ -35,7 +36,7 @@
try {
lookup.load(in);
} catch(Exception ex) {
- System.out.println("Abgefangene Exception: " + ex.getMessage());
+ MessageHandler.logln("Abgefangene Exception: " + ex.getMessage());
isSourceFound = false;
}
}
@@ -70,7 +71,7 @@
return obj;
else {
if (isMissingEmphasized) {
- System.out.println(getClass().getName() + ": missing key: " + key);
+ MessageHandler.logln(getClass().getName() + ": missing key: " + key);
return getMissedRepresentation(key.toString());
}
else
1.2 +11 -10 xml-fop/src/org/apache/fop/viewer/UserMessage.java
Index: UserMessage.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/viewer/UserMessage.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- UserMessage.java 2000/01/25 13:58:04 1.1
+++ UserMessage.java 2000/06/27 22:14:35 1.2
@@ -1,6 +1,7 @@
package org.apache.fop.viewer;
import java.awt.*;
+import org.apache.fop.messaging.MessageHandler;
import java.io.*;
import java.awt.event.*;
import java.util.*;
@@ -33,7 +34,7 @@
public static void setTranslator(Translator aRes) {
res = aRes;
if (res == null) {
- System.out.println("UserMessage: setTranslator(null) !");
+ MessageHandler.logln("UserMessage: setTranslator(null) !");
res = new SecureResourceBundle(null);
}
@@ -112,18 +113,18 @@
* Ersetzt die eventuellen Platzhalter durch die �bergebenen Parameter
*/
static String prepareMessage(String rawText, String[] par) {
- System.out.println("prepareMessage(): " + rawText + ", parameter: " + par);
+ MessageHandler.logln("prepareMessage(): " + rawText + ", parameter: " + par);
int index = rawText.indexOf(PARAMETER_TAG);
String composedMess = "";
if ((index == -1) && (par == null)) return rawText;
if ((index != -1) && (par == null)) {
- System.out.println("Message " + actMessId+ " erwartet Parameter. Aufgerufen ohne Parameter");
+ MessageHandler.logln("Message " + actMessId+ " erwartet Parameter. Aufgerufen ohne Parameter");
return rawText;
}
if ((index == -1) && (par != null)) {
- System.out.println("Message " + actMessId + " erwartet keine Parameter. Aufgerufen mit folgenden Parametern:");
+ MessageHandler.logln("Message " + actMessId + " erwartet keine Parameter. Aufgerufen mit folgenden Parametern:");
for(int i = 0; i < par.length; ++i)
- System.out.println(par[i].toString());
+ MessageHandler.logln(par[i].toString());
return rawText;
}
int tagCount = 0;
@@ -132,7 +133,7 @@
try {
composedMess += rawText.substring(0, index) + par[tagCount];
} catch(ArrayIndexOutOfBoundsException ex) {
- System.out.println("Anzahl der �bergebenen Parameter zu der Meldung " + actMessId + " ist weniger als erwartet.");
+ MessageHandler.logln("Anzahl der �bergebenen Parameter zu der Meldung " + actMessId + " ist weniger als erwartet.");
ex.printStackTrace();
return composedMess + rawText;
}
@@ -141,7 +142,7 @@
}
composedMess += rawText;
if (tagCount != par.length)
- System.out.println("Die zu der Meldung " + actMessId + " �bergebenen Parameter sind mehr als die Meldung vorsieht.");
+ MessageHandler.logln("Die zu der Meldung " + actMessId + " �bergebenen Parameter sind mehr als die Meldung vorsieht.");
return composedMess;
}
@@ -218,11 +219,11 @@
translatedMes = translatedMes.substring(translatedMes.indexOf(':')+1);
} catch(Exception ex) {
- System.out.println("FALSCHES FORMAT: MESSAGE: " + textID);
+ MessageHandler.logln("FALSCHES FORMAT: MESSAGE: " + textID);
}
}
else { // Message not found
- System.out.println("UserMessage: textID '" + textID + "' not found. Return " +
+ MessageHandler.logln("UserMessage: textID '" + textID + "' not found. Return " +
"value 'CANCEL' = " + CANCEL);
//return CANCEL;
@@ -260,7 +261,7 @@
else {
if (optionTypeIndex == STYLE_NOBUTTON) {
// Wird nicht mehr unterst�tzt
- System.out.println("UserMessage: STYLE_NOBUTTON wird nicht unterst�tzt");
+ MessageHandler.logln("UserMessage: STYLE_NOBUTTON wird nicht unterst�tzt");
return result;
}
else {