import java.util.*;
-
/**
* initialize AWT previewer
*/
}
-
-
package org.apache.fop.apps;
-import org.apache.fop.messaging.MessageHandler;
-
public class Fop {
public static void main(String[] args) {
CommandLineOptions options = null;
Starter starter = options.getStarter();
starter.run();
} catch (FOPException e) {
- MessageHandler.errorln("" + e.getMessage());
+ System.err.println("" + e.getMessage());
if (options != null && options.isDebugMode().booleanValue()) {
e.printStackTrace();
}
} catch (java.io.FileNotFoundException e) {
- MessageHandler.errorln("" + e.getMessage());
+ System.err.println("" + e.getMessage());
if (options != null && options.isDebugMode().booleanValue()) {
e.printStackTrace();
}
import java.io.File;
// FOP
-import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.configuration.Configuration;
*/
protected static XMLReader createParser() throws FOPException {
String parserClassName = Driver.getParserClassName();
- MessageHandler.logln("using SAX parser " + parserClassName);
+ //log.debug("using SAX parser " + parserClassName);
try {
return (XMLReader)Class.forName(parserClassName).newInstance();
import java.io.InputStream;
// fop
-import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.configuration.Configuration;
import org.apache.fop.configuration.ConfigurationReader;
// initializing option settings
void initOptions() {
if (Configuration.getBooleanValue("quiet").booleanValue()) {
- MessageHandler.setQuiet(true);
+ //MessageHandler.setQuiet(true);
}
if (Configuration.getBooleanValue("debugMode").booleanValue()) {
errorDump = true;
// quiet mode
if (clOptions.isQuiet() != null) {
- MessageHandler.setQuiet(clOptions.isQuiet().booleanValue());
+ //MessageHandler.setQuiet(clOptions.isQuiet().booleanValue());
}
// set base directory
} catch (Exception e) {}
}
if (errorDump) {
- MessageHandler.logln("base directory: " + baseDir);
+ //log.debug("base directory: " + baseDir);
}
}
throw new FOPException("can't find default configuration file");
}
if (errorDump) {
- MessageHandler.logln("reading default configuration file");
+ //log.error("reading default configuration file");
}
ConfigurationReader reader =
new ConfigurationReader(new InputSource(configfile));
public void loadUserconfiguration(File userConfigFile) {
// read user configuration file
if (userConfigFile != null) {
- MessageHandler.logln("reading user configuration file");
+ //log.debug("reading user configuration file");
ConfigurationReader reader =
new ConfigurationReader(InputHandler.fileInputSource(userConfigFile));
if (errorDump) {
try {
reader.start();
} catch (org.apache.fop.apps.FOPException error) {
- MessageHandler.errorln("Could not load user configuration file "
- + userConfigFile + " - error: "
- + error.getMessage());
- MessageHandler.errorln("using default values");
+ //log.error("Could not load user configuration file "
+ // + userConfigFile + " - error: "
+ // + error.getMessage());
+ //log.error("using default values");
if (errorDump) {
reader.dumpError(error);
}
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.
}
String version = Version.getVersion();
- MessageHandler.errorln(version);
+ //log.debug(version);
XMLReader parser = inputHandler.getParser();
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
-import org.apache.fop.messaging.MessageHandler;
/**
* a configuration class for all general configuration aspects except those
awtConfiguration = config;
break;
default:
- MessageHandler.errorln("Can't setup configuration. Unknown configuration role/target");
+ //log.error("Can't setup configuration. Unknown configuration role/target");
}
}
break;
default:
standardConfiguration.put(key, value);
- MessageHandler.errorln("Unknown role for new configuration entry. "
- + "Putting key:" + key + " - value:"
- + value + " into standard configuration.");
+ //log.error("Unknown role for new configuration entry. "
+ // + "Putting key:" + key + " - value:"
+ // + value + " into standard configuration.");
}
}
standardConfiguration, pdfConfiguration, awtConfiguration
};
for (int i = 0; i < configs.length; i++) {
- MessageHandler.logln("----------------------");
+ //log.debug("----------------------");
configuration = configs[i];
Iterator iterator = configuration.keySet().iterator();
while (iterator.hasNext()) {
key = (String)iterator.next();
- MessageHandler.logln("key: " + key);
+ //log.debug("key: " + key);
value = configuration.get(key);
if (value instanceof String) {
- MessageHandler.logln(" value: " + value);
+ //log.debug(" value: " + value);
} else if (value instanceof ArrayList) {
list = (ArrayList)value;
- MessageHandler.log(" values: ");
+ //log.debug(" values: ");
for (int count = 0; count < list.size(); count++) {
- MessageHandler.log(list.get(count) + " - ");
+ //log.debug(list.get(count) + " - ");
}
- MessageHandler.logln("");
} else if (value instanceof HashMap) {
map = (HashMap)value;
Iterator iter = map.keySet().iterator();
- MessageHandler.log(" values: ");
+ //log.debug(" values: ");
while (iter.hasNext()) {
tmp = (String)iter.next();
- MessageHandler.log(" " + tmp + ":" + map.get(tmp));
+ //log.debug(" " + tmp + ":" + map.get(tmp));
}
- MessageHandler.logln("");
}
}
}
import java.util.HashMap;
import java.util.ArrayList;
-// fop
-import org.apache.fop.messaging.MessageHandler;
-
/**
* SAX2 Handler which retrieves the configuration information and stores them in Configuration.
* Normally this class doesn't need to be accessed directly.
fontTriplets.add(fontTriplet);
} else {
// to make sure that user knows about false tag
- MessageHandler.errorln("Unknown tag in configuration file: "
- + localName);
+ //log.error("Unknown tag in configuration file: "
+ // + localName);
}
} // end startElement
if (activeConfiguration != null) {
activeConfiguration.put(key, value);
} else {
- MessageHandler.errorln("Unknown role >" + role
- + "< for new configuration entry. \n"
- + "Putting configuration with key:" + key
- + " into standard configuration.");
+ //log.error("Unknown role >" + role
+ // + "< for new configuration entry. \n"
+ // + "Putting configuration with key:" + key
+ // + " into standard configuration.");
}
}
// fop
import org.apache.fop.apps.Driver;
-import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.apps.FOPException;
import org.apache.fop.configuration.Configuration;
public static XMLReader createParser() throws FOPException {
String parserClassName = Driver.getParserClassName();
if (errorDump) {
- MessageHandler.logln("configuration reader using SAX parser "
- + parserClassName);
+ //log.debug("configuration reader using SAX parser "
+ // + parserClassName);
}
try {
package org.apache.fop.datatypes;
import org.apache.fop.fo.Property;
-import org.apache.fop.messaging.MessageHandler;
/**
* a length quantity in XSL which is specified as "auto"
package org.apache.fop.datatypes;
import java.util.*;
-import org.apache.fop.messaging.MessageHandler;
/**
* a colour quantity in XSL
this.red = 0;
this.green = 0;
this.blue = 0;
- MessageHandler.errorln("unknown colour format. Must be #RGB or #RRGGBB");
+ //log.error("unknown colour format. Must be #RGB or #RRGGBB");
}
} catch (Exception e) {
this.red = 0;
this.green = 0;
this.blue = 0;
- MessageHandler.errorln("unknown colour format. Must be #RGB or #RRGGBB");
+ //log.error("unknown colour format. Must be #RGB or #RRGGBB");
}
} else if (value.startsWith("rgb(")) {
int poss = value.indexOf("(");
this.red = 0;
this.green = 0;
this.blue = 0;
- MessageHandler.errorln("unknown colour format. Must be #RGB or #RRGGBB");
+ //log.error("unknown colour format. Must be #RGB or #RRGGBB");
}
}
} else if (value.startsWith("url(")) {
this.red = 0;
this.green = 0;
this.blue = 0;
- MessageHandler.errorln("unknown colour name: "
- + value);
+ //log.error("unknown colour name: "
+ // + value);
}
}
}
import org.apache.fop.fo.Property;
import org.apache.fop.fo.expr.Numeric;
-import org.apache.fop.messaging.MessageHandler;
/**
* a length quantity in XSL
dvalue = dvalue * assumed_resolution;
else {
dvalue = 0;
- MessageHandler.errorln("unknown length unit '" + unit
- + "'");
+ //log.error("unknown length unit '" + unit
+ // + "'");
}
setComputedValue((int)(dvalue * 1000));
}
import org.apache.fop.fo.expr.Numeric;
import org.apache.fop.fo.Property;
-import org.apache.fop.messaging.MessageHandler;
/**
* a length quantity in XSL
import org.apache.fop.fo.FObj;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.PropertyList;
-import org.apache.fop.messaging.MessageHandler;
public class LengthBase implements PercentBase {
// Standard kinds of percent-based length
return 0;
}
case CUSTOM_BASE:
- MessageHandler.errorln("!!! LengthBase.getBaseLength() called on CUSTOM_BASE type !!!");
+ //log.debug("!!! LengthBase.getBaseLength() called on CUSTOM_BASE type !!!");
return 0;
default:
- MessageHandler.errorln("Unknown base type for LengthBase.");
+ //log.error("Unknown base type for LengthBase.");
return 0;
}
}
* // if minimum is explicit, force max to min
* if ((bfSet&MAXSET)!=0) {
* // Warning: min>max, resetting max to min
- * MessageHandler.errorln("forcing max to min in LengthRange");
+ * log.error("forcing max to min in LengthRange");
* }
* maximum = minimum ;
* }
* if ((bfSet&OPTSET)!=0) {
* if ((bfSet&MAXSET)!=0) {
* // Warning: opt > max, resetting opt to max
- * MessageHandler.errorln("forcing opt to max in LengthRange");
+ * log.error("forcing opt to max in LengthRange");
* optimum = maximum ;
* }
* else {
* if ((bfSet&MINSET)!=0) {
* // if minimum is explicit, force opt to min
* if ((bfSet&OPTSET)!=0) {
- * MessageHandler.errorln("forcing opt to min in LengthRange");
+ * log.error("forcing opt to min in LengthRange");
* }
* optimum = minimum ;
* }
// FOP
import org.apache.fop.datatypes.ColorType;
+import java.awt.color.ICC_Profile;
+import java.awt.color.ICC_ColorSpace;
+import java.net.URL;
+import java.io.IOException;
+import java.io.InputStream;
+
/**
* The fo:color-profile formatting object.
* This loads the color profile when needed and resolves a requested color.
int intent;
String src;
String profileName;
+ ICC_ColorSpace colorSpace = null;
protected ColorProfile(FONode parent) {
super(parent);
* or the value is not found.
*/
public ColorType getColor(int[] colorVals, int defR, int defG, int defB) {
+ // float[] rgbvals = colorSpace.toRGB(colorVals);
+ // return new ColorType(rgbvals);
return null;
}
* Load the color profile.
*/
private void load() {
-
+ try {
+ URL url = new URL(src);
+ InputStream is = url.openStream();
+ ICC_Profile iccProfile = ICC_Profile.getInstance(is);
+ colorSpace = new ICC_ColorSpace(iccProfile);
+ } catch(IOException ioe) {
+ log.error("Could not read Color Profile src", ioe);
+ } catch(IllegalArgumentException iae) {
+ log.error("Color Profile src not an ICC Profile", iae);
+ }
}
}
package org.apache.fop.fo;
import org.apache.fop.apps.FOPException;
-import org.apache.fop.messaging.MessageHandler;
public class EnumProperty extends Property {
* Called by subclass if no match found.
*/
public Property checkEnumValues(String value) {
- MessageHandler.errorln("Unknown enumerated value for property '"
- + getPropName() + "': " + value);
+ //log.error("Unknown enumerated value for property '"
+ // + getPropName() + "': " + value);
return null;
}
return setSubprop(baseProp, partName, p);
}
} else {
- //MessageHandler.errorln("compound property component "
+ //log.error("compound property component "
// + partName + " unknown.");
}
return baseProp;
}
} catch (FOPException e) {
- //MessageHandler.errorln("convertShorthandProperty caught FOPException "
+ //log.error("convertShorthandProperty caught FOPException "
// + e);
} catch (org.apache.fop.fo.expr.PropertyException propEx) {
- //MessageHandler.errorln("convertShorthandProperty caught PropertyException "
+ //log.error("convertShorthandProperty caught PropertyException "
// + propEx);
}
if (pret != null) {
return make(propertyList, specVal,
propertyList.getParentFObj());
} catch (FOPException e) {
- //MessageHandler.errorln("Error computing property value for "
+ //log.error("Error computing property value for "
// + propName + " from "
// + specVal);
return null;
package org.apache.fop.fo;
import java.util.HashMap;
-import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.fo.properties.WritingMode;
import org.apache.fop.apps.FOPException;
return builder.makeProperty(this, namespace, element,
propertyName);
} catch (org.apache.fop.apps.FOPException e) {
- MessageHandler.errorln("Exception in getInherited(): property="
- + propertyName + " : " + e);
+ //log.error("Exception in getInherited(): property="
+ // + propertyName + " : " + e);
}
}
}
private Property get(String propertyName, boolean bTryInherit,
boolean bTryDefault) {
- if (builder == null)
- MessageHandler.errorln("OH OH, builder has not been set");
-
+ if (builder == null) {
+ //log.error("OH OH, builder has not been set");
+ }
/* Handle request for one part of a compound property */
int sepchar = propertyName.indexOf('.');
String subpropName = null;
p = this.builder.makeProperty(this, namespace, element,
propertyName);
} catch (FOPException e) {
- MessageHandler.errorln("Exception in getNearestSpecified(): property="
- + propertyName + " : " + e);
+ //log.error("Exception in getNearestSpecified(): property="
+ // + propertyName + " : " + e);
}
}
return p;
return builder.makeProperty(this, namespace, element,
propertyName);
} catch (org.apache.fop.apps.FOPException e) {
- MessageHandler.errorln("Exception in getFromParent(): property="
- + propertyName + " : " + e);
+ //log.error("Exception in getFromParent(): property="
+ // + propertyName + " : " + e);
}
}
return null; // No builder or exception in makeProperty!
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.datatypes.*;
try {
p = propertyMaker.compute(propertyList);
} catch (FOPException e) {
- MessageHandler.errorln("exception occurred while computing"
- + " value of property '"
- + propertyName + "': "
- + e.getMessage());
+ //log.error("exception occurred while computing"
+ // + " value of property '"
+ // + propertyName + "': "
+ // + e.getMessage());
}
} else {
- MessageHandler.errorln("property " + propertyName
- + " ignored");
+ //log.error("property " + propertyName
+ // + " ignored");
}
return p;
}
if (propertyMaker != null) {
b = propertyMaker.isInherited();
} else {
- // MessageHandler.errorln("Unknown property " + propertyName);
+ // log.error("Unknown property " + propertyName);
b = true;
}
return b;
p.put(propName, propVal);
}
} catch (FOPException e) { /* Do other props. */
- MessageHandler.errorln(e.getMessage());
+ //log.error(e.getMessage());
}
} else {
- if (!attributeName.startsWith("xmlns"))
- MessageHandler.errorln("property '"
- + attributeName + "' ignored");
+ if (!attributeName.startsWith("xmlns")) {
+ //log.error("property '"
+ // + attributeName + "' ignored");
+ }
}
}
if (propertyMaker != null) {
return propertyMaker.isCorrespondingForced(propertyList);
} else {
- MessageHandler.errorln("no Maker for " + propertyName);
+ //log.error("no Maker for " + propertyName);
}
return false;
}
if (propertyMaker != null) {
return propertyMaker.getShorthand(propertyList);
} else {
- MessageHandler.errorln("no Maker for " + propertyName);
+ //log.error("no Maker for " + propertyName);
return null;
}
}
if (propertyMaker != null) {
p = propertyMaker.make(propertyList);
} else {
- MessageHandler.errorln("property " + propertyName
- + " ignored");
+ //log.error("property " + propertyName
+ // + " ignored");
}
return p;
}
public void handleAttrs(Attributes attlist) throws FOPException {
attr = attlist;
}
+
+ public Document getDocument() {
+ return doc;
+ }
+
public abstract String getNameSpace();
protected static HashMap ns = new HashMap();
public Character(FONode parent) {
super(parent);
- this.name = "fo:character";
}
public Status layout(Area area) throws FOPException {
public Flow(FONode parent) {
super(parent);
- this.name = getElementName();
}
public void handleAttrs(Attributes attlist) throws FOPException {
protected void setFlowName(String name) throws FOPException {
if (name == null || name.equals("")) {
log.warn("A 'flow-name' is required for "
- + getElementName()
+ + getName()
+ ". This constraint will be enforced in future versions of FOP");
_flowName = "xsl-region-body";
} else {
return this.contentWidth;
}
- protected String getElementName() {
- return "fo:flow";
- }
-
public Status getStatus() {
return _status;
}
-
public boolean generatesReferenceAreas() {
return true;
}
public Footnote(FONode parent) {
super(parent);
- this.name = "fo:footnote";
}
public Status layout(Area area) throws FOPException {
public FootnoteBody(FONode parent) {
super(parent);
- this.name = "fo:footnote-body";
}
public Status layout(Area area) throws FOPException {
// FOP
import org.apache.fop.fo.*;
import org.apache.fop.fo.properties.*;
-import org.apache.fop.layout.*;
-import org.apache.fop.layout.inline.*;
-import org.apache.fop.layout.BlockArea;
+import org.apache.fop.area.inline.InlineArea;
+import org.apache.fop.area.inline.Viewport;
+import org.apache.fop.area.inline.ForeignObject;
import org.apache.fop.layout.FontState;
+import org.apache.fop.layout.AccessibilityProps;
+import org.apache.fop.layout.AuralProps;
+import org.apache.fop.layout.BorderAndPadding;
+import org.apache.fop.layout.BackgroundProps;
+import org.apache.fop.layout.MarginInlineProps;
+import org.apache.fop.layout.RelativePositionProps;
import org.apache.fop.apps.FOPException;
-// Java
-import java.util.Enumeration;
+import org.w3c.dom.Document;
public class InstreamForeignObject extends FObj {
int startIndent;
int endIndent;
- ForeignObjectArea areaCurrent;
+ Viewport areaCurrent;
/**
* constructs an instream-foreign-object object (called by Maker).
super(parent);
}
+ /**
+ * Get the inline area created by this element.
+ */
+ protected InlineArea getInlineArea() {
+ if (children == null) {
+ return areaCurrent;
+ }
+
+ if (this.children.size() != 1) {
+ // error
+ }
+ FONode fo = (FONode)children.get(0);
+ if(!(fo instanceof XMLObj)) {
+ // error
+ }
+ XMLObj child = (XMLObj)fo;
+
+ // Common Accessibility Properties
+ AccessibilityProps mAccProps = propMgr.getAccessibilityProps();
+
+ // Common Aural Properties
+ AuralProps mAurProps = propMgr.getAuralProps();
+
+ // Common Border, Padding, and Background Properties
+ BorderAndPadding bap = propMgr.getBorderAndPadding();
+ BackgroundProps bProps = propMgr.getBackgroundProps();
+
+ // Common Margin Properties-Inline
+ MarginInlineProps mProps = propMgr.getMarginInlineProps();
+
+ // Common Relative Position Properties
+ RelativePositionProps mRelProps = propMgr.getRelativePositionProps();
+
+ // viewport size is determined by block-progression-dimension
+ // and inline-progression-dimension
+
+ // if replaced then use height then ignore block-progression-dimension
+ //int h = this.properties.get("height").getLength().mvalue();
+
+ // use line-height then ignore dimension in height direction
+ int lh = this.properties.get("line-height").getLength().mvalue();
+
+ int bpd = this.properties.get("block-progression-dimension").getLength().mvalue();
+ int ipd = this.properties.get("inline-progression-dimension").getLength().mvalue();
+
+ // if auto then use the intrinsic size of the content scaled
+ // to the content-height and content-width
+
+ Document doc = child.getDocument();
+ String ns = child.getNameSpace();
+
+ children = null;
+ ForeignObject foreign = new ForeignObject(doc, ns);
+
+ areaCurrent = new Viewport(foreign);
+ return areaCurrent;
+ }
+
/**
* layout this formatting object.
*
* @param area the area to layout the object into
*
* @return the status of the layout
- */
+ *
public Status layout(Area area) throws FOPException {
if (this.marker == BREAK_AFTER) {
// this.properties.get("text-align");
// this.properties.get("width");
- /* retrieve properties */
+ /* retrieve properties *
String id = this.properties.get("id").getString();
int align = this.properties.get("text-align").getEnum();
int valign = this.properties.get("vertical-align").getEnum();
if (numChildren > 1) {
throw new FOPException("Only one child element is allowed in an instream-foreign-object");
}
- /* layout foreign object */
+ /* layout foreign object *
if (this.children.size() > 0) {
FONode fo = (FONode)children.get(0);
Status status;
return status;
}
- /* finish off the foreign object area */
+ /* finish off the foreign object area *
this.areaCurrent.end();
}
}
/*
* endIndent = areaCurrent.getEffectiveWidth() - forcedWidth -
* forcedStartOffset;
- */
+ *
}
areaCurrent.setStartIndent(startIndent);
// areaCurrent.setEndIndent(endIndent);
- /* if there is a space-before */
+ /* if there is a space-before *
if (spaceBefore != 0) {
- /* add a display space */
+ /* add a display space *
// area.addDisplaySpace(spaceBefore);
}
- /* add the SVG area to the containing area */
+ /* add the SVG area to the containing area *
// area.addChild(areaCurrent);
areaCurrent.setPage(area.getPage());
- /* increase the height of the containing area accordingly */
+ /* increase the height of the containing area accordingly *
// area.increaseHeight(areaCurrent.getEffectiveHeight());
- /* if there is a space-after */
+ /* if there is a space-after *
if (spaceAfter != 0) {
- /* add a display space */
+ /* add a display space *
// area.addDisplaySpace(spaceAfter);
}
}
areaCurrent = null;
- /* return status */
+ /* return status *
return new Status(Status.OK);
}
-
+*/
}
public ListItem(FONode parent) {
super(parent);
- this.name = "fo:list-item";
}
public Status layout(Area area) throws FOPException {
public ListItemBody(FONode parent) {
super(parent);
- this.name = "fo:list-item-body";
}
public Status layout(Area area) throws FOPException {
public ListItemLabel(FONode parent) {
super(parent);
- this.name = "fo:list-item-label";
}
public Status layout(Area area) throws FOPException {
public MultiProperties(FONode parent) {
super(parent);
- this.name = "fo:multi-properties";
}
public Status layout(Area area) throws FOPException {
public MultiPropertySet(FONode parent) {
super(parent);
- this.name = "fo:multi-property-set";
}
public Status layout(Area area) throws FOPException {
public MultiSwitch(FONode parent) {
super(parent);
- this.name = "fo:multi-switch";
}
public Status layout(Area area) throws FOPException {
public MultiToggle(FONode parent) {
super(parent);
- this.name = "fo:multi-toggle";
}
public Status layout(Area area) throws FOPException {
public RetrieveMarker(FONode parent) {
super(parent);
- this.name = "fo:retrieve-marker";
}
public void handleAttrs(Attributes attlist) throws FOPException {
import org.apache.fop.layout.Area;
import org.apache.fop.apps.FOPException;
-// Java
-import java.util.Enumeration;
-
public class StaticContent extends Flow {
public StaticContent(FONode parent) {
return new Status(Status.OK);
}
- protected String getElementName() {
- return "fo:static-content";
- }
-
// flowname checking is more stringient for static content currently
protected void setFlowName(String name) throws FOPException {
if (name == null || name.equals("")) {
throw new FOPException("A 'flow-name' is required for "
- + getElementName() + ".");
+ + getName() + ".");
} else {
super.setFlowName(name);
}
public Table(FONode parent) {
super(parent);
- this.name = "fo:table";
}
public Status layout(Area area) throws FOPException {
public TableBody(FONode parent) {
super(parent);
- this.name = "fo:table-body";
}
public void setColumns(ArrayList columns) {
public TableCell(FONode parent) {
super(parent);
- this.name = "fo:table-cell";
}
public void handleAttrs(Attributes attlist) throws FOPException {
public TableColumn(FONode parent) {
super(parent);
- this.name = "fo:table-column";
}
public Length getColumnWidthAsLength() {
public TableFooter(FONode parent) {
super(parent);
- this.name = "fo:table-footer";
}
}
public TableHeader(FONode parent) {
super(parent);
- this.name = "fo:table-header";
}
}
import java.util.Iterator;
import java.util.HashMap;
import java.util.ArrayList;
-import org.apache.fop.messaging.MessageHandler;
/**
* Reads a TrueType file and generates a subset
if (newIdx == null) {
// This errormessage would look much better
// if the fontname was printed to
- MessageHandler.error("An embedded font "
- + "contains bad glyph data. "
- + "Characters might not display "
- + "correctly.");
+ //log.error("An embedded font "
+ // + "contains bad glyph data. "
+ // + "Characters might not display "
+ // + "correctly.");
moreComposites = false;
continue;
}
createCvt(in); // copy the cvt table
} catch (IOException ex) {
// Cvt is optional (only required for OpenType (MS) fonts)
- MessageHandler.errorln("TrueType warning: " + ex.getMessage());
+ //log.error("TrueType warning: " + ex.getMessage());
}
try {
createFpgm(in); // copy fpgm table
} catch (IOException ex) {
// Fpgm is optional (only required for OpenType (MS) fonts)
- MessageHandler.errorln("TrueType warning: " + ex.getMessage());
+ //log.error("TrueType warning: " + ex.getMessage());
}
try {
createPrep(in); // copy prep table
} catch (IOException ex) {
// Prep is optional (only required for OpenType (MS) fonts)
- MessageHandler.errorln("TrueType warning: " + ex.getMessage());
+ //log.error("TrueType warning: " + ex.getMessage());
}
try {
createLoca(glyphs.size()); // create empty loca table
} catch (IOException ex) {
// Loca is optional (only required for OpenType (MS) fonts)
- MessageHandler.errorln("TrueType warning: " + ex.getMessage());
+ //log.error("TrueType warning: " + ex.getMessage());
}
try {
createGlyf(in, glyphs);
} catch (IOException ex) {
// Glyf is optional (only required for OpenType (MS) fonts)
- MessageHandler.errorln("TrueType warning: " + ex.getMessage());
+ //log.error("TrueType warning: " + ex.getMessage());
}
pad4();
}
public byte[] getEPSImage() throws FopImageException {
- if (epsImage == null)
- MessageHandler.errorln("ERROR LOADING EXTERNAL EPS");
+ if (epsImage == null) {
+ //log.error("ERROR LOADING EXTERNAL EPS");
+ }
return epsImage;
}
// Java
import java.util.Hashtable;
-import org.apache.fop.messaging.MessageHandler;
import java.awt.image.*;
import java.awt.*;
public void imageComplete(int status) {
/*
- * MessageHandler.error("Status ");
+ * log.error("Status ");
* if (status == ImageConsumer.COMPLETESCANLINES) {
- * MessageHandler.errorln("CompleteScanLines");
+ * log.error("CompleteScanLines");
* } else if (status == ImageConsumer.IMAGEABORTED) {
- * MessageHandler.errorln("ImageAborted");
+ * log.error("ImageAborted");
* } else if (status == ImageConsumer.IMAGEERROR) {
- * MessageHandler.errorln("ImageError");
+ * log.error("ImageError");
* } else if (status == ImageConsumer.RANDOMPIXELORDER) {
- * MessageHandler.errorln("RandomPixelOrder");
+ * log.error("RandomPixelOrder");
* } else if (status == ImageConsumer.SINGLEFRAME) {
- * MessageHandler.errorln("SingleFrame");
+ * log.error("SingleFrame");
* } else if (status == ImageConsumer.SINGLEFRAMEDONE) {
- * MessageHandler.errorln("SingleFrameDone");
+ * log.error("SingleFrameDone");
* } else if (status == ImageConsumer.SINGLEPASS) {
- * MessageHandler.errorln("SinglePass");
+ * log.error("SinglePass");
* } else if (status == ImageConsumer.STATICIMAGEDONE) {
- * MessageHandler.errorln("StaticImageDone");
+ * log.error("StaticImageDone");
* } else if (status == ImageConsumer.TOPDOWNLEFTRIGHT) {
- * MessageHandler.errorln("TopDownLeftRight");
+ * log.error("TopDownLeftRight");
* }
*/
synchronized (this.imageStatus) {
}
public void setColorModel(ColorModel model) {
- // MessageHandler.errorln("setColorModel: " + model);
+ // log.error("setColorModel: " + model);
this.cm = model;
}
public void setDimensions(int width, int height) {
- // MessageHandler.errorln("setDimension: w=" + width + " h=" + height);
+ // log.error("setDimension: w=" + width + " h=" + height);
this.width = width;
this.height = height;
}
public void setHints(int hintflags) {
- // MessageHandler.errorln("setHints: " + hintflags);
+ // log.error("setHints: " + hintflags);
this.hints = hintflags;
}
public void setProperties(Hashtable props) {
- // MessageHandler.errorln("setProperties: " + props);
+ // log.error("setProperties: " + props);
this.properties = props;
}
// FOP
import org.apache.fop.apps.Driver;
-import org.apache.fop.messaging.*;
import org.apache.fop.datatypes.ColorSpace;
import org.apache.fop.pdf.PDFColor;
import org.apache.fop.image.analyser.ImageReader;
new SAXSVGDocumentFactory(SVGImage.getParserName());
doc = factory.createDocument(this.m_href.toExternalForm());
} catch (Exception e) {
- MessageHandler.errorln("Could not load external SVG: "
- + e.getMessage());
+ //log.error("Could not load external SVG: "
+ // + e.getMessage());
}
}
return true;
} catch (NoClassDefFoundError ncdfe) {
- MessageHandler.errorln("Batik not in class path");
+ //log.error("Batik not in class path");
return false;
}
catch (Exception e) {
- MessageHandler.errorln("Could not load external SVG: " +
- e.getMessage());
+ //log.error("Could not load external SVG: " +
+ // e.getMessage());
// assuming any exception means this document is not svg
// or could not be loaded for some reason
return false;
// Java
import java.util.Vector;
import java.util.Enumeration;
-import org.apache.fop.messaging.MessageHandler;
/**
* This class represents a Block Area.
if (f == null) {
throw new FOPException("no default font defined by OutputConverter");
}
- //MessageHandler.errorln("defaulted font to any,normal,normal");
+ //log.error("defaulted font to any,normal,normal");
}
- //MessageHandler.errorln("unknown font " + key
+ //log.error("unknown font " + key
// + " so defaulted font to any");
}
// fop
import org.apache.fop.render.Renderer;
-import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.layout.inline.*;
import org.apache.fop.datatypes.IDNode;
import org.apache.fop.fo.properties.WrapOption;
wordWidth = charWidth;
if ((finalWidth + spaceWidth + wordWidth)
> this.getContentWidth()) {
- if (overrun)
- MessageHandler.log("area contents overflows area");
+ if (overrun) {
+ //log.debug("area contents overflows area");
+ }
if (this.wrapOption == WrapOption.WRAP) {
return i;
}
(wordStart == start) &&
(finalWidth == 0)) {
- MessageHandler.log("area contents overflows area");
+ //log.debug("area contents overflows area");
addSpacedWord(new String(data, wordStart, wordLength - 1),
ls,
finalWidth + spaceWidth
wordWidth = 0;
}
- if (overrun)
- MessageHandler.log("area contents overflows area");
+ if (overrun) {
+ //log.debug("area contents overflows area");
+ }
return -1;
}
break;
// leader pattern use-content not implemented.
case LeaderPattern.USECONTENT:
- MessageHandler.errorln("leader-pattern=\"use-content\" not "
- + "supported by this version of Fop");
+ //log.error("leader-pattern=\"use-content\" not "
+ // + "supported by this version of Fop");
return;
}
// adds leader length to length of pending inline areas
private InlineArea buildSimpleLeader(char c, int leaderLength) {
int width = this.currentFontState.width(currentFontState.mapChar(c));
if (width == 0) {
- MessageHandler.errorln("char " + c
- + " has width 0. Using width 100 instead.");
+ //log.error("char " + c
+ // + " has width 0. Using width 100 instead.");
width = 100;
}
int factor = (int)Math.floor(leaderLength / width);
int remainingWidth) {
// check whether the language property has been set
if (this.hyphProps.language.equalsIgnoreCase("none")) {
- MessageHandler.errorln("if property 'hyphenate' is used, a language must be specified");
+ //log.error("if property 'hyphenate' is used, a language must be specified");
return wordStart;
}
import java.io.*;
import java.util.Hashtable;
import org.apache.fop.configuration.*;
-import org.apache.fop.messaging.MessageHandler;
/**
* This class is the main entry point to the hyphenation package.
if (hTree != null) {
hyphenTrees.put(key, hTree);
} else {
- MessageHandler.errorln("Couldn't find hyphenation pattern "
- + key);
+ //log.error("Couldn't find hyphenation pattern "
+ // + key);
}
return hTree;
}
if (key.length() == 5) {
is = getResourceStream(key.substring(0, 2));
if (is != null) {
- MessageHandler.errorln("Couldn't find hyphenation pattern "
- + key
- + "\nusing general language pattern "
- + key.substring(0, 2)
- + " instead.");
+ //log.error("Couldn't find hyphenation pattern "
+ // + key
+ // + "\nusing general language pattern "
+ // + key.substring(0, 2)
+ // + " instead.");
} else {
if (errorDump) {
- MessageHandler.errorln("Couldn't find precompiled "
- + "fop hyphenation pattern "
- + key + ".hyp");
+ //log.error("Couldn't find precompiled "
+ // + "fop hyphenation pattern "
+ // + key + ".hyp");
}
return null;
}
} else {
if (errorDump) {
- MessageHandler.errorln("Couldn't find precompiled "
- + "fop hyphenation pattern "
- + key + ".hyp");
+ //log.error("Couldn't find precompiled "
+ // + "fop hyphenation pattern "
+ // + key + ".hyp");
}
return null;
}
try {
ois.close();
} catch (IOException e) {
- MessageHandler.errorln("can't close hyphenation object stream");
+ //log.error("can't close hyphenation object stream");
}
}
}
if (hyphenFile.exists()) {
hTree = new HyphenationTree();
if (errorDump) {
- MessageHandler.errorln("reading " + hyphenDir + key
- + ".xml");
+ //log.error("reading " + hyphenDir + key
+ // + ".xml");
}
try {
hTree.loadPatterns(hyphenFile.getPath());
return hTree;
} catch (HyphenationException ex) {
if (errorDump) {
- MessageHandler.errorln("Can't load user patterns "
- + "from xml file " + hyphenDir
- + key + ".xml");
+ //log.error("Can't load user patterns "
+ // + "from xml file " + hyphenDir
+ // + key + ".xml");
}
return null;
}
} else {
if (errorDump) {
- MessageHandler.errorln("Tried to load "
- + hyphenFile.toString()
- + "\nCannot find compiled nor xml file for "
- + "hyphenation pattern" + key);
+ //log.error("Tried to load "
+ // + hyphenFile.toString()
+ // + "\nCannot find compiled nor xml file for "
+ // + "hyphenation pattern" + key);
}
return null;
}
int rightMin) {
HyphenationTree hTree = getHyphenationTree(lang, country);
if (hTree == null) {
- MessageHandler.errorln("Error building hyphenation tree for language "
- + lang);
+ //log.error("Error building hyphenation tree for language "
+ // + lang);
return null;
}
return hTree.hyphenate(word, leftMin, rightMin);
int leftMin, int rightMin) {
HyphenationTree hTree = getHyphenationTree(lang, country);
if (hTree == null) {
- MessageHandler.errorln("Error building hyphenation tree for language "
- + lang);
+ //log.error("Error building hyphenation tree for language "
+ // + lang);
return null;
}
return hTree.hyphenate(word, offset, len, leftMin, rightMin);
+++ /dev/null
-/*
- * $Id$
- * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
- * For details on use and redistribution please refer to the
- * LICENSE file included with these sources.
- */
-
-package org.apache.fop.messaging;
-
-/**
- * A trivial implementation of a MessageListener
- * For further explanation
- */
-public class DefaultMessageListener implements MessageListener {
-
- /**
- * The method processMessage has to be overwritten to handle the MessageEvents.
- * The message type (information or error) is accessible via event.getMessageType().
- */
-
- public void processMessage(MessageEvent event) {
- switch (event.getMessageType()) {
- case MessageEvent.ERROR:
- System.err.print("ERROR: " + event.getMessage());
- break;
- case MessageEvent.LOG:
- System.out.print("LOG: " + event.getMessage());
- break;
- default:
- System.out.print("Unknown message type: " + event.getMessage());
- }
- }
-
-}
+++ /dev/null
-/*
- * $Id$
- * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
- * For details on use and redistribution please refer to the
- * LICENSE file included with these sources.
- */
-
-package org.apache.fop.messaging;
-
-import java.util.EventObject;
-
-/**
- * a container for the text and the type of a message
- * MessageEvents are created by MessageHandler and can be received by any
- * MessageListener, which is added to MessageHandler;
- */
-public class MessageEvent extends EventObject {
- public static final int LOG = 0;
- public static final int ERROR = 1;
- String message;
- int messageType = MessageEvent.LOG;
-
- public MessageEvent(Object source) {
- super(source);
- message = (String)source; // MessageHandler.getMessage()
- }
-
- /**
- * retrieves the message
- * @return String containing the message
- *
- */
- public String getMessage() {
- return message;
- }
-
- /**
- * sets the message type
- * @param messageType the type of the message as int in the form of MessageEvent.LOG or MessageEvent.ERROR
- *
- */
- void setMessageType(int messageType) {
- this.messageType = messageType;
- }
-
- /**
- * returns the type of message as int
- *
- * @return messageType the type of the message as int in the form of MessageEvent.LOG or MessageEvent.ERROR
- */
- public int getMessageType() {
- return messageType;
- }
-
-}
-
+++ /dev/null
-/*
- * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
- * For details on use and redistribution please refer to the
- * LICENSE file included with these sources."
- */
-
-
-package org.apache.fop.messaging;
-
-import java.io.*;
-import java.util.*;
-
-import org.apache.log.*;
-
-/**
- * The class MessageHandler contains the static methods log and error which
- * should be used for any end user information instead of System.out.print() or
- * System.err.print(). The class defines several output methods:
- * writing to the screen (default), logging to a file, creating message events and repressing all
- * output. If you don't want to change the default behaviour, you should be
- * happy with MessageHandler.log(message) and MessageHandler.error(message)<br>
- * The class MessageHandler also supports the setting of an id. If set every message
- * has as a prefix an identifying string. That way Fop probably can also be used in
- * environments, where more than one Fop instance are running in same JVM.<br>
- * If Fop is embedded in a gui application or for any reasons the existing
- * messaging system doesn't meet the programmer's requirements, one can add
- * a MessageEvent listener to MessageHandler and handle the incoming messages
- * in an appropriate way. See the class DefaultMessageListener, which is a trivial
- * implementation of the MessageListener.
- * Here is an example how to configure MessageHandler for the DefaultMessageListener (anybody
- * can provide his own listener by extending MessageListener<br>
- * <code>
- * MessageHandler.setOutputMethod(MessageHandler.EVENT);
- * MessageHandler.addListener(new DefaultMessageListener());
- * </code><br>
- * This examples shows, how to redirect the messages to a log file called fop.log.
- * All messages are appended to this file.
- * <code>
- * MessageHandler.setOutputMethod(MessageHandler.FILE);
- * MessageHandler.setLogfileName("\\fop.log",true);
- * </code>
- */
-
-public class MessageHandler {
- public static final int SCREEN = 0;
- public static final int FILE = 1;
- public static final int EVENT = 2;
- public static final int NONE = 3; // this should always be the last method
-
- private static String logfileName = "fop.log";
- private static PrintWriter writer;
- private static int outputMethod = SCREEN;
- private static boolean fileOpened = false;
- private static boolean appendToFile = true;
- private static String message = "";
- private static String prefix = "";
- private static Vector listeners = new Vector();
- private static boolean IDisSet = false;
- private static boolean quiet = false;
-
- /**
- * helper class to access the message
- * @return a string containing the message
- */
-
- private static String getMessage() {
- return message;
- }
-
- /**
- * helper class which sets the message
- * and adds a prefix which can contain
- * the id of the thread which uses this messagehandler
- */
- private static void setMessage(String m) {
- if (IDisSet) {
- message = getID() + ":" + m;
- } else {
- message = m;
- }
- }
-
- // temp workaround
- private static Logger logger = null;
-
- /**
- * informs the user of the message
- * @param message the message for the user
- */
- public static void log(String message) {
- if (!quiet) {
- if(logger == null) {
- logger = Hierarchy.getDefaultHierarchy().getLoggerFor("fop");
- }
- setMessage(message);
- switch (outputMethod) {
- case SCREEN:
- logger.debug(getMessage());
- break;
- case FILE:
- if (fileOpened) {
- writer.print(getMessage());
- writer.flush();
- } else {
- openFile();
- writer.print(getMessage());
- writer.flush();
- }
- break;
- case EVENT:
- setMessage(message);
- Enumeration enum = listeners.elements();
- while (enum.hasMoreElements()) {
- ((MessageListener)enum.nextElement()).processMessage(new MessageEvent(getMessage()));
- }
- break;
- case NONE:
- // do nothing
- break;
- default:
- logger.debug(message);
- }
- }
- }
-
- /**
- * convenience method which adds a return to the message
- * @param message the message for the user
- */
- public static void logln(String message) {
- log(message);
- }
-
- /**
- * error warning for the user
- * @param errorMessage contains the warning string
- */
-
- public static void error(String errorMessage) {
- if(logger == null) {
- logger = Hierarchy.getDefaultHierarchy().getLoggerFor("fop");
- }
- setMessage(errorMessage);
- switch (outputMethod) {
- case SCREEN:
- logger.error(getMessage());
- break;
- case FILE:
- if (fileOpened) {
- writer.print(getMessage());
- writer.flush();
- } else {
- openFile();
- writer.print(getMessage());
- writer.flush();
- }
- break;
- case EVENT:
- setMessage(message);
- Enumeration enum = listeners.elements();
- while (enum.hasMoreElements()) {
- MessageEvent messEv = new MessageEvent(getMessage());
- messEv.setMessageType(MessageEvent.ERROR);
- ((MessageListener)enum.nextElement()).processMessage(messEv);
- }
- break;
- case NONE:
- // do nothing
- break;
- default:
- logger.error(errorMessage);
- }
- }
-
- /**
- * convenience method which adds a return to the error message
- * @param errorMessage the message for the user
- */
- public static void errorln(String errorMessage) {
- error(errorMessage);
- }
-
- /**
- * adds a MessageListener which listens for MessageEvents
- * @param MessageListener the listener to add
- */
- public static void addListener(MessageListener listener) {
- listeners.addElement(listener);
- }
-
- /**
- * removes a MessageListener
- * @param MessageListener the listener to remove
- */
- public static void removeListener(MessageListener listener) {
- listeners.removeElement(listener);
- }
-
- /**
- * sets the output method
- * @param method the output method to use, allowed values are<br>
- * MessageHandler.SCREEN, MessageHandler.FILE, MessageHandler.EVENT
- * MessageHandler.NONE
- */
- public static void setOutputMethod(int method) {
- if (method > NONE) {
- MessageHandler.error("Error: Unknown output method");
- } else {
- outputMethod = method;
- }
- }
-
- /**
- * informs what output method is set
- * @return the output method
- */
- public static int getOutputMethod() {
- return outputMethod;
- }
-
- /**
- * sets the logfile name
- * @param filename name of the logfile
- * @param append if true, the logfile is appended
- */
- public static void setLogfileName(String filename, boolean append) {
- logfileName = filename;
- appendToFile = append;
- }
-
- /**
- * returns the logfile name
- * @return String containing the logfile name
- */
- public static String getLogfileName() {
- return logfileName;
- }
-
- /**
- * helper file which opens the file for output method FILE
- */
- private static void openFile() {
- try {
- writer =
- new PrintWriter(new FileWriter(logfileName, appendToFile),
- true);
- writer.println("\n==============================================");
- fileOpened = true;
- } catch (IOException ioe) {
- System.err.println("Error: " + ioe);
- }
- }
-
- /**
- * if set to true an id string is prefixed to every message
- * uses the thread info as an id for the message producer. Should be used if
- * more than one instance of Fop is running in the same JVM
- * this id becomes a prefix to every message
- */
- private static String getID() {
- return Thread.currentThread().toString();
- }
-
- /**
- * if set to true an id string is prefixed to every message
- * uses the thread info as an id for the message producer. Should be used if
- * more than one instance of Fop is running in the same JVM
- * this id becomes a prefix to every message
- *
- * @param id boolean (default is false)
- */
-
- public static void setID(boolean id) {
- IDisSet = id;
- }
-
- /**
- * if set to true all normal messages are suppressed.
- * error messages are displayed allthesame
- *
- * @param quietMode boolean (default is false)
- */
- public static void setQuiet(boolean quietMode) {
- quiet = quietMode;
- }
-
-}
+++ /dev/null
-/*
- * $Id$
- * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
- * For details on use and redistribution please refer to the
- * LICENSE file included with these sources.
- */
-
-package org.apache.fop.messaging;
-
-/**
- * For situations, where the messages Fop directs to the user have to be handled in some
- * special way, the interface MessageListener and the class MessageEvent are provided.
- * Embedding Fop into a graphical user interface could be such a scenario.<br>
- * Any MessageListener listens for MessageEvents, which contain the user message and
- * also the message type information (progress information or error warning).
- * The class DefaultMessageListener shows an trivial implementation of MessageListener.
- */
-
-
-public interface MessageListener {
-
- void processMessage(MessageEvent event);
-
-}
-
// referenced and I'd rather not do it
import org.apache.fop.image.FopImage;
-import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.layout.LinkSet;
import org.apache.fop.datatypes.ColorSpace;
} else if (bookComponent.document.height != height
|| bookComponent.document.width != width) {
- MessageHandler.logln("Warning : FrameMaker doesnt support different page-sizes in a document");
+ //log.warn("FrameMaker doesnt support different page-sizes in a document");
}
}
compressedStream.flush();
compressedStream.close();
} catch (IOException e) {
- org.apache.fop.messaging.MessageHandler.error("Fatal error: "
- + e.getMessage());
- e.printStackTrace();
+ //log.error("Fatal error: "
+ // + e.getMessage(), e);
}
return outArrayStream.toByteArray();
// Java
import java.io.PrintWriter;
-import org.apache.fop.messaging.MessageHandler;
import java.util.ArrayList;
/**
*/
public void incrementCount() {
this.count++;
- // MessageHandler.logln("Incrementing count to " + this.getCount());
+ // log.debug("Incrementing count to " + this.getCount());
}
/**
import java.util.ArrayList;
import java.util.Enumeration;
import org.apache.fop.configuration.Configuration;
-import org.apache.fop.messaging.MessageHandler;
/**
* class representing a PDF stream.
} else if (filterType.equals("")) {
return;
} else {
- MessageHandler.errorln("Unsupported filter type in stream-filter-list: "
- + filterType);
+ //log.error("Unsupported filter type in stream-filter-list: "
+ // + filterType);
}
}
// Java
import java.io.IOException;
-import org.apache.fop.messaging.MessageHandler;
import java.io.OutputStream;
// FOP
isPS = false;
this.Xnum = Xnumber;
if (img == null)
- MessageHandler.errorln("FISH");
+ //log.error("FISH");
fopimage = img;
this.pdfDoc = pdfdoc;
pdfICCStream = null;
}
}
} catch (Exception e) {
- MessageHandler.errorln("Error while reading image " +
- fopimage.getURL() +
- ": " + e.getMessage());
+ //log.error("Error while reading image " +
+ // fopimage.getURL() +
+ // ": " + e.getMessage());
}
}
length += pdfBytes.length;
}
} catch (FopImageException imgex) {
- MessageHandler.errorln("Error in XObject : "
- + imgex.getMessage());
+ //log.error("Error in XObject : "
+ // + imgex.getMessage());
}
return length;
package org.apache.fop.render.awt;
// FOP
-import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.layout.FontInfo;
import org.apache.fop.layout.FontDescriptor;
import org.apache.fop.layout.FontState;
package org.apache.fop.render.awt;
// FOP
-import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.layout.FontInfo;
import org.apache.fop.layout.FontDescriptor;
FontMetricsMapper metric;
int normal, bold, bolditalic, italic;
- MessageHandler.logln("setting up fonts");
-
/*
* available java fonts are:
* Serif - bold, normal, italic, bold-italic
// FOP
import org.apache.fop.render.mif.fonts.*;
-import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.layout.FontInfo;
import org.apache.fop.layout.FontDescriptor;
import org.apache.fop.mif.MIFDocument;
* @param fontInfo the font info object to set up
*/
public static void setup(FontInfo fontInfo) {
- MessageHandler.logln("setting up fonts");
fontInfo.addMetrics("F1", new Helvetica());
fontInfo.addMetrics("F2", new HelveticaOblique());
}
}
} catch (Exception ex) {
- //MessageHandler.error("Failed to read font metrics file "
+ //log.error("Failed to read font metrics file "
// + configFontInfo.getMetricsFile()
// + " : " + ex.getMessage());
}
import org.apache.fop.render.pdf.Font;
import org.apache.fop.layout.FontDescriptor;
import org.apache.fop.pdf.PDFStream;
-import org.apache.fop.messaging.MessageHandler;
import java.util.HashMap;
import org.apache.fop.render.pdf.FontReader;
}
// System.out.println("Metrics " + metricsFileName + " loaded.");
} catch (Exception ex) {
- MessageHandler.error("Failed to read font metrics file "
- + metricsFileName
- + " : " + ex.getMessage());
+ //log.error("Failed to read font metrics file "
+ // + metricsFileName
+ // + " : " + ex.getMessage());
}
}
}
import org.apache.fop.render.pdf.CIDFont;
import org.apache.fop.render.pdf.CMap;
import org.apache.fop.pdf.PDFTTFStream;
-import org.apache.fop.messaging.MessageHandler;
import java.io.InputStream;
import java.io.IOException;
import java.io.FileInputStream;
embeddedFont.addFilter("ascii-85");
embeddedFont.setData(subsetFont, subsetFont.length);
} catch (IOException ioe) {
- MessageHandler.errorln("Failed to embed font [" + i + "] "
- + fontName + ": " + ioe.getMessage());
+ //log.error("Failed to embed font [" + i + "] "
+ // + fontName + ": " + ioe.getMessage());
return (PDFStream)null;
}
*/
import java.awt.event.ActionEvent;
-import org.apache.fop.messaging.MessageHandler;
import javax.swing.AbstractAction;
import javax.swing.ImageIcon;
import java.net.*;
String path = IMAGE_DIR + iconName + ".gif";
URL url = getClass().getResource(path);
if (url == null) {
- MessageHandler.errorln("Icon not found: " + path);
+ //log.error("Icon not found: " + path);
} else
putValue(SMALL_ICON, new ImageIcon(url));
}
}
public void doit() {
- MessageHandler.errorln("Not implemented.");
+ //log.error("Not implemented.");
}
public void undoit() {
- MessageHandler.errorln("Not implemented.");
+ //log.error("Not implemented.");
}
}
import javax.swing.*;
import java.awt.event.*;
-import org.apache.fop.messaging.MessageHandler;
-
public class GoToPageDialog extends JDialog {
JPanel panel1 = new JPanel();
GridBagLayout gridBagLayout1 = new GridBagLayout();
jbInit();
pack();
} catch (Exception ex) {
- MessageHandler.errorln("GoToPageDialog: Konstruktor: "
- + ex.getMessage());
+ //log.error("GoToPageDialog: Konstruktor: "
+ // + ex.getMessage(), ex);
}
}
package org.apache.fop.viewer;
import java.io.*;
-import org.apache.fop.messaging.MessageHandler;
import java.util.*;
/**
if (index > 0 && str.length() > index) {
return true;
} else {
- MessageHandler.logln(getClass().getName()
- + ": load(): invalid line " + str + "."
- + " Character '=' missed.");
+ //log.debug(getClass().getName()
+ // + ": load(): invalid line " + str + "."
+ // + " Character '=' missed.");
return false;
}
}
import org.apache.fop.layout.*;
import org.apache.fop.render.awt.*;
-import org.apache.fop.messaging.*;
/**
* Frame and User Interface for Preview
*/
-public class PreviewDialog extends JFrame implements ProgressListener,
- MessageListener {
+public class PreviewDialog extends JFrame implements ProgressListener {
protected Translator res;
/**
- * Called by MessageHandler if an error message or a
+ * Called by logger if an error message or a
* log message is received.
*/
- public void processMessage(MessageEvent event) {
- String error = event.getMessage();
+ public void processMessage() {
+/* String error = event.getMessage();
String text = processStatus.getText();
FontMetrics fmt =
processStatus.getFontMetrics(processStatus.getFont());
progress(event.getMessage());
}
}
- }
+ }*/
}
-
public void dispose() {
System.exit(0);
}
} // class PreviewDialog
-
-
-
package org.apache.fop.viewer;
import java.util.*;
-import org.apache.fop.messaging.MessageHandler;
import java.io.*;
try {
lookup.load(in);
} catch (Exception ex) {
- MessageHandler.logln("Abgefangene Exception: " + ex.getMessage());
+ //log.error("Abgefangene Exception: " + ex.getMessage());
isSourceFound = false;
}
}
return obj;
else {
if (isMissingEmphasized) {
- MessageHandler.logln(getClass().getName() + ": missing key: "
- + key);
+ //log.debug(getClass().getName() + ": missing key: "
+ // + key);
return getMissedRepresentation(key.toString());
} else
return key.toString();
package org.apache.fop.viewer;
import java.awt.*;
-import org.apache.fop.messaging.MessageHandler;
import java.io.*;
import java.awt.event.*;
import java.util.*;
public static void setTranslator(Translator aRes) {
res = aRes;
if (res == null) {
- MessageHandler.logln("UserMessage: setTranslator(null) !");
+ //log.debug("UserMessage: setTranslator(null) !");
res = new SecureResourceBundle(null);
}
* Ersetzt die eventuellen Platzhalter durch die übergebenen Parameter
*/
static String prepareMessage(String rawText, String[] par) {
- MessageHandler.logln("prepareMessage(): " + rawText + ", parameter: "
- + par);
+ //log.debug("prepareMessage(): " + rawText + ", parameter: "
+ // + par);
int index = rawText.indexOf(PARAMETER_TAG);
String composedMess = "";
if ((index == -1) && (par == null))
return rawText;
if ((index != -1) && (par == null)) {
- MessageHandler.logln("Message " + actMessId
- + " erwartet Parameter. Aufgerufen ohne Parameter");
+ //log.debug("Message " + actMessId
+ // + " erwartet Parameter. Aufgerufen ohne Parameter");
return rawText;
}
if ((index == -1) && (par != null)) {
- MessageHandler.logln("Message " + actMessId
- + " erwartet keine Parameter. Aufgerufen mit folgenden Parametern:");
- for (int i = 0; i < par.length; ++i)
- MessageHandler.logln(par[i].toString());
+ //log.debug("Message " + actMessId
+ // + " erwartet keine Parameter. Aufgerufen mit folgenden Parametern:");
+ for (int i = 0; i < par.length; ++i) {
+ //log.debug(par[i].toString());
+ }
return rawText;
}
int tagCount = 0;
try {
composedMess += rawText.substring(0, index) + par[tagCount];
} catch (ArrayIndexOutOfBoundsException ex) {
- MessageHandler.logln("Anzahl der übergebenen Parameter zu der Meldung "
- + actMessId
- + " ist weniger als erwartet.");
- ex.printStackTrace();
+ //log.error("Anzahl der übergebenen Parameter zu der Meldung "
+ // + actMessId
+ // + " ist weniger als erwartet.", ex);
return composedMess + rawText;
}
rawText = rawText.substring(index + PARAMETER_TAG.length());
tagCount++;
}
composedMess += rawText;
- if (tagCount != par.length)
- MessageHandler.logln("Die zu der Meldung " + actMessId
- + " übergebenen Parameter sind mehr als die Meldung vorsieht.");
+ if (tagCount != par.length) {
+ //log.debug("Die zu der Meldung " + actMessId
+ // + " übergebenen Parameter sind mehr als die Meldung vorsieht.");
+ }
return composedMess;
}
translatedMes.substring(translatedMes.indexOf(':') + 1);
} catch (Exception ex) {
- MessageHandler.logln("FALSCHES FORMAT: MESSAGE: " + textID);
+ //log.debug("FALSCHES FORMAT: MESSAGE: " + textID);
}
} else { // Message not found
- MessageHandler.logln("UserMessage: textID '" + textID
- + "' not found. Return "
- + "value 'CANCEL' = " + CANCEL);
+ //log.debug("UserMessage: textID '" + textID
+ // + "' not found. Return "
+ // + "value 'CANCEL' = " + CANCEL);
// return CANCEL;
} else {
if (optionTypeIndex == STYLE_NOBUTTON) {
// Wird nicht mehr unterstützt
- MessageHandler.logln("UserMessage: STYLE_NOBUTTON wird nicht unterstützt");
+ //log.debug("UserMessage: STYLE_NOBUTTON wird nicht unterstützt");
return result;
} else {
result = MessagesDialog.showConfirmDialog(null, preparedMes,