cvs commit: xml-fop/src/java/org/apache/fop/render Renderer.java
bckfnn 2004/12/10 02:12:21 Modified:src/java/org/apache/fop/fo/flow RetrieveMarker.java src/java/org/apache/fop/layoutmgr AbstractLayoutManager.java InlineStackingLayoutManager.java LayoutManager.java LeaderLayoutManager.java src/java/org/apache/fop/render Renderer.java Log: Remove unused import statements. Revision ChangesPath 1.25 +0 -4 xml-fop/src/java/org/apache/fop/fo/flow/RetrieveMarker.java Index: RetrieveMarker.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/RetrieveMarker.java,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- RetrieveMarker.java 7 Dec 2004 20:11:21 - 1.24 +++ RetrieveMarker.java 10 Dec 2004 10:12:21 - 1.25 @@ -18,9 +18,6 @@ package org.apache.fop.fo.flow; -// Java -import java.util.List; - import org.xml.sax.Locator; import org.apache.commons.logging.Log; @@ -32,7 +29,6 @@ import org.apache.fop.fo.PropertyList; import org.apache.fop.fo.StaticPropertyList; import org.apache.fop.fo.ValidationException; -import org.apache.fop.layoutmgr.LayoutManager; /** 1.33 +0 -1 xml-fop/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java Index: AbstractLayoutManager.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- AbstractLayoutManager.java7 Dec 2004 20:11:21 - 1.32 +++ AbstractLayoutManager.java10 Dec 2004 10:12:21 - 1.33 @@ -32,7 +32,6 @@ import java.util.List; import java.util.ArrayList; -import java.util.LinkedList; import java.util.ListIterator; import java.util.Map; 1.18 +0 -1 xml-fop/src/java/org/apache/fop/layoutmgr/InlineStackingLayoutManager.java Index: InlineStackingLayoutManager.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/InlineStackingLayoutManager.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- InlineStackingLayoutManager.java 13 Nov 2004 20:37:17 - 1.17 +++ InlineStackingLayoutManager.java 10 Dec 2004 10:12:21 - 1.18 @@ -18,7 +18,6 @@ package org.apache.fop.layoutmgr; -import java.util.List; import java.util.LinkedList; import java.util.Iterator; import java.util.ListIterator; 1.16 +0 -1 xml-fop/src/java/org/apache/fop/layoutmgr/LayoutManager.java Index: LayoutManager.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/LayoutManager.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- LayoutManager.java13 Nov 2004 20:37:17 - 1.15 +++ LayoutManager.java10 Dec 2004 10:12:21 - 1.16 @@ -18,7 +18,6 @@ package org.apache.fop.layoutmgr; -import java.util.LinkedList; import java.util.List; import java.util.Map; 1.14 +1 -4 xml-fop/src/java/org/apache/fop/layoutmgr/LeaderLayoutManager.java Index: LeaderLayoutManager.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/LeaderLayoutManager.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- LeaderLayoutManager.java 24 Nov 2004 21:07:30 - 1.13 +++ LeaderLayoutManager.java 10 Dec 2004 10:12:21 - 1.14 @@ -23,10 +23,7 @@ import org.apache.fop.area.inline.InlineArea; import org.apache.fop.area.inline.Space; import org.apache.fop.area.inline.TextArea; -import org.apache.fop.datatypes.Length; import org.apache.fop.datatypes.PercentBase; -import org.apache.fop.fo.Constants; -import org.apache.fop.fo.flow.Inline; import org.apache.fop.fo.flow.Leader; import org.apache.fop.fonts.Font; import org.apache.fop.traits.MinOptMax; 1.19 +0 -1 xml-fop/src/java/org/apache/fop/render/Renderer.java Index: Renderer.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/Renderer.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- Renderer.java 29 Nov 2004 08:45:14 - 1.18 +++ Renderer.java 10 Dec 2004 10:12:21 - 1.19 @@ -27,7 +27,6 @@ import org.apache.fop.area.PageViewport; import org.apache.fop.area.LineArea; import
cvs commit: xml-fop/src/java/org/apache/fop/fo PropertyList.java
bckfnn 2004/11/21 23:57:34 Modified:src/java/org/apache/fop/fo PropertyList.java Log: Handle unknown subproperty names by logging an error message and ignoring the property value. PR: 32338 Revision ChangesPath 1.41 +5 -2 xml-fop/src/java/org/apache/fop/fo/PropertyList.java Index: PropertyList.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/PropertyList.java,v retrieving revision 1.40 retrieving revision 1.41 diff -u -r1.40 -r1.41 --- PropertyList.java 28 Oct 2004 10:00:20 - 1.40 +++ PropertyList.java 22 Nov 2004 07:57:34 - 1.41 @@ -308,6 +308,10 @@ Property baseProperty = findBaseProperty(attributes, parentFO, propId, basePropertyName, propertyMaker); int subpropId = FOPropertyMapping.getSubPropertyId(subPropertyName); +if (subpropId == -1) { +handleInvalidProperty(attributeName); +return; +} prop = propertyMaker.make(baseProperty, subpropId, this, attributeValue, parentFO); } @@ -353,8 +357,7 @@ private void handleInvalidProperty(String attributeName) { if (!attributeName.startsWith("xmlns")) { -//log.error("property '" -// + attributeName + "' ignored"); +log.error("property '" + attributeName + "' ignored"); } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/fo FOPropertyMapping.java
bckfnn 2004/10/29 05:36:50 Modified:src/java/org/apache/fop/fo FOPropertyMapping.java Log: Moved white-space-treatment from shorthands to "block and line related". Revision ChangesPath 1.36 +12 -12xml-fop/src/java/org/apache/fop/fo/FOPropertyMapping.java Index: FOPropertyMapping.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FOPropertyMapping.java,v retrieving revision 1.35 retrieving revision 1.36 diff -u -r1.35 -r1.36 --- FOPropertyMapping.java29 Oct 2004 11:19:35 - 1.35 +++ FOPropertyMapping.java29 Oct 2004 12:36:50 - 1.36 @@ -1582,6 +1582,17 @@ m.setDefault("treat-as-space"); addPropertyMaker("linefeed-treatment", m); +// white-space-treatment +m = new EnumProperty.Maker(PR_WHITE_SPACE_TREATMENT); +m.setInherited(true); +m.addEnum("ignore", makeEnumProperty(IGNORE, "IGNORE")); +m.addEnum("preserve", makeEnumProperty(PRESERVE, "PRESERVE")); +m.addEnum("ignore-if-before-linefeed", makeEnumProperty(IGNORE_IF_BEFORE_LINEFEED, "IGNORE_IF_BEFORE_LINEFEED")); +m.addEnum("ignore-if-after-linefeed", makeEnumProperty(IGNORE_IF_AFTER_LINEFEED, "IGNORE_IF_AFTER_LINEFEED")); +m.addEnum("ignore-if-surrounding-linefeed", makeEnumProperty(IGNORE_IF_SURROUNDING_LINEFEED, "IGNORE_IF_SURROUNDING_LINEFEED")); +m.setDefault("ignore-if-surrounding-linefeed"); +addPropertyMaker("white-space-treatment", m); + // text-align TODO: make it a StringProperty with enums. m = new EnumProperty.Maker(PR_TEXT_ALIGN); m.setInherited(true); @@ -2660,17 +2671,6 @@ m.addEnum("bottom", makeEnumProperty(BOTTOM, "BOTTOM")); m.setDefault("baseline"); addPropertyMaker("vertical-align", m); - -// white-space-treatment -m = new EnumProperty.Maker(PR_WHITE_SPACE_TREATMENT); -m.setInherited(true); -m.addEnum("ignore", makeEnumProperty(IGNORE, "IGNORE")); -m.addEnum("preserve", makeEnumProperty(PRESERVE, "PRESERVE")); -m.addEnum("ignore-if-before-linefeed", makeEnumProperty(IGNORE_IF_BEFORE_LINEFEED, "IGNORE_IF_BEFORE_LINEFEED")); -m.addEnum("ignore-if-after-linefeed", makeEnumProperty(IGNORE_IF_AFTER_LINEFEED, "IGNORE_IF_AFTER_LINEFEED")); -m.addEnum("ignore-if-surrounding-linefeed", makeEnumProperty(IGNORE_IF_SURROUNDING_LINEFEED, "IGNORE_IF_SURROUNDING_LINEFEED")); -m.setDefault("ignore-if-surrounding-linefeed"); -addPropertyMaker("white-space-treatment", m); // xml:lang m = new ToBeImplementedProperty.Maker(PR_XML_LANG); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/fo/properties CommonHyphenation.java
bckfnn 2004/10/29 04:19:37 Modified:src/java/org/apache/fop/fo Constants.java FOPropertyMapping.java src/java/org/apache/fop/fo/flow Block.java BlockContainer.java Character.java ExternalGraphic.java InitialPropertySet.java Inline.java InstreamForeignObject.java Leader.java PageNumber.java PageNumberCitation.java TableBody.java TableColumn.java TableRow.java src/java/org/apache/fop/fo/pagination Root.java Title.java src/java/org/apache/fop/fo/properties CommonHyphenation.java Log: More properties implemented. Revision ChangesPath 1.18 +11 -2 xml-fop/src/java/org/apache/fop/fo/Constants.java Index: Constants.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/Constants.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- Constants.java29 Oct 2004 10:35:03 - 1.17 +++ Constants.java29 Oct 2004 11:19:35 - 1.18 @@ -540,7 +540,16 @@ int COLLAPSE_WITH_PRECEDENCE = 149; int SHOW = 150; int HIDE = 151; -int ENUM_COUNT = 151; +int EMBED = 152; +int BIDI_OVERRIDE = 153; +int LTR = 154; +int RTL = 155; +int CHARACTER_BY_CHARACTER = 156; +int SUPPRESS = 157; +int PAGINATE = 158; +int BOUNDED_IN_ONE_DIMENSION = 159; +int UNBOUNDED = 160; +int ENUM_COUNT = 160; // Enumeration Interfaces 1.35 +38 -14xml-fop/src/java/org/apache/fop/fo/FOPropertyMapping.java Index: FOPropertyMapping.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FOPropertyMapping.java,v retrieving revision 1.34 retrieving revision 1.35 diff -u -r1.34 -r1.35 --- FOPropertyMapping.java29 Oct 2004 10:35:03 - 1.34 +++ FOPropertyMapping.java29 Oct 2004 11:19:35 - 1.35 @@ -661,8 +661,10 @@ CorrespondingPropertyMaker corr; // background-attachment -m = new ToBeImplementedProperty.Maker(PR_BACKGROUND_ATTACHMENT); +m = new EnumProperty.Maker(PR_BACKGROUND_ATTACHMENT); m.setInherited(false); +m.addEnum("scroll", makeEnumProperty(SCROLL, "SCROLL")); +m.addEnum("fixed", makeEnumProperty(FIXED, "FIXED")); m.setDefault("scroll"); addPropertyMaker("background-attachment", m); @@ -1057,8 +1059,10 @@ addPropertyMaker("font-family", m); // font-selection-strategy -m = new ToBeImplementedProperty.Maker(PR_FONT_SELECTION_STRATEGY); +m = new EnumProperty.Maker(PR_FONT_SELECTION_STRATEGY); m.setInherited(true); +m.addEnum("auto", makeEnumProperty(AUTO, "AUTO")); +m.addEnum("character-by-character", makeEnumProperty(CHARACTER_BY_CHARACTER, "CHARACTER_BY_CHARACTER")); m.setDefault("auto"); addPropertyMaker("font-selection-strategy", m); @@ -1131,7 +1135,7 @@ addPropertyMaker("language", m); // script -m = new ToBeImplementedProperty.Maker(PR_SCRIPT); +m = new StringProperty.Maker(PR_SCRIPT); m.setInherited(true); m.setDefault("auto"); addPropertyMaker("script", m); @@ -1537,7 +1541,7 @@ addPropertyMaker("hyphenation-ladder-count", m); // last-line-end-indent -m = new ToBeImplementedProperty.Maker(PR_LAST_LINE_END_INDENT); +m = new LengthProperty.Maker(PR_LAST_LINE_END_INDENT); m.setInherited(true); m.setDefault("0pt"); addPropertyMaker("last-line-end-indent", m); @@ -1666,8 +1670,11 @@ addPropertyMaker("letter-spacing", m); // suppress-at-line-break -m = new ToBeImplementedProperty.Maker(PR_SUPPRESS_AT_LINE_BREAK); +m = new EnumProperty.Maker(PR_SUPPRESS_AT_LINE_BREAK); m.setInherited(false); +m.addEnum("auto", makeEnumProperty(AUTO, "AUTO")); +m.addEnum("suppress", makeEnumProperty(SUPPRESS, "SUPPRESS")); +m.addEnum("retain", makeEnumProperty(RETAIN, "RETAIN")); m.setDefault("auto"); addPropertyMaker("suppress-at-line-break", m); @@ -1703,7 +1710,10 @@ addPropertyMaker("text-transform", m); // treat-as-word-space -m = new ToBeImplement
cvs commit: xml-fop/src/java/org/apache/fop/fo FOPropertyMapping.java Constants.java
bckfnn 2004/10/29 03:35:03 Modified:src/java/org/apache/fop/fo FOPropertyMapping.java Constants.java Log: The 'space-treatment' property has long ago been renamed to 'white-space-treatment'. Revision ChangesPath 1.34 +1 -7 xml-fop/src/java/org/apache/fop/fo/FOPropertyMapping.java Index: FOPropertyMapping.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FOPropertyMapping.java,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- FOPropertyMapping.java29 Oct 2004 10:12:34 - 1.33 +++ FOPropertyMapping.java29 Oct 2004 10:35:03 - 1.34 @@ -1578,12 +1578,6 @@ m.setDefault("treat-as-space"); addPropertyMaker("linefeed-treatment", m); -// space-treatment -m = new ToBeImplementedProperty.Maker(PR_SPACE_TREATMENT); -m.setInherited(true); -m.setDefault("preserve"); -addPropertyMaker("space-treatment", m); - // text-align TODO: make it a StringProperty with enums. m = new EnumProperty.Maker(PR_TEXT_ALIGN); m.setInherited(true); 1.17 +2 -2 xml-fop/src/java/org/apache/fop/fo/Constants.java Index: Constants.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/Constants.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- Constants.java29 Oct 2004 09:17:34 - 1.16 +++ Constants.java29 Oct 2004 10:35:03 - 1.17 @@ -326,7 +326,7 @@ int PR_SPACE_BEFORE = 201; int PR_SPACE_END = 202; int PR_SPACE_START = 203; -int PR_SPACE_TREATMENT = 204; +// space-treatment was removed. TODO: re-number properties. int PR_SPAN = 205; int PR_SPEAK = 206; int PR_SPEAK_HEADER = 207; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/fo/flow BasicLink.java Block.java BlockContainer.java Character.java ExternalGraphic.java Float.java Inline.java InlineContainer.java InstreamForeignObject.java Leader.java ListBlock.java ListItem.java PageNumber.java PageNumberCitation.java Table.java TableAndCaption.java TableCaption.java TableCell.java
bckfnn 2004/10/29 03:20:56 Modified:src/java/org/apache/fop/fo/flow BasicLink.java Block.java BlockContainer.java Character.java ExternalGraphic.java Float.java Inline.java InlineContainer.java InstreamForeignObject.java Leader.java ListBlock.java ListItem.java PageNumber.java PageNumberCitation.java Table.java TableAndCaption.java TableCaption.java TableCell.java Log: Bind some more of the implemented properties. Revision ChangesPath 1.34 +2 -2 xml-fop/src/java/org/apache/fop/fo/flow/BasicLink.java Index: BasicLink.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/BasicLink.java,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- BasicLink.java28 Oct 2004 10:00:21 - 1.33 +++ BasicLink.java29 Oct 2004 10:20:55 - 1.34 @@ -39,7 +39,7 @@ public class BasicLink extends Inline { // The value of properties relevant for fo:basic-link. // private ToBeImplementedProperty destinationPlacementOffset; -// private ToBeImplementedProperty dominantBaseline; +private int dominantBaseline; private String externalDestination; // private ToBeImplementedProperty indicateDestination; private String internalDestination; @@ -65,7 +65,7 @@ public void bind(PropertyList pList) throws FOPException { super.bind(pList); // destinationPlacementOffset = pList.get(PR_DESTINATION_PLACEMENT_OFFSET); -// dominantBaseline = pList.get(PR_DOMINANT_BASELINE); +dominantBaseline = pList.get(PR_DOMINANT_BASELINE).getEnum(); externalDestination = pList.get(PR_EXTERNAL_DESTINATION).getString(); // indicateDestination = pList.get(PR_INDICATE_DESTINATION); internalDestination = pList.get(PR_INTERNAL_DESTINATION).getString(); 1.48 +14 -14xml-fop/src/java/org/apache/fop/fo/flow/Block.java Index: Block.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/Block.java,v retrieving revision 1.47 retrieving revision 1.48 diff -u -r1.47 -r1.48 --- Block.java28 Oct 2004 10:00:21 - 1.47 +++ Block.java29 Oct 2004 10:20:55 - 1.48 @@ -82,20 +82,20 @@ private int breakAfter; private int breakBefore; private ColorType color; -// private ToBeImplementedProperty textDepth; -// private ToBeImplementedProperty textAltitude; -// private ToBeImplementedProperty hyphenationKeep; -// private ToBeImplementedProperty hyphenationLadderCount; +private Length textDepth; +private Length textAltitude; +private int hyphenationKeep; +private Numeric hyphenationLadderCount; private String id; -// private ToBeImplementedProperty intrusionDisplace; +private int intrusionDisplace; private KeepProperty keepTogether; private KeepProperty keepWithNext; private KeepProperty keepWithPrevious; // private ToBeImplementedProperty lastLineEndIndent; private int linefeedTreatment; private SpaceProperty lineHeight; -// private ToBeImplementedProperty lineHeightShiftAdjustment; -// private ToBeImplementedProperty lineStackingStrategy; +private int lineHeightShiftAdjustment; +private int lineStackingStrategy; private Numeric orphans; private int whiteSpaceTreatment; private int span; @@ -140,20 +140,20 @@ breakAfter = pList.get(PR_BREAK_AFTER).getEnum(); breakBefore = pList.get(PR_BREAK_BEFORE).getEnum(); color = pList.get(PR_COLOR).getColorType(); -// textDepth = pList.get(PR_TEXT_DEPTH); -// textAltitude = pList.get(PR_TEXT_ALTITUDE); -// hyphenationKeep = pList.get(PR_HYPHENATION_KEEP); -// hyphenationLadderCount = pList.get(PR_HYPHENATION_LADDER_COUNT); +textDepth = pList.get(PR_TEXT_DEPTH).getLength(); +textAltitude = pList.get(PR_TEXT_ALTITUDE).getLength(); +hyphenationKeep = pList.get(PR_HYPHENATION_KEEP).getEnum(); +hyphenationLadderCount = pList.get(PR_HYPHENATION_LADDER_COUNT).getNumeric(); id = pList.get(PR_ID).getString(); -// intrusionDisplace = pList.get(PR_INTRUSION_DISPLACE); +intrusionDisplace = pList.get(PR_INTRUSION_DISPLACE).getEnum(); keepTogether = pList.get(PR_KEEP_TOGETHER).getKeep(); keepWithNext = pList.get(PR_KEEP_WITH_NEXT).getKeep(); keepWithPrevious = pList.get(PR_KEEP_WITH_PREVIOUS).getKeep(); // lastLineEndIndent = pList.get(PR_LAST_LINE_END_INDENT
cvs commit: xml-fop/src/java/org/apache/fop/fo FOPropertyMapping.java
bckfnn 2004/10/29 03:12:34 Modified:src/java/org/apache/fop/fo FOPropertyMapping.java Log: Style fix. Revision ChangesPath 1.33 +3 -2 xml-fop/src/java/org/apache/fop/fo/FOPropertyMapping.java Index: FOPropertyMapping.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FOPropertyMapping.java,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- FOPropertyMapping.java29 Oct 2004 09:17:34 - 1.32 +++ FOPropertyMapping.java29 Oct 2004 10:12:34 - 1.33 @@ -1081,7 +1081,8 @@ m.addEnum("semi-expanded", makeEnumProperty(SEMI_EXPANDED, "SEMI_EXPANDED")); m.addEnum("expanded", makeEnumProperty(EXPANDED, "EXPANDED")); m.addEnum("extra-expanded", makeEnumProperty(EXTRA_EXPANDED, "EXTRA_EXPANDED")); -m.addEnum("ultra-expanded", makeEnumProperty(ULTRA_EXPANDED, "ULTRA_EXPANDED"));m.setDefault("normal"); +m.addEnum("ultra-expanded", makeEnumProperty(ULTRA_EXPANDED, "ULTRA_EXPANDED")); +m.setDefault("normal"); addPropertyMaker("font-stretch", m); // font-size-adjust - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr ExternalGraphicLayoutManager.java
bckfnn 2004/10/29 02:17:34 Modified:src/java/org/apache/fop/fo Constants.java FOPropertyMapping.java src/java/org/apache/fop/layoutmgr ExternalGraphicLayoutManager.java Log: More properties implement in the property subsystem. Revision ChangesPath 1.16 +43 -3 xml-fop/src/java/org/apache/fop/fo/Constants.java Index: Constants.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/Constants.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- Constants.java13 Sep 2004 08:05:34 - 1.15 +++ Constants.java29 Oct 2004 09:17:34 - 1.16 @@ -370,7 +370,8 @@ int PR_WRITING_MODE = 245; int PR_XML_LANG = 246; int PR_Z_INDEX = 247; -int PROPERTY_COUNT = 247; +int PR_INTRUSION_DISPLACE = 248; +int PROPERTY_COUNT = 248; // compound property constants @@ -500,7 +501,46 @@ int NO_LIMIT = 110; int AUTO_ODD = 111; int AUTO_EVEN = 112; -int ENUM_COUNT = 112; +int BEFORE_EDGE = 113; +int TEXT_BEFORE_EDGE = 114; +int CENTRAL = 115; +int AFTER_EDGE = 116; +int TEXT_AFTER_EDGE = 117; +int IDEOGRAPHIC = 118; +int HANGING = 119; +int MATHEMATICAL = 120; +int SCALE_TO_FIT = 121; +int USE_FONT_METRICS = 122; +int INDEFINITE = 123; +int LARGER = 124; +int SMALLER = 125; +int INSIDE = 126; +int OUTSIDE = 127; +int CONSIDER_SHIFTS = 128; +int DISREGARD_SHIFTS = 129; +int INTEGER_PIXELS = 130; +int RESAMPLE_ANY_METHOD = 131; +int USE_SCRIPT = 132; +int NO_CHANGE = 133; +int RESET_SIZE = 134; +int WIDER = 135; +int NARROWER = 136; +int ULTRA_CONDENSED = 137; +int EXTRA_CONDENSED = 138; +int CONDENSED = 139; +int SEMI_CONDENSED = 140; +int SEMI_EXPANDED = 141; +int EXPANDED = 142; +int EXTRA_EXPANDED = 143; +int ULTRA_EXPANDED = 144; +int LINE = 145; +int INDENT = 146; +int BLOCK = 147; +int BOTH = 148; +int COLLAPSE_WITH_PRECEDENCE = 149; +int SHOW = 150; +int HIDE = 151; +int ENUM_COUNT = 151; // Enumeration Interfaces 1.32 +133 -29 xml-fop/src/java/org/apache/fop/fo/FOPropertyMapping.java Index: FOPropertyMapping.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FOPropertyMapping.java,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- FOPropertyMapping.java28 Oct 2004 15:21:54 - 1.31 +++ FOPropertyMapping.java29 Oct 2004 09:17:34 - 1.32 @@ -1070,14 +1070,24 @@ addPropertyMaker("font-size", m); // font-stretch -m = new ToBeImplementedProperty.Maker(PR_FONT_STRETCH); -m.setInherited(true); -m.setDefault("normal"); +m = new EnumProperty.Maker(PR_FONT_STRETCH); +m.addEnum("normal", makeEnumProperty(NORMAL, "NORMAL")); +m.addEnum("wider", makeEnumProperty(WIDER, "WIDER")); +m.addEnum("narrower", makeEnumProperty(NARROWER, "NARROWER")); +m.addEnum("ultra-condensed", makeEnumProperty(ULTRA_CONDENSED, "ULTRA_CONDENSED")); +m.addEnum("extra-condensed", makeEnumProperty(EXTRA_CONDENSED, "EXTRA_CONDENSED")); +m.addEnum("condensed", makeEnumProperty(CONDENSED, "CONDENSED")); +m.addEnum("semi-condensed", makeEnumProperty(SEMI_CONDENSED, "SEMI_CONDENSED")); +m.addEnum("semi-expanded", makeEnumProperty(SEMI_EXPANDED, "SEMI_EXPANDED")); +m.addEnum("expanded", makeEnumProperty(EXPANDED, "EXPANDED")); +m.addEnum("extra-expanded", makeEnumProperty(EXTRA_EXPANDED, "EXTRA_EXPANDED")); +m.addEnum("ultra-expanded", makeEnumProperty(ULTRA_EXPANDED, "ULTRA_EXPANDED"));m.setDefault("normal"); addPropertyMaker("font-stretch", m); // font-size-adjust -m = new ToBeImplementedProperty.Maker(PR_FONT_SIZE_ADJUST); +m = new NumberProperty.Maker(PR_FONT_SIZE_ADJUST); m.setInherited(true); +m.addEnum("none", makeEnumProperty(NONE, "NONE")); m.setDefault("none"); addPropertyMaker("font-size-adjust", m); @@ -1257,8 +1267,10 @@ PropertyMaker m; // relative-position -m = new ToBeImplemente
cvs commit: xml-fop/src/java/org/apache/fop/render/rtf TableAttributesConverter.java TextAttributesConverter.java
bckfnn 2004/10/28 08:21:54 Modified:src/java/org/apache/fop/datatypes Length.java Numeric.java src/java/org/apache/fop/fo FOPropertyMapping.java src/java/org/apache/fop/fo/expr NumericProperty.java RelativeNumericProperty.java src/java/org/apache/fop/fo/pagination PageSequence.java src/java/org/apache/fop/fo/properties CompoundPropertyMaker.java LengthProperty.java NumberProperty.java PropertyMaker.java src/java/org/apache/fop/layoutmgr BlockContainerLayoutManager.java ExternalGraphicLayoutManager.java InstreamForeignObjectLM.java src/java/org/apache/fop/render/rtf TableAttributesConverter.java TextAttributesConverter.java Added: src/java/org/apache/fop/fo/properties EnumLength.java EnumNumber.java Removed: src/java/org/apache/fop/fo/properties AutoLength.java Log: Removed special case handling of "auto" enum for length properties. Added general support for "auto" and other enums on Length and Numeric properties. Revision ChangesPath 1.6 +0 -6 xml-fop/src/java/org/apache/fop/datatypes/Length.java Index: Length.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/datatypes/Length.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- Length.java 27 Feb 2004 17:42:28 - 1.5 +++ Length.java 28 Oct 2004 15:21:53 - 1.6 @@ -27,10 +27,4 @@ * @return the length in millipoints */ public int getValue(); - -/** - * Return true if the length has the "auto" value. - * @return true when length is auto. - */ -public boolean isAuto(); } 1.5 +6 -1 xml-fop/src/java/org/apache/fop/datatypes/Numeric.java Index: Numeric.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/datatypes/Numeric.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- Numeric.java 18 Oct 2004 20:11:16 - 1.4 +++ Numeric.java 28 Oct 2004 15:21:53 - 1.5 @@ -70,4 +70,9 @@ * @throws PropertyException */ //Numeric getResolved() throws PropertyException; + +/** + * Return the enum value that is stored in this numeric. + */ +public int getEnum(); } 1.31 +18 -18xml-fop/src/java/org/apache/fop/fo/FOPropertyMapping.java Index: FOPropertyMapping.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FOPropertyMapping.java,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- FOPropertyMapping.java28 Oct 2004 10:00:19 - 1.30 +++ FOPropertyMapping.java28 Oct 2004 15:21:54 - 1.31 @@ -517,28 +517,28 @@ // top l = new LengthProperty.Maker(PR_TOP); l.setInherited(false); -l.setAutoOk(true); +l.addEnum("auto", makeEnumProperty(AUTO, "AUTO")); l.setDefault("auto"); addPropertyMaker("top", l); // right l = new LengthProperty.Maker(PR_RIGHT); l.setInherited(false); -l.setAutoOk(true); +l.addEnum("auto", makeEnumProperty(AUTO, "AUTO")); l.setDefault("auto"); addPropertyMaker("right", l); // bottom l = new LengthProperty.Maker(PR_BOTTOM); l.setInherited(false); -l.setAutoOk(true); +l.addEnum("auto", makeEnumProperty(AUTO, "AUTO")); l.setDefault("auto"); addPropertyMaker("bottom", l); // left l = new LengthProperty.Maker(PR_LEFT); l.setInherited(false); -l.setAutoOk(true); +l.addEnum("auto", makeEnumProperty(AUTO, "AUTO")); l.setDefault("auto"); addPropertyMaker("left", l); } @@ -1326,20 +1326,20 @@ l = new LengthProperty.Maker(CP_MINIMUM); l.setDefault("auto"); -l.setAutoOk(true); +l.addEnum("auto", makeEnumProperty(AUTO, "AUTO")); l.setPercentBase(LengthBase.CONTAINING_BOX); l.setByShorthand(true); m.addSubpropMaker(l); l = new LengthProperty.Maker(CP_OPTIMUM); l.setDefault("auto");
cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr RetrieveMarkerLayoutManager.java
bckfnn 2004/10/28 03:00:25 Modified:examples/mathml/src/org/apache/fop/mathml MathMLElement.java examples/plan/src/org/apache/fop/plan PlanElement.java src/java/org/apache/fop/apps FOPException.java src/java/org/apache/fop/datatypes LengthBase.java PercentBase.java src/java/org/apache/fop/fo FONode.java FOPropertyMapping.java FOText.java FOTreeBuilder.java FObj.java FObjMixed.java PropertyList.java StaticPropertyList.java XMLObj.java src/java/org/apache/fop/fo/expr NumericProperty.java PropertyException.java PropertyInfo.java PropertyParser.java RelativeNumericProperty.java src/java/org/apache/fop/fo/extensions Bookmarks.java ExtensionObj.java Outline.java src/java/org/apache/fop/fo/extensions/svg SVGElement.java src/java/org/apache/fop/fo/flow BasicLink.java BidiOverride.java Block.java BlockContainer.java Character.java ExternalGraphic.java Float.java Footnote.java FootnoteBody.java InitialPropertySet.java Inline.java InlineContainer.java InstreamForeignObject.java Leader.java ListBlock.java ListItem.java ListItemBody.java ListItemLabel.java Marker.java MultiCase.java MultiProperties.java MultiPropertySet.java MultiSwitch.java MultiToggle.java PageNumber.java PageNumberCitation.java RetrieveMarker.java Table.java TableAndCaption.java TableBody.java TableCaption.java TableCell.java TableColumn.java TableRow.java Wrapper.java src/java/org/apache/fop/fo/pagination ColorProfile.java ConditionalPageMasterReference.java Declarations.java Flow.java LayoutMasterSet.java PageSequence.java PageSequenceMaster.java Region.java RegionBA.java RegionBody.java RegionSE.java RepeatablePageMasterAlternatives.java RepeatablePageMasterReference.java Root.java SimplePageMaster.java SinglePageMasterReference.java StaticContent.java Title.java src/java/org/apache/fop/fo/properties BorderWidthPropertyMaker.java BoxPropShorthandParser.java CommonAbsolutePosition.java CommonAccessibility.java CommonBorderPaddingBackground.java CommonFont.java CommonHyphenation.java CommonMarginBlock.java CommonMarginInline.java CommonRelativePosition.java CompoundPropertyMaker.java CondLengthProperty.java CorrespondingPropertyMaker.java DimensionPropertyMaker.java EnumProperty.java GenericShorthandParser.java IndentPropertyMaker.java KeepProperty.java LengthPairProperty.java LengthProperty.java LengthRangeProperty.java LineHeightPropertyMaker.java PercentLength.java Property.java PropertyMaker.java ShorthandParser.java SpaceProperty.java SpacingPropertyMaker.java src/java/org/apache/fop/layoutmgr RetrieveMarkerLayoutManager.java Added: src/java/org/apache/fop/fo ValidationException.java Log: New exception hierarchy rooted in SAXException and throw clauses on property parsing and retrieval. PR: 31899 Revision ChangesPath 1.8 +3 -3 xml-fop/examples/mathml/src/org/apache/fop/mathml/MathMLElement.java http://cvs.apache.org/viewcvs/xml-fop/examples/mathml/src/org/apache/fop/mathml/MathMLElement.java.diff?r1=1.7&r2=1.8 1.9 +3 -3 xml-fop/examples/plan/src/org/apache/fop/plan/PlanElement.java http://cvs.apache.org/viewcvs/xml-fop/examples/plan/src/org/apache/fop/plan/PlanElement.java.diff?r1=1.8&r2=1.9 1.6 +34 -30xml-fop/src/java/org/apache/fop/apps/FOPException.java http://cvs.apache.org/viewcvs/xml-fop/src/java/org/apache/fop/apps/FOPException.java.diff?r1=1.5&r2=1.6 1.8 +3 -2 xml-fop/src/java/org/apache/fop/datatypes/LengthBase.java http://cvs.apache.org/viewcvs/xml-fop/src/java/org/apache/fop/datatypes/LengthBase.java.diff?r1=1.7&r2=1.8 1.5 +3 -1
cvs commit: xml-fop/src/java/org/apache/fop/fo/flow Leader.java
bckfnn 2004/10/25 07:57:59 Modified:src/java/org/apache/fop/render/rtf/rtflib/rtfdoc BorderAttributesConverter.java src/java/org/apache/fop/fo/flow Leader.java Log: Cleanup after PR 31699. Revision ChangesPath 1.5 +3 -19 xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/BorderAttributesConverter.java Index: BorderAttributesConverter.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/BorderAttributesConverter.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- BorderAttributesConverter.java20 Oct 2004 17:53:36 - 1.4 +++ BorderAttributesConverter.java25 Oct 2004 14:57:58 - 1.5 @@ -27,7 +27,6 @@ package org.apache.fop.render.rtf.rtflib.rtfdoc; import org.apache.fop.fo.Constants; -import org.apache.fop.fo.PropertyList; import org.apache.fop.fo.properties.CommonBorderPaddingBackground; import org.apache.fop.render.rtf.FOPRtfAttributes; @@ -112,26 +111,11 @@ /** * Create a border control word in attributes, with border properties * as specified in color, style and width. - * @param propList The property list to get properties from. + * @param border The CommonBorderPaddingBackground object. + * @param side The START, END, BEFORE, AFTER enum from CommonBorderPaddingBackground. * @param attributes The attributes list to set the border control word. * @param controlWord The border control word. - * @param color The PR_BORDER_X_COLOR constants for the color, - * @param style The PR_BORDER_X_STYLE constants for the border style. - * @param width The PR_BORDER_X_WIDTH constants for the width. */ -public static void makeBorder(PropertyList propList, -RtfAttributes attributes, String controlWord, -int color, int style, int width) { -int styleEnum = propList.get(style).getEnum(); -if (styleEnum != Constants.NONE) { -FOPRtfAttributes attrs = new FOPRtfAttributes(); -attrs.set(BORDER_COLOR, propList.get(color).getColorType()); -attrs.set(convertAttributetoRtf(styleEnum)); -attrs.set(BORDER_WIDTH, propList.get(width).getLength()); -attributes.set(controlWord, attrs); -} -} - public static void makeBorder(CommonBorderPaddingBackground border, int side, RtfAttributes attributes, String controlWord) { int styleEnum = border.getBorderStyle(side); 1.44 +1 -15 xml-fop/src/java/org/apache/fop/fo/flow/Leader.java Index: Leader.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/Leader.java,v retrieving revision 1.43 retrieving revision 1.44 diff -u -r1.43 -r1.44 --- Leader.java 20 Oct 2004 21:07:01 - 1.43 +++ Leader.java 25 Oct 2004 14:57:59 - 1.44 @@ -39,7 +39,6 @@ import org.apache.fop.fo.properties.KeepProperty; import org.apache.fop.fo.properties.LengthRangeProperty; import org.apache.fop.fo.properties.SpaceProperty; -import org.apache.fop.fo.properties.PercentLength; import org.apache.fop.layoutmgr.LeaderLayoutManager; /** @@ -140,20 +139,7 @@ protected void startOfNode() throws SAXParseException { checkId(id); } - -/** - * @todo check need for each of these accessors (should be LM instead?) - */ -public int getLength(Length maxlength, int dim) { -int length; -if (maxlength instanceof PercentLength) { -length = (int)(((PercentLength)maxlength).value() * dim); -} else { -length = maxlength.getValue(); -} -return length; -} - + /** * Return the Common Font Properties. */ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/apps InputHandler.java
bckfnn 2004/10/25 07:57:14 Modified:src/java/org/apache/fop/apps InputHandler.java Log: Register an Errorlistener to get messages placed in the log system. Revision ChangesPath 1.16 +32 -2 xml-fop/src/java/org/apache/fop/apps/InputHandler.java Index: InputHandler.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/apps/InputHandler.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- InputHandler.java 25 Jul 2004 17:04:44 - 1.15 +++ InputHandler.java 25 Oct 2004 14:57:14 - 1.16 @@ -23,22 +23,29 @@ import java.util.Vector; // Imported TraX classes +import javax.xml.transform.ErrorListener; import javax.xml.transform.Result; import javax.xml.transform.Source; import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.sax.SAXResult; import javax.xml.transform.stream.StreamSource; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + /** * Class for handling files input from command line * either with XML and XSLT files (and optionally xsl * parameters) or FO File input alone */ -public class InputHandler { +public class InputHandler implements ErrorListener { private File sourcefile = null; // either FO or XML/XSLT usage private File stylesheet = null; // for XML/XSLT usage private Vector xsltParams = null; // for XML/XSLT usage + +protected Log log = LogFactory.getLog(InputHandler.class); /** * Constructor for XML->XSLT->FO input @@ -101,6 +108,7 @@ } } } +transformer.setErrorListener(this); // Create a SAXSource from the input Source file Source src = new StreamSource(sourcefile); @@ -114,5 +122,27 @@ } catch (Exception e) { throw new FOPException(e); } +} + +/** + * Implementation of the ErrorListener interface. + */ +public void warning(TransformerException exc) { +log.warn(exc.toString()); +} + +/** + * Implementation of the ErrorListener interface. + */ +public void error(TransformerException exc) { +log.error(exc.toString()); +} + +/** + * Implementation of the ErrorListener interface. + */ +public void fatalError(TransformerException exc) +throws TransformerException { +throw exc; } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/fo/extensions Label.java
bckfnn 2004/10/24 13:51:45 Modified:src/java/org/apache/fop/fo/extensions Label.java Log: Fix a regression in pdfoutline.fo, the method signature for addCharacters changed during patch 31699. Revision ChangesPath 1.8 +3 -1 xml-fop/src/java/org/apache/fop/fo/extensions/Label.java Index: Label.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/extensions/Label.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- Label.java4 Aug 2004 22:50:57 - 1.7 +++ Label.java24 Oct 2004 20:51:45 - 1.8 @@ -21,6 +21,7 @@ import org.xml.sax.Locator; import org.apache.fop.fo.FONode; +import org.apache.fop.fo.PropertyList; /** * Labal for PDF bookmark extension. @@ -48,6 +49,7 @@ * @param locator location in fo source file. */ protected void addCharacters(char data[], int start, int end, + PropertyList pList, Locator locator) { label += new String(data, start, end - start); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/fo/extensions ExtensionObj.java
bckfnn 2004/10/24 13:48:37 Modified:src/java/org/apache/fop/fo/extensions ExtensionObj.java Log: Fix a regression in pdfoutline.fo. Supply empty createPropertyList and processNode methods since the extension elements handles all attributes themself. Revision ChangesPath 1.6 +25 -1 xml-fop/src/java/org/apache/fop/fo/extensions/ExtensionObj.java Index: ExtensionObj.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/extensions/ExtensionObj.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- ExtensionObj.java 4 Aug 2004 22:50:57 - 1.5 +++ ExtensionObj.java 24 Oct 2004 20:48:37 - 1.6 @@ -18,8 +18,14 @@ package org.apache.fop.fo.extensions; +import org.apache.fop.fo.FOEventHandler; import org.apache.fop.fo.FONode; import org.apache.fop.fo.FObj; +import org.apache.fop.fo.PropertyList; +import org.xml.sax.Attributes; +import org.xml.sax.Locator; +import org.xml.sax.SAXParseException; + /** * Base class for pdf bookmark extension objects. @@ -33,6 +39,24 @@ */ public ExtensionObj(FONode parent) { super(parent); +} + +/** + * @see org.apache.fop.fo.FONode#processNode + */ +public void processNode(String elementName, Locator locator, +Attributes attlist, PropertyList pList) +throws SAXParseException +{ +// Empty +} + +/** + * Create a default property list for this element. + */ +protected PropertyList createPropertyList(PropertyList parent, +FOEventHandler foEventHandler) throws SAXParseException { +return null; } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr BasicLinkLayoutManager.java FlowLayoutManager.java InlineStackingLayoutManager.java LeaderLayoutManager.java LineLayoutManager.java PageNumberLayoutManager.java StaticContentLayoutManager.java
bckfnn 2004/10/20 14:07:02 Modified:src/java/org/apache/fop/fo PropertyList.java src/java/org/apache/fop/fo/flow Leader.java PageNumber.java src/java/org/apache/fop/fo/pagination ColorProfile.java Declarations.java Region.java RegionAfter.java RegionBefore.java RegionBody.java RegionEnd.java RegionStart.java RepeatablePageMasterAlternatives.java src/java/org/apache/fop/fo/properties CorrespondingPropertyMaker.java src/java/org/apache/fop/layoutmgr BasicLinkLayoutManager.java FlowLayoutManager.java InlineStackingLayoutManager.java LeaderLayoutManager.java LineLayoutManager.java PageNumberLayoutManager.java StaticContentLayoutManager.java Log: Fourth phase of performance improvement. - Misc cleanup. PR: 31699 Revision ChangesPath 1.39 +1 -1 xml-fop/src/java/org/apache/fop/fo/PropertyList.java Index: PropertyList.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/PropertyList.java,v retrieving revision 1.38 retrieving revision 1.39 diff -u -r1.38 -r1.39 --- PropertyList.java 20 Oct 2004 11:55:32 - 1.38 +++ PropertyList.java 20 Oct 2004 21:07:01 - 1.39 @@ -98,7 +98,7 @@ /* Handle request for one part of a compound property */ Property p = getExplicit(propId); if (p == null) { -p = getShorthand(propId & Constants.PROPERTY_MASK); +p = getShorthand(propId); } return p; } 1.43 +0 -5 xml-fop/src/java/org/apache/fop/fo/flow/Leader.java Index: Leader.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/Leader.java,v retrieving revision 1.42 retrieving revision 1.43 diff -u -r1.42 -r1.43 --- Leader.java 20 Oct 2004 17:49:16 - 1.42 +++ Leader.java 20 Oct 2004 21:07:01 - 1.43 @@ -40,7 +40,6 @@ import org.apache.fop.fo.properties.LengthRangeProperty; import org.apache.fop.fo.properties.SpaceProperty; import org.apache.fop.fo.properties.PercentLength; -import org.apache.fop.fonts.Font; import org.apache.fop.layoutmgr.LeaderLayoutManager; /** @@ -153,10 +152,6 @@ length = maxlength.getValue(); } return length; -} - -public Font getFontState() { -return commonFont.getFontState(getFOEventHandler().getFontInfo()); } /** 1.43 +0 -9 xml-fop/src/java/org/apache/fop/fo/flow/PageNumber.java Index: PageNumber.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/PageNumber.java,v retrieving revision 1.42 retrieving revision 1.43 diff -u -r1.42 -r1.43 --- PageNumber.java 20 Oct 2004 11:55:32 - 1.42 +++ PageNumber.java 20 Oct 2004 21:07:01 - 1.43 @@ -38,7 +38,6 @@ import org.apache.fop.fo.properties.CommonRelativePosition; import org.apache.fop.fo.properties.KeepProperty; import org.apache.fop.fo.properties.SpaceProperty; -import org.apache.fop.fonts.Font; import org.apache.fop.layoutmgr.PageNumberLayoutManager; /** @@ -131,14 +130,6 @@ protected void validateChildNode(Locator loc, String nsURI, String localName) throws SAXParseException { invalidChildError(loc, nsURI, localName); -} - -/** - * @return the FontState object for this PageNumber - */ -public Font getFontState() { -return commonFont.getFontState(getFOEventHandler().getFontInfo()); - } /** 1.19 +4 -6 xml-fop/src/java/org/apache/fop/fo/pagination/ColorProfile.java Index: ColorProfile.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/ColorProfile.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- ColorProfile.java 20 Oct 2004 13:19:24 - 1.18 +++ ColorProfile.java 20 Oct 2004 21:07:02 - 1.19 @@ -46,8 +46,6 @@ private int renderingIntent; // End of property values -private int intent; -private String profileName; private ICC_ColorSpace colorSpace = null; /** @@ -76,10 +74,10 @@ } /** - * @return the name of this color profile. + * Return the "color-profile-name" property. */ -public String getProfileName() { -return profileName;
cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr RetrieveMarkerLayoutManager.java
bckfnn 2004/10/20 14:04:43 Modified:src/java/org/apache/fop/fo FOEventHandler.java FOTreeBuilder.java FObj.java src/java/org/apache/fop/fo/flow Marker.java RetrieveMarker.java src/java/org/apache/fop/layoutmgr RetrieveMarkerLayoutManager.java Added: src/java/org/apache/fop/fo PropertyListMaker.java Log: Fourth phase of performance improvement. - Add PropertyListMaker to support fo:maker and fo:retrieve-marker. PR: 31699 Revision ChangesPath 1.4 +20 -1 xml-fop/src/java/org/apache/fop/fo/FOEventHandler.java Index: FOEventHandler.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FOEventHandler.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- FOEventHandler.java 30 Sep 2004 19:55:35 - 1.3 +++ FOEventHandler.java 20 Oct 2004 21:04:43 - 1.4 @@ -82,6 +82,11 @@ */ private Set idReferences = new HashSet(); +/* + * The property list maker. + */ +protected PropertyListMaker propertyListMaker; + /** * Main constructor * @param FOUserAgent the apps.FOUserAgent instance for this process @@ -121,6 +126,20 @@ */ public FontInfo getFontInfo() { return this.fontInfo; +} + +/** + * Return the propertyListMaker. +*/ +public PropertyListMaker getPropertyListMaker() { +return propertyListMaker; +} + +/** + * Set a new propertyListMaker. + */ +public void setPropertyListMaker(PropertyListMaker propertyListMaker) { +this.propertyListMaker = propertyListMaker; } /** 1.56 +6 -1 xml-fop/src/java/org/apache/fop/fo/FOTreeBuilder.java Index: FOTreeBuilder.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FOTreeBuilder.java,v retrieving revision 1.55 retrieving revision 1.56 diff -u -r1.55 -r1.56 --- FOTreeBuilder.java19 Oct 2004 12:52:09 - 1.55 +++ FOTreeBuilder.java20 Oct 2004 21:04:43 - 1.56 @@ -106,7 +106,12 @@ //This creates either an AreaTreeHandler and ultimately a Renderer, or //one of the RTF-, MIF- etc. Handlers. foEventHandler = RendererFactory.createFOEventHandler(foUserAgent, renderType, stream); - +foEventHandler.setPropertyListMaker(new PropertyListMaker() { +public PropertyList make(FObj fobj, PropertyList parentPropertyList) { +return new StaticPropertyList(fobj, parentPropertyList); +} +}); + // Add standard element mappings setupDefaultMappings(); 1.84 +1 -2 xml-fop/src/java/org/apache/fop/fo/FObj.java Index: FObj.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FObj.java,v retrieving revision 1.83 retrieving revision 1.84 diff -u -r1.83 -r1.84 --- FObj.java 20 Oct 2004 18:21:27 - 1.83 +++ FObj.java 20 Oct 2004 21:04:43 - 1.84 @@ -101,8 +101,7 @@ * Create a default property list for this element. */ protected PropertyList createPropertyList(PropertyList parent, FOEventHandler foEventHandler) throws SAXParseException { -//return foEventHandler.getPropertyListMaker().make(this, parent); -return new StaticPropertyList(this, parent); +return foEventHandler.getPropertyListMaker().make(this, parent); } /** 1.1 xml-fop/src/java/org/apache/fop/fo/PropertyListMaker.java Index: PropertyListMaker.java === /* * Copyright 2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* $Id: PropertyListMaker.java,v 1.1 2004/10/20 21:04:43 bckfnn Exp $ */ package org.apache.fop.fo; /** * A PropertyListMaker is a factory that creates PropertyLists. */ public interface PropertyListMaker { PropertyList make(FOb
cvs commit: xml-fop/src/java/org/apache/fop/fo/flow TableRow.java
bckfnn 2004/10/20 11:21:27 Modified:src/java/org/apache/fop/fo FObj.java src/java/org/apache/fop/fo/flow TableRow.java Log: Fourth phase of performance improvement. - Remove propertyList from FObj. PR: 31699 Revision ChangesPath 1.83 +4 -63 xml-fop/src/java/org/apache/fop/fo/FObj.java Index: FObj.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FObj.java,v retrieving revision 1.82 retrieving revision 1.83 diff -u -r1.82 -r1.83 --- FObj.java 20 Oct 2004 13:19:23 - 1.82 +++ FObj.java 20 Oct 2004 18:21:27 - 1.83 @@ -26,7 +26,6 @@ import java.util.Set; import org.apache.fop.fo.flow.Marker; -import org.apache.fop.fo.properties.Property; import org.apache.fop.fo.properties.PropertyMaker; import org.xml.sax.Attributes; @@ -39,9 +38,6 @@ public class FObj extends FONode implements Constants { public static PropertyMaker[] propertyListTable = null; -/** Formatting properties for this fo element. */ -protected PropertyList propertyList; - /** The immediate child nodes of this node. */ public ArrayList childNodes = null; @@ -96,9 +92,9 @@ public void processNode(String elementName, Locator locator, Attributes attlist, PropertyList pList) throws SAXParseException { setLocator(locator); -propertyList.addAttributesToList(attlist); -propertyList.setWritingMode(); -bind(propertyList); +pList.addAttributesToList(attlist); +pList.setWritingMode(); +bind(pList); } /** @@ -106,8 +102,7 @@ */ protected PropertyList createPropertyList(PropertyList parent, FOEventHandler foEventHandler) throws SAXParseException { //return foEventHandler.getPropertyListMaker().make(this, parent); -propertyList = new StaticPropertyList(this, parent); -return propertyList; +return new StaticPropertyList(this, parent); } /** @@ -145,60 +140,6 @@ */ public boolean getIsOutOfLineFODescendant() { return isOutOfLineFODescendant; -} - -/** - * Return the property list object for this FO. PropertyList tends - * to hold the base, pre-trait properties for this FO, either explicitly - * declared in the input XML or from inherited values. - */ -public PropertyList getPropertyList() { -return propertyList; -} - -/** - * Helper method to quickly obtain the value of a property - * for this FO, without querying for the propertyList first. - * @param propId - the Constants ID of the desired property to obtain - * @return the property - */ -public Property getProperty(int propId) { -return propertyList.get(propId); -} - -/** - * Convenience method to quickly obtain the String value of a property - * for this FO, without querying for the propertyList first. - * Meaningful only for properties having a string representation - * @param propId - the Constants ID of the desired property to obtain - * @return the String value of the property value - */ -public String getPropString(int propId) { -return propertyList.get(propId).getString(); -} - -/** - * Convenience method to quickly obtain the length value of a property - * for this FO, without querying for the propertyList first. - * Meaningful only for properties having a length representation - * Note: getValue() only correct after resolution completed, therefore - * should be called only in layout manager code. - * @param propId - the Constants ID of the desired property to obtain - * @return the length value of the property value - */ -public int getPropLength(int propId) { -return propertyList.get(propId).getLength().getValue(); -} - -/** - * Convenience method to quickly obtain the Constants class enumeration - * value of a property for this FO. Meaningful only for properties - * having an enumeration representation - * @param propId - the Constants ID of the desired property to obtain - * @return the enumeration value of the property value - */ -public int getPropEnum(int propId) { -return propertyList.get(propId).getEnum(); } /** 1.40 +0 -19 xml-fop/src/java/org/apache/fop/fo/flow/TableRow.java Index: TableRow.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/TableRow.java,v retrieving revision 1.39 retrieving revision 1.40 diff -u -r1.39 -r1.40 --- TableRow.java 20 Oct 2004
cvs commit: xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc BorderAttributesConverter.java
bckfnn 2004/10/20 10:53:36 Modified:src/java/org/apache/fop/render/rtf ListAttributesConverter.java PageAttributesConverter.java RTFHandler.java TableAttributesConverter.java TextAttributesConverter.java src/java/org/apache/fop/render/rtf/rtflib/rtfdoc BorderAttributesConverter.java Log: Fourth phase of performance improvement. - Get rid of calls to FObj.getProperty() and its friends. Replace them with the property getters on the FO nodes. PR: 31699 Revision ChangesPath 1.9 +5 -10 xml-fop/src/java/org/apache/fop/render/rtf/ListAttributesConverter.java Index: ListAttributesConverter.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/rtf/ListAttributesConverter.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- ListAttributesConverter.java 1 Oct 2004 09:19:15 - 1.8 +++ ListAttributesConverter.java 20 Oct 2004 17:53:35 - 1.9 @@ -20,10 +20,7 @@ //FOP import org.apache.fop.apps.FOPException; -import org.apache.fop.fo.Constants; -import org.apache.fop.fo.FObj; - -//RTF +import org.apache.fop.fo.flow.ListBlock; import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfAttributes; import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfListTable; import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfText; @@ -42,15 +39,13 @@ public class ListAttributesConverter { -static RtfAttributes convertAttributes(FObj fobj) +static RtfAttributes convertAttributes(ListBlock fobj) throws FOPException { FOPRtfAttributes attrib = new FOPRtfAttributes(); -attrib.set(RtfListTable.LIST_INDENT, -fobj.getProperty(Constants.PR_START_INDENT).getLength()); -attrib.set(RtfText.LEFT_INDENT_BODY, -fobj.getProperty(Constants.PR_END_INDENT).getLength()); +attrib.set(RtfListTable.LIST_INDENT, fobj.getCommonMarginBlock().startIndent); +attrib.set(RtfText.LEFT_INDENT_BODY, fobj.getCommonMarginBlock().endIndent); /* * set list table defaults 1.12 +21 -20 xml-fop/src/java/org/apache/fop/render/rtf/PageAttributesConverter.java Index: PageAttributesConverter.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/rtf/PageAttributesConverter.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- PageAttributesConverter.java 1 Oct 2004 09:22:15 - 1.11 +++ PageAttributesConverter.java 20 Oct 2004 17:53:35 - 1.12 @@ -21,13 +21,13 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.impl.SimpleLog; - -//FOP import org.apache.fop.datatypes.Length; import org.apache.fop.fo.Constants; -import org.apache.fop.fo.pagination.Region; -import org.apache.fop.fo.pagination.SimplePageMaster; import org.apache.fop.fo.expr.NumericOp; +import org.apache.fop.fo.pagination.RegionBA; +import org.apache.fop.fo.pagination.RegionBody; +import org.apache.fop.fo.pagination.SimplePageMaster; +import org.apache.fop.fo.properties.CommonMarginBlock; import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfAttributes; import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfPage; @@ -46,17 +46,17 @@ FOPRtfAttributes attrib = new FOPRtfAttributes(); try { -Region before = pagemaster.getRegion(Constants.FO_REGION_BEFORE); -Region body = pagemaster.getRegion(Constants.FO_REGION_BODY); -Region after = pagemaster.getRegion(Constants.FO_REGION_AFTER); +RegionBA before = (RegionBA) pagemaster.getRegion(Constants.FO_REGION_BEFORE); +RegionBody body = (RegionBody) pagemaster.getRegion(Constants.FO_REGION_BODY); +RegionBA after = (RegionBA) pagemaster.getRegion(Constants.FO_REGION_AFTER); -attrib.set(RtfPage.PAGE_WIDTH, pagemaster.getProperty(Constants.PR_PAGE_WIDTH).getLength()); -attrib.set(RtfPage.PAGE_HEIGHT, pagemaster.getProperty(Constants.PR_PAGE_HEIGHT).getLength()); +attrib.set(RtfPage.PAGE_WIDTH, pagemaster.getPageWidth()); +attrib.set(RtfPage.PAGE_HEIGHT, pagemaster.getPageHeight()); -Length pageTop = pagemaster.getProperty(Constants.PR_MARGIN_TOP).getLength(); -Length pageBottom = pagemaster.getProperty(Constants.PR_MARGIN_BOTTOM).getLength(); -Length pageLeft = pagemaster.getProperty(Constants.PR_MARGIN_LEFT).getLength(); -Length pageRight
cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr ExternalGraphicLayoutManager.java
bckfnn 2004/10/20 10:51:11 Modified:src/java/org/apache/fop/layoutmgr ExternalGraphicLayoutManager.java Log: Fourth phase of performance improvement. - Get rid of calls to FObj.getPropertyList() and its friends. Replace them with the property getters on the FO nodes. PR: 31699 Revision ChangesPath 1.11 +7 -8 xml-fop/src/java/org/apache/fop/layoutmgr/ExternalGraphicLayoutManager.java Index: ExternalGraphicLayoutManager.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/ExternalGraphicLayoutManager.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- ExternalGraphicLayoutManager.java 20 Oct 2004 13:37:48 - 1.10 +++ ExternalGraphicLayoutManager.java 20 Oct 2004 17:51:11 - 1.11 @@ -73,21 +73,20 @@ url = ImageFactory.getURL(fobj.getSrc()); // assume lr-tb for now and just use the .optimum value of the range -Length ipd = fobj.getPropertyList().get(PR_INLINE_PROGRESSION_DIMENSION). -getLengthRange().getOptimum().getLength(); +Length ipd = fobj.getInlineProgressionDimension().getOptimum().getLength(); if (!ipd.isAuto()) { viewWidth = ipd.getValue(); } else { -ipd = fobj.getPropertyList().get(PR_WIDTH).getLength(); +ipd = fobj.getWidth(); if (!ipd.isAuto()) { viewWidth = ipd.getValue(); } } -Length bpd = fobj.getPropertyList().get(PR_BLOCK_PROGRESSION_DIMENSION).getLengthRange().getOptimum().getLength(); +Length bpd = fobj.getBlockProgressionDimension().getOptimum().getLength(); if (!bpd.isAuto()) { viewHeight = bpd.getValue(); } else { -bpd = fobj.getPropertyList().get(PR_HEIGHT).getLength(); +bpd = fobj.getHeight(); if (!bpd.isAuto()) { viewHeight = bpd.getValue(); } @@ -98,7 +97,7 @@ int cwidth = -1; int cheight = -1; -Length ch = fobj.getPropertyList().get(PR_CONTENT_HEIGHT).getLength(); +Length ch = fobj.getContentHeight(); if (!ch.isAuto()) { /*if (ch.scaleToFit()) { if (viewHeight != -1) { @@ -107,7 +106,7 @@ } else {*/ cheight = ch.getValue(); } -Length cw = fobj.getPropertyList().get(PR_CONTENT_WIDTH).getLength(); +Length cw = fobj.getContentWidth(); if (!cw.isAuto()) { /*if (cw.scaleToFit()) { if (viewWidth != -1) { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr LeaderLayoutManager.java
bckfnn 2004/10/20 10:49:16 Modified:src/java/org/apache/fop/fo/flow Leader.java TableRow.java src/java/org/apache/fop/layoutmgr LeaderLayoutManager.java Log: Fourth phase of performance improvement. - fix temporary renamed property getter method. PR: 31699 Revision ChangesPath 1.42 +1 -10 xml-fop/src/java/org/apache/fop/fo/flow/Leader.java Index: Leader.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/Leader.java,v retrieving revision 1.41 retrieving revision 1.42 diff -u -r1.41 -r1.42 --- Leader.java 20 Oct 2004 11:55:32 - 1.41 +++ Leader.java 20 Oct 2004 17:49:16 - 1.42 @@ -155,18 +155,10 @@ return length; } -public int getRuleThickness() { -return ruleThickness.getValue(); -} - public Font getFontState() { return commonFont.getFontState(getFOEventHandler().getFontInfo()); } -public int getPatternWidth() { -return leaderPatternWidth.getValue(); -} - /** * Return the Common Font Properties. */ @@ -190,9 +182,8 @@ /** * Return the "rule-thickness" property. - * TODO: 31699 */ -public Length ___getRuleThickness() { +public Length getRuleThickness() { return ruleThickness; } 1.39 +1 -2 xml-fop/src/java/org/apache/fop/fo/flow/TableRow.java Index: TableRow.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/TableRow.java,v retrieving revision 1.38 retrieving revision 1.39 diff -u -r1.38 -r1.39 --- TableRow.java 19 Oct 2004 13:45:37 - 1.38 +++ TableRow.java 20 Oct 2004 17:49:16 - 1.39 @@ -151,9 +151,8 @@ /** * Return the "keep-with-previous" property. - * TODO: 31699 */ -public KeepProperty ___getKeepWithPrevious() { +public KeepProperty getKeepWithPrevious() { return keepWithPrevious; } 1.10 +8 -8 xml-fop/src/java/org/apache/fop/layoutmgr/LeaderLayoutManager.java Index: LeaderLayoutManager.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/LeaderLayoutManager.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- LeaderLayoutManager.java 20 Oct 2004 13:37:48 - 1.9 +++ LeaderLayoutManager.java 20 Oct 2004 17:49:16 - 1.10 @@ -75,7 +75,7 @@ org.apache.fop.area.inline.Leader leader = new org.apache.fop.area.inline.Leader(); leader.setRuleStyle(fobj.getRuleStyle()); -leader.setRuleThickness(fobj.getRuleThickness()); +leader.setRuleThickness(fobj.getRuleThickness().getValue()); leaderArea = leader; } else if (fobj.getLeaderPattern() == LeaderPattern.SPACE) { leaderArea = new Space(); @@ -90,10 +90,10 @@ t.setOffset(font.getAscender()); int width = font.getCharWidth(dot); Space spacer = null; -if (fobj.getPatternWidth() > width) { +if (fobj.getLeaderPatternWidth().getValue() > width) { spacer = new Space(); -spacer.setIPD(fobj.getPatternWidth() - width); -width = fobj.getPatternWidth(); +spacer.setIPD(fobj.getLeaderPatternWidth().getValue() - width); +width = fobj.getLeaderPatternWidth().getValue(); } FilledArea fa = new FilledArea(); fa.setUnitWidth(width); @@ -127,10 +127,10 @@ clm.fillArea(lm); int width = clm.getStackingSize(); Space spacer = null; -if (fobj.getPatternWidth() > width) { +if (fobj.getLeaderPatternWidth().getValue() > width) { spacer = new Space(); -spacer.setIPD(fobj.getPatternWidth() - width); -width = fobj.getPatternWidth(); +spacer.setIPD(fobj.getLeaderPatternWidth().getValue() - width); +width = fobj.getLeaderPatternWidth().getValue(); } fa.setUnitWidth(width); if (spacer != null) { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr PageNumberCitationLayoutManager.java
bckfnn 2004/10/20 06:42:41 Modified:src/java/org/apache/fop/layoutmgr PageNumberCitationLayoutManager.java Log: Consistent definition of fobj. Revision ChangesPath 1.9 +2 -2 xml-fop/src/java/org/apache/fop/layoutmgr/PageNumberCitationLayoutManager.java Index: PageNumberCitationLayoutManager.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/PageNumberCitationLayoutManager.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- PageNumberCitationLayoutManager.java 20 Oct 2004 13:19:24 - 1.8 +++ PageNumberCitationLayoutManager.java 20 Oct 2004 13:42:41 - 1.9 @@ -32,7 +32,7 @@ */ public class PageNumberCitationLayoutManager extends LeafNodeLayoutManager { -PageNumberCitation fobj; +private PageNumberCitation fobj; Font font = null; // whether the page referred to by the citation has been resolved yet - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr BidiLayoutManager.java BlockStackingLayoutManager.java LeafNodeLayoutManager.java StaticContentLayoutManager.java TextLayoutManager.java
bckfnn 2004/10/20 06:41:06 Modified:src/java/org/apache/fop/layoutmgr BidiLayoutManager.java BlockStackingLayoutManager.java LeafNodeLayoutManager.java StaticContentLayoutManager.java TextLayoutManager.java Log: Fourth phase of performance improvement. - Use correct AbstractLayoutManager constructor. PR: 31699 Revision ChangesPath 1.7 +2 -1 xml-fop/src/java/org/apache/fop/layoutmgr/BidiLayoutManager.java Index: BidiLayoutManager.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/BidiLayoutManager.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- BidiLayoutManager.java7 Aug 2004 13:01:17 - 1.6 +++ BidiLayoutManager.java20 Oct 2004 13:41:06 - 1.7 @@ -35,6 +35,7 @@ private List children; public BidiLayoutManager(BidiOverride node, InlineStackingLayoutManager cLM) { +super(node); children = new ArrayList(); setFObj(node); /* 1.9 +0 -3 xml-fop/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java Index: BlockStackingLayoutManager.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- BlockStackingLayoutManager.java 22 Sep 2004 08:24:32 - 1.8 +++ BlockStackingLayoutManager.java 20 Oct 2004 13:41:06 - 1.9 @@ -36,9 +36,6 @@ protected LayoutManager curChildLM = null; protected BlockParent parentArea = null; -public BlockStackingLayoutManager() { -} - public BlockStackingLayoutManager(FObj node) { super(node); } 1.10 +0 -6 xml-fop/src/java/org/apache/fop/layoutmgr/LeafNodeLayoutManager.java Index: LeafNodeLayoutManager.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/LeafNodeLayoutManager.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- LeafNodeLayoutManager.java20 Oct 2004 13:19:24 - 1.9 +++ LeafNodeLayoutManager.java20 Oct 2004 13:41:06 - 1.10 @@ -77,12 +77,6 @@ } /** - * Create a Leaf node layout mananger. - */ -public LeafNodeLayoutManager() { -} - -/** * get the inline area. * @param context the context used to create the area * @return the current inline area for this layout manager 1.6 +5 -0 xml-fop/src/java/org/apache/fop/layoutmgr/StaticContentLayoutManager.java Index: StaticContentLayoutManager.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/StaticContentLayoutManager.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- StaticContentLayoutManager.java 26 Sep 2004 13:51:01 - 1.5 +++ StaticContentLayoutManager.java 20 Oct 2004 13:41:06 - 1.6 @@ -21,6 +21,7 @@ import org.apache.fop.area.RegionReference; import org.apache.fop.area.Area; import org.apache.fop.area.Block; +import org.apache.fop.fo.pagination.Flow; import java.util.ArrayList; import java.util.List; @@ -36,6 +37,10 @@ private RegionReference region; private List blockBreaks = new ArrayList(); + +public StaticContentLayoutManager(Flow node) { +super(node); +} /** * Sets the region reference 1.25 +1 -2 xml-fop/src/java/org/apache/fop/layoutmgr/TextLayoutManager.java Index: TextLayoutManager.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/TextLayoutManager.java,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- TextLayoutManager.java20 Oct 2004 11:55:32 - 1.24 +++ TextLayoutManager.java20 Oct 2004 13:41:06 - 1.25 @@ -123,9 +123,8 @@ * @param node The FOText object to be rendered */ public TextLayoutManager(FOText node) { -super(); - foText = node; + textArray = new char[node.endIndex - node.startIndex]; System.arraycopy(node.ca, node.startIndex, textArray, 0, node.endIndex - node.startIndex); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr/list Item.java
bckfnn 2004/10/20 06:39:33 Modified:src/java/org/apache/fop/layoutmgr AbstractLayoutManager.java src/java/org/apache/fop/layoutmgr/list Item.java Log: Fourth phase of performance improvement. - Field AbstractLayoutManager.fobj no longer needed. PR: 31699 Revision ChangesPath 1.29 +3 -5 xml-fop/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java Index: AbstractLayoutManager.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- AbstractLayoutManager.java20 Oct 2004 13:19:24 - 1.28 +++ AbstractLayoutManager.java20 Oct 2004 13:39:33 - 1.29 @@ -41,7 +41,6 @@ public abstract class AbstractLayoutManager implements LayoutManager, Constants { protected LayoutManager parentLM = null; protected List childLMs = new ArrayList(10); -protected FObj fobj; protected ListIterator fobjIter = null; protected Map markers = null; @@ -82,9 +81,8 @@ * @param fo the formatting object for this layout manager */ public void setFObj(FObj fo) { -this.fobj = fo; -markers = fobj.getMarkers(); -fobjIter = fobj.getChildNodes(); +markers = fo.getMarkers(); +fobjIter = fo.getChildNodes(); childLMiter = new LMiter(this); } @@ -93,7 +91,7 @@ * for the areas it will create, based on Properties set on its FO. */ public void initialize() { -if (fobj != null && bInited == false) { +if (bInited == false) { initProperties(); bInited = true; } 1.10 +2 -0 xml-fop/src/java/org/apache/fop/layoutmgr/list/Item.java Index: Item.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/list/Item.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- Item.java 19 Oct 2004 21:47:15 - 1.9 +++ Item.java 20 Oct 2004 13:39:33 - 1.10 @@ -18,6 +18,7 @@ package org.apache.fop.layoutmgr.list; +import org.apache.fop.fo.FObj; import org.apache.fop.fo.flow.ListItemBody; import org.apache.fop.fo.flow.ListItemLabel; import org.apache.fop.layoutmgr.BlockStackingLayoutManager; @@ -40,6 +41,7 @@ * A cell contains blocks. These blocks fill the cell. */ public class Item extends BlockStackingLayoutManager { +private FObj fobj; private Block curBlockArea; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr ExternalGraphicLayoutManager.java InstreamForeignObjectLM.java LeaderLayoutManager.java PageSequenceLayoutManager.java
bckfnn 2004/10/20 06:37:49 Modified:src/java/org/apache/fop/layoutmgr ExternalGraphicLayoutManager.java InstreamForeignObjectLM.java LeaderLayoutManager.java PageSequenceLayoutManager.java Log: Fourth phase of performance improvement. - Consistent naming of the fobj. PR: 31699 Revision ChangesPath 1.10 +21 -23 xml-fop/src/java/org/apache/fop/layoutmgr/ExternalGraphicLayoutManager.java Index: ExternalGraphicLayoutManager.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/ExternalGraphicLayoutManager.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- ExternalGraphicLayoutManager.java 20 Oct 2004 13:19:24 - 1.9 +++ ExternalGraphicLayoutManager.java 20 Oct 2004 13:37:48 - 1.10 @@ -34,8 +34,7 @@ * LayoutManager for the fo:external-graphic formatting object */ public class ExternalGraphicLayoutManager extends LeafNodeLayoutManager { - -ExternalGraphic graphic = null; +private ExternalGraphic fobj; private String url; private int breakAfter; @@ -57,12 +56,11 @@ */ public ExternalGraphicLayoutManager(ExternalGraphic node) { super(node); - -graphic = node; +fobj = node; setup(); InlineArea area = getExternalGraphicInlineArea(); setCurrentArea(area); -setAlignment(graphic.getVerticalAlign()); +setAlignment(fobj.getVerticalAlign()); setLead(viewHeight); } @@ -72,24 +70,24 @@ * @todo see if can simplify property handling logic */ private void setup() { -url = ImageFactory.getURL(graphic.getSrc()); +url = ImageFactory.getURL(fobj.getSrc()); // assume lr-tb for now and just use the .optimum value of the range -Length ipd = graphic.getPropertyList().get(PR_INLINE_PROGRESSION_DIMENSION). +Length ipd = fobj.getPropertyList().get(PR_INLINE_PROGRESSION_DIMENSION). getLengthRange().getOptimum().getLength(); if (!ipd.isAuto()) { viewWidth = ipd.getValue(); } else { -ipd = graphic.getPropertyList().get(PR_WIDTH).getLength(); +ipd = fobj.getPropertyList().get(PR_WIDTH).getLength(); if (!ipd.isAuto()) { viewWidth = ipd.getValue(); } } -Length bpd = graphic.getPropertyList().get(PR_BLOCK_PROGRESSION_DIMENSION).getLengthRange().getOptimum().getLength(); +Length bpd = fobj.getPropertyList().get(PR_BLOCK_PROGRESSION_DIMENSION).getLengthRange().getOptimum().getLength(); if (!bpd.isAuto()) { viewHeight = bpd.getValue(); } else { -bpd = graphic.getPropertyList().get(PR_HEIGHT).getLength(); +bpd = fobj.getPropertyList().get(PR_HEIGHT).getLength(); if (!bpd.isAuto()) { viewHeight = bpd.getValue(); } @@ -100,7 +98,7 @@ int cwidth = -1; int cheight = -1; -Length ch = graphic.getPropertyList().get(PR_CONTENT_HEIGHT).getLength(); +Length ch = fobj.getPropertyList().get(PR_CONTENT_HEIGHT).getLength(); if (!ch.isAuto()) { /*if (ch.scaleToFit()) { if (viewHeight != -1) { @@ -109,7 +107,7 @@ } else {*/ cheight = ch.getValue(); } -Length cw = graphic.getPropertyList().get(PR_CONTENT_WIDTH).getLength(); +Length cw = fobj.getPropertyList().get(PR_CONTENT_WIDTH).getLength(); if (!cw.isAuto()) { /*if (cw.scaleToFit()) { if (viewWidth != -1) { @@ -119,10 +117,10 @@ cwidth = cw.getValue(); } -int scaling = graphic.getScaling(); +int scaling = fobj.getScaling(); if ((scaling == Scaling.UNIFORM) || (cwidth == -1) || cheight == -1) { ImageFactory fact = ImageFactory.getInstance(); -fopimage = fact.getImage(url, graphic.getUserAgent()); +fopimage = fact.getImage(url, fobj.getUserAgent()); if (fopimage == null) { // error url = null; @@ -162,11 +160,11 @@ } if (cwidth > viewWidth || cheight > viewHeight) { -int overflow = graphic.getOverflow(); +int overflow = fobj.getOverflow(); if (overflow == Overflow.HIDDEN) { clip = true; } else if (overflow == Overflow.ERROR_IF_OVERFLOW) { -graphic.getLogger().error("Image: " + url +
cvs commit: xml-fop/src/java/org/apache/fop/render/mif MIFHandler.java
bckfnn 2004/10/20 06:19:25 Modified:src/java/org/apache/fop/fo FObj.java src/java/org/apache/fop/fo/expr BodyStartFunction.java LabelEndFunction.java src/java/org/apache/fop/fo/flow Character.java ExternalGraphic.java InstreamForeignObject.java TableCell.java src/java/org/apache/fop/fo/pagination ColorProfile.java LayoutMasterSet.java PageSequence.java RegionBA.java RegionSE.java RepeatablePageMasterReference.java SimplePageMaster.java SinglePageMasterReference.java src/java/org/apache/fop/fo/properties LineHeightPropertyMaker.java src/java/org/apache/fop/layoutmgr AbstractLayoutManager.java CharacterLayoutManager.java ExternalGraphicLayoutManager.java ICLayoutManager.java InstreamForeignObjectLM.java LeaderLayoutManager.java LeafNodeLayoutManager.java PageNumberCitationLayoutManager.java PageNumberLayoutManager.java PageSequenceLayoutManager.java RetrieveMarkerLayoutManager.java src/java/org/apache/fop/layoutmgr/list ListBlockLayoutManager.java ListItemLayoutManager.java src/java/org/apache/fop/layoutmgr/table Body.java Caption.java Column.java Row.java TableAndCaptionLayoutManager.java src/java/org/apache/fop/render/mif MIFHandler.java Log: Fourth phase of performance improvement. - Get rid of calls to FObj.getProperty() and its friends. Replace them with the property getters on the FO nodes. PR: 31699 Revision ChangesPath 1.82 +1 -1 xml-fop/src/java/org/apache/fop/fo/FObj.java Index: FObj.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FObj.java,v retrieving revision 1.81 retrieving revision 1.82 diff -u -r1.81 -r1.82 --- FObj.java 20 Oct 2004 11:58:53 - 1.81 +++ FObj.java 20 Oct 2004 13:19:23 - 1.82 @@ -316,7 +316,7 @@ * @param marker Marker to add. */ protected void addMarker(Marker marker) { -String mcname = marker.getPropString(PR_MARKER_CLASS_NAME); +String mcname = marker.getMarkerClassName(); if (childNodes != null) { // check for empty childNodes for (Iterator iter = childNodes.iterator(); iter.hasNext();) { 1.10 +6 -7 xml-fop/src/java/org/apache/fop/fo/expr/BodyStartFunction.java Index: BodyStartFunction.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/expr/BodyStartFunction.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- BodyStartFunction.java22 May 2004 21:44:37 - 1.9 +++ BodyStartFunction.java20 Oct 2004 13:19:23 - 1.10 @@ -20,7 +20,7 @@ import org.apache.fop.datatypes.Numeric; import org.apache.fop.fo.Constants; -import org.apache.fop.fo.FONode; +import org.apache.fop.fo.PropertyList; import org.apache.fop.fo.flow.ListItem; import org.apache.fop.fo.properties.Property; @@ -49,16 +49,15 @@ Numeric distance = pInfo.getPropertyList().get(Constants.PR_PROVISIONAL_DISTANCE_BETWEEN_STARTS).getNumeric(); -FONode item = pInfo.getFO(); -while (item != null && !(item instanceof ListItem)) { -item = item.getParent(); +PropertyList pList = pInfo.getPropertyList(); +while (pList != null && !(pList.getFObj() instanceof ListItem)) { +pList = pList.getParentPropertyList(); } -if (item == null) { +if (pList == null) { throw new PropertyException("body-start() called from outside an fo:list-item"); } -Numeric startIndent = -((ListItem)item).getProperty(Constants.PR_START_INDENT).getNumeric(); +Numeric startIndent = pList.get(Constants.PR_START_INDENT).getNumeric(); return (Property) NumericOp.addition(distance, startIndent); } 1.11 +7 -7 xml-fop/src/java/org/apache/fop/fo/expr/LabelEndFunction.java Index: LabelEndFunction.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/expr/LabelEndFunction.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- LabelEndFunction.jav
cvs commit: xml-fop/src/java/org/apache/fop/fo FOPropertyMapping.java
bckfnn 2004/10/20 06:17:03 Modified:src/java/org/apache/fop/fo FOPropertyMapping.java Log: Fourth phase of performance improvement. - Set a better base for leader-length percentages. PR: 31699 Revision ChangesPath 1.29 +4 -4 xml-fop/src/java/org/apache/fop/fo/FOPropertyMapping.java Index: FOPropertyMapping.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FOPropertyMapping.java,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- FOPropertyMapping.java19 Oct 2004 18:42:43 - 1.28 +++ FOPropertyMapping.java20 Oct 2004 13:17:03 - 1.29 @@ -1822,19 +1822,19 @@ sub = new LengthProperty.Maker(CP_MINIMUM); sub.setDefault("0pt"); -sub.setPercentBase(LengthBase.CONTAINING_BOX); +sub.setPercentBase(LengthBase.BLOCK_WIDTH); sub.setByShorthand(true); m.addSubpropMaker(sub); sub = new LengthProperty.Maker(CP_OPTIMUM); sub.setDefault("12.0pt"); -sub.setPercentBase(LengthBase.CONTAINING_BOX); +sub.setPercentBase(LengthBase.BLOCK_WIDTH); sub.setByShorthand(true); m.addSubpropMaker(sub); sub = new LengthProperty.Maker(CP_MAXIMUM); sub.setDefault("100%", true); -sub.setPercentBase(LengthBase.CONTAINING_BOX); +sub.setPercentBase(LengthBase.BLOCK_WIDTH); sub.setByShorthand(true); m.addSubpropMaker(sub); addPropertyMaker("leader-length", m); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/fo TextInfo.java
bckfnn 2004/10/20 05:06:51 Removed: src/java/org/apache/fop/fo TextInfo.java Log: Third phase of performance improvement. - Functionality moved into FOText. PR: 31699 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/fo PropertyManager.java
bckfnn 2004/10/20 05:06:07 Removed: src/java/org/apache/fop/fo PropertyManager.java Log: Third phase of performance improvement. - Functionality moved into CommonXXX classes and PropertyList. PR: 31699 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/fo/properties CommonBackground.java CommonBorderAndPadding.java
bckfnn 2004/10/20 05:04:26 Removed: src/java/org/apache/fop/fo/properties CommonBackground.java CommonBorderAndPadding.java Log: Third phase of performance improvement. - Functionality moved into CommonBorderPaddingBackground. PR: 31699 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr LineLayoutManager.java
bckfnn 2004/10/20 05:01:09 Modified:src/java/org/apache/fop/layoutmgr LineLayoutManager.java Log: Third phase of performance improvement. - Use the new CommonXXX fields. PR: 31699 Revision ChangesPath 1.29 +11 -14xml-fop/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java Index: LineLayoutManager.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- LineLayoutManager.java10 Oct 2004 11:21:28 - 1.28 +++ LineLayoutManager.java20 Oct 2004 12:01:09 - 1.29 @@ -19,14 +19,12 @@ package org.apache.fop.layoutmgr; import org.apache.fop.datatypes.Length; -import org.apache.fop.fo.FObj; -import org.apache.fop.fo.PropertyManager; import org.apache.fop.fo.Constants; +import org.apache.fop.fo.flow.Block; import org.apache.fop.fo.properties.CommonMarginBlock; import org.apache.fop.fo.properties.CommonHyphenation; import org.apache.fop.hyphenation.Hyphenation; import org.apache.fop.hyphenation.Hyphenator; -import org.apache.fop.traits.BlockProps; import org.apache.fop.area.LineArea; import org.apache.fop.area.Resolveable; @@ -50,25 +48,24 @@ * child layout managers. */ public class LineLayoutManager extends InlineStackingLayoutManager { - +private Block fobj; + /** * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties() */ protected void initProperties() { -PropertyManager pm = fobj.getPropertyManager(); -CommonMarginBlock marginProps = pm.getMarginProps(); -iIndents = marginProps.startIndent + marginProps.endIndent; -BlockProps blockProps = pm.getBlockProps(); -bTextAlignment = blockProps.textAlign; -bTextAlignmentLast = blockProps.textAlignLast; +CommonMarginBlock marginProps = fobj.getCommonMarginBlock(); +bTextAlignment = fobj.getTextAlign(); +bTextAlignmentLast = fobj.getTextAlignLast(); +textIndent = fobj.getTextIndent(); +hyphProps = fobj.getCommonHyphenation(); + // if (bTextAlignment != JUSTIFY && bTextAlignmentLast == JUSTIFY) { effectiveAlignment = 0; } else { effectiveAlignment = bTextAlignment; } -textIndent = blockProps.firstIndent; -hyphProps = pm.getHyphenationProps(); } /** @@ -105,7 +102,6 @@ private int bTextAlignmentLast; private int effectiveAlignment; private Length textIndent; -private int iIndents = 0; private CommonHyphenation hyphProps; private int lineHeight; @@ -355,8 +351,9 @@ * @param l the default lead, from top to baseline * @param f the default follow, from baseline to bottom */ -public LineLayoutManager(FObj node, int lh, int l, int f) { +public LineLayoutManager(Block node, int lh, int l, int f) { super(node); +fobj = node; // the child FObj are owned by the parent BlockLM // this LM has all its childLMs preloaded fobjIter = null; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr InlineStackingLayoutManager.java
bckfnn 2004/10/20 05:00:24 Modified:src/java/org/apache/fop/layoutmgr InlineStackingLayoutManager.java Log: Third phase of performance improvement. - Use the new CommonXXX fields. - Delegate all access to fo:inline properties to the InlineLM subclass. PR: 31699 Revision ChangesPath 1.14 +30 -17 xml-fop/src/java/org/apache/fop/layoutmgr/InlineStackingLayoutManager.java Index: InlineStackingLayoutManager.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/InlineStackingLayoutManager.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- InlineStackingLayoutManager.java 19 Oct 2004 21:51:54 - 1.13 +++ InlineStackingLayoutManager.java 20 Oct 2004 12:00:24 - 1.14 @@ -25,8 +25,8 @@ import java.util.HashMap; import org.apache.fop.fo.FObj; -import org.apache.fop.fo.PropertyManager; -import org.apache.fop.traits.InlineProps; +import org.apache.fop.fo.properties.SpaceProperty; +import org.apache.fop.traits.SpaceVal; import org.apache.fop.area.Area; import org.apache.fop.area.inline.InlineArea; import org.apache.fop.area.inline.InlineParent; @@ -66,9 +66,6 @@ */ protected MinOptMax extraBPD; - -private InlineProps inlineProps = null; - private Area currentArea; // LineArea or InlineParent private BreakPoss prevBP; @@ -97,8 +94,6 @@ * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties() */ protected void initProperties() { -PropertyManager pm = fobj.getPropertyManager(); -inlineProps = pm.getInlineProps(); extraBPD = new MinOptMax(0); } @@ -134,6 +129,14 @@ return false; } +protected SpaceProperty getSpaceStart() { +return null; +} + +protected SpaceProperty getSpaceEnd() { +return null; +} + /** * Reset position for returning next BreakPossibility. * @param prevPos a Position returned by this layout manager @@ -175,9 +178,6 @@ * propagate to first child LM */ public boolean canBreakBefore(LayoutContext context) { -if (inlineProps.spaceStart.getSpace().min > 0 || hasLeadingFence(false)) { -return true; -} LayoutManager lm = getChildLM(); if (lm != null) { return lm.canBreakBefore(context); @@ -215,7 +215,9 @@ // First call to this LM in new parent "area", but this may // not be the first area created by this inline childLC = new LayoutContext(lc); -lc.getLeadingSpace().addSpace(inlineProps.spaceStart); +if (getSpaceStart() != null) { +lc.getLeadingSpace().addSpace(new SpaceVal(getSpaceStart())); +} // Check for "fence" if (hasLeadingFence(!lc.isFirstArea())) { @@ -338,7 +340,9 @@ // call in this LM trailingSpace = (SpaceSpecifier) trailingSpace.clone(); } -trailingSpace.addSpace(inlineProps.spaceEnd); +if (getSpaceEnd() != null) { +trailingSpace.addSpace(new SpaceVal(getSpaceEnd())); +} myBP.setTrailingSpace(trailingSpace); // Add start and end borders and padding @@ -441,7 +445,9 @@ false); } -context.getLeadingSpace().addSpace(inlineProps.spaceStart); +if (getSpaceStart() != null) { +context.getLeadingSpace().addSpace(new SpaceVal(getSpaceStart())); +} // "unwrap" the NonLeafPositions stored in parentIter // and put them in a new list; @@ -492,10 +498,11 @@ context.setTrailingSpace(getContext().getTrailingSpace()); } // Add own trailing space to parent context (or set on area?) -if (context.getTrailingSpace() != null) { -context.getTrailingSpace().addSpace(inlineProps.spaceEnd); +if (context.getTrailingSpace() != null && getSpaceEnd() != null) { +context.getTrailingSpace().addSpace(new SpaceVal(getSpaceEnd())); } - +setTraits(bAreaCreated, !bIsLast); + parentLM.addChild(getCurrentArea()); context.setFlags(LayoutContext.LAST_AREA, bIsLast); bAreaCreated = true; @@ -509,6 +516,10 @@ currentArea = area; } +protected void setTraits(boolean bNotFirst, boolean bNotLast) { + +} + public void addChild(Area childArea) { // Make sure childArea is inline area if (childArea instanceof InlineArea) { @@ -569,7 +580,9 @@
cvs commit: xml-fop/src/java/org/apache/fop/fo FObj.java
bckfnn 2004/10/20 04:58:53 Modified:src/java/org/apache/fop/fo FObj.java Log: Third phase of performance improvement. - Remove use of PropertyManager. PR: 31699 Revision ChangesPath 1.81 +0 -13 xml-fop/src/java/org/apache/fop/fo/FObj.java Index: FObj.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FObj.java,v retrieving revision 1.80 retrieving revision 1.81 diff -u -r1.80 -r1.81 --- FObj.java 19 Oct 2004 12:52:09 - 1.80 +++ FObj.java 20 Oct 2004 11:58:53 - 1.81 @@ -42,9 +42,6 @@ /** Formatting properties for this fo element. */ protected PropertyList propertyList; -/** Property manager for providing refined properties/traits. */ -protected PropertyManager propMgr; - /** The immediate child nodes of this node. */ public ArrayList childNodes = null; @@ -102,7 +99,6 @@ propertyList.addAttributesToList(attlist); propertyList.setWritingMode(); bind(propertyList); -propMgr = new PropertyManager(propertyList); } /** @@ -149,15 +145,6 @@ */ public boolean getIsOutOfLineFODescendant() { return isOutOfLineFODescendant; -} - -/** - * Return the PropertyManager object for this FO. PropertyManager - * tends to hold the traits for this FO, and is primarily used in layout. - * @return the property manager for this FO - */ -public PropertyManager getPropertyManager() { -return propMgr; } /** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr BlockLayoutManager.java CharacterLayoutManager.java PageNumberCitationLayoutManager.java PageSequenceLayoutManager.java TextLayoutManager.java TraitSetter.java
bckfnn 2004/10/20 04:55:33 Modified:src/java/org/apache/fop/fo PropertyList.java src/java/org/apache/fop/fo/flow Leader.java PageNumber.java src/java/org/apache/fop/fo/pagination RegionBody.java src/java/org/apache/fop/layoutmgr BlockLayoutManager.java CharacterLayoutManager.java PageNumberCitationLayoutManager.java PageSequenceLayoutManager.java TextLayoutManager.java TraitSetter.java Log: Third phase of performance improvement. - Use the new CommonXXX fields. PR: 31699 Revision ChangesPath 1.38 +7 -7 xml-fop/src/java/org/apache/fop/fo/PropertyList.java Index: PropertyList.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/PropertyList.java,v retrieving revision 1.37 retrieving revision 1.38 diff -u -r1.37 -r1.38 --- PropertyList.java 19 Oct 2004 12:55:03 - 1.37 +++ PropertyList.java 20 Oct 2004 11:55:32 - 1.38 @@ -488,7 +488,7 @@ * @return a HyphenationProps object */ public CommonHyphenation getHyphenationProps() { -return new CommonHyphenation(); +return new CommonHyphenation(this); } /** @@ -496,7 +496,7 @@ * @return a MarginProps object */ public CommonMarginBlock getMarginBlockProps() { -return new CommonMarginBlock(); +return new CommonMarginBlock(this); } /** @@ -504,7 +504,7 @@ * @return a MarginInlineProps object */ public CommonMarginInline getMarginInlineProps() { -return new CommonMarginInline(); +return new CommonMarginInline(this); } /** @@ -512,7 +512,7 @@ * @return a AccessibilityProps object */ public CommonAccessibility getAccessibilityProps() { -return new CommonAccessibility(); +return new CommonAccessibility(this); } /** @@ -520,7 +520,7 @@ * @return a AuralProps object */ public CommonAural getAuralProps() { -CommonAural props = new CommonAural(); +CommonAural props = new CommonAural(this); return props; } @@ -529,7 +529,7 @@ * @return a RelativePositionProps object */ public CommonRelativePosition getRelativePositionProps() { -return new CommonRelativePosition(); +return new CommonRelativePosition(this); } /** @@ -537,7 +537,7 @@ * @return a AbsolutePositionProps object */ public CommonAbsolutePosition getAbsolutePositionProps() { -return new CommonAbsolutePosition(); +return new CommonAbsolutePosition(this); } 1.41 +1 -1 xml-fop/src/java/org/apache/fop/fo/flow/Leader.java Index: Leader.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/Leader.java,v retrieving revision 1.40 retrieving revision 1.41 diff -u -r1.40 -r1.41 --- Leader.java 19 Oct 2004 13:45:37 - 1.40 +++ Leader.java 20 Oct 2004 11:55:32 - 1.41 @@ -160,7 +160,7 @@ } public Font getFontState() { -return propMgr.getFontState(getFOEventHandler().getFontInfo()); +return commonFont.getFontState(getFOEventHandler().getFontInfo()); } public int getPatternWidth() { 1.42 +1 -1 xml-fop/src/java/org/apache/fop/fo/flow/PageNumber.java Index: PageNumber.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/PageNumber.java,v retrieving revision 1.41 retrieving revision 1.42 diff -u -r1.41 -r1.42 --- PageNumber.java 19 Oct 2004 13:45:37 - 1.41 +++ PageNumber.java 20 Oct 2004 11:55:32 - 1.42 @@ -137,7 +137,7 @@ * @return the FontState object for this PageNumber */ public Font getFontState() { -return propMgr.getFontState(getFOEventHandler().getFontInfo()); +return commonFont.getFontState(getFOEventHandler().getFontInfo()); } 1.32 +7 -4 xml-fop/src/java/org/apache/fop/fo/pagination/RegionBody.java Index: RegionBody.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/RegionBody.java,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- RegionBody.java 19 Oct 2004 08:53:51 - 1.31 +++ RegionBody.java 20 Oct 2004 11:55:32 - 1.32 @@ -94,10 +94,13 @@ * writing-mode on the page (not on the region-body
cvs commit: xml-fop/src/java/org/apache/fop/fo/properties CommonAbsolutePosition.java CommonAural.java CommonMarginInline.java
bckfnn 2004/10/20 04:51:35 Modified:src/java/org/apache/fop/fo/properties CommonAbsolutePosition.java CommonAural.java CommonMarginInline.java Log: Third phase of performance improvement. - Remove default ctor. Was only used by PropertyManager. PR: 31699 Revision ChangesPath 1.4 +1 -4 xml-fop/src/java/org/apache/fop/fo/properties/CommonAbsolutePosition.java Index: CommonAbsolutePosition.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/properties/CommonAbsolutePosition.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- CommonAbsolutePosition.java 19 Oct 2004 21:40:56 - 1.3 +++ CommonAbsolutePosition.java 20 Oct 2004 11:51:34 - 1.4 @@ -53,9 +53,6 @@ */ public Length left; -public CommonAbsolutePosition() { -} - /** * Create a CommonAbsolutePosition object. * @param pList The PropertyList with propery values. 1.4 +1 -4 xml-fop/src/java/org/apache/fop/fo/properties/CommonAural.java Index: CommonAural.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/properties/CommonAural.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- CommonAural.java 19 Oct 2004 21:40:56 - 1.3 +++ CommonAural.java 20 Oct 2004 11:51:34 - 1.4 @@ -116,9 +116,6 @@ */ public int volume; -public CommonAural() { -} - /** * Create a CommonAbsolutePosition object. * @param pList The PropertyList with propery values. 1.4 +1 -5 xml-fop/src/java/org/apache/fop/fo/properties/CommonMarginInline.java Index: CommonMarginInline.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/properties/CommonMarginInline.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- CommonMarginInline.java 19 Oct 2004 21:40:56 - 1.3 +++ CommonMarginInline.java 20 Oct 2004 11:51:34 - 1.4 @@ -59,10 +59,6 @@ */ public SpaceProperty spaceEnd; -public CommonMarginInline() { - -} - /** * Create a CommonMarginInline object. * @param pList The PropertyList with propery values. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/fo/properties CommonAccessibility.java CommonHyphenation.java CommonMarginBlock.java CommonRelativePosition.java
bckfnn 2004/10/20 04:50:05 Modified:src/java/org/apache/fop/fo/properties CommonAccessibility.java CommonHyphenation.java CommonMarginBlock.java CommonRelativePosition.java Log: Third phase of performance improvement. - Follow the spec for property types and names. PR: 31699 Revision ChangesPath 1.3 +26 -2 xml-fop/src/java/org/apache/fop/fo/properties/CommonAccessibility.java Index: CommonAccessibility.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/properties/CommonAccessibility.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- CommonAccessibility.java 27 Feb 2004 17:45:44 - 1.2 +++ CommonAccessibility.java 20 Oct 2004 11:50:04 - 1.3 @@ -18,16 +18,40 @@ package org.apache.fop.fo.properties; +import org.apache.fop.fo.Constants; +import org.apache.fop.fo.PropertyList; + /** * Store all common accessibility properties. * See Sec 7.4 of the XSL-FO Standard. * Public "structure" allows direct member access. */ public class CommonAccessibility { +/** + * The "source-doc" property. + */ public String sourceDoc = null; + +/** + * The "role" property. + */ public String role = null; -public CommonAccessibility() { +/** + * Create a CommonAbsolutePosition object. + * @param pList The PropertyList with propery values. + */ +public CommonAccessibility(PropertyList pList) { +sourceDoc = pList.get(Constants.PR_SOURCE_DOCUMENT).getString(); +if ("none".equals(sourceDoc)) { +sourceDoc = null; +} +role = pList.get(Constants.PR_ROLE).getString(); +if ("none".equals(role)) { +role = null; +} + } + } 1.3 +51 -5 xml-fop/src/java/org/apache/fop/fo/properties/CommonHyphenation.java Index: CommonHyphenation.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/properties/CommonHyphenation.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- CommonHyphenation.java27 Feb 2004 17:45:44 - 1.2 +++ CommonHyphenation.java20 Oct 2004 11:50:04 - 1.3 @@ -18,18 +18,64 @@ package org.apache.fop.fo.properties; +import org.apache.fop.fo.Constants; +import org.apache.fop.fo.PropertyList; + /** * Store all common hyphenation properties. * See Sec. 7.9 of the XSL-FO Standard. * Public "structure" allows direct member access. */ public class CommonHyphenation { +/** + * The "language" property. + */ +public String language; + +/** + * The "country" property. + */ +public String country; + +/** + * The "script" property. + */ +public String script; + +/** + * The "hyphenate" property. + */ +public int hyphenate; -public int hyphenate; // Enum true or false: store as boolean! -public char hyphenationChar; +/** + * The "hyphenation-character" property. + */ +public char hyphenationCharacter; + +/** + * The "hyphenation-push-character" property. + */ public int hyphenationPushCharacterCount; + +/** + * The "hyphenation-remain-character-count" property. + */ public int hyphenationRemainCharacterCount; -public String language;// Language code or enum "NONE" -public String country; // Country code or enum "NONE" + +/** + * Create a CommonHyphenation object. + * @param pList The PropertyList with propery values. + */ +public CommonHyphenation(PropertyList pList) { +language = pList.get(Constants.PR_LANGUAGE).getString(); +country = pList.get(Constants.PR_COUNTRY).getString(); +hyphenate = pList.get(Constants.PR_HYPHENATE).getEnum(); +hyphenationCharacter = pList.get(Constants.PR_HYPHENATION_CHARACTER).getCharacter(); +hyphenationPushCharacterCount = + pList.get(Constants.PR_HYPHENATION_PUSH_CHARACTER_COUNT).getNumber().intValue(); +hyphenationRemainCharacterCount = + pList.get(Constants.PR_HYPHENATION_REMAIN_CHARACTER_COUNT).getNumber().intValue(); + +} } 1.3 +59 -9 xml-fop/src/java/org/apache/fop/fo/properties/CommonMarginBlock.java Index: CommonMarginBlock.java === RCS
cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr InlineLayoutManager.java InlineStackingLayoutManager.java
bckfnn 2004/10/19 14:51:54 Modified:src/java/org/apache/fop/layoutmgr InlineStackingLayoutManager.java Added: src/java/org/apache/fop/layoutmgr InlineLayoutManager.java Log: Third phase of performance improvement. - Split the border/padding features of InlineStackingLM out into a InlineLM which is the LM for fo:inline. PR: 31699 Revision ChangesPath 1.13 +5 -41 xml-fop/src/java/org/apache/fop/layoutmgr/InlineStackingLayoutManager.java Index: InlineStackingLayoutManager.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/InlineStackingLayoutManager.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- InlineStackingLayoutManager.java 22 Sep 2004 08:24:32 - 1.12 +++ InlineStackingLayoutManager.java 19 Oct 2004 21:51:54 - 1.13 @@ -26,8 +26,6 @@ import org.apache.fop.fo.FObj; import org.apache.fop.fo.PropertyManager; -import org.apache.fop.fo.properties.CommonBorderAndPadding; -import org.apache.fop.fo.properties.CommonBackground; import org.apache.fop.traits.InlineProps; import org.apache.fop.area.Area; import org.apache.fop.area.inline.InlineArea; @@ -66,12 +64,10 @@ /** * Size of border and padding in BPD (ie, before and after). */ -private MinOptMax extraBPD; +protected MinOptMax extraBPD; private InlineProps inlineProps = null; -private CommonBorderAndPadding borderProps = null; -private CommonBackground backgroundProps; private Area currentArea; // LineArea or InlineParent @@ -103,16 +99,7 @@ protected void initProperties() { PropertyManager pm = fobj.getPropertyManager(); inlineProps = pm.getInlineProps(); -borderProps = pm.getBorderAndPadding(); -// Calculdate border and padding size in BPD -int iPad = borderProps.getPadding(CommonBorderAndPadding.BEFORE, false); -iPad += borderProps.getBorderWidth(CommonBorderAndPadding.BEFORE, - false); -iPad += borderProps.getPadding(CommonBorderAndPadding.AFTER, false); -iPad += borderProps.getBorderWidth(CommonBorderAndPadding.AFTER, false); -extraBPD = new MinOptMax(iPad); - -backgroundProps = pm.getBackgroundProps(); +extraBPD = new MinOptMax(0); } /** @@ -135,28 +122,16 @@ } private MinOptMax getExtraIPD(boolean bNotFirst, boolean bNotLast) { -int iBP = borderProps.getPadding(CommonBorderAndPadding.START, - bNotFirst); -iBP += borderProps.getBorderWidth(CommonBorderAndPadding.START, -bNotFirst); -iBP += borderProps.getPadding(CommonBorderAndPadding.END, bNotLast); -iBP += borderProps.getBorderWidth(CommonBorderAndPadding.END, bNotLast); -return new MinOptMax(iBP); +return new MinOptMax(0); } protected boolean hasLeadingFence(boolean bNotFirst) { -int iBP = borderProps.getPadding(CommonBorderAndPadding.START, - bNotFirst); -iBP += borderProps.getBorderWidth(CommonBorderAndPadding.START, -bNotFirst); -return (iBP > 0); +return false; } protected boolean hasTrailingFence(boolean bNotLast) { -int iBP = borderProps.getPadding(CommonBorderAndPadding.END, bNotLast); -iBP += borderProps.getBorderWidth(CommonBorderAndPadding.END, bNotLast); -return (iBP > 0); +return false; } /** @@ -519,17 +494,6 @@ // Add own trailing space to parent context (or set on area?) if (context.getTrailingSpace() != null) { context.getTrailingSpace().addSpace(inlineProps.spaceEnd); -} - -// Add border and padding to current area and set flags (FIRST, LAST ...) -TraitSetter.setBorderPaddingTraits(getCurrentArea(), - borderProps, bAreaCreated, !bIsLast); - -if (borderProps != null) { -TraitSetter.addBorders(getCurrentArea(), borderProps); -} -if (backgroundProps != null) { -TraitSetter.addBackground(getCurrentArea(), backgroundProps); } parentLM.addChild(getCurrentArea()); 1.1 xml-fop/src/java/org/apache/fop/layoutmgr/InlineLayoutManager.java Index: InlineLayoutManager.java === /* * Copyright 1999-2004 The Apache Software Foundation. * * Licensed under the Apache License, Versi
cvs commit: xml-fop/src/java/org/apache/fop/fo/flow BlockContainer.java
bckfnn 2004/10/19 14:50:14 Modified:src/java/org/apache/fop/fo/flow BlockContainer.java Log: Third phase of performance improvement. PR: 31699 Revision ChangesPath 1.29 +0 -1 xml-fop/src/java/org/apache/fop/fo/flow/BlockContainer.java Index: BlockContainer.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/BlockContainer.java,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- BlockContainer.java 19 Oct 2004 13:45:36 - 1.28 +++ BlockContainer.java 19 Oct 2004 21:50:14 - 1.29 @@ -196,7 +196,6 @@ */ public void addLayoutManager(List list) { BlockContainerLayoutManager blm = new BlockContainerLayoutManager(this); -blm.setOverflow(getPropEnum(PR_OVERFLOW)); list.add(blm); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/fo PropertyManager.java
bckfnn 2004/10/19 14:49:43 Modified:src/java/org/apache/fop/fo PropertyManager.java Log: Third phase of performance improvement. - Use new CommonAbsolutePosition. PR: 31699 Revision ChangesPath 1.37 +1 -7 xml-fop/src/java/org/apache/fop/fo/PropertyManager.java Index: PropertyManager.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/PropertyManager.java,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- PropertyManager.java 22 Sep 2004 19:21:10 - 1.36 +++ PropertyManager.java 19 Oct 2004 21:49:43 - 1.37 @@ -380,13 +380,7 @@ * @return a AbsolutePositionProps object */ public CommonAbsolutePosition getAbsolutePositionProps() { -CommonAbsolutePosition props = new CommonAbsolutePosition(); -props.absolutePosition = - this.propertyList.get(PR_ABSOLUTE_POSITION).getEnum(); -props.top = this.propertyList.get(PR_TOP).getLength().getValue(); -props.bottom = this.propertyList.get(PR_BOTTOM).getLength().getValue(); -props.left = this.propertyList.get(PR_LEFT).getLength().getValue(); -props.right = this.propertyList.get(PR_RIGHT).getLength().getValue(); +CommonAbsolutePosition props = new CommonAbsolutePosition(propertyList); return props; } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr/table Body.java Cell.java Column.java Row.java TableLayoutManager.java
bckfnn 2004/10/19 14:48:17 Modified:src/java/org/apache/fop/layoutmgr/table Body.java Cell.java Column.java Row.java TableLayoutManager.java Log: Third phase of performance improvement. - Use CommonBorderPaddingBackground. PR: 31699 Revision ChangesPath 1.10 +6 -20 xml-fop/src/java/org/apache/fop/layoutmgr/table/Body.java Index: Body.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/table/Body.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- Body.java 26 May 2004 04:22:40 - 1.9 +++ Body.java 19 Oct 2004 21:48:17 - 1.10 @@ -18,8 +18,7 @@ package org.apache.fop.layoutmgr.table; -import org.apache.fop.fo.FObj; -import org.apache.fop.fo.PropertyManager; +import org.apache.fop.fo.flow.TableBody; import org.apache.fop.layoutmgr.LayoutManager; import org.apache.fop.layoutmgr.BlockStackingLayoutManager; import org.apache.fop.layoutmgr.LeafPosition; @@ -32,8 +31,6 @@ import org.apache.fop.area.Area; import org.apache.fop.area.Block; import org.apache.fop.traits.MinOptMax; -import org.apache.fop.fo.properties.CommonBorderAndPadding; -import org.apache.fop.fo.properties.CommonBackground; import java.util.ArrayList; import java.util.List; @@ -44,9 +41,8 @@ * Cells are organised into rows. */ public class Body extends BlockStackingLayoutManager { -private CommonBorderAndPadding borderProps = null; -private CommonBackground backgroundProps; - +private TableBody fobj; + private boolean rows = true; private List columns; @@ -60,17 +56,9 @@ /** * Create a new body layout manager. */ -public Body(FObj node) { +public Body(TableBody node) { super(node); -} - -/** - * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties() - */ -protected void initProperties() { -PropertyManager pm = fobj.getPropertyManager(); -borderProps = pm.getBorderAndPadding(); -backgroundProps = pm.getBackgroundProps(); +fobj = node; } /** @@ -266,9 +254,7 @@ public Area createColumnArea() { Area curBlockArea = new Block(); -if (backgroundProps != null) { -TraitSetter.addBackground(curBlockArea, backgroundProps); -} +TraitSetter.addBackground(curBlockArea, fobj.getCommonBorderPaddingBackground()); return curBlockArea; } } 1.11 +9 -20 xml-fop/src/java/org/apache/fop/layoutmgr/table/Cell.java Index: Cell.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/table/Cell.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- Cell.java 22 Sep 2004 08:25:16 - 1.10 +++ Cell.java 19 Oct 2004 21:48:17 - 1.11 @@ -18,8 +18,7 @@ package org.apache.fop.layoutmgr.table; -import org.apache.fop.fo.FObj; -import org.apache.fop.fo.PropertyManager; +import org.apache.fop.fo.flow.TableCell; import org.apache.fop.layoutmgr.BlockStackingLayoutManager; import org.apache.fop.layoutmgr.LayoutManager; import org.apache.fop.layoutmgr.LeafPosition; @@ -32,8 +31,6 @@ import org.apache.fop.area.Area; import org.apache.fop.area.Block; import org.apache.fop.traits.MinOptMax; -import org.apache.fop.fo.properties.CommonBorderAndPadding; -import org.apache.fop.fo.properties.CommonBackground; import java.util.ArrayList; import java.util.List; @@ -43,10 +40,8 @@ * A cell contains blocks. These blocks fill the cell. */ public class Cell extends BlockStackingLayoutManager { - -private CommonBorderAndPadding borderProps = null; -private CommonBackground backgroundProps; - +private TableCell fobj; + private Block curBlockArea; private List childBreaks = new ArrayList(); @@ -59,17 +54,15 @@ /** * Create a new Cell layout manager. */ -public Cell(FObj node) { +public Cell(TableCell node) { super(node); +fobj = node; } /** * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties() */ protected void initProperties() { -PropertyManager pm = fobj.getPropertyManager(); -borderProps = pm.getBorderAndPadding(); -backgroundProps = pm.getBackgroundProps(); } /** @@ -187,7 +180,7 @@ public void addAreas(PositionIterator parentIter, LayoutContext layoutContext) { getParentArea(null); -addID(); +addID(fobj.getId()); LayoutManager
cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr/list Item.java ListBlockLayoutManager.java ListItemLayoutManager.java
bckfnn 2004/10/19 14:47:15 Modified:src/java/org/apache/fop/fo/flow TableCell.java src/java/org/apache/fop/layoutmgr BlockContainerLayoutManager.java BlockLayoutManager.java ExternalGraphicLayoutManager.java PageSequenceLayoutManager.java TraitSetter.java src/java/org/apache/fop/layoutmgr/list Item.java ListBlockLayoutManager.java ListItemLayoutManager.java Log: Third phase of performance improvement. - Use CommonBorderPaddingBackground. PR: 31699 Revision ChangesPath 1.37 +1 -2 xml-fop/src/java/org/apache/fop/fo/flow/TableCell.java Index: TableCell.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/TableCell.java,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- TableCell.java19 Oct 2004 13:45:37 - 1.36 +++ TableCell.java19 Oct 2004 21:47:15 - 1.37 @@ -38,7 +38,6 @@ import org.apache.fop.fo.properties.LengthPairProperty; import org.apache.fop.fo.properties.LengthRangeProperty; import org.apache.fop.layoutmgr.table.Cell; -import org.apache.fop.fo.properties.CommonBorderAndPadding; /** * Class modelling the fo:table-cell object. @@ -193,7 +192,7 @@ * Calculate cell border and padding, including offset of content * rectangle from the theoretical grid position. */ -private void calcBorders(CommonBorderAndPadding bp) { +private void calcBorders(CommonBorderPaddingBackground bp) { if (this.borderCollapse == BorderCollapse.SEPARATE) { /* * Easy case. 1.25 +26 -44 xml-fop/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java Index: BlockContainerLayoutManager.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- BlockContainerLayoutManager.java 19 Oct 2004 13:36:46 - 1.24 +++ BlockContainerLayoutManager.java 19 Oct 2004 21:47:15 - 1.25 @@ -24,11 +24,8 @@ import org.apache.fop.area.Area; import org.apache.fop.area.BlockViewport; import org.apache.fop.area.Block; -import org.apache.fop.fo.FObj; -import org.apache.fop.fo.PropertyManager; +import org.apache.fop.fo.flow.BlockContainer; import org.apache.fop.fo.properties.CommonAbsolutePosition; -import org.apache.fop.fo.properties.CommonBorderAndPadding; -import org.apache.fop.fo.properties.CommonMarginBlock; import org.apache.fop.area.CTM; import org.apache.fop.datatypes.FODimension; import org.apache.fop.datatypes.Length; @@ -39,20 +36,17 @@ * LayoutManager for a block FO. */ public class BlockContainerLayoutManager extends BlockStackingLayoutManager { - +private BlockContainer fobj; + private BlockViewport viewportBlockArea; private Block curBlockArea; private List childBreaks = new java.util.ArrayList(); private CommonAbsolutePosition abProps; -private CommonBorderAndPadding borderProps; -private CommonMarginBlock marginProps; private FODimension relDims; private CTM absoluteCTM; private boolean clip = false; -private int overflow; -private PropertyManager propManager; private Length width; private Length height; @@ -62,41 +56,31 @@ /** * Create a new block container layout manager. */ -public BlockContainerLayoutManager(FObj node) { +public BlockContainerLayoutManager(BlockContainer node) { super(node); +fobj = node; } /** * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties() */ protected void initProperties() { -propManager = fobj.getPropertyManager(); - -abProps = propManager.getAbsolutePositionProps(); +abProps = fobj.getCommonAbsolutePosition(); if (abProps.absolutePosition == AbsolutePosition.ABSOLUTE) { -Rectangle2D rect = new Rectangle2D.Double(abProps.left, -abProps.top, abProps.right - abProps.left, -abProps.bottom - abProps.top); +Rectangle2D rect = new Rectangle2D.Double(abProps.left.getValue(), +abProps.top.getValue(), abProps.right.getValue() - abProps.left.getValue(), +abProps.bottom.getValue() - abProps.top.getValue()); relDims = new FODimension(0, 0); -absoluteCTM = CTM.getCTMandRelDims(propManager.getAbsRefOrient
cvs commit: xml-fop/src/java/org/apache/fop/fo InlineCharIterator.java
bckfnn 2004/10/19 14:43:25 Modified:src/java/org/apache/fop/fo/flow Inline.java src/java/org/apache/fop/fo InlineCharIterator.java Log: Third phase of performance improvement. - Use CommonBorderPaddingBackground. PR: 31699 Revision ChangesPath 1.31 +14 -1 xml-fop/src/java/org/apache/fop/fo/flow/Inline.java Index: Inline.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/Inline.java,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- Inline.java 19 Oct 2004 13:45:37 - 1.30 +++ Inline.java 19 Oct 2004 21:43:25 - 1.31 @@ -18,6 +18,8 @@ package org.apache.fop.fo.flow; +import java.util.List; + // XML import org.xml.sax.Locator; import org.xml.sax.SAXParseException; @@ -38,6 +40,7 @@ import org.apache.fop.fo.properties.CommonRelativePosition; import org.apache.fop.fo.properties.KeepProperty; import org.apache.fop.fo.properties.LengthRangeProperty; +import org.apache.fop.layoutmgr.InlineLayoutManager; /** * Class modelling the fo:inline formatting object. @@ -216,7 +219,17 @@ * @see org.apache.fop.fo.FObjMixed#charIterator */ public CharIterator charIterator() { -return new InlineCharIterator(this, propMgr.getBorderAndPadding()); +return new InlineCharIterator(this, commonBorderPaddingBackground); +} + +/** + * @see org.apache.fop.fo.FObj#addLayoutManager(List) + */ +public void addLayoutManager(List list) { +if (getChildNodes() != null) { +InlineLayoutManager lm = new InlineLayoutManager(this); +list.add(lm); +} } /** 1.7 +9 -9 xml-fop/src/java/org/apache/fop/fo/InlineCharIterator.java Index: InlineCharIterator.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/InlineCharIterator.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- InlineCharIterator.java 27 Feb 2004 17:57:40 - 1.6 +++ InlineCharIterator.java 19 Oct 2004 21:43:25 - 1.7 @@ -18,7 +18,7 @@ package org.apache.fop.fo; -import org.apache.fop.fo.properties.CommonBorderAndPadding; +import org.apache.fop.fo.properties.CommonBorderPaddingBackground; import org.apache.fop.util.CharUtilities; import java.util.NoSuchElementException; @@ -30,19 +30,19 @@ /** * @param fobj the object for whose character contents and for whose * descendant's character contents should be iterated - * @param bap the CommonBorderAndPadding properties to be applied + * @param bpb the CommonBorderPaddingBackground properties to be applied */ -public InlineCharIterator(FObj fobj, CommonBorderAndPadding bap) { +public InlineCharIterator(FObj fobj, CommonBorderPaddingBackground bpb) { super(fobj); -checkBoundaries(bap); +checkBoundaries(bpb); } -private void checkBoundaries(CommonBorderAndPadding bap) { -bStartBoundary = (bap.getBorderStartWidth(false) > 0 - || bap.getPaddingStart(false) > 0); -bEndBoundary = (bap.getBorderEndWidth(false) > 0 - || bap.getPaddingEnd(false) > 0); +private void checkBoundaries(CommonBorderPaddingBackground bpb) { +bStartBoundary = (bpb.getBorderStartWidth(false) > 0 + || bpb.getPaddingStart(false) > 0); +bEndBoundary = (bpb.getBorderEndWidth(false) > 0 + || bpb.getPaddingEnd(false) > 0); } /** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr AbstractLayoutManager.java
bckfnn 2004/10/19 14:41:46 Modified:src/java/org/apache/fop/layoutmgr AbstractLayoutManager.java Log: Third phase of performance improvement. PR: 31699 Revision ChangesPath 1.27 +10 -2 xml-fop/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java Index: AbstractLayoutManager.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- AbstractLayoutManager.java13 Oct 2004 00:31:46 - 1.26 +++ AbstractLayoutManager.java19 Oct 2004 21:41:46 - 1.27 @@ -20,7 +20,6 @@ import org.apache.fop.fo.FObj; import org.apache.fop.fo.FONode; -import org.apache.fop.apps.FOUserAgent; import org.apache.fop.area.Area; import org.apache.fop.area.Resolveable; import org.apache.fop.area.PageViewport; @@ -40,7 +39,6 @@ * The base class for all LayoutManagers. */ public abstract class AbstractLayoutManager implements LayoutManager, Constants { -protected FOUserAgent userAgent; protected LayoutManager parentLM = null; protected List childLMs = new ArrayList(10); protected FObj fobj; @@ -351,6 +349,16 @@ * If the id string is not null then add the id to the current page. */ protected void addID() { +if (foID != null) { +addIDToPage(foID); +} +} + +/** + * Add the id to the page. + * If the id string is not null then add the id to the current page. + */ +protected void addID(String foID) { if (foID != null) { addIDToPage(foID); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/fo/properties CommonAbsolutePosition.java CommonAural.java CommonBorderPaddingBackground.java CommonMarginInline.java
bckfnn 2004/10/19 14:40:56 Modified:src/java/org/apache/fop/fo/properties CommonAbsolutePosition.java CommonAural.java CommonBorderPaddingBackground.java CommonMarginInline.java Log: Third phase of performance improvement. - Added javadoc comment. - Fixed the type of properties. PR: 31699 Revision ChangesPath 1.3 +39 -5 xml-fop/src/java/org/apache/fop/fo/properties/CommonAbsolutePosition.java Index: CommonAbsolutePosition.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/properties/CommonAbsolutePosition.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- CommonAbsolutePosition.java 27 Feb 2004 17:45:44 - 1.2 +++ CommonAbsolutePosition.java 19 Oct 2004 21:40:56 - 1.3 @@ -18,19 +18,53 @@ package org.apache.fop.fo.properties; +import org.apache.fop.datatypes.Length; +import org.apache.fop.fo.Constants; +import org.apache.fop.fo.PropertyList; + /** * Store all common absolute position properties. * See Sec. 7.5 of the XSL-FO Standard. * Public "structure" allows direct member access. */ public class CommonAbsolutePosition { +/** + * The "absolute-position" property. + */ public int absolutePosition; -public int top; -public int right; -public int bottom; -public int left; + +/** + * The "top" property. + */ +public Length top; + +/** + * The "right" property. + */ +public Length right; + +/** + * The "bottom" property. + */ +public Length bottom; + +/** + * The "left" property. + */ +public Length left; public CommonAbsolutePosition() { } +/** + * Create a CommonAbsolutePosition object. + * @param pList The PropertyList with propery values. + */ +public CommonAbsolutePosition(PropertyList pList) { +absolutePosition = pList.get(Constants.PR_ABSOLUTE_POSITION).getEnum(); +top = pList.get(Constants.PR_TOP).getLength(); +bottom = pList.get(Constants.PR_BOTTOM).getLength(); +left = pList.get(Constants.PR_LEFT).getLength(); +right = pList.get(Constants.PR_RIGHT).getLength(); +} } 1.3 +83 -2 xml-fop/src/java/org/apache/fop/fo/properties/CommonAural.java Index: CommonAural.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/properties/CommonAural.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- CommonAural.java 27 Feb 2004 17:45:44 - 1.2 +++ CommonAural.java 19 Oct 2004 21:40:56 - 1.3 @@ -18,30 +18,111 @@ package org.apache.fop.fo.properties; +import org.apache.fop.fo.PropertyList; + /** * Stores all common aural properties. * See Sec. 7.6 of the XSL-FO Standard. * Public "structure" allows direct member access. */ public class CommonAural { - +/** + * The "azimuth" property. + */ public int azimuth; + +/** + * The "cueAfter" property. + */ public String cueAfter; + +/** + * The "cueBefore" property. + */ public String cueBefore; + +/** + * The "elevation" property. + */ public int elevation; + +/** + * The "pauseAfter" property. + */ public int pauseAfter; + +/** + * The "pauseBefore" property. + */ public int pauseBefore; + +/** + * The "pitch" property. + */ public int pitch; + +/** + * The "pitch-range" property. + */ public int pitchRange; + +/** + * The "playDuring" property. + */ public int playDuring; + +/** + * The "richness" property. + */ public int richness; + +/** + * The "speak" property. + */ public int speak; + +/** + * The "speak-header" property. + */ public int speakHeader; + +/** + * The "speak-numeral" property. + */ public int speakNumeral; + +/** + * The "speak-punctuation" property. + */ public int speakPunctuation; + +/** + * The "speech-rate" property. + */ public int speechRate; + +/** + * The "stress" property. + */
cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr BlockLayoutManager.java
bckfnn 2004/10/19 13:15:13 Modified:src/java/org/apache/fop/layoutmgr BlockLayoutManager.java Log: Third phase of performance improvement. - Remove use of TextInfo. PR: 31699 Revision ChangesPath 1.30 +11 -12 xml-fop/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java Index: BlockLayoutManager.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- BlockLayoutManager.java 10 Oct 2004 20:22:56 - 1.29 +++ BlockLayoutManager.java 19 Oct 2004 20:15:13 - 1.30 @@ -23,8 +23,8 @@ import java.util.List; import org.apache.fop.datatypes.PercentBase; -import org.apache.fop.fo.TextInfo; import org.apache.fop.fo.PropertyManager; +import org.apache.fop.fonts.Font; import org.apache.fop.area.Area; import org.apache.fop.area.Block; import org.apache.fop.area.BlockParent; @@ -39,7 +39,8 @@ * LayoutManager for a block FO. */ public class BlockLayoutManager extends BlockStackingLayoutManager { - +private org.apache.fop.fo.flow.Block fobj; + private Block curBlockArea; protected ListIterator proxyLMiter; @@ -71,17 +72,15 @@ protected List childBreaks = new java.util.ArrayList(); public BlockLayoutManager(org.apache.fop.fo.flow.Block inBlock) { -super.setFObj(inBlock); +super(inBlock); +fobj = inBlock; proxyLMiter = new ProxyLMiter(); -userAgent = inBlock.getUserAgent(); -setBlockTextInfo(inBlock.getPropertyManager().getTextLayoutProps( -inBlock.getFOEventHandler().getFontInfo())); -} - -private void setBlockTextInfo(TextInfo ti) { -lead = ti.fs.getAscender(); -follow = -ti.fs.getDescender(); -lineHeight = ti.lineHeight; + +Font fs = fobj.getCommonFont().getFontState(fobj.getFOEventHandler().getFontInfo()); + +lead = fs.getAscender(); +follow = -fs.getDescender(); +lineHeight = fobj.getLineHeight().getOptimum().getLength().getValue(); } /** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/traits SpaceVal.java
bckfnn 2004/10/19 13:13:23 Modified:src/java/org/apache/fop/traits SpaceVal.java Log: Third phase of performance improvement. - Added factory methods to create letter and word SpaceVal. PR: 31699 Revision ChangesPath 1.8 +25 -0 xml-fop/src/java/org/apache/fop/traits/SpaceVal.java Index: SpaceVal.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/traits/SpaceVal.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- SpaceVal.java 27 Feb 2004 17:56:25 - 1.7 +++ SpaceVal.java 19 Oct 2004 20:13:23 - 1.8 @@ -21,6 +21,7 @@ import org.apache.fop.fo.Constants; import org.apache.fop.fo.properties.Property; import org.apache.fop.fo.properties.SpaceProperty; +import org.apache.fop.fonts.Font; /** * Store a single Space property value in simplified form, with all @@ -66,6 +67,30 @@ this.bConditional = bConditional; this.bForcing = bForcing; this.iPrecedence = iPrecedence; +} + +static public SpaceVal makeWordSpacing(Property wordSpacing, SpaceVal letterSpacing, Font fs) { +if (wordSpacing.getEnum() == Constants.NORMAL) { +// give word spaces the possibility to shrink by a third, +// and stretch by a half; +int spaceCharIPD = fs.getCharWidth(' '); +MinOptMax space = new MinOptMax(-spaceCharIPD / 3, 0, spaceCharIPD / 2); +return new SpaceVal( +MinOptMax.add + (space, MinOptMax.multiply(letterSpacing.getSpace(), 2)), + true, true, 0); +} else { +return new SpaceVal(wordSpacing.getSpace()); +} +} + +static public SpaceVal makeLetterSpacing(Property letterSpacing) { +if (letterSpacing.getEnum() == Constants.NORMAL) { +// letter spaces are set to zero (or use different values?) +return new SpaceVal(new MinOptMax(0), true, true, 0); +} else { +return new SpaceVal(letterSpacing.getSpace()); +} } /** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr CharacterLayoutManager.java TextLayoutManager.java
bckfnn 2004/10/19 13:12:21 Modified:src/java/org/apache/fop/fo FOText.java src/java/org/apache/fop/layoutmgr CharacterLayoutManager.java TextLayoutManager.java Log: Third phase of performance improvement. - Remove use of TextInfo. PR: 31699 Revision ChangesPath 1.32 +1 -4 xml-fop/src/java/org/apache/fop/fo/FOText.java Index: FOText.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FOText.java,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- FOText.java 19 Oct 2004 13:30:53 - 1.31 +++ FOText.java 19 Oct 2004 20:12:21 - 1.32 @@ -109,7 +109,6 @@ */ private Block ancestorBlock = null; -public TextInfo textInfo; private static final int IS_WORD_CHAR_FALSE = 0; private static final int IS_WORD_CHAR_TRUE = 1; private static final int IS_WORD_CHAR_MAYBE = 2; @@ -122,14 +121,12 @@ * @param end ending index into char[] for the text in this object * @param parent FONode that is the parent of this object */ -public FOText(char[] chars, int start, int end, FObj parent) { +public FOText(char[] chars, int start, int end, FONode parent) { super(parent); endIndex = end - start; this.ca = new char[endIndex]; System.arraycopy(chars, start, ca, 0, endIndex); // System.out.println("->" + new String(ca) + "<-"); -textInfo = parent.propMgr.getTextLayoutProps(parent.getFOEventHandler().getFontInfo()); - } /** 1.5 +14 -18 xml-fop/src/java/org/apache/fop/layoutmgr/CharacterLayoutManager.java Index: CharacterLayoutManager.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/CharacterLayoutManager.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- CharacterLayoutManager.java 22 Sep 2004 08:24:32 - 1.4 +++ CharacterLayoutManager.java 19 Oct 2004 20:12:21 - 1.5 @@ -19,7 +19,7 @@ package org.apache.fop.layoutmgr; import org.apache.fop.fo.flow.Character; -import org.apache.fop.fo.TextInfo; +import org.apache.fop.fonts.Font; import org.apache.fop.area.inline.InlineArea; import org.apache.fop.area.Trait; import org.apache.fop.traits.MinOptMax; @@ -32,10 +32,10 @@ * LayoutManager for the fo:character formatting object */ public class CharacterLayoutManager extends LeafNodeLayoutManager { - +private Character fobj; private MinOptMax letterSpaceIPD; private int hyphIPD; -private TextInfo textInfo; +private Font fs; /** * Constructor @@ -45,16 +45,14 @@ */ public CharacterLayoutManager(Character node) { super(node); +fobj = node; InlineArea inline = getCharacterInlineArea(node); setCurrentArea(inline); +fs = fobj.getCommonFont().getFontState(fobj.getFOEventHandler().getFontInfo()); -textInfo = node.getPropertyManager().getTextLayoutProps -(node.getFOEventHandler().getFontInfo()); -SpaceVal ls = textInfo.letterSpacing; -letterSpaceIPD = new MinOptMax(ls.getSpace().min, - ls.getSpace().opt, - ls.getSpace().max); -hyphIPD = textInfo.fs.getCharWidth(textInfo.hyphChar); +SpaceVal ls = SpaceVal.makeLetterSpacing(fobj.getLetterSpacing()); +letterSpaceIPD = ls.getSpace(); +hyphIPD = fs.getCharWidth(fobj.getCommonHyphenation().hyphenationChar); } private InlineArea getCharacterInlineArea(Character node) { @@ -102,20 +100,18 @@ return null; } -ipd = new MinOptMax(textInfo.fs.getCharWidth(((org.apache.fop.area.inline.Character) curArea).getChar().charAt(0))); +ipd = new MinOptMax(fs.getCharWidth(((org.apache.fop.area.inline.Character) curArea).getChar().charAt(0))); curArea.setIPD(ipd.opt); -curArea.setBPD(textInfo.fs.getAscender() - - textInfo.fs.getDescender()); +curArea.setBPD(fs.getAscender() - fs.getDescender()); // offset is set in the offsetArea() method //curArea.setOffset(textInfo.fs.getAscender()); //curArea.setOffset(context.getBaseline()); -curArea.addTrait(Trait.FONT_NAME, textInfo.fs.getFontName()); -curArea.addTrait(Trait.FONT_SIZE, - new Integer(textInfo.fs.getFontSize())); -curArea.addTrait(Trait.COLOR, textInfo.color); +curArea.addTrait(Trait
cvs commit: xml-fop/src/java/org/apache/fop/fo FOPropertyMapping.java
bckfnn 2004/10/19 11:42:43 Modified:src/java/org/apache/fop/fo/properties LineHeightPropertyMaker.java src/java/org/apache/fop/fo FOPropertyMapping.java Log: Third phase of performance improvement. - Make line-height a SpaceProperty instead of a LengthProperty. PR: 31699 Revision ChangesPath 1.6 +21 -3 xml-fop/src/java/org/apache/fop/fo/properties/LineHeightPropertyMaker.java Index: LineHeightPropertyMaker.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/properties/LineHeightPropertyMaker.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- LineHeightPropertyMaker.java 27 Feb 2004 17:45:45 - 1.5 +++ LineHeightPropertyMaker.java 19 Oct 2004 18:42:43 - 1.6 @@ -19,8 +19,10 @@ package org.apache.fop.fo.properties; import org.apache.fop.apps.FOPException; +import org.apache.fop.datatypes.Numeric; import org.apache.fop.fo.FObj; import org.apache.fop.fo.PropertyList; +import org.apache.fop.fo.expr.PropertyException; /** * A maker which calculates the line-height property. @@ -31,7 +33,7 @@ * the nearest specified is used to recalculate the line-height. */ -public class LineHeightPropertyMaker extends LengthProperty.Maker { +public class LineHeightPropertyMaker extends SpaceProperty.Maker { /** * Create a maker for line-height. * @param propId the is for linehight. @@ -76,7 +78,22 @@ } return null; } - + +public Property convertProperty(Property p, +PropertyList propertyList, +FObj fo) throws FOPException { +Numeric numval = p.getNumeric(); +if (numval != null && numval.getDimension() == 0) { +try { +p = new PercentLength(numval.getNumericValue(), getPercentBase(fo,propertyList)); +} catch (PropertyException exc) { +// log.error("exception", exc); +} +} +return super.convertProperty(p, propertyList, fo); +} + +/* protected Property convertPropertyDatatype(Property p, PropertyList propertyList, FObj fo) { @@ -86,4 +103,5 @@ } return super.convertPropertyDatatype(p, propertyList, fo); } +*/ } 1.28 +2 -1 xml-fop/src/java/org/apache/fop/fo/FOPropertyMapping.java Index: FOPropertyMapping.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FOPropertyMapping.java,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- FOPropertyMapping.java10 Oct 2004 21:12:06 - 1.27 +++ FOPropertyMapping.java19 Oct 2004 18:42:43 - 1.28 @@ -1481,6 +1481,7 @@ // line-height m = new LineHeightPropertyMaker(PR_LINE_HEIGHT); +m.useGeneric(genericSpace); m.setInherited(true); m.setDefault("normal", true); m.addKeyword("normal", "1.2em"); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/fo/extensions Outline.java
bckfnn 2004/10/19 06:43:22 Modified:src/java/org/apache/fop/fo/extensions Outline.java Log: Second phase of performance improvement. - Move from addProperties() to processNode(). PR: 31699 Revision ChangesPath 1.10 +7 -3 xml-fop/src/java/org/apache/fop/fo/extensions/Outline.java Index: Outline.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/extensions/Outline.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- Outline.java 4 Aug 2004 22:50:57 - 1.9 +++ Outline.java 19 Oct 2004 13:43:22 - 1.10 @@ -19,11 +19,13 @@ package org.apache.fop.fo.extensions; import org.apache.fop.fo.FONode; +import org.apache.fop.fo.PropertyList; import java.util.ArrayList; import org.xml.sax.Attributes; import org.xml.sax.SAXParseException; +import org.xml.sax.Locator; /** @@ -50,9 +52,11 @@ * The attributes on the outline object are the internal and external * destination. One of these is required. * - * @see org.apache.fop.fo.FObj#addProperties + * @see org.apache.fop.fo.FObj#processNode */ -protected void addProperties(Attributes attlist) throws SAXParseException { +public void processNode(String elementName, Locator locator, +Attributes attlist, PropertyList propertyList) throws SAXParseException +{ internalDestination = attlist.getValue("internal-destination"); externalDestination = - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/render/rtf TableAttributesConverter.java
bckfnn 2004/10/19 06:41:25 Modified:src/java/org/apache/fop/render/rtf TableAttributesConverter.java Log: Second phase of performance improvement. - Only get base properties from property list. PR: 31699 Revision ChangesPath 1.19 +2 -2 xml-fop/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java Index: TableAttributesConverter.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- TableAttributesConverter.java 3 Oct 2004 18:10:02 - 1.18 +++ TableAttributesConverter.java 19 Oct 2004 13:41:25 - 1.19 @@ -174,7 +174,7 @@ //need to set a default width //check for keep-together row attribute -if ((p = fobj.getProperty(Constants.PR_KEEP_TOGETHER | Constants.CP_WITHIN_PAGE)) != null) { +if ((p = fobj.getProperty(Constants.PR_KEEP_TOGETHER).getKeep().getWithinPage()) != null) { attrib.set(ITableAttributes.ROW_KEEP_TOGETHER); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/fo StaticPropertyList.java
bckfnn 2004/10/19 06:40:14 Added: src/java/org/apache/fop/fo StaticPropertyList.java Log: Initial version. PR: 31699 Revision ChangesPath 1.1 xml-fop/src/java/org/apache/fop/fo/StaticPropertyList.java Index: StaticPropertyList.java === /* * Copyright 2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.fop.fo; import org.apache.fop.fo.properties.Property; /** * A very fast implementation of PropertyList that uses arrays to store * the explit set properties and another array to store cached values. */ public class StaticPropertyList extends PropertyList { private Property[] explicit; private Property[] values; /** * Construct a StaticPropertyList. * @param fObjToAttach The FObj object. * @param parentPropertyList The parent property list. */ public StaticPropertyList(FObj fObjToAttach, PropertyList parentPropertyList) { super(fObjToAttach, parentPropertyList); explicit = new Property[Constants.PROPERTY_COUNT + 1]; values = new Property[Constants.PROPERTY_COUNT + 1]; } /** * Return the value explicitly specified on this FO. * @param propId The ID of the property whose value is desired. * @return The value if the property is explicitly set, otherwise null. */ public Property getExplicit(int propId) { return explicit[propId]; } /** * Set an value defined explicitly on this FO. * @param propId The ID of the property whose value is desired. * @param value The value of the property to set. */ public void putExplicit(int propId, Property value) { explicit[propId] = value; } /** * Override PropertyList.get() and provides fast caching of previously * retrieved property values. * @param propId The property ID */ public Property get(int propId, boolean bTryInherit, boolean bTryDefault) { Property p = values[propId]; if (p == null) { p = values[propId] = super.get(propId, bTryInherit, bTryDefault); } return p; } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr BasicLinkLayoutManager.java
bckfnn 2004/10/19 06:38:15 Modified:src/java/org/apache/fop/layoutmgr BasicLinkLayoutManager.java Log: Second phase of performance improvement. - Use the official properties on BasicLink. PR: 31699 Revision ChangesPath 1.3 +8 -7 xml-fop/src/java/org/apache/fop/layoutmgr/BasicLinkLayoutManager.java Index: BasicLinkLayoutManager.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/BasicLinkLayoutManager.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- BasicLinkLayoutManager.java 26 Aug 2004 20:58:30 - 1.2 +++ BasicLinkLayoutManager.java 19 Oct 2004 13:38:15 - 1.3 @@ -29,8 +29,8 @@ */ public class BasicLinkLayoutManager extends InlineStackingLayoutManager { -private String link; -private boolean isExternalLink = false; +private String externalLink; +private String internalLink; /** * Create an fo:basic-link layout manager. @@ -39,8 +39,8 @@ */ public BasicLinkLayoutManager(BasicLink node) { super(node); -link = node.getLink(); -isExternalLink = node.isExternalLink(); +externalLink = node.getExternalDestination(); +internalLink = node.getInternalDestination(); } protected InlineParent createArea() { @@ -51,9 +51,10 @@ private void setupBasicLinkArea(LayoutManager parentLM, InlineParent area) { - if (isExternalLink) { - area.addTrait(Trait.EXTERNAL_LINK, link); + if (externalLink != null) { + area.addTrait(Trait.EXTERNAL_LINK, externalLink); } else { + String link = internalLink; PageViewport page = parentLM.resolveRefID(link); if (page != null) { area.addTrait(Trait.INTERNAL_LINK, page.getKey()); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr BlockContainerLayoutManager.java ExternalGraphicLayoutManager.java InstreamForeignObjectLM.java LeaderLayoutManager.java
bckfnn 2004/10/19 06:36:46 Modified:src/java/org/apache/fop/layoutmgr BlockContainerLayoutManager.java ExternalGraphicLayoutManager.java InstreamForeignObjectLM.java LeaderLayoutManager.java Log: Second phase of performance improvement. - Only get base properties from property list. PR: 31699 Revision ChangesPath 1.24 +2 -2 xml-fop/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java Index: BlockContainerLayoutManager.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- BlockContainerLayoutManager.java 22 Sep 2004 08:22:14 - 1.23 +++ BlockContainerLayoutManager.java 19 Oct 2004 13:36:46 - 1.24 @@ -85,9 +85,9 @@ marginProps = propManager.getMarginProps(); borderProps = propManager.getBorderAndPadding(); height = fobj.getPropertyList().get( -PR_BLOCK_PROGRESSION_DIMENSION | CP_OPTIMUM).getLength(); + PR_BLOCK_PROGRESSION_DIMENSION).getLengthRange().getOptimum().getLength(); width = fobj.getPropertyList().get( -PR_INLINE_PROGRESSION_DIMENSION | CP_OPTIMUM).getLength(); + PR_INLINE_PROGRESSION_DIMENSION).getLengthRange().getOptimum().getLength(); } public void setOverflow(int of) { 1.7 +2 -2 xml-fop/src/java/org/apache/fop/layoutmgr/ExternalGraphicLayoutManager.java Index: ExternalGraphicLayoutManager.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/ExternalGraphicLayoutManager.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- ExternalGraphicLayoutManager.java 22 Sep 2004 13:19:48 - 1.6 +++ ExternalGraphicLayoutManager.java 19 Oct 2004 13:36:46 - 1.7 @@ -87,7 +87,7 @@ viewWidth = ipd.getValue(); } } -Length bpd = graphic.getPropertyList().get(PR_BLOCK_PROGRESSION_DIMENSION | CP_OPTIMUM).getLength(); +Length bpd = graphic.getPropertyList().get(PR_BLOCK_PROGRESSION_DIMENSION).getLengthRange().getOptimum().getLength(); if (!bpd.isAuto()) { viewHeight = bpd.getValue(); } else { 1.6 +3 -3 xml-fop/src/java/org/apache/fop/layoutmgr/InstreamForeignObjectLM.java Index: InstreamForeignObjectLM.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/InstreamForeignObjectLM.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- InstreamForeignObjectLM.java 22 Sep 2004 08:24:32 - 1.5 +++ InstreamForeignObjectLM.java 19 Oct 2004 13:36:46 - 1.6 @@ -77,7 +77,7 @@ // this property does not apply when the line-height applies // isn't the block-progression-dimension always in the same // direction as the line height? -len = ifoNode.getProperty(PR_BLOCK_PROGRESSION_DIMENSION | CP_OPTIMUM).getLength(); +len = ifoNode.getProperty(PR_BLOCK_PROGRESSION_DIMENSION).getLengthRange().getOptimum().getLength(); if (!len.isAuto()) { bpd = len.getValue(); } else { @@ -88,7 +88,7 @@ } } -len = ifoNode.getProperty(PR_INLINE_PROGRESSION_DIMENSION | CP_OPTIMUM).getLength(); +len = ifoNode.getProperty(PR_INLINE_PROGRESSION_DIMENSION).getLengthRange().getOptimum().getLength(); if (!len.isAuto()) { ipd = len.getValue(); } else { 1.7 +4 -4 xml-fop/src/java/org/apache/fop/layoutmgr/LeaderLayoutManager.java Index: LeaderLayoutManager.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/LeaderLayoutManager.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- LeaderLayoutManager.java 22 Sep 2004 08:24:32 - 1.6 +++ LeaderLayoutManager.java 19 Oct 2004 13:36:46 - 1.7 @@ -61,9 +61,9 @@ private MinOptMax getLeaderAllocIPD(int ipd) { // length of the leader -int opt = ldrNode.getLength(PR_LEADER_LENGTH | CP_OPTIMUM, ipd); -int min = ldrNode.getLength(PR_LEADER_LENGTH | CP_MINIMUM, ipd); -int max = ldrNode.getLength(PR_LEADER_LENGTH | CP_MAXIMUM, ipd); +int opt = ldrNode.getLength(ldrNode.getProperty(PR_LEADER_LENGTH).getLengthRange().getOptimum().getLength(),
cvs commit: xml-fop/src/java/org/apache/fop/render/pdf PDFRenderer.java
bckfnn 2004/10/19 06:35:16 Modified:src/java/org/apache/fop/render/pdf PDFRenderer.java Log: End textmode before emitting an image. Revision ChangesPath 1.57 +1 -0 xml-fop/src/java/org/apache/fop/render/pdf/PDFRenderer.java Index: PDFRenderer.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/pdf/PDFRenderer.java,v retrieving revision 1.56 retrieving revision 1.57 diff -u -r1.56 -r1.57 --- PDFRenderer.java 15 Oct 2004 18:16:21 - 1.56 +++ PDFRenderer.java 19 Oct 2004 13:35:16 - 1.57 @@ -1073,6 +1073,7 @@ * @see org.apache.fop.render.AbstractRenderer#renderImage(Image, Rectangle2D) */ public void renderImage(Image image, Rectangle2D pos) { +endTextObject(); String url = image.getURL(); putImage(url, pos); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/fo FOText.java FObjMixed.java
bckfnn 2004/10/19 06:30:53 Modified:src/java/org/apache/fop/fo FOText.java FObjMixed.java Log: Second phase of performance improvement. - Pass in a PropertyList to addCharacters() PR: 31699 Revision ChangesPath 1.31 +13 -15xml-fop/src/java/org/apache/fop/fo/FOText.java Index: FOText.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FOText.java,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- FOText.java 19 Oct 2004 08:53:49 - 1.30 +++ FOText.java 19 Oct 2004 13:30:53 - 1.31 @@ -83,11 +83,6 @@ // End of property values /** - * The TextInfo object attached to the text - */ -public TextInfo textInfo; - -/** * Keeps track of the last FOText object created within the current * block. This is used to create pointers between such objects. * TODO: As soon as the control hierarchy is straightened out, this static @@ -114,6 +109,7 @@ */ private Block ancestorBlock = null; +public TextInfo textInfo; private static final int IS_WORD_CHAR_FALSE = 0; private static final int IS_WORD_CHAR_TRUE = 1; private static final int IS_WORD_CHAR_MAYBE = 2; @@ -124,18 +120,16 @@ * be a superset of the text in this object) * @param start starting index into char[] for the text in this object * @param end ending index into char[] for the text in this object - * @param ti TextInfo object for the text in this object * @param parent FONode that is the parent of this object */ -public FOText(char[] chars, int start, int end, TextInfo ti, FONode parent) { +public FOText(char[] chars, int start, int end, FObj parent) { super(parent); endIndex = end - start; this.ca = new char[endIndex]; System.arraycopy(chars, start, ca, 0, endIndex); // System.out.println("->" + new String(ca) + "<-"); -textInfo = ti; -createBlockPointers(); -textTransform(); +textInfo = parent.propMgr.getTextLayoutProps(parent.getFOEventHandler().getFontInfo()); + } /** @@ -154,6 +148,11 @@ wrapOption = pList.get(Constants.PR_WRAP_OPTION).getEnum(); } +protected void startOfNode() { +createBlockPointers(); +textTransform(); +} + /** * Check if this text node will create an area. * This means either there is non-whitespace or it is @@ -164,7 +163,7 @@ * @return true if this will create an area in the output */ public boolean willCreateArea() { -if (textInfo.whiteSpaceCollapse == Constants.WhiteSpaceCollapse.FALSE +if (whiteSpaceCollapse == Constants.WhiteSpaceCollapse.FALSE && endIndex - startIndex > 0) { return true; } @@ -227,7 +226,7 @@ * text-transform property. */ private void textTransform() { -if (textInfo.textTransform == Constants.TextTransform.NONE) { +if (textTransform == Constants.TextTransform.NONE) { return; } for (int i = 0; i < endIndex; i++) { @@ -354,7 +353,7 @@ * @return char with transformed value */ private char charTransform(int i) { -switch (textInfo.textTransform) { +switch (textTransform) { /* put NONE first, as this is probably the common case */ case Constants.TextTransform.NONE: return ca[i]; @@ -375,8 +374,7 @@ return Character.toLowerCase(ca[i]); } default: -getLogger().warn("Invalid text-tranform value: " -+ textInfo.textTransform); +getLogger().warn("Invalid text-tranform value: " + textTransform); return ca[i]; } } 1.42 +4 -11 xml-fop/src/java/org/apache/fop/fo/FObjMixed.java Index: FObjMixed.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FObjMixed.java,v retrieving revision 1.41 retrieving revision 1.42 diff -u -r1.41 -r1.42 --- FObjMixed.java13 Oct 2004 00:31:46 - 1.41 +++ FObjMixed.java19 Oct 2004 13:30:53 - 1.42 @@ -28,9 +28,6 @@ * (i.e., those that can contain both child FO's and text nodes/PCDATA) */ public class FObjMixed extends FObj { -/** TextInfo for this object */ -protected TextInfo textInfo = null; - /** * @param parent FONode that is the parent of this object */ @@ -45,16 +42,12 @@ * @param locator location in fo sourc
cvs commit: xml-fop/src/java/org/apache/fop/fo/properties PropertyMaker.java
bckfnn 2004/10/19 05:57:33 Modified:src/java/org/apache/fop/fo/properties PropertyMaker.java Log: Second phase of performance improvement. - Let PropertyList deal with caching issues. - Don't use compound property ids. PR: 31699 Revision ChangesPath 1.9 +19 -21xml-fop/src/java/org/apache/fop/fo/properties/PropertyMaker.java Index: PropertyMaker.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/properties/PropertyMaker.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- PropertyMaker.java7 Sep 2004 12:40:43 - 1.8 +++ PropertyMaker.java19 Oct 2004 12:57:33 - 1.9 @@ -25,6 +25,7 @@ import org.apache.fop.datatypes.CompoundDatatype; import org.apache.fop.datatypes.LengthBase; import org.apache.fop.datatypes.PercentBase; +import org.apache.fop.fo.Constants; import org.apache.fop.fo.FOPropertyMapping; import org.apache.fop.fo.FObj; import org.apache.fop.fo.PropertyList; @@ -238,14 +239,16 @@ { Property p = null; -log.trace("PropertyMaker.findProperty: " +if (log.isTraceEnabled()) { +log.trace("PropertyMaker.findProperty: " + FOPropertyMapping.getPropertyName(propId) + ", " + propertyList.getFObj().getName()); +} if (corresponding != null && corresponding.isCorrespondingForced(propertyList)) { p = corresponding.compute(propertyList); } else { -p = propertyList.getExplicitBaseProp(propId); +p = propertyList.getExplicit(propId); if (p == null) { p = this.compute(propertyList); } @@ -256,12 +259,7 @@ // else inherit (if has parent and is inheritable) PropertyList parentPropertyList = propertyList.getParentPropertyList(); if (parentPropertyList != null && isInherited()) { -if (!contextDep) { -// use the cache -p = parentPropertyList.findProperty(propId, this); -} else { -p = findProperty(parentPropertyList, bTryInherit); -} +p = parentPropertyList.get(propId, true, false); } } } @@ -283,14 +281,7 @@ boolean bTryInherit, boolean bTryDefault) throws FOPException { -Property p; - -if (!contextDep && bTryInherit) { -// use the cache -p = propertyList.findProperty(propId, this); -} else { -p = findProperty(propertyList, bTryInherit); -} +Property p = findProperty(propertyList, bTryInherit); if (p == null && bTryDefault) {// default value for this FO! try { @@ -376,13 +367,17 @@ */ public Property make(PropertyList propertyList) throws FOPException { if (defaultProperty != null) { -log.trace("PropertyMaker.make: reusing defaultProperty, " - + FOPropertyMapping.getPropertyName(propId)); +if (log.isTraceEnabled()) { +log.trace("PropertyMaker.make: reusing defaultProperty, " + + FOPropertyMapping.getPropertyName(propId)); +} return defaultProperty; } -log.trace("PropertyMaker.make: making default property value, " +if (log.isTraceEnabled()) { +log.trace("PropertyMaker.make: making default property value, " + FOPropertyMapping.getPropertyName(propId) + ", " + propertyList.getFObj().getName()); +} Property p = make(propertyList, defaultValue, propertyList.getParentFObj()); if (!contextDep) { defaultProperty = p; @@ -404,7 +399,10 @@ Property newProp = null; String pvalue = value; if ("inherit".equals(value)) { -newProp = propertyList.getFromParent(this.propId); +newProp = propertyList.getFromParent(this.propId & Constants.PROPERTY_MASK); +if ((propId & Constants.COMPOUND_MASK) != 0) { +newProp = getSubprop(newProp, propId & Constants.COMPOUND_MASK); +} } else { newProp = checkEnumValues(value); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/fo PropertyList.java
bckfnn 2004/10/19 05:55:03 Modified:src/java/org/apache/fop/fo PropertyList.java Log: Second phase of performance improvement. - Made class abstract. Leave storage and caching to subclasses. - Cleanup of old writingMode code. - Only support retrieval of base properties. PR: 31699 Revision ChangesPath 1.37 +42 -234 xml-fop/src/java/org/apache/fop/fo/PropertyList.java Index: PropertyList.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/PropertyList.java,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- PropertyList.java 18 Oct 2004 20:30:22 - 1.36 +++ PropertyList.java 19 Oct 2004 12:55:03 - 1.37 @@ -19,8 +19,6 @@ package org.apache.fop.fo; // Java -import java.util.Map; -import java.util.HashMap; import org.xml.sax.Attributes; // FOP @@ -43,92 +41,26 @@ /** * Class containing the collection of properties for a given FObj. */ -public class PropertyList extends HashMap { - -// writing-mode values -private byte[] writingModeTable = null; +abstract public class PropertyList { // writing-mode index private int writingMode; private static boolean[] inheritableProperty; -// absolute directions and dimensions -/** constant for direction "left" */ -public static final int LEFT = 0; -/** constant for direction "right" */ -public static final int RIGHT = 1; -/** constant for direction "top" */ -public static final int TOP = 2; -/** constant for direction "bottom" */ -public static final int BOTTOM = 3; -/** constant for dimension "height" */ -public static final int HEIGHT = 4; -/** constant for dimension "width" */ -public static final int WIDTH = 5; - -// directions relative to writing-mode -/** constant for direction "start" */ -public static final int START = 0; -/** constant for direction "end" */ -public static final int END = 1; -/** constant for direction "before" */ -public static final int BEFORE = 2; -/** constant for direction "after" */ -public static final int AFTER = 3; -/** constant for dimension "block-progression-dimension" */ -public static final int BLOCKPROGDIM = 4; -/** constant for dimension "inline-progression-dimension" */ -public static final int INLINEPROGDIM = 5; - -private static final String[] ABS_WM_NAMES = new String[] { -"left", "right", "top", "bottom", "height", "width" -}; - -private static final String[] REL_WM_NAMES = new String[] { -"start", "end", "before", "after", "block-progression-dimension", -"inline-progression-dimension" -}; - -private static final HashMap WRITING_MODE_TABLES = new HashMap(4); -{ -WRITING_MODE_TABLES.put(new Integer(Constants.WritingMode.LR_TB),/* lr-tb */ -new byte[] { -START, END, BEFORE, AFTER, BLOCKPROGDIM, INLINEPROGDIM -}); -WRITING_MODE_TABLES.put(new Integer(Constants.WritingMode.RL_TB),/* rl-tb */ -new byte[] { -END, START, BEFORE, AFTER, BLOCKPROGDIM, INLINEPROGDIM -}); -WRITING_MODE_TABLES.put(new Integer(Constants.WritingMode.TB_RL),/* tb-rl */ -new byte[] { -AFTER, BEFORE, START, END, INLINEPROGDIM, BLOCKPROGDIM -}); -} - -private PropertyList parentPropertyList = null; -private String namespace = ""; +protected PropertyList parentPropertyList = null; private FObj fobj = null; -private Log log = LogFactory.getLog(PropertyList.class); - -/** - * Cache for properties looked up via maker.findProperty - * with bTryInherit == true - */ -private Map cache = new HashMap(); +private static Log log = LogFactory.getLog(PropertyList.class); /** * Basic constructor. * @param parentPropertyList the PropertyList belonging to the new objects * parent - * @param space name of namespace */ -public PropertyList(FObj fObjToAttach, PropertyList parentPropertyList, -String space) { +public PropertyList(FObj fObjToAttach, PropertyList parentPropertyList) { this.fobj = fObjToAttach; this.parentPropertyList = parentPropertyList; -this.namespace = space; } /** @@ -157,74 +89,45 @@ } /** - * @return the namespace of this element - */ -pub
cvs commit: xml-fop/src/java/org/apache/fop/fo/extensions/svg SVGElement.java
bckfnn 2004/10/19 05:52:09 Modified:examples/plan/src/org/apache/fop/plan PlanElement.java src/java/org/apache/fop/fo FONode.java FOTreeBuilder.java FObj.java UnknownXMLObj.java XMLObj.java src/java/org/apache/fop/fo/extensions/svg SVGElement.java Log: Second phase of performance improvement. Pass the propertyList into processNode(..) and addCharacters(..). PR: 31699 Revision ChangesPath 1.8 +6 -3 xml-fop/examples/plan/src/org/apache/fop/plan/PlanElement.java Index: PlanElement.java === RCS file: /home/cvs/xml-fop/examples/plan/src/org/apache/fop/plan/PlanElement.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- PlanElement.java 14 Aug 2004 16:26:08 - 1.7 +++ PlanElement.java 19 Oct 2004 12:52:09 - 1.8 @@ -21,6 +21,7 @@ import java.awt.geom.Point2D; import org.apache.fop.fo.FONode; +import org.apache.fop.fo.PropertyList; import org.w3c.dom.Document; import org.xml.sax.Attributes; @@ -48,8 +49,10 @@ * @see org.apache.fop.fo.FONode#processNode */ public void processNode(String elementName, Locator locator, -Attributes attlist) throws SAXParseException { -super.processNode(elementName, locator, attlist); +Attributes attlist, PropertyList propertyList) +throws SAXParseException +{ +super.processNode(elementName, locator, attlist, propertyList); createBasicDocument(); } 1.48 +3 -1 xml-fop/src/java/org/apache/fop/fo/FONode.java Index: FONode.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FONode.java,v retrieving revision 1.47 retrieving revision 1.48 diff -u -r1.47 -r1.48 --- FONode.java 18 Oct 2004 20:15:19 - 1.47 +++ FONode.java 19 Oct 2004 12:52:09 - 1.48 @@ -107,7 +107,8 @@ * @param attlist Collection of attributes passed to us from the parser. * @throws SAXParseException for errors or inconsistencies in the attributes */ -public void processNode(String elementName, Locator locator, Attributes attlist) throws SAXParseException { +public void processNode(String elementName, Locator locator, +Attributes attlist, PropertyList parent) throws SAXParseException { System.out.println("name = " + elementName); } @@ -143,6 +144,7 @@ * @param locator location in fo source file. */ protected void addCharacters(char data[], int start, int length, + PropertyList pList, Locator locator) throws SAXParseException { // ignore } 1.55 +16 -3 xml-fop/src/java/org/apache/fop/fo/FOTreeBuilder.java Index: FOTreeBuilder.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FOTreeBuilder.java,v retrieving revision 1.54 retrieving revision 1.55 diff -u -r1.54 -r1.55 --- FOTreeBuilder.java10 Oct 2004 12:24:02 - 1.54 +++ FOTreeBuilder.java19 Oct 2004 12:52:09 - 1.55 @@ -80,6 +80,11 @@ protected FONode currentFObj = null; /** + * Current propertyList for the node being handled. + */ +protected PropertyList currentPropertyList; + +/** * The class that handles formatting and rendering to a stream * ([EMAIL PROTECTED]) */ @@ -188,7 +193,7 @@ public void characters(char[] data, int start, int length) throws SAXParseException { if (currentFObj != null) { -currentFObj.addCharacters(data, start, start + length, locator); +currentFObj.addCharacters(data, start, start + length, currentPropertyList, locator); } } @@ -226,6 +231,7 @@ /* the node found in the FO document */ FONode foNode; +PropertyList propertyList; // Check to ensure first node encountered is an fo:root if (rootFObj == null) { @@ -250,7 +256,9 @@ try { foNode = fobjMaker.make(currentFObj); -foNode.processNode(localName, locator, attlist); +propertyList = foNode.createPropertyList(currentPropertyList, foEventHandler); +foNode.processNode(localName, locator, attlist, propertyList); +foNode.startOfNode(); } catch (IllegalArgumentException e) { throw new SAXException(e); } @@ -263,6 +271,9 @@ } currentFObj = foNode; +
cvs commit: xml-fop/examples/plan/docs plan.fo
bckfnn 2004/10/19 05:46:00 Modified:examples/plan/docs plan.fo Log: Pass validation. Revision ChangesPath 1.2 +1 -1 xml-fop/examples/plan/docs/plan.fo Index: plan.fo === RCS file: /home/cvs/xml-fop/examples/plan/docs/plan.fo,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- plan.fo 29 Jan 2003 16:35:06 - 1.1 +++ plan.fo 19 Oct 2004 12:46:00 - 1.2 @@ -9,8 +9,8 @@ page-width="21cm" page-height="29.7cm" master-name="first"> - + - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr PageSequenceLayoutManager.java
bckfnn 2004/10/19 01:53:51 Modified:src/java/org/apache/fop/fo FOText.java src/java/org/apache/fop/fo/flow BasicLink.java BidiOverride.java Block.java BlockContainer.java Character.java ExternalGraphic.java Float.java Footnote.java FootnoteBody.java InitialPropertySet.java Inline.java InlineContainer.java InstreamForeignObject.java Leader.java ListBlock.java ListItem.java ListItemBody.java ListItemLabel.java Marker.java MultiCase.java MultiProperties.java MultiPropertySet.java MultiSwitch.java MultiToggle.java PageNumber.java PageNumberCitation.java RetrieveMarker.java Table.java TableAndCaption.java TableBody.java TableCaption.java TableCell.java TableColumn.java TableRow.java Wrapper.java src/java/org/apache/fop/fo/pagination ColorProfile.java ConditionalPageMasterReference.java Declarations.java Flow.java LayoutMasterSet.java PageSequence.java PageSequenceMaster.java Region.java RegionBA.java RegionBody.java RegionSE.java RepeatablePageMasterAlternatives.java RepeatablePageMasterReference.java Root.java SimplePageMaster.java SinglePageMasterReference.java StaticContent.java Title.java src/java/org/apache/fop/layoutmgr PageSequenceLayoutManager.java Log: First phase of performance improvement. Added bind() and startOfNode() methods to the FO nodes, unused for now. PR: 31699 Revision ChangesPath 1.30 +82 -0 xml-fop/src/java/org/apache/fop/fo/FOText.java http://cvs.apache.org/viewcvs/xml-fop/src/java/org/apache/fop/fo/FOText.java.diff?r1=1.29&r2=1.30 1.31 +67 -8 xml-fop/src/java/org/apache/fop/fo/flow/BasicLink.java http://cvs.apache.org/viewcvs/xml-fop/src/java/org/apache/fop/fo/flow/BasicLink.java.diff?r1=1.30&r2=1.31 1.21 +36 -0 xml-fop/src/java/org/apache/fop/fo/flow/BidiOverride.java http://cvs.apache.org/viewcvs/xml-fop/src/java/org/apache/fop/fo/flow/BidiOverride.java.diff?r1=1.20&r2=1.21 1.45 +204 -25 xml-fop/src/java/org/apache/fop/fo/flow/Block.java http://cvs.apache.org/viewcvs/xml-fop/src/java/org/apache/fop/fo/flow/Block.java.diff?r1=1.44&r2=1.45 1.27 +134 -6xml-fop/src/java/org/apache/fop/fo/flow/BlockContainer.java http://cvs.apache.org/viewcvs/xml-fop/src/java/org/apache/fop/fo/flow/BlockContainer.java.diff?r1=1.26&r2=1.27 1.24 +150 -0xml-fop/src/java/org/apache/fop/fo/flow/Character.java http://cvs.apache.org/viewcvs/xml-fop/src/java/org/apache/fop/fo/flow/Character.java.diff?r1=1.23&r2=1.24 1.43 +186 -0xml-fop/src/java/org/apache/fop/fo/flow/ExternalGraphic.java http://cvs.apache.org/viewcvs/xml-fop/src/java/org/apache/fop/fo/flow/ExternalGraphic.java.diff?r1=1.42&r2=1.43 1.18 +13 -0 xml-fop/src/java/org/apache/fop/fo/flow/Float.java http://cvs.apache.org/viewcvs/xml-fop/src/java/org/apache/fop/fo/flow/Float.java.diff?r1=1.17&r2=1.18 1.28 +32 -13xml-fop/src/java/org/apache/fop/fo/flow/Footnote.java http://cvs.apache.org/viewcvs/xml-fop/src/java/org/apache/fop/fo/flow/Footnote.java.diff?r1=1.27&r2=1.28 1.22 +31 -12xml-fop/src/java/org/apache/fop/fo/flow/FootnoteBody.java http://cvs.apache.org/viewcvs/xml-fop/src/java/org/apache/fop/fo/flow/FootnoteBody.java.diff?r1=1.21&r2=1.22 1.16 +52 -0 xml-fop/src/java/org/apache/fop/fo/flow/InitialPropertySet.java http://cvs.apache.org/viewcvs/xml-fop/src/java/org/apache/fop/fo/flow/InitialPropertySet.java.diff?r1=1.15&r2=1.16 1.29 +135 -3xml-fop/src/java/org/apache/fop/fo/flow/Inline.java http://cvs.apache.org/viewcvs/xml-fop/src/java/org/apache/fop/fo/flow/Inline.java.diff?r1=1.28&r2=1.29 1.21 +72 -0 xml-fop/src/java/org/apache/fop/fo/flow/InlineContainer.java http://cvs.apache.org/viewcvs/xml-fop/src/java/org/apache/fop/fo/flow/InlineContainer.java.diff?r1=1.20&r2=1.21 1.30 +165 -10 xml-fop/src/java/org/apache/fop/fo/flow/InstreamForeignObject.java http://cvs.apache.org/viewcvs/xml-fop/src/java/org/apache/fop/fo/flow/InstreamForeignObject.java.diff?r1=1.29&r2=1.30 1.39 +155 -11 xml-fop/src/java/org/apache/fop/fo/flow/Leader.java http://cvs.apache.org/viewcvs/xml-fop/src/java/org/apache/fop/fo/flow/Leader.java.diff?r1=1.38&a
cvs commit: xml-fop/src/java/org/apache/fop/fo PropertyList.java
bckfnn 2004/10/18 13:30:22 Modified:src/java/org/apache/fop/fo PropertyList.java Log: First phase of performance improvement. PR: 31699 Revision ChangesPath 1.36 +92 -0 xml-fop/src/java/org/apache/fop/fo/PropertyList.java Index: PropertyList.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/PropertyList.java,v retrieving revision 1.35 retrieving revision 1.36 diff -u -r1.35 -r1.36 --- PropertyList.java 1 Aug 2004 04:20:48 - 1.35 +++ PropertyList.java 18 Oct 2004 20:30:22 - 1.36 @@ -25,6 +25,15 @@ // FOP import org.apache.fop.apps.FOPException; +import org.apache.fop.fo.properties.CommonAbsolutePosition; +import org.apache.fop.fo.properties.CommonAccessibility; +import org.apache.fop.fo.properties.CommonAural; +import org.apache.fop.fo.properties.CommonBorderPaddingBackground; +import org.apache.fop.fo.properties.CommonFont; +import org.apache.fop.fo.properties.CommonHyphenation; +import org.apache.fop.fo.properties.CommonMarginBlock; +import org.apache.fop.fo.properties.CommonMarginInline; +import org.apache.fop.fo.properties.CommonRelativePosition; import org.apache.fop.fo.properties.Property; import org.apache.fop.fo.properties.PropertyMaker; @@ -386,6 +395,14 @@ } /** + * Return the "writing-mode" property value. + * @return The "writing-mode" property value. + */ +public int getWritingMode() { +return writingMode; +} + +/** * Uses the stored writingMode. * @param absdir an absolute direction (top, bottom, left, right) * @return the corresponding writing model relative direction name @@ -647,6 +664,81 @@ return FObj.propertyListTable[propId]; } } + +/** + * Constructs a BorderAndPadding object. + * @return a BorderAndPadding object + */ +public CommonBorderPaddingBackground getBorderPaddingBackgroundProps() { +return new CommonBorderPaddingBackground(this); +} + + + +/** + * Constructs a HyphenationProps objects. + * @return a HyphenationProps object + */ +public CommonHyphenation getHyphenationProps() { +return new CommonHyphenation(); +} + +/** + * Constructs a MarginProps objects. + * @return a MarginProps object + */ +public CommonMarginBlock getMarginBlockProps() { +return new CommonMarginBlock(); +} + +/** + * Constructs a MarginInlineProps objects. + * @return a MarginInlineProps object + */ +public CommonMarginInline getMarginInlineProps() { +return new CommonMarginInline(); +} +/** + * Constructs a AccessibilityProps objects. + * @return a AccessibilityProps object + */ +public CommonAccessibility getAccessibilityProps() { +return new CommonAccessibility(); +} + +/** + * Constructs a AuralProps objects. + * @return a AuralProps object + */ +public CommonAural getAuralProps() { +CommonAural props = new CommonAural(); +return props; +} + +/** + * Constructs a RelativePositionProps objects. + * @return a RelativePositionProps object + */ +public CommonRelativePosition getRelativePositionProps() { +return new CommonRelativePosition(); +} + +/** + * Constructs a AbsolutePositionProps objects. + * @return a AbsolutePositionProps object + */ +public CommonAbsolutePosition getAbsolutePositionProps() { +return new CommonAbsolutePosition(); +} + + +/** + * Constructs a CommonFont object. + * @return A CommonFont object + */ +public CommonFont getFontProps() { +return new CommonFont(this); +} } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/fo/properties CommonBorderPaddingBackground.java CommonFont.java
bckfnn 2004/10/18 13:17:45 Modified:src/java/org/apache/fop/fo/properties CommonBorderPaddingBackground.java CommonFont.java Log: Fix copyright year. Revision ChangesPath 1.2 +2 -2 xml-fop/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java Index: CommonBorderPaddingBackground.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- CommonBorderPaddingBackground.java18 Oct 2004 20:16:54 - 1.1 +++ CommonBorderPaddingBackground.java18 Oct 2004 20:17:45 - 1.2 @@ -1,5 +1,5 @@ /* - * Copyright 1999-2004 The Apache Software Foundation. + * Copyright 2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. 1.2 +2 -2 xml-fop/src/java/org/apache/fop/fo/properties/CommonFont.java Index: CommonFont.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/properties/CommonFont.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- CommonFont.java 18 Oct 2004 20:16:54 - 1.1 +++ CommonFont.java 18 Oct 2004 20:17:45 - 1.2 @@ -1,5 +1,5 @@ /* - * Copyright 1999-2004 The Apache Software Foundation. + * Copyright 2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/fo/properties CommonBorderPaddingBackground.java CommonFont.java
bckfnn 2004/10/18 13:16:54 Added: src/java/org/apache/fop/fo/properties CommonBorderPaddingBackground.java CommonFont.java Log: Initial version. PR: 31699 Revision ChangesPath 1.1 xml-fop/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java Index: CommonBorderPaddingBackground.java === /* * Copyright 1999-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* $Id: CommonBorderPaddingBackground.java,v 1.1 2004/10/18 20:16:54 bckfnn Exp $ */ package org.apache.fop.fo.properties; import org.apache.fop.datatypes.ColorType; import org.apache.fop.datatypes.Length; import org.apache.fop.fo.Constants; import org.apache.fop.fo.PropertyList; /** * Stores all common border and padding properties. * See Sec. 7.7 of the XSL-FO Standard. */ public class CommonBorderPaddingBackground implements Cloneable { /** * The "background-attachment" property. */ public int backgroundAttachment; /** * The "background-color" property. */ public ColorType backgroundColor; /** * The "background-image" property. */ public String backgroundImage; /** * The "background-repeat" property. */ public int backgroundRepeat; /** * The "background-position-horizontal" property. */ public Length backgroundPositionHorizontal; /** * The "background-position-vertical" property. */ public Length backgroundPositionVertical; public static final int BEFORE = 0; public static final int AFTER = 1; public static final int START = 2; public static final int END = 3; private static class BorderInfo implements Cloneable { private int mStyle; // Enum for border style private ColorType mColor; // Border color private CondLengthProperty mWidth; BorderInfo(int style, CondLengthProperty width, ColorType color) { mStyle = style; mWidth = width; mColor = color; } } private BorderInfo[] borderInfo = new BorderInfo[4]; private CondLengthProperty[] padding = new CondLengthProperty[4]; /** * Construct a CommonBorderAndPadding object. * @param pList The PropertyList to get properties from. */ public CommonBorderPaddingBackground(PropertyList pList) { backgroundAttachment = pList.get(Constants.PR_BACKGROUND_ATTACHMENT).getEnum(); backgroundColor = pList.get(Constants.PR_BACKGROUND_COLOR).getColorType(); if (backgroundColor.getAlpha() == 0) { backgroundColor = null; } backgroundImage = pList.get(Constants.PR_BACKGROUND_IMAGE).getString(); if (backgroundImage == null || "none".equals(backgroundImage)) { backgroundImage = null; } else { backgroundRepeat = pList.get(Constants.PR_BACKGROUND_REPEAT).getEnum(); backgroundPositionHorizontal = pList.get(Constants.PR_BACKGROUND_POSITION_HORIZONTAL).getLength(); backgroundPositionVertical = pList.get(Constants.PR_BACKGROUND_POSITION_VERTICAL).getLength(); } initBorderInfo(pList, BEFORE, Constants.PR_BORDER_BEFORE_COLOR, Constants.PR_BORDER_BEFORE_STYLE, Constants.PR_BORDER_BEFORE_WIDTH, Constants.PR_PADDING_BEFORE); initBorderInfo(pList, AFTER, Constants.PR_BORDER_AFTER_COLOR, Constants.PR_BORDER_AFTER_STYLE, Constants.PR_BORDER_AFTER_WIDTH, Constants.PR_PADDING_AFTER); initBorderInfo(pList, START, Constants.PR_BORDER_START_COLOR, Constants.PR_BORDER_START_STYLE, Constants.PR_BORDER_START_WIDTH, Constants.PR_PADDING_START); initBorderInfo(pList, END, Constants.PR_BORDER_END_COLOR, Constants.PR_BORDER_END_STYLE, Constants.PR_BORDER
cvs commit: xml-fop/src/java/org/apache/fop/fo FONode.java FObj.java
bckfnn 2004/10/18 13:15:19 Modified:src/java/org/apache/fop/fo FONode.java FObj.java Log: First phase of performance improvement. PR: 31699 Revision ChangesPath 1.47 +19 -0 xml-fop/src/java/org/apache/fop/fo/FONode.java Index: FONode.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FONode.java,v retrieving revision 1.46 retrieving revision 1.47 diff -u -r1.46 -r1.47 --- FONode.java 12 Oct 2004 05:07:46 - 1.46 +++ FONode.java 18 Oct 2004 20:15:19 - 1.47 @@ -112,6 +112,18 @@ } /** + * Create a property list for this node. Return null if the node does not + * need a property list. + * @param parent the closest parent propertylist. + * @param foEventHandler The FOEventHandler where the PropertyListMaker + * instance can be found. + * @return A new property list. + */ +protected PropertyList createPropertyList(PropertyList parent, FOEventHandler foEventHandler) throws SAXParseException { +return null; +} + +/** * Checks to make sure, during SAX processing of input document, that the * incoming node is valid for the this (parent) node (e.g., checking to * see that fo:table is not an immediate child of fo:root) @@ -134,6 +146,13 @@ Locator locator) throws SAXParseException { // ignore } + +/** +* +*/ +protected void startOfNode() throws SAXParseException { +// do nothing by default + } /** * 1.79 +42 -5 xml-fop/src/java/org/apache/fop/fo/FObj.java Index: FObj.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FObj.java,v retrieving revision 1.78 retrieving revision 1.79 diff -u -r1.78 -r1.79 --- FObj.java 13 Oct 2004 00:31:46 - 1.78 +++ FObj.java 18 Oct 2004 20:15:19 - 1.79 @@ -103,6 +103,43 @@ } /** + * Create a default property list for this element. + */ +protected PropertyList createPropertyList(PropertyList parent, FOEventHandler foEventHandler) throws SAXParseException { +//return foEventHandler.getPropertyListMaker().make(this, parent); +return null; +} + +/** + * Bind property values from the property list to the FO node. + * Must be overriden in all FObj subclasses. + * @param pList the PropertyList where the properties can be found. + * @throws SAXParseException + */ +public void bind(PropertyList pList) throws SAXParseException { +throw new SAXParseException("Unconverted element " + this, locator); +} + +/** + * Setup the id for this formatting object. + * Most formatting objects can have an id that can be referenced. + * This methods checks that the id isn't already used by another + * fo and sets the id attribute of this object. + */ + protected void checkId(String id) throws SAXParseException { +if (!id.equals("")) { +Set idrefs = getFOEventHandler().getIDReferences(); +if (!idrefs.contains(id)) { +idrefs.add(id); +} else { +throw new SAXParseException("Property id \"" + id + +"\" previously used; id values must be unique" + +" in document.", locator); +} +} +} + +/** * Set properties for this FO based on node attributes * @param attlist Collection of attributes passed to us from the parser. */ @@ -236,11 +273,11 @@ * @return FObj the nearest ancestor FONode that is an FObj */ public FObj findNearestAncestorFObj() { - FONode par = parent; - while (par != null && !(par instanceof FObj)) { - par = par.parent; - } - return (FObj) par; +FONode par = parent; +while (par != null && !(par instanceof FObj)) { +par = par.parent; +} +return (FObj) par; } /** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/fo/properties NumberProperty.java
bckfnn 2004/10/18 13:11:16 Modified:src/java/org/apache/fop/datatypes Numeric.java src/java/org/apache/fop/fo/properties NumberProperty.java Log: Added convenience method getValue() that returns the value as an int. Revision ChangesPath 1.4 +8 -2 xml-fop/src/java/org/apache/fop/datatypes/Numeric.java Index: Numeric.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/datatypes/Numeric.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- Numeric.java 27 Feb 2004 17:42:28 - 1.3 +++ Numeric.java 18 Oct 2004 20:11:16 - 1.4 @@ -54,7 +54,13 @@ * @return true when the numeric is absolute. */ boolean isAbsolute(); - + +/** + * Returns the value of this numeric as an int. + * @return the value as an integer. + */ +public int getValue(); + /** * Return the resolved value. This method will becalled during evaluation * of the expression tree and relative numerics can then return a 1.5 +5 -1 xml-fop/src/java/org/apache/fop/fo/properties/NumberProperty.java Index: NumberProperty.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/properties/NumberProperty.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- NumberProperty.java 27 Feb 2004 17:45:45 - 1.4 +++ NumberProperty.java 18 Oct 2004 20:11:16 - 1.5 @@ -101,6 +101,10 @@ return number.doubleValue(); } +public int getValue() { + return number.intValue(); +} + /** * Return true because all numbers are absolute. * @return true. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/fo/properties EnumProperty.java
bckfnn 2004/10/17 13:14:11 Modified:src/java/org/apache/fop/fo/properties EnumProperty.java Log: Removed unused method. Revision ChangesPath 1.4 +1 -5 xml-fop/src/java/org/apache/fop/fo/properties/EnumProperty.java Index: EnumProperty.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/properties/EnumProperty.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- EnumProperty.java 7 Sep 2004 10:25:28 - 1.3 +++ EnumProperty.java 17 Oct 2004 20:14:10 - 1.4 @@ -50,10 +50,6 @@ return super.checkEnumValues(value); } -protected Property findConstant(String value) { -return null; -} - public Property convertProperty(Property p, PropertyList propertyList, FObj fo) throws FOPException { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/render/rtf RTFHandler.java
bckfnn 2004/10/17 13:12:57 Modified:src/java/org/apache/fop/fo/flow Block.java Wrapper.java src/java/org/apache/fop/render/rtf RTFHandler.java Log: Removed unused imports. Revision ChangesPath 1.44 +0 -1 xml-fop/src/java/org/apache/fop/fo/flow/Block.java Index: Block.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/Block.java,v retrieving revision 1.43 retrieving revision 1.44 diff -u -r1.43 -r1.44 --- Block.java13 Oct 2004 00:09:54 - 1.43 +++ Block.java17 Oct 2004 20:12:57 - 1.44 @@ -29,7 +29,6 @@ // FOP import org.apache.fop.datatypes.ColorType; import org.apache.fop.fo.CharIterator; -import org.apache.fop.fo.FObj; import org.apache.fop.fo.FObjMixed; import org.apache.fop.fo.FONode; import org.apache.fop.fo.FOText; 1.16 +0 -1 xml-fop/src/java/org/apache/fop/fo/flow/Wrapper.java Index: Wrapper.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/Wrapper.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- Wrapper.java 13 Oct 2004 06:53:33 - 1.15 +++ Wrapper.java 17 Oct 2004 20:12:57 - 1.16 @@ -24,7 +24,6 @@ // FOP import org.apache.fop.fo.FONode; -import org.apache.fop.fo.FObj; import org.apache.fop.fo.FObjMixed; /** 1.36 +1 -2 xml-fop/src/java/org/apache/fop/render/rtf/RTFHandler.java Index: RTFHandler.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/rtf/RTFHandler.java,v retrieving revision 1.35 retrieving revision 1.36 diff -u -r1.35 -r1.36 --- RTFHandler.java 12 Oct 2004 05:07:47 - 1.35 +++ RTFHandler.java 17 Oct 2004 20:12:57 - 1.36 @@ -29,7 +29,6 @@ import org.apache.fop.apps.FOPException; import org.apache.fop.apps.FOUserAgent; import org.apache.fop.fo.FOEventHandler; -import org.apache.fop.fo.FObj; import org.apache.fop.fo.FONode; import org.apache.fop.fo.flow.BasicLink; import org.apache.fop.fo.flow.Block; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/render/pdf PDFRenderer.java
bckfnn 2004/10/15 11:16:21 Modified:src/java/org/apache/fop/render/pdf PDFRenderer.java Log: Exit text-mode before rendering a instream-foreign-object. Revision ChangesPath 1.56 +1 -0 xml-fop/src/java/org/apache/fop/render/pdf/PDFRenderer.java Index: PDFRenderer.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/pdf/PDFRenderer.java,v retrieving revision 1.55 retrieving revision 1.56 diff -u -r1.55 -r1.56 --- PDFRenderer.java 25 Sep 2004 21:55:36 - 1.55 +++ PDFRenderer.java 15 Oct 2004 18:16:21 - 1.56 @@ -1181,6 +1181,7 @@ * @see org.apache.fop.render.AbstractRenderer#renderForeignObject(ForeignObject, Rectangle2D) */ public void renderForeignObject(ForeignObject fo, Rectangle2D pos) { +endTextObject(); Document doc = fo.getDocument(); String ns = fo.getNameSpace(); renderDocument(doc, ns, pos); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/image BatikImage.java
bckfnn 2004/10/12 23:56:49 Modified:src/java/org/apache/fop/image BatikImage.java Log: Fix a ArrayIndexOutOfBoundsException when loading indexed PNGs. PR: 31675 Submitted by: Thomas Deweese Revision ChangesPath 1.2 +11 -12xml-fop/src/java/org/apache/fop/image/BatikImage.java Index: BatikImage.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/image/BatikImage.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- BatikImage.java 11 Oct 2004 21:43:13 - 1.1 +++ BatikImage.java 13 Oct 2004 06:56:49 - 1.2 @@ -118,14 +118,15 @@ this.height = cr.getHeight(); this.width = cr.getWidth(); - -cr = new Any2sRGBRed(cr); - this.isTransparent = false; this.softMask = null; +this.bitmapsSize = this.width * this.height * 3; +this.bitmaps = new byte[this.bitmapsSize]; +this.bitsPerPixel = 8; + int transparencyType = cm.getTransparency(); -if ((transparencyType == Transparency.BITMASK) -&& (cm instanceof IndexColorModel)) { +if (cm instanceof IndexColorModel) { +if (transparencyType == Transparency.BITMASK) { // Use 'transparent color'. IndexColorModel icm = (IndexColorModel)cm; int numColor = icm.getMapSize(); @@ -142,20 +143,18 @@ } } } +} else { +cr = new Any2sRGBRed(cr); +} // Get our current ColorModel cm = cr.getColorModel(); // It has an alpha channel so generate a soft mask. -if ((!this.isTransparent) && cm.hasAlpha()) { +if (!this.isTransparent && cm.hasAlpha()) this.softMask = new byte[this.width * this.height]; -} -this.bitsPerPixel = 8; -this.bitmapsSize = this.width * this.height * 3; -this.bitmaps = new byte[this.bitmapsSize]; this.colorSpace = cm.getColorSpace(); - WritableRaster wr = (WritableRaster)cr.getData(); BufferedImage bi = new BufferedImage (cm, wr.createWritableTranslatedChild(0, 0), - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/fo/flow Wrapper.java
bckfnn 2004/10/12 23:53:33 Modified:src/java/org/apache/fop/fo/flow Wrapper.java Log: Children can now contain FONodes (esp. FOText). Revision ChangesPath 1.15 +1 -1 xml-fop/src/java/org/apache/fop/fo/flow/Wrapper.java Index: Wrapper.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/Wrapper.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- Wrapper.java 12 Oct 2004 05:07:47 - 1.14 +++ Wrapper.java 13 Oct 2004 06:53:33 - 1.15 @@ -55,7 +55,7 @@ return; } while (baseIter.hasNext()) { -FObj child = (FObj) baseIter.next(); +FONode child = (FONode) baseIter.next(); child.addLayoutManager(list); } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/render/ps PSRenderer.java
bckfnn 2004/10/10 23:49:26 Modified:src/java/org/apache/fop/render/ps PSRenderer.java Log: Deleted unused imports. Revision ChangesPath 1.34 +0 -2 xml-fop/src/java/org/apache/fop/render/ps/PSRenderer.java Index: PSRenderer.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/ps/PSRenderer.java,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- PSRenderer.java 10 Oct 2004 11:26:51 - 1.33 +++ PSRenderer.java 11 Oct 2004 06:49:26 - 1.34 @@ -41,8 +41,6 @@ import org.apache.fop.apps.FOUserAgent; import org.apache.fop.fonts.FontSetup; import org.apache.fop.fonts.Typeface; -import org.apache.fop.fonts.FontInfo; -import org.apache.fop.render.AbstractRenderer; import org.apache.fop.render.PrintRenderer; import org.apache.fop.render.RendererContext; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/fo FOPropertyMapping.java
bckfnn 2004/10/10 14:12:06 Modified:src/java/org/apache/fop/fo FOPropertyMapping.java Log: Calculations of indents must use the writing-mode of the parent. See 4.2.3: """ For purposes of this definition, the content-rectangle of an area uses the inline-progression-direction and block-progression-direction of that area; but the border-rectangle, padding-rectangle, and allocation-rectangle use the directions of its parent area. """ Revision ChangesPath 1.27 +3 -1 xml-fop/src/java/org/apache/fop/fo/FOPropertyMapping.java Index: FOPropertyMapping.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FOPropertyMapping.java,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- FOPropertyMapping.java28 Sep 2004 19:43:39 - 1.26 +++ FOPropertyMapping.java10 Oct 2004 21:12:06 - 1.27 @@ -1211,6 +1211,7 @@ m.setDefault("0pt"); IndentPropertyMaker sCorr = new IndentPropertyMaker(m); sCorr.setCorresponding(PR_MARGIN_LEFT, PR_MARGIN_RIGHT, PR_MARGIN_TOP); +sCorr.setUseParent(true); sCorr.setRelative(true); sCorr.setPaddingCorresponding(new int[] { PR_PADDING_LEFT, PR_PADDING_RIGHT, PR_PADDING_TOP @@ -1226,6 +1227,7 @@ m.setDefault("0pt"); IndentPropertyMaker eCorr = new IndentPropertyMaker(m); eCorr.setCorresponding(PR_MARGIN_RIGHT, PR_MARGIN_LEFT, PR_MARGIN_BOTTOM); +eCorr.setUseParent(true); eCorr.setRelative(true); eCorr.setPaddingCorresponding(new int[] { PR_PADDING_RIGHT, PR_PADDING_LEFT, PR_PADDING_BOTTOM - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/fo/pagination RegionBody.java
bckfnn 2004/10/10 14:08:16 Modified:src/java/org/apache/fop/fo/pagination RegionBody.java Log: Simplify the calculation of the viewport. Now that indents are calculated correctly, we can just use them without doing any lookup of absolute margins. Revision ChangesPath 1.30 +2 -33 xml-fop/src/java/org/apache/fop/fo/pagination/RegionBody.java Index: RegionBody.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/RegionBody.java,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- RegionBody.java 7 Sep 2004 20:47:10 - 1.29 +++ RegionBody.java 10 Oct 2004 21:08:16 - 1.30 @@ -25,11 +25,7 @@ import org.apache.fop.datatypes.ColorType; import org.apache.fop.datatypes.FODimension; import org.apache.fop.fo.FONode; -import org.apache.fop.fo.FObj; -import org.apache.fop.fo.PropertyList; import org.apache.fop.fo.properties.CommonMarginBlock; -import org.apache.fop.fo.properties.Property; -import org.apache.fop.fo.FOPropertyMapping; /** * The fo:region-body element. @@ -57,36 +53,9 @@ * set but indent is explicitly set, it will return that. */ CommonMarginBlock mProps = propMgr.getMarginProps(); -int start = getRelMargin(PropertyList.START, PR_START_INDENT); -Rectangle vpRect; -if (this.wm == WritingMode.LR_TB || this.wm == WritingMode.RL_TB) { -vpRect = new Rectangle(start, mProps.spaceBefore, -reldims.ipd - start -- getRelMargin(PropertyList.END, PR_END_INDENT), +return new Rectangle(mProps.startIndent, mProps.spaceBefore, +reldims.ipd - mProps.startIndent - mProps.endIndent, reldims.bpd - mProps.spaceBefore - mProps.spaceAfter); -} else { -vpRect = new Rectangle(start, mProps.spaceBefore, -reldims.bpd - mProps.spaceBefore - mProps.spaceAfter, -reldims.ipd - start -- getRelMargin(PropertyList.END, PR_END_INDENT)); -} -return vpRect; -} - -/** - * Get the relative margin using parent's writing mode, not own - * writing mode. - */ -private int getRelMargin(int reldir, int relPropId) { -FObj parent = (FObj) getParent(); -String sPropName = "margin-" -+ parent.getPropertyList().getAbsoluteWritingMode(reldir); -int propId = FOPropertyMapping.getPropertyId(sPropName); -Property prop = propertyList.getExplicitOrShorthand(propId); -if (prop == null) { -prop = propertyList.getExplicitOrShorthand(relPropId); -} -return ((prop != null) ? prop.getLength().getValue() : 0); } /** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/fo/properties IndentPropertyMaker.java
bckfnn 2004/10/10 14:06:15 Modified:src/java/org/apache/fop/fo/properties IndentPropertyMaker.java Log: Fully implement the 5.3.2 rules for calculating indent values. Revision ChangesPath 1.8 +23 -9 xml-fop/src/java/org/apache/fop/fo/properties/IndentPropertyMaker.java Index: IndentPropertyMaker.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/properties/IndentPropertyMaker.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- IndentPropertyMaker.java 22 Sep 2004 19:19:36 - 1.7 +++ IndentPropertyMaker.java 10 Oct 2004 21:06:15 - 1.8 @@ -69,20 +69,33 @@ * @see CorrespondingPropertyMaker#compute(PropertyList) */ public Property compute(PropertyList propertyList) throws FOPException { -// TODO: bckfnn reenable -if (propertyList.getExplicitOrShorthand( -propertyList.getWritingMode(lr_tb, rl_tb, tb_rl)) == null) { -return null; -} +PropertyList pList = getWMPropertyList(propertyList); // Calculate the values as described in 5.3.2. try { +int marginProp = pList.getWritingMode(lr_tb, rl_tb, tb_rl); +Numeric margin; +// Calculate the absolute margin. +if (propertyList.getExplicitOrShorthand(marginProp) == null) { +Property indent = propertyList.getExplicit(baseMaker.propId); +if (indent == null) { +margin = new FixedLength(0); +} else { +margin = propertyList.getExplicit(baseMaker.propId).getNumeric(); +margin = NumericOp.subtraction(margin, propertyList.getInherited(baseMaker.propId).getNumeric()); +} +margin = NumericOp.subtraction(margin, getCorresponding(paddingCorresponding, propertyList).getNumeric()); +margin = NumericOp.subtraction(margin, getCorresponding(borderWidthCorresponding, propertyList).getNumeric()); +} else { +margin = propertyList.get(marginProp).getNumeric(); +} + Numeric v = new FixedLength(0); if (!propertyList.getFObj().generatesReferenceAreas()) { // The inherited_value_of([start|end]-indent) -v = NumericOp.addition(v, propertyList.getInherited(this.baseMaker.propId).getNumeric()); +v = NumericOp.addition(v, propertyList.getInherited(baseMaker.propId).getNumeric()); } // The corresponding absolute margin-[right|left}. -v = NumericOp.addition(v, propertyList.get(propertyList.getWritingMode(lr_tb, rl_tb, tb_rl)).getNumeric()); +v = NumericOp.addition(v, margin); v = NumericOp.addition(v, getCorresponding(paddingCorresponding, propertyList).getNumeric()); v = NumericOp.addition(v, getCorresponding(borderWidthCorresponding, propertyList).getNumeric()); return (Property) v; @@ -94,7 +107,8 @@ } private Property getCorresponding(int[] corresponding, PropertyList propertyList) { -int wmcorr = propertyList.getWritingMode(corresponding[0], corresponding[1], corresponding[2]); +PropertyList pList = getWMPropertyList(propertyList); +int wmcorr = pList.getWritingMode(corresponding[0], corresponding[1], corresponding[2]); return propertyList.get(wmcorr); } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/fo/properties CorrespondingPropertyMaker.java
bckfnn 2004/10/10 14:05:21 Modified:src/java/org/apache/fop/fo/properties CorrespondingPropertyMaker.java Log: Added helper method getWMPropertyList(). Revision ChangesPath 1.5 +17 -12 xml-fop/src/java/org/apache/fop/fo/properties/CorrespondingPropertyMaker.java Index: CorrespondingPropertyMaker.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/properties/CorrespondingPropertyMaker.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- CorrespondingPropertyMaker.java 22 May 2004 21:44:37 - 1.4 +++ CorrespondingPropertyMaker.java 10 Oct 2004 21:05:21 - 1.5 @@ -74,9 +74,7 @@ return false; } -PropertyList pList = (useParent) ? propertyList.getParentPropertyList() : -propertyList; - +PropertyList pList = getWMPropertyList(propertyList); int correspondingId = pList.getWritingMode(lr_tb, rl_tb, tb_rl); if (pList.getExplicit(correspondingId) != null) { @@ -97,14 +95,9 @@ * @throws FOPException for invalid or inconsistent FO input */ public Property compute(PropertyList propertyList) throws FOPException { -PropertyList pList; -if (useParent) { -pList = propertyList.getParentPropertyList(); -if (pList == null) { -return null; -} -} else { -pList = propertyList; +PropertyList pList = getWMPropertyList(propertyList); +if (pList == null) { +return null; } int correspondingId = pList.getWritingMode(lr_tb, rl_tb, tb_rl); @@ -114,6 +107,18 @@ p = baseMaker.convertProperty(p, propertyList, parentFO); } return p; +} + +/** + * Return the property list to use for fetching writing mode depending property + * ids. + */ +protected PropertyList getWMPropertyList(PropertyList pList) { +if (useParent) { +return pList.getParentPropertyList(); +} else { +return pList; +} } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr RetrieveMarkerLayoutManager.java
bckfnn 2004/10/10 13:24:16 Modified:src/java/org/apache/fop/layoutmgr RetrieveMarkerLayoutManager.java Log: Fix regression for fo:retrieve-marker. Revision ChangesPath 1.11 +11 -1 xml-fop/src/java/org/apache/fop/layoutmgr/RetrieveMarkerLayoutManager.java Index: RetrieveMarkerLayoutManager.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/RetrieveMarkerLayoutManager.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- RetrieveMarkerLayoutManager.java 7 Sep 2004 20:47:11 - 1.10 +++ RetrieveMarkerLayoutManager.java 10 Oct 2004 20:24:16 - 1.11 @@ -20,6 +20,7 @@ import java.util.ArrayList; import java.util.List; +import java.util.LinkedList; import org.apache.fop.area.Area; import org.apache.fop.fo.flow.Marker; @@ -62,6 +63,15 @@ return replaceLM.getNextBreakPoss(context); } +public LinkedList getNextKnuthElements(LayoutContext context, +int alignment) { +loadLM(); +if (replaceLM == null) { +return null; +} +return replaceLM.getNextKnuthElements(context, alignment); +} + public void addAreas(PositionIterator parentIter, LayoutContext layoutContext) { @@ -96,7 +106,7 @@ List list = new ArrayList(); Marker marker = retrieveMarker(name, position, boundary); if (marker != null) { -marker.addLayoutManager(markerLMList); +marker.addLayoutManager(list); if (list.size() > 0) { replaceLM = (LayoutManager)list.get(0); replaceLM.setParent(this); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr BlockLayoutManager.java
bckfnn 2004/10/10 13:22:56 Modified:src/java/org/apache/fop/layoutmgr BlockLayoutManager.java Log: When the child LM is a RetrieveMarker, it need a valid parent before generatesInlineAreas() are called. Revision ChangesPath 1.29 +2 -0 xml-fop/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java Index: BlockLayoutManager.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- BlockLayoutManager.java 22 Sep 2004 08:22:14 - 1.28 +++ BlockLayoutManager.java 10 Oct 2004 20:22:56 - 1.29 @@ -134,6 +134,7 @@ while (proxyLMiter.hasNext()) { LayoutManager lm = (LayoutManager) proxyLMiter.next(); +lm.setParent(this); if (lm.generatesInlineAreas()) { LineLayoutManager lineLM = createLineManager(lm); addChildLM(lineLM); @@ -160,6 +161,7 @@ inlines.add(firstlm); while (proxyLMiter.hasNext()) { LayoutManager lm = (LayoutManager) proxyLMiter.next(); +lm.setParent(this); if (lm.generatesInlineAreas()) { inlines.add(lm); } else { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/examples/fo/markers hide.fo
bckfnn 2004/10/10 13:09:31 Modified:examples/fo/markers hide.fo Log: Pass validation. Revision ChangesPath 1.4 +1 -1 xml-fop/examples/fo/markers/hide.fo Index: hide.fo === RCS file: /home/cvs/xml-fop/examples/fo/markers/hide.fo,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- hide.fo 22 Feb 2004 13:37:06 - 1.3 +++ hide.fo 10 Oct 2004 20:09:31 - 1.4 @@ -8,8 +8,8 @@ margin-top="1cm" page-width="21cm" page-height="29.7cm"> - + - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/examples/fo/tables background.fo borders.fo break.fo headfoot.fo keep.fo omit.fo space.fo widowsorphans.fo
bckfnn 2004/10/10 13:08:14 Modified:examples/fo/tables background.fo borders.fo break.fo headfoot.fo keep.fo omit.fo space.fo widowsorphans.fo Log: Pass validation. Revision ChangesPath 1.4 +1 -1 xml-fop/examples/fo/tables/background.fo Index: background.fo === RCS file: /home/cvs/xml-fop/examples/fo/tables/background.fo,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- background.fo 22 Feb 2004 13:37:07 - 1.3 +++ background.fo 10 Oct 2004 20:08:14 - 1.4 @@ -8,8 +8,8 @@ margin-top="1cm" page-width="21cm" page-height="29.7cm"> - + 1.6 +1 -1 xml-fop/examples/fo/tables/borders.fo Index: borders.fo === RCS file: /home/cvs/xml-fop/examples/fo/tables/borders.fo,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- borders.fo22 Feb 2004 13:37:07 - 1.5 +++ borders.fo10 Oct 2004 20:08:14 - 1.6 @@ -8,8 +8,8 @@ margin-top="1cm" page-width="21cm" page-height="29.7cm"> - + 1.4 +1 -1 xml-fop/examples/fo/tables/break.fo Index: break.fo === RCS file: /home/cvs/xml-fop/examples/fo/tables/break.fo,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- break.fo 22 Feb 2004 13:37:07 - 1.3 +++ break.fo 10 Oct 2004 20:08:14 - 1.4 @@ -8,8 +8,8 @@ margin-top="1cm" page-width="21cm" page-height="17cm"> - + 1.4 +1 -1 xml-fop/examples/fo/tables/headfoot.fo Index: headfoot.fo === RCS file: /home/cvs/xml-fop/examples/fo/tables/headfoot.fo,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- headfoot.fo 22 Feb 2004 13:37:07 - 1.3 +++ headfoot.fo 10 Oct 2004 20:08:14 - 1.4 @@ -8,8 +8,8 @@ margin-top="1cm" page-width="21cm" page-height="29.7cm"> - + 1.4 +1 -1 xml-fop/examples/fo/tables/keep.fo Index: keep.fo === RCS file: /home/cvs/xml-fop/examples/fo/tables/keep.fo,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- keep.fo 22 Feb 2004 13:37:07 - 1.3 +++ keep.fo 10 Oct 2004 20:08:14 - 1.4 @@ -8,8 +8,8 @@ margin-top="1cm" page-width="21cm" page-height="17cm"> - + 1.4 +1 -1 xml-fop/examples/fo/tables/omit.fo Index: omit.fo === RCS file: /home/cvs/xml-fop/examples/fo/tables/omit.fo,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- omit.fo 22 Feb 2004 13:37:07 - 1.3 +++ omit.fo 10 Oct 2004 20:08:14 - 1.4 @@ -8,8 +8,8 @@ margin-top="1cm" page-width="21cm" page-height="29.7cm"> - + 1.4 +1 -1 xml-fop/examples/fo/tables/space.fo Index: space.fo === RCS file: /home/cvs/xml-fop/examples/fo/tables/space.fo,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- space.fo 22 Feb 2004 13:37:07 - 1.3 +++ space.fo 10 Oct 2004 20:08:14 - 1.4 @@ -8,8 +8,8 @@ margin-top="1cm" page-width="21cm" page-height="29.7cm"> - + 1.4 +1 -1 xml-fop/examples/fo/tables/widowsorphans.fo Index: widowsorphans.fo === RCS file: /home/cvs/xml-fop/examples/fo/tables/widowsorphans.fo,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- widowsorphans.fo 22 Feb 2004 13:37:07 - 1.3 +++ widowsorphans.fo 10 Oct 2004 20:08:14 - 1.4 @@ -8,8 +8,8 @@ margin-top="1cm"
cvs commit: xml-fop/src/java/org/apache/fop/fo/pagination PageSequence.java
bckfnn 2004/10/08 03:07:40 Modified:src/java/org/apache/fop/fo/pagination PageSequence.java Log: Fix missing static-content regression. Revision ChangesPath 1.47 +2 -0 xml-fop/src/java/org/apache/fop/fo/pagination/PageSequence.java Index: PageSequence.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/PageSequence.java,v retrieving revision 1.46 retrieving revision 1.47 diff -u -r1.46 -r1.47 --- PageSequence.java 26 Sep 2004 13:51:00 - 1.46 +++ PageSequence.java 8 Oct 2004 10:07:40 - 1.47 @@ -220,6 +220,8 @@ super.addChildNode(child); // For getChildren } else if (childId == FO_STATIC_CONTENT) { addFlow((StaticContent) child); +String flowName = ((StaticContent) child).getPropString(PR_FLOW_NAME); +flowMap.put(flowName, child); startStructuredPageSequence(); } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/fo/pagination Flow.java LayoutMasterSet.java RepeatablePageMasterAlternatives.java SimplePageMaster.java StaticContent.java
bckfnn 2004/10/07 12:47:47 Modified:src/java/org/apache/fop/area Area.java src/java/org/apache/fop/fo/flow BasicLink.java Block.java BlockContainer.java Float.java Footnote.java FootnoteBody.java Inline.java InstreamForeignObject.java ListBlock.java ListItem.java MultiProperties.java MultiSwitch.java TableAndCaption.java TableCaption.java TableCell.java TableRow.java src/java/org/apache/fop/fo/pagination Flow.java LayoutMasterSet.java RepeatablePageMasterAlternatives.java SimplePageMaster.java StaticContent.java Log: Fix javadoc warnings. Revision ChangesPath 1.5 +4 -4 xml-fop/src/java/org/apache/fop/area/Area.java Index: Area.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/area/Area.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- Area.java 22 Sep 2004 08:16:00 - 1.4 +++ Area.java 7 Oct 2004 19:47:46 - 1.5 @@ -157,7 +157,7 @@ * for this area. * * @param i the new inline progression dimension - * @see http://www.w3.org/TR/xsl/slice4.html#area-common + * @see http://www.w3.org/TR/xsl/slice4.html#area-common";>ipd */ public void setIPD(int i) { ipd = i; @@ -168,7 +168,7 @@ * for this area. * * @return the inline progression dimension - * @see http://www.w3.org/TR/xsl/slice4.html#area-common + * @see http://www.w3.org/TR/xsl/slice4.html#area-common";>ipd */ public int getIPD() { return ipd; @@ -179,7 +179,7 @@ * for this area. * * @param b the new block progression dimension - * @see http://www.w3.org/TR/xsl/slice4.html#area-common + * @see http://www.w3.org/TR/xsl/slice4.html#area-common";>bpd */ public void setBPD(int b) { bpd = b; @@ -190,7 +190,7 @@ * for this area. * * @return the block progression dimension - * @see http://www.w3.org/TR/xsl/slice4.html#area-common + * @see http://www.w3.org/TR/xsl/slice4.html#area-common";>bpd */ public int getBPD() { return bpd; 1.29 +1 -1 xml-fop/src/java/org/apache/fop/fo/flow/BasicLink.java Index: BasicLink.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/BasicLink.java,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- BasicLink.java11 Sep 2004 17:11:58 - 1.28 +++ BasicLink.java7 Oct 2004 19:47:46 - 1.29 @@ -98,7 +98,7 @@ } /** - * @see org.apache.fop.fo.FONode#end + * @see org.apache.fop.fo.FONode#endOfNode */ protected void endOfNode() throws SAXParseException { super.endOfNode(); 1.41 +1 -1 xml-fop/src/java/org/apache/fop/fo/flow/Block.java Index: Block.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/Block.java,v retrieving revision 1.40 retrieving revision 1.41 diff -u -r1.40 -r1.41 --- Block.java11 Sep 2004 17:11:58 - 1.40 +++ Block.java7 Oct 2004 19:47:47 - 1.41 @@ -184,7 +184,7 @@ } /** - * @see org.apache.fop.fo.FONode#end + * @see org.apache.fop.fo.FONode#endOfNode */ protected void endOfNode() throws SAXParseException { handleWhiteSpace(); 1.25 +1 -1 xml-fop/src/java/org/apache/fop/fo/flow/BlockContainer.java Index: BlockContainer.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/BlockContainer.java,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- BlockContainer.java 30 Sep 2004 19:56:24 - 1.24 +++ BlockContainer.java 7 Oct 2004 19:47:47 - 1.25 @@ -70,7 +70,7 @@ } /** - * @see org.apache.fop.fo.FONode#end + * @see org.apache.fop.fo.FONode#endOfNode */ protected void endOfNode() throws SAXParseException { getFOEventHandler().endBlockContainer(this); 1.17 +1 -1 xml-fop/src/java/org/apache/fop/fo/flow/Float.java Index: Float.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/Float.java,v retrieving revision 1.16 retrieving revision 1.17 diff -
cvs commit: xml-fop/src/java/org/apache/fop/render/rtf TableAttributesConverter.java
bckfnn 2004/10/03 11:10:02 Modified:src/java/org/apache/fop/render/rtf TableAttributesConverter.java Log: Re-enable calls to TableAttributesConverter.makeBorder. Revision ChangesPath 1.18 +2 -5 xml-fop/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java Index: TableAttributesConverter.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- TableAttributesConverter.java 2 Oct 2004 04:34:13 - 1.17 +++ TableAttributesConverter.java 3 Oct 2004 18:10:02 - 1.18 @@ -118,7 +118,6 @@ } } -/* BorderAttributesConverter.makeBorder(propList, attrib, ITableAttributes.CELL_BORDER_TOP, Constants.PR_BORDER_TOP_COLOR, Constants.PR_BORDER_TOP_STYLE, @@ -135,7 +134,7 @@ Constants.PR_BORDER_RIGHT_COLOR, Constants.PR_BORDER_RIGHT_STYLE, Constants.PR_BORDER_RIGHT_WIDTH); -*/ + int n = fobj.getProperty(Constants.PR_NUMBER_COLUMNS_SPANNED).getNumber().intValue(); // Column spanning : if (n > 1) { @@ -215,7 +214,6 @@ * place. */ PropertyList propList = fobj.getPropertyList(); -/* BorderAttributesConverter.makeBorder(propList, attrib, ITableAttributes.CELL_BORDER_TOP, Constants.PR_BORDER_TOP_COLOR, Constants.PR_BORDER_TOP_STYLE, @@ -232,7 +230,6 @@ Constants.PR_BORDER_RIGHT_COLOR, Constants.PR_BORDER_RIGHT_STYLE, Constants.PR_BORDER_RIGHT_WIDTH); -*/ /* ep = (EnumProperty)fobj.getProperty(Constants.PR_BORDER_TOP_STYLE); if (ep != null && ep.getEnum() != Constants.NONE) { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc BorderAttributesConverter.java
bckfnn 2004/10/03 11:05:15 Modified:src/java/org/apache/fop/render/rtf/rtflib/rtfdoc BorderAttributesConverter.java Log: Added makeBorder() method. Moved convertAttributetoRtf() from TableAttributesConverter to here. Revision ChangesPath 1.3 +72 -41 xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/BorderAttributesConverter.java Index: BorderAttributesConverter.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/BorderAttributesConverter.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- BorderAttributesConverter.java27 Feb 2004 17:54:01 - 1.2 +++ BorderAttributesConverter.java3 Oct 2004 18:05:15 - 1.3 @@ -26,6 +26,10 @@ package org.apache.fop.render.rtf.rtflib.rtfdoc; +import org.apache.fop.fo.Constants; +import org.apache.fop.fo.PropertyList; +import org.apache.fop.render.rtf.FOPRtfAttributes; + /** Constants for RTF border attribute names, and a static method for converting * fo attribute strings. */ @@ -81,6 +85,8 @@ public static final String BORDER_EMBOSS = "brdremboss"; /** Constant for an engraved border */ public static final String BORDER_ENGRAVE = "brdrengrave"; +/** Constant for an nil border */ +public static final String BORDER_NIL = "brdrnil"; /** Constant for border color */ public static final String BORDER_COLOR = "brdrcf"; /** Constant for border space */ @@ -103,48 +109,73 @@ }; /** -* BorderAttributesConverter: Static Method for converting FO strings -* to RTF control words -* @param value FO string -* @return RTF control word -*/ -public static String convertAttributetoRtf(String value) { -// Added by Normand Masse -// "solid" is interpreted like "thin" -if (value.equals("thin") || value.equals("solid")) { -return BORDER_SINGLE_THICKNESS; -} else if (value.equals("thick")) { -return BORDER_DOUBLE_THICKNESS; -} else if (value.equals("shadowed")) { -return BORDER_SHADOWED; -} else if (value.equals("double")) { -return BORDER_DOUBLE; -} else if (value.equals("dotted")) { -return BORDER_DOTTED; -} else if (value.equals("dash")) { -return BORDER_DASH; -} else if (value.equals("hairline")) { -return BORDER_HAIRLINE; -} else if (value.equals("dot-dash")) { -return BORDER_DOT_DASH; -} else if (value.equals("dot-dot-dash")) { -return BORDER_DOT_DOT_DASH; -} else if (value.equals("triple")) { -return BORDER_TRIPLE; -} else if (value.equals("wavy")) { -return BORDER_WAVY; -} else if (value.equals("wavy-double")) { -return BORDER_WAVY_DOUBLE; -} else if (value.equals("striped")) { -return BORDER_STRIPED; -} else if (value.equals("emboss")) { -return BORDER_EMBOSS; -} else if (value.equals("engrave")) { -return BORDER_ENGRAVE; -} else { -return null; + * Create a border control word in attributes, with border properties + * as specified in color, style and width. + * @param propList The property list to get properties from. + * @param attributes The attributes list to set the border control word. + * @param controlWord The border control word. + * @param color The PR_BORDER_X_COLOR constants for the color, + * @param style The PR_BORDER_X_STYLE constants for the border style. + * @param width The PR_BORDER_X_WIDTH constants for the width. + */ +public static void makeBorder(PropertyList propList, +RtfAttributes attributes, String controlWord, +int color, int style, int width) { +int styleEnum = propList.get(style).getEnum(); +if (styleEnum != Constants.NONE) { +FOPRtfAttributes attrs = new FOPRtfAttributes(); +attrs.set(BORDER_COLOR, propList.get(color).getColorType()); +attrs.set(convertAttributetoRtf(styleEnum)); +attrs.set(BORDER_WIDTH, propList.get(width).getLength()); +attributes.set(controlWord, attrs); } } +/** +* +* @param iBorderStyle the border style to be converted +* @return String with the converted border style +*/ + public static String convertAttr
cvs commit: xml-fop/src/java/org/apache/fop/render/rtf TableAttributesConverter.java
bckfnn 2004/10/01 02:46:36 Modified:src/java/org/apache/fop/render/rtf TableAttributesConverter.java Log: Simplified the handling of length attributes. Attempt at setting borders correctly. Revision ChangesPath 1.16 +49 -140 xml-fop/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java Index: TableAttributesConverter.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- TableAttributesConverter.java 23 May 2004 17:00:00 - 1.15 +++ TableAttributesConverter.java 1 Oct 2004 09:46:36 - 1.16 @@ -18,27 +18,17 @@ package org.apache.fop.render.rtf; -//RTF -import org.apache.fop.render.rtf.rtflib.rtfdoc.BorderAttributesConverter; - -//FOP import org.apache.commons.logging.Log; import org.apache.commons.logging.impl.SimpleLog; import org.apache.fop.apps.FOPException; -import org.apache.fop.fo.expr.NCnameProperty; -import org.apache.fop.fo.properties.ColorTypeProperty; -import org.apache.fop.fo.properties.EnumProperty; -import org.apache.fop.fo.properties.LengthProperty; -import org.apache.fop.fo.properties.ListProperty; -import org.apache.fop.fo.properties.NumberProperty; -import org.apache.fop.fo.properties.Property; +import org.apache.fop.datatypes.ColorType; import org.apache.fop.fo.Constants; import org.apache.fop.fo.FObj; import org.apache.fop.fo.PropertyList; -import org.apache.fop.datatypes.ColorType; - -import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfAttributes; +import org.apache.fop.fo.properties.Property; +import org.apache.fop.render.rtf.rtflib.rtfdoc.BorderAttributesConverter; import org.apache.fop.render.rtf.rtflib.rtfdoc.ITableAttributes; +import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfAttributes; import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfColorTable; /** @@ -85,20 +75,9 @@ */ static RtfAttributes convertTableAttributes(FObj fobj) throws FOPException { -RtfAttributes attrib = new RtfAttributes(); - -LengthProperty lengthProp = null; -// margin-left -lengthProp = (LengthProperty)fobj.getProperty(Constants.PR_MARGIN_LEFT); -if (lengthProp != null) { -Float f = new Float(lengthProp.getLength().getValue() / 1000f); -final String sValue = f.toString() + "pt"; - -attrib.set( -ITableAttributes.ATTR_ROW_LEFT_INDENT, -(int)FoUnitsConverter.getInstance().convertToTwips(sValue)); -} - +FOPRtfAttributes attrib = new FOPRtfAttributes(); +attrib.set(ITableAttributes.ATTR_ROW_LEFT_INDENT, +fobj.getProperty(Constants.PR_MARGIN_LEFT).getLength()); return attrib; } @@ -114,14 +93,11 @@ throws FOPException { Property p; -EnumProperty ep; RtfColorTable colorTable = RtfColorTable.getInstance(); PropertyList propList = fobj.getPropertyList(); -RtfAttributes attrib = null; - -attrib = new RtfAttributes(); +FOPRtfAttributes attrib = new FOPRtfAttributes(); boolean isBorderPresent = false; @@ -135,118 +111,35 @@ || color.getGreen() != 0 || color.getBlue() != 0) { attrib.set( -ITableAttributes.CELL_COLOR_BACKGROUND, -TextAttributesConverter.convertFOPColorToRTF(color)); +ITableAttributes.CELL_COLOR_BACKGROUND, color); } } else { log.warn("Named color '" + p.toString() + "' not found. "); } } + +BorderAttributesConverter.makeBorder(propList, attrib, ITableAttributes.CELL_BORDER_TOP, +Constants.PR_BORDER_TOP_COLOR, +Constants.PR_BORDER_TOP_STYLE, +Constants.PR_BORDER_TOP_WIDTH); +BorderAttributesConverter.makeBorder(propList, attrib, ITableAttributes.CELL_BORDER_BOTTOM, +Constants.PR_BORDER_BOTTOM_COLOR, +Constants.PR_BORDER_BOTTOM_STYLE, +Constants.PR_BORDER_BOTTOM_WIDTH); +BorderAttributesConverter.makeBorder(propList, attrib, ITableAttributes.CELL_BORDER_LEFT, +Constants.PR_BORDER_LEFT_COLOR, +Constants.PR_BORDER_LEFT_STYLE, +Constants.PR_BORDER_LEFT_WIDTH); +BorderAttributesConverter.makeBorder(propList, attrib, ITableAttributes.CELL_BORDER_RIGHT, +
cvs commit: xml-fop/src/java/org/apache/fop/render/rtf TextAttributesConverter.java
bckfnn 2004/10/01 02:44:57 Modified:src/java/org/apache/fop/render/rtf TextAttributesConverter.java Log: Simplified the handling of length attributes. Don't set a background color, when it is specified as "transparent". Revision ChangesPath 1.17 +29 -74 xml-fop/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java Index: TextAttributesConverter.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- TextAttributesConverter.java 1 Oct 2004 09:03:35 - 1.16 +++ TextAttributesConverter.java 1 Oct 2004 09:44:57 - 1.17 @@ -23,15 +23,12 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.impl.SimpleLog; import org.apache.fop.apps.FOPException; +import org.apache.fop.datatypes.ColorType; +import org.apache.fop.datatypes.Length; import org.apache.fop.fo.Constants; import org.apache.fop.fo.FObj; import org.apache.fop.fo.properties.ColorTypeProperty; import org.apache.fop.fo.properties.EnumProperty; -import org.apache.fop.fo.properties.LengthProperty; -import org.apache.fop.fo.properties.SpaceProperty; -import org.apache.fop.datatypes.ColorType; - -//RTF import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfAttributes; import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfColorTable; import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfFontManager; @@ -57,9 +54,7 @@ */ public static RtfAttributes convertAttributes(FObj fobj) throws FOPException { -RtfAttributes attrib = null; - -attrib = new RtfAttributes(); +FOPRtfAttributes attrib = new FOPRtfAttributes(); attrBlockFontFamily(fobj, attrib); attrBlockFontWeight(fobj, attrib); attrBlockFontSize(fobj, attrib); @@ -80,7 +75,7 @@ */ public static RtfAttributes convertBlockContainerAttributes(FObj fobj) throws FOPException { -RtfAttributes attrib = new RtfAttributes(); +FOPRtfAttributes attrib = new FOPRtfAttributes(); attrBlockFontFamily(fobj, attrib); attrBlockFontWeight(fobj, attrib); attrBlockFontSize(fobj, attrib); @@ -178,77 +173,37 @@ } } -private static void attrBlockSpaceBeforeAfter(FObj fobj, RtfAttributes rtfAttr) { -SpaceProperty spaceProp = null; - -//space-before -spaceProp = (SpaceProperty)fobj.getProperty(Constants.PR_SPACE_BEFORE); -if (spaceProp != null) { -Float f = new Float( -spaceProp.getLengthRange().getOptimum().getLength().getValue() / 1000f); -String sValue = f.toString() + "pt"; - -try { -rtfAttr.set( -RtfText.SPACE_BEFORE, -(int)FoUnitsConverter.getInstance().convertToTwips(sValue)); -} catch (FOPException fe) { -log.warn("attrBlockSpaceBeforeAfter: " + fe.getMessage()); -} +private static void attrBlockSpaceBeforeAfter(FObj fobj, FOPRtfAttributes rtfAttr) { +Length space; +space = fobj.getProperty(Constants.PR_SPACE_BEFORE).getLengthRange().getOptimum().getLength(); +if (space.getValue() >= 0) { +rtfAttr.set(RtfText.SPACE_BEFORE, space); } - -//space-after -spaceProp = (SpaceProperty)fobj.getProperty(Constants.PR_SPACE_AFTER); -if (spaceProp != null) { -Float f = new Float( -spaceProp.getLengthRange().getOptimum().getLength().getValue() / 1000f); -String sValue = f.toString() + "pt"; - -try { -rtfAttr.set( -RtfText.SPACE_AFTER, -(int)FoUnitsConverter.getInstance().convertToTwips(sValue)); -} catch (FOPException fe) { -log.warn("attrBlockSpaceBeforeAfter: " + fe.getMessage()); -} +space = fobj.getProperty(Constants.PR_SPACE_AFTER).getLengthRange().getOptimum().getLength(); +if (space.getValue() >= 0) { + rtfAttr.set(RtfText.SPACE_AFTER, space); } } -private static void attrBlockMargins(FObj fobj, RtfAttributes rtfAttr) { -try { -LengthProperty lengthProp = null; - -// margin-left -lengthProp = (LengthProperty)fobj.getProperty(Constants.PR_MARGIN_LEFT); -if (lengthProp != null) { -Float f = new Float(lengthProp.getLength().getValue() / 1000f); -String sVa
cvs commit: xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc RtfAttributes.java RtfElement.java
bckfnn 2004/10/01 02:30:35 Modified:src/java/org/apache/fop/render/rtf/rtflib/rtfdoc RtfAttributes.java RtfElement.java Log: Support nested attribute values, for use with border control words. Revision ChangesPath 1.3 +12 -1 xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfAttributes.java Index: RtfAttributes.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfAttributes.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- RtfAttributes.java27 Feb 2004 17:54:01 - 1.2 +++ RtfAttributes.java1 Oct 2004 09:30:35 - 1.3 @@ -145,6 +145,17 @@ } /** + * Set an attribute that has nested attributes as value + * @param name name of attribute + * @param type value of the nested attributes + * @return this (which now contains the new entry) + */ +public RtfAttributes set(String name, RtfAttributes value) { +values.put(name, value); +return this; +} + +/** * @param name String containing attribute name * @return the value of an attribute, null if not found */ 1.3 +11 -3 xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfElement.java Index: RtfElement.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfElement.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- RtfElement.java 27 Feb 2004 17:54:01 - 1.2 +++ RtfElement.java 1 Oct 2004 09:30:35 - 1.3 @@ -211,7 +211,11 @@ cw += value; } else if (value instanceof String) { cw += value; -} +} else if (value instanceof RtfAttributes) { +writeControlWord(cw); +writeAttributes((RtfAttributes) value, null); +return; +} writeControlWord(cw); } @@ -229,7 +233,11 @@ cw += value; } else if (value instanceof String) { cw += value; -} +} else if (value instanceof RtfAttributes) { +writeControlWord(cw); +writeAttributes((RtfAttributes) value, null); +return; +} writeControlWordNS(cw); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/render/rtf PageAttributesConverter.java
bckfnn 2004/10/01 02:22:15 Modified:src/java/org/apache/fop/render/rtf PageAttributesConverter.java Log: Simplified the handling of length attributes. Revision ChangesPath 1.11 +33 -80 xml-fop/src/java/org/apache/fop/render/rtf/PageAttributesConverter.java Index: PageAttributesConverter.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/rtf/PageAttributesConverter.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- PageAttributesConverter.java 29 Aug 2004 20:58:20 - 1.10 +++ PageAttributesConverter.java 1 Oct 2004 09:22:15 - 1.11 @@ -23,11 +23,11 @@ import org.apache.commons.logging.impl.SimpleLog; //FOP -import org.apache.fop.apps.FOPException; +import org.apache.fop.datatypes.Length; import org.apache.fop.fo.Constants; import org.apache.fop.fo.pagination.Region; import org.apache.fop.fo.pagination.SimplePageMaster; -import org.apache.fop.fo.properties.Property; +import org.apache.fop.fo.expr.NumericOp; import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfAttributes; import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfPage; @@ -43,103 +43,56 @@ /** convert xsl:fo attributes to RTF text attributes */ static RtfAttributes convertPageAttributes(SimplePageMaster pagemaster) { -RtfAttributes attrib = new RtfAttributes(); +FOPRtfAttributes attrib = new FOPRtfAttributes(); try { -FoUnitsConverter converter = FoUnitsConverter.getInstance(); - -float fPageTop = 0; -float fPageBottom = 0; -Property p = null; -Float f = null; - Region before = pagemaster.getRegion(Constants.FO_REGION_BEFORE); Region body = pagemaster.getRegion(Constants.FO_REGION_BODY); Region after = pagemaster.getRegion(Constants.FO_REGION_AFTER); -if ((p = pagemaster.getProperty(Constants.PR_PAGE_WIDTH)) != null) { -f = new Float(p.getLength().getValue() / 1000f); -attrib.set(RtfPage.PAGE_WIDTH, -(int)converter.convertToTwips(f.toString() + "pt")); -} +attrib.set(RtfPage.PAGE_WIDTH, pagemaster.getProperty(Constants.PR_PAGE_WIDTH).getLength()); +attrib.set(RtfPage.PAGE_HEIGHT, pagemaster.getProperty(Constants.PR_PAGE_HEIGHT).getLength()); -if ((p = pagemaster.getProperty(Constants.PR_PAGE_HEIGHT)) != null) { -f = new Float(p.getLength().getValue() / 1000f); -attrib.set(RtfPage.PAGE_HEIGHT, -(int)converter.convertToTwips(f.toString() + "pt")); -} - -if ((p = pagemaster.getProperty(Constants.PR_MARGIN_TOP)) != null) { -fPageTop = p.getLength().getValue() / 1000f; -} +Length pageTop = pagemaster.getProperty(Constants.PR_MARGIN_TOP).getLength(); +Length pageBottom = pagemaster.getProperty(Constants.PR_MARGIN_BOTTOM).getLength(); +Length pageLeft = pagemaster.getProperty(Constants.PR_MARGIN_LEFT).getLength(); +Length pageRight = pagemaster.getProperty(Constants.PR_MARGIN_RIGHT).getLength(); + +Length bodyTop = pageTop; +Length bodyBottom = pageBottom; +Length bodyLeft = pageLeft; +Length bodyRight = pageRight; -if ((p = pagemaster.getProperty(Constants.PR_MARGIN_BOTTOM)) != null) { -fPageBottom = p.getLength().getValue() / 1000f; -} - -if ((p = pagemaster.getProperty(Constants.PR_MARGIN_LEFT)) != null) { -f = new Float(p.getLength().getValue() / 1000f); -attrib.set(RtfPage.MARGIN_LEFT, -(int)converter.convertToTwips(f.toString() + "pt")); -} -if ((p = pagemaster.getProperty(Constants.PR_MARGIN_RIGHT)) != null) { -f = new Float(p.getLength().getValue() / 1000f); -attrib.set(RtfPage.MARGIN_RIGHT, -(int)converter.convertToTwips(f.toString() + "pt")); -} - -//region-body attributes -float fBodyTop = fPageTop; -float fBodyBottom = fPageBottom; - if (body != null) { -if ((p = body.getProperty(Constants.PR_MARGIN_TOP)) != null) { -fBodyTop += p.getLength().getValue() / 1000f; -} - -if ((p = body.getProperty(Constants.PR_MARGIN_BOTTOM)) != null) { -
cvs commit: xml-fop/src/java/org/apache/fop/render/rtf ListAttributesConverter.java
bckfnn 2004/10/01 02:19:15 Modified:src/java/org/apache/fop/render/rtf ListAttributesConverter.java Log: Simplified the handling of length attributes. Revision ChangesPath 1.8 +6 -39 xml-fop/src/java/org/apache/fop/render/rtf/ListAttributesConverter.java Index: ListAttributesConverter.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/rtf/ListAttributesConverter.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- ListAttributesConverter.java 22 May 2004 21:44:38 - 1.7 +++ ListAttributesConverter.java 1 Oct 2004 09:19:15 - 1.8 @@ -22,8 +22,6 @@ import org.apache.fop.apps.FOPException; import org.apache.fop.fo.Constants; import org.apache.fop.fo.FObj; -import org.apache.fop.fo.properties.LengthProperty; -import org.apache.fop.fo.properties.Property; //RTF import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfAttributes; @@ -47,43 +45,12 @@ static RtfAttributes convertAttributes(FObj fobj) throws FOPException { -RtfAttributes attrib = new RtfAttributes(); +FOPRtfAttributes attrib = new FOPRtfAttributes(); -Property prop = null; -int iStartIndentInTwips = 0; - -//start-indent -if ((prop = fobj.getProperty(Constants.PR_START_INDENT)) != null) { -LengthProperty lengthprop = (LengthProperty)prop; - -Float f = new Float(lengthprop.getLength().getValue() / 1000f); -String sValue = f.toString() + "pt"; - -iStartIndentInTwips = (int) FoUnitsConverter.getInstance().convertToTwips(sValue); -} else { -//set default -iStartIndentInTwips = 360; -} -attrib.set(RtfListTable.LIST_INDENT, iStartIndentInTwips); - -//end-indent -if ((prop = fobj.getProperty(Constants.PR_END_INDENT)) != null) { -LengthProperty lengthprop = (LengthProperty)prop; - -Float f = new Float(lengthprop.getLength().getValue() / 1000f); -String sValue = f.toString() + "pt"; - -attrib.set(RtfText.LEFT_INDENT_BODY, -(int) FoUnitsConverter.getInstance().convertToTwips(sValue)); -} else { -if (iStartIndentInTwips >= 360) { -//if the start indent is greater than default, set to the start indent -attrib.set(RtfText.LEFT_INDENT_BODY, iStartIndentInTwips); -} else { -//else set to default -attrib.set(RtfText.LEFT_INDENT_BODY, 360); -} -} +attrib.set(RtfListTable.LIST_INDENT, +fobj.getProperty(Constants.PR_START_INDENT).getLength()); +attrib.set(RtfText.LEFT_INDENT_BODY, +fobj.getProperty(Constants.PR_END_INDENT).getLength()); /* * set list table defaults - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/render/rtf FOPRtfAttributes.java
bckfnn 2004/10/01 02:05:23 Added: src/java/org/apache/fop/render/rtf FOPRtfAttributes.java Log: Helper class which supports FOP datatypes as values. Revision ChangesPath 1.1 xml-fop/src/java/org/apache/fop/render/rtf/FOPRtfAttributes.java Index: FOPRtfAttributes.java === /* * Copyright 1999-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* $Id: FOPRtfAttributes.java,v 1.1 2004/10/01 09:05:23 bckfnn Exp $ */ package org.apache.fop.render.rtf; import org.apache.fop.datatypes.ColorType; import org.apache.fop.datatypes.Length; import org.apache.fop.fo.properties.ColorTypeProperty; import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfAttributes; import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfColorTable; /** * A RtfAttributes subclass that adds some helper set methods. */ public class FOPRtfAttributes extends RtfAttributes { /** * Set an attribute that has a Length value * @param name name of attribute * @param value value of attribute * @return this (which now contains the new entry) */ public RtfAttributes set(String name, Length value) { set(name, value.getValue() / (1000 / 20)); return this; } public RtfAttributes set(String name, ColorType color) { int redComponent = ColorTypeProperty.convertChannelToInteger (color.getRed()); int greenComponent = ColorTypeProperty.convertChannelToInteger (color.getGreen()); int blueComponent = ColorTypeProperty.convertChannelToInteger (color.getBlue()); set(name, RtfColorTable.getInstance().getColorNumber( redComponent,greenComponent, blueComponent).intValue()); return this; } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/render/rtf RTFHandler.java TextAttributesConverter.java
bckfnn 2004/10/01 02:03:35 Modified:src/java/org/apache/fop/render/rtf RTFHandler.java TextAttributesConverter.java Log: Initial support for fo:blockcontainer. Revision ChangesPath 1.34 +61 -1 xml-fop/src/java/org/apache/fop/render/rtf/RTFHandler.java Index: RTFHandler.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/rtf/RTFHandler.java,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- RTFHandler.java 1 Oct 2004 08:58:52 - 1.33 +++ RTFHandler.java 1 Oct 2004 09:03:35 - 1.34 @@ -32,6 +32,7 @@ import org.apache.fop.fo.FObj; import org.apache.fop.fo.flow.BasicLink; import org.apache.fop.fo.flow.Block; +import org.apache.fop.fo.flow.BlockContainer; import org.apache.fop.fo.flow.Character; import org.apache.fop.fo.flow.ExternalGraphic; import org.apache.fop.fo.flow.Footnote; @@ -374,6 +375,65 @@ return; } +if(bDefer) { +return; +} + +try { +IRtfTextrunContainer container += (IRtfTextrunContainer)builderContext.getContainer( +IRtfTextrunContainer.class, +true, this); + +RtfTextrun textrun = container.getTextrun(); + +textrun.addParagraphBreak(); +textrun.popAttributes(); + +} catch (IOException ioe) { +log.error("startBlock:" + ioe.getMessage()); +throw new RuntimeException(ioe.getMessage()); +} catch (Exception e) { +log.error("startBlock:" + e.getMessage()); +throw new RuntimeException(e.getMessage()); +} +} + +/** + * @see org.apache.fop.fo.FOEventHandler#startBlockContainer(BlockContainer) + */ +public void startBlockContainer(BlockContainer blc) { +if (bDefer) { +return; +} + +try { +RtfAttributes rtfAttr += TextAttributesConverter.convertBlockContainerAttributes(blc); + +IRtfTextrunContainer container += (IRtfTextrunContainer)builderContext.getContainer( +IRtfTextrunContainer.class, +true, this); + +RtfTextrun textrun = container.getTextrun(); + +textrun.addParagraphBreak(); +textrun.pushAttributes(rtfAttr); +} catch (IOException ioe) { +// TODO could we throw Exception in all FOEventHandler events? +log.error("startBlock: " + ioe.getMessage()); +throw new RuntimeException("IOException: " + ioe); +} catch (Exception e) { +log.error("startBlock: " + e.getMessage()); +throw new RuntimeException("Exception: " + e); +} +} + +/** + * @see org.apache.fop.fo.FOEventHandler#endBlockContainer(BlockContainer) + */ +public void endBlockContainer(BlockContainer bl) { if(bDefer) { return; } 1.16 +23 -1 xml-fop/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java Index: TextAttributesConverter.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- TextAttributesConverter.java 30 Aug 2004 12:00:54 - 1.15 +++ TextAttributesConverter.java 1 Oct 2004 09:03:35 - 1.16 @@ -75,6 +75,28 @@ } /** + * Converts all known text FO properties to RtfAttributes + * @param props list of FO properites, which are to be converted + */ +public static RtfAttributes convertBlockContainerAttributes(FObj fobj) +throws FOPException { +RtfAttributes attrib = new RtfAttributes(); +attrBlockFontFamily(fobj, attrib); +attrBlockFontWeight(fobj, attrib); +attrBlockFontSize(fobj, attrib); +attrBlockFontColor(fobj, attrib); +attrBlockFontItalic(fobj, attrib); +attrBlockFontUnderline(fobj, attrib); +attrBlockBackgroundColor(fobj, attrib); +attrBlockSpaceBeforeAfter(fobj, attrib); +attrBlockMargins(fobj, attrib); +attrBlockTextAlign(fobj, attrib); +//attrBlockDimension(fobj, attrib); + +return attrib; +} + +/** * Converts all character related FO properties to RtfAttributes.
cvs commit: xml-fop/src/java/org/apache/fop/render/rtf RTFHandler.java
bckfnn 2004/10/01 01:58:52 Modified:src/java/org/apache/fop/render/rtf RTFHandler.java Log: Support fo:character. Revision ChangesPath 1.33 +38 -1 xml-fop/src/java/org/apache/fop/render/rtf/RTFHandler.java Index: RTFHandler.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/rtf/RTFHandler.java,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- RTFHandler.java 6 Sep 2004 18:44:33 - 1.32 +++ RTFHandler.java 1 Oct 2004 08:58:52 - 1.33 @@ -32,6 +32,7 @@ import org.apache.fop.fo.FObj; import org.apache.fop.fo.flow.BasicLink; import org.apache.fop.fo.flow.Block; +import org.apache.fop.fo.flow.Character; import org.apache.fop.fo.flow.ExternalGraphic; import org.apache.fop.fo.flow.Footnote; import org.apache.fop.fo.flow.FootnoteBody; @@ -1067,6 +1068,37 @@ } /** + * @see org.apache.fop.fo.FOEventHandler#character(Character) + */ +public void character(Character c) { +if (bDefer) { +return; +} + +try { +RtfAttributes rtfAttr= +TextAttributesConverter.convertCharacterAttributes(c); + +IRtfTextrunContainer container += (IRtfTextrunContainer)builderContext.getContainer( +IRtfTextrunContainer.class, true, this); + +RtfTextrun textrun = container.getTextrun(); + +textrun.pushAttributes(rtfAttr); +textrun.addString(c.getPropString(Constants.PR_CHARACTER)); +textrun.popAttributes(); + } catch (IOException ioe) { +// FIXME could we throw Exception in all FOEventHandler events? +log.error("character: " + ioe.getMessage()); +throw new RuntimeException(ioe.getMessage()); +} catch (Exception e) { +log.error("character:" + e.getMessage()); +throw new RuntimeException(e.getMessage()); +} +} + +/** * @see org.apache.fop.fo.FOEventHandler#characters(char[], int, int) */ public void characters(char[] data, int start, int length) { @@ -1153,6 +1185,11 @@ if (bStart) { FOText text = (FOText) fobj; characters(text.ca, text.startIndex, text.endIndex); +} +} else if (fobj instanceof Character) { +if (bStart) { +Character c = (Character) fobj; +character(c); } } else if (fobj instanceof BasicLink) { if (bStart) { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc RtfList.java
bckfnn 2004/10/01 01:52:23 Modified:src/java/org/apache/fop/render/rtf/rtflib/rtfdoc RtfList.java Log: Make the rtf output a little less random and thus easier to compare between runs. Revision ChangesPath 1.5 +2 -2 xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfList.java Index: RtfList.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfList.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- RtfList.java 17 Jul 2004 13:11:12 - 1.4 +++ RtfList.java 1 Oct 2004 08:52:23 - 1.5 @@ -51,7 +51,7 @@ //random number generator for ids Date runTime = new Date(); -Random listIdGenerator = new Random(runTime.getTime()); +Random listIdGenerator = new Random(0); listId = new Integer(listIdGenerator.nextInt()); listTemplateId = new Integer(listIdGenerator.nextInt()); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc RtfSection.java
bckfnn 2004/10/01 01:51:04 Modified:src/java/org/apache/fop/render/rtf/rtflib/rtfdoc RtfSection.java Log: Write the "sectd" after the page attributes, so the default margins for the section is inherited from the page. Revision ChangesPath 1.3 +2 -2 xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfSection.java Index: RtfSection.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfSection.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- RtfSection.java 27 Feb 2004 17:54:01 - 1.2 +++ RtfSection.java 1 Oct 2004 08:51:04 - 1.3 @@ -181,8 +181,8 @@ * @throws IOException for I/O problems */ protected void writeRtfPrefix() throws IOException { -writeControlWord("sectd"); writeAttributes(attrib, RtfPage.PAGE_ATTR); +writeControlWord("sectd"); } /** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc RtfText.java
bckfnn 2004/10/01 01:48:29 Modified:src/java/org/apache/fop/render/rtf/rtflib/rtfdoc RtfText.java Log: Style: fix indent. Revision ChangesPath 1.4 +42 -43 xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfText.java Index: RtfText.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfText.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- RtfText.java 27 Feb 2004 17:54:01 - 1.3 +++ RtfText.java 1 Oct 2004 08:48:29 - 1.4 @@ -34,18 +34,18 @@ */ public class RtfText extends RtfElement { -// char code for non-breakable space -private static final int CHAR_NBSP = 160; -private static final int CHAR_TAB = 137; -private static final int CHAR_NEW_LINE = 141; -/* these next two variables are used to encode bold formating in the - * raw xml text. Usefull when specific words or phrases are to be bolded - * but their placement and length change. Thus the bold formatting becomes - * part of the data. The same method can be used for implementing other types - * of raw text formatting. - */ -private static final int CHAR_BOLD_START = 130; -private static final int CHAR_BOLD_END = 131; +// char code for non-breakable space +private static final int CHAR_NBSP = 160; +private static final int CHAR_TAB = 137; +private static final int CHAR_NEW_LINE = 141; +/* these next two variables are used to encode bold formating in the + * raw xml text. Usefull when specific words or phrases are to be bolded + * but their placement and length change. Thus the bold formatting becomes + * part of the data. The same method can be used for implementing other types + * of raw text formatting. + */ +private static final int CHAR_BOLD_START = 130; +private static final int CHAR_BOLD_END = 131; /** members */ private String text; @@ -189,40 +189,39 @@ * @throws IOException for I/O problems */ public void writeRtfContent() throws IOException { -writeChars: { - -//these lines were added by Boris Pouderous - if (attr != null) { - writeAttributes(attr, new String[] {RtfText.SPACE_BEFORE}); - writeAttributes(attr, new String[] {RtfText.SPACE_AFTER}); -} +writeChars: { -if (isTab()) { -writeControlWord("tab"); -} else if (isNewLine()) { -break writeChars; -} else if (isBold(true)) { -writeControlWord("b"); -} else if (isBold(false)) { -writeControlWord("b0"); -// TODO not optimal, consecutive RtfText with same attributes -// could be written without group marks -} else { -writeGroupMark(true); -if (attr != null && mustWriteAttributes()) { -writeAttributes(attr, RtfText.ATTR_NAMES); -} -RtfStringConverter.getInstance().writeRtfString(writer, text); -writeGroupMark(false); +//these lines were added by Boris Pouderous +if (attr != null) { +writeAttributes(attr, new String[] {RtfText.SPACE_BEFORE}); +writeAttributes(attr, new String[] {RtfText.SPACE_AFTER}); +} + +if (isTab()) { +writeControlWord("tab"); +} else if (isNewLine()) { +break writeChars; +} else if (isBold(true)) { +writeControlWord("b"); +} else if (isBold(false)) { +writeControlWord("b0"); +// TODO not optimal, consecutive RtfText with same attributes +// could be written without group marks +} else { +writeGroupMark(true); +if (attr != null && mustWriteAttributes()) { +writeAttributes(attr, RtfText.ATTR_NAMES); } - - } +RtfStringConverter.getInstance().writeRtfString(writer, text); +writeGroupMark(false); +} +} } -/** true if our text attributes must be written */ -private boolean mustWriteAttributes() { -return !isEmpty() && !isNbsp(); -} +/** true if our text attributes must be written */
cvs commit: xml-fop/src/java/org/apache/fop/fo/flow BlockContainer.java Character.java
bckfnn 2004/09/30 12:56:24 Modified:src/java/org/apache/fop/fo/flow BlockContainer.java Character.java Log: Fire FOEventandler events. Revision ChangesPath 1.24 +8 -0 xml-fop/src/java/org/apache/fop/fo/flow/BlockContainer.java Index: BlockContainer.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/BlockContainer.java,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- BlockContainer.java 11 Sep 2004 17:11:58 - 1.23 +++ BlockContainer.java 30 Sep 2004 19:56:24 - 1.24 @@ -66,6 +66,14 @@ this.width = getPropLength(PR_WIDTH); this.height = getPropLength(PR_HEIGHT); +getFOEventHandler().startBlockContainer(this); +} + +/** + * @see org.apache.fop.fo.FONode#end + */ +protected void endOfNode() throws SAXParseException { +getFOEventHandler().endBlockContainer(this); } /** 1.21 +9 -0 xml-fop/src/java/org/apache/fop/fo/flow/Character.java Index: Character.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/Character.java,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- Character.java11 Sep 2004 17:11:58 - 1.20 +++ Character.java30 Sep 2004 19:56:24 - 1.21 @@ -22,6 +22,7 @@ import java.util.List; // XML +import org.xml.sax.Attributes; import org.xml.sax.Locator; import org.xml.sax.SAXParseException; @@ -68,6 +69,14 @@ protected void validateChildNode(Locator loc, String nsURI, String localName) throws SAXParseException { invalidChildError(loc, nsURI, localName); +} + +/** + * @see org.apache.fop.fo.FObj#addProperties + */ +protected void addProperties(Attributes attlist) throws SAXParseException { +super.addProperties(attlist); +getFOEventHandler().character(this); } /** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/fo FOEventHandler.java
bckfnn 2004/09/30 12:55:35 Modified:src/java/org/apache/fop/fo FOEventHandler.java Log: Added support for Character and BlockContainer. Revision ChangesPath 1.3 +24 -1 xml-fop/src/java/org/apache/fop/fo/FOEventHandler.java Index: FOEventHandler.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FOEventHandler.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- FOEventHandler.java 7 Sep 2004 20:47:09 - 1.2 +++ FOEventHandler.java 30 Sep 2004 19:55:35 - 1.3 @@ -27,6 +27,8 @@ import org.apache.fop.apps.FOUserAgent; import org.apache.fop.fo.flow.BasicLink; import org.apache.fop.fo.flow.Block; +import org.apache.fop.fo.flow.BlockContainer; +import org.apache.fop.fo.flow.Character; import org.apache.fop.fo.flow.ExternalGraphic; import org.apache.fop.fo.flow.Footnote; import org.apache.fop.fo.flow.FootnoteBody; @@ -194,6 +196,20 @@ } /** +* +* @param bl BlockContainer that is starting. +*/ + public void startBlockContainer(BlockContainer blc) { + } + + /** +* +* @param blc BlockContainer that is ending. +*/ + public void endBlockContainer(BlockContainer blc) { + } + +/** * * @param inl Inline that is starting. */ @@ -452,6 +468,13 @@ * @param l Leader to process. */ public void leader(Leader l) { +} + +/** + * Process a Character. + * @param c Character to process. + */ +public void character(Character c) { } /** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/render/ps PSGenerator.java
bckfnn 2004/09/28 04:04:31 Modified:src/java/org/apache/fop/render/ps PSGenerator.java Log: Emit valid floating point numbers, even when running under a Locale with a decimal point different from '.' Revision ChangesPath 1.7 +5 -3 xml-fop/src/java/org/apache/fop/render/ps/PSGenerator.java Index: PSGenerator.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/ps/PSGenerator.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- PSGenerator.java 22 Jun 2004 18:42:27 - 1.6 +++ PSGenerator.java 28 Sep 2004 11:04:31 - 1.7 @@ -23,7 +23,9 @@ import java.io.IOException; import java.text.DateFormat; import java.text.DecimalFormat; +import java.text.DecimalFormatSymbols; import java.util.Date; +import java.util.Locale; import java.util.Stack; /** @@ -47,9 +49,9 @@ private Stack graphicsStateStack = new Stack(); private PSState currentState; -private DecimalFormat df3 = new DecimalFormat("0.000"); -private DecimalFormat df1 = new DecimalFormat("0.#"); -private DecimalFormat df5 = new DecimalFormat("0.#"); +private DecimalFormat df3 = new DecimalFormat("0.000", new DecimalFormatSymbols(Locale.US)); +private DecimalFormat df1 = new DecimalFormat("0.#", new DecimalFormatSymbols(Locale.US)); +private DecimalFormat df5 = new DecimalFormat("0.#", new DecimalFormatSymbols(Locale.US)); private StringBuffer tempBuffer = new StringBuffer(256); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/tools TestConverter.java
bckfnn 2004/09/28 03:56:18 Modified:src/java/org/apache/fop/tools TestConverter.java Log: Support -ps output option. Revision ChangesPath 1.23 +4 -0 xml-fop/src/java/org/apache/fop/tools/TestConverter.java Index: TestConverter.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/tools/TestConverter.java,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- TestConverter.java27 Sep 2004 07:42:27 - 1.22 +++ TestConverter.java28 Sep 2004 10:56:18 - 1.23 @@ -105,6 +105,8 @@ tc.setRenderType(Fop.RENDER_PDF); } else if (args[count].equals("-rtf")) { tc.setRenderType(Fop.RENDER_RTF); +} else if (args[count].equals("-ps")) { +tc.setRenderType(Fop.RENDER_PS); } else if (args[count].equals("-d")) { tc.setDebug(true); } else if (args[count].equals("-b")) { @@ -348,6 +350,8 @@ return ".pdf"; } else if (renderType == Fop.RENDER_RTF) { return ".rtf"; +} else if (renderType == Fop.RENDER_PS) { + return ".ps"; } else { return ".at.xml"; } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/fo FOTreeBuilder.java
bckfnn 2004/09/24 03:31:22 Modified:src/java/org/apache/fop/apps FOUserAgent.java src/java/org/apache/fop/fo FOTreeBuilder.java Log: Moved from element mapping class names to element mapping objects. This solves a potential problem where Class.forName() can't load the element mapping class because the element mapping is only available in a classloader below the one that loaded fop.jar. Revision ChangesPath 1.17 +4 -3 xml-fop/src/java/org/apache/fop/apps/FOUserAgent.java Index: FOUserAgent.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/apps/FOUserAgent.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- FOUserAgent.java 11 Sep 2004 17:10:46 - 1.16 +++ FOUserAgent.java 24 Sep 2004 10:31:22 - 1.17 @@ -35,6 +35,7 @@ import org.apache.commons.logging.LogFactory; // FOP +import org.apache.fop.fo.ElementMapping; import org.apache.fop.pdf.PDFEncryptionParams; import org.apache.fop.render.Renderer; @@ -113,11 +114,11 @@ * Add the element mapping with the given class name. * @param mappingClassName the class name representing the element mapping. */ -public void addElementMapping(String mappingClassName) { +public void addElementMapping(ElementMapping elementMapping) { if (additionalElementMappings == null) { additionalElementMappings = new ArrayList(); } -additionalElementMappings.add(mappingClassName); +additionalElementMappings.add(elementMapping); } /** 1.53 +1 -1 xml-fop/src/java/org/apache/fop/fo/FOTreeBuilder.java Index: FOTreeBuilder.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FOTreeBuilder.java,v retrieving revision 1.52 retrieving revision 1.53 diff -u -r1.52 -r1.53 --- FOTreeBuilder.java17 Sep 2004 21:27:36 - 1.52 +++ FOTreeBuilder.java24 Sep 2004 10:31:22 - 1.53 @@ -130,7 +130,7 @@ if (addlEMs != null) { for (int i = 0; i < addlEMs.size(); i++) { -addElementMapping((String) addlEMs.get(i)); +addElementMapping((ElementMapping) addlEMs.get(i)); } } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/render/pdf PDFRenderer.java
bckfnn 2004/09/24 02:10:27 Modified:src/java/org/apache/fop/render/pdf PDFRenderer.java Log: Support url(...) function in image source. Revision ChangesPath 1.54 +1 -0 xml-fop/src/java/org/apache/fop/render/pdf/PDFRenderer.java Index: PDFRenderer.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/pdf/PDFRenderer.java,v retrieving revision 1.53 retrieving revision 1.54 diff -u -r1.53 -r1.54 --- PDFRenderer.java 24 Sep 2004 09:07:52 - 1.53 +++ PDFRenderer.java 24 Sep 2004 09:10:26 - 1.54 @@ -1093,6 +1093,7 @@ return; } +url = ImageFactory.getURL(url); ImageFactory fact = ImageFactory.getInstance(); FopImage fopimage = fact.getImage(url, userAgent); if (fopimage == null) { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/render/pdf PDFRenderer.java
bckfnn 2004/09/24 02:07:53 Modified:src/java/org/apache/fop/render/pdf PDFRenderer.java Log: Style: fix indent. Revision ChangesPath 1.53 +6 -6 xml-fop/src/java/org/apache/fop/render/pdf/PDFRenderer.java Index: PDFRenderer.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/pdf/PDFRenderer.java,v retrieving revision 1.52 retrieving revision 1.53 diff -u -r1.52 -r1.53 --- PDFRenderer.java 23 Sep 2004 13:56:27 - 1.52 +++ PDFRenderer.java 24 Sep 2004 09:07:52 - 1.53 @@ -864,12 +864,12 @@ prevWordY = bl; textOpen = true; } else { -closeText(); +closeText(); -pdf.append("1 0 0 -1 " + (rx / 1000f) + " " + (bl / 1000f) + " Tm " +pdf.append("1 0 0 -1 " + (rx / 1000f) + " " + (bl / 1000f) + " Tm " + (ch.getTextLetterSpaceAdjust() / 1000f) + " Tc " + (ch.getTextWordSpaceAdjust() / 1000f) + " Tw [" + startText); -textOpen = true; +textOpen = true; } prevWordWidth = ch.getIPD(); prevWordX = rx; @@ -936,12 +936,12 @@ prevWordY = bl; textOpen = true; } else { -closeText(); +closeText(); -pdf.append("1 0 0 -1 " + (rx / 1000f) + " " + (bl / 1000f) + " Tm " +pdf.append("1 0 0 -1 " + (rx / 1000f) + " " + (bl / 1000f) + " Tm " + (text.getTextLetterSpaceAdjust() / 1000f) + " Tc " + (text.getTextWordSpaceAdjust() / 1000f) + " Tw [" + startText); -textOpen = true; +textOpen = true; } prevWordWidth = text.getIPD(); prevWordX = rx; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]