gmazza      2004/08/21 12:48:00

  Modified:    src/java/org/apache/fop/fo/flow Character.java
                        ExternalGraphic.java MultiCase.java
                        MultiProperties.java PageNumberCitation.java
                        RetrieveMarker.java
               src/java/org/apache/fop/fo/pagination PageSequence.java
                        PageSequenceMaster.java
                        RepeatablePageMasterReference.java
               src/java/org/apache/fop/layoutmgr
                        ExternalGraphicLayoutManager.java
               src/java/org/apache/fop/render/mif MIFHandler.java
  Log:
  1.) validateChildNode() implemented for fo:multi-properties.
  
  2.) fo:multi-properties disconnected from ToBeImplementedElement.
  
  3.) increased usage of FObj.getPropString() throughout application.
  
  Revision  Changes    Path
  1.18      +1 -1      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.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- Character.java    13 Aug 2004 12:29:51 -0000      1.17
  +++ Character.java    21 Aug 2004 19:47:59 -0000      1.18
  @@ -83,7 +83,7 @@
        * @see org.apache.fop.fo.FObj#addLayoutManager(List)
        */
       public void addLayoutManager(List list) {         
  -        String str = getProperty(PR_CHARACTER).getString();
  +        String str = getPropString(PR_CHARACTER);
           if (str.length() == 1) {
               CharacterLayoutManager lm = new CharacterLayoutManager(this);
               list.add(lm);
  
  
  
  1.40      +1 -7      xml-fop/src/java/org/apache/fop/fo/flow/ExternalGraphic.java
  
  Index: ExternalGraphic.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/ExternalGraphic.java,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- ExternalGraphic.java      18 Aug 2004 03:26:36 -0000      1.39
  +++ ExternalGraphic.java      21 Aug 2004 19:47:59 -0000      1.40
  @@ -37,7 +37,6 @@
    * inline area that can be added to the area tree.
    */
   public class ExternalGraphic extends FObj {
  -    private String url;
   
       /**
        * Create a new External graphic node.
  @@ -63,19 +62,14 @@
        */
       protected void addProperties(Attributes attlist) throws SAXParseException {
           super.addProperties(attlist);
  -        url = this.propertyList.get(PR_SRC).getString();
           getFOInputHandler().image(this);
       }
   
  -    public String getURL() {
  -        return url;
  -    }
  -
       /**
        * @see org.apache.fop.fo.FObj#addLayoutManager(List)
        */
       public void addLayoutManager(List list) {
  -        if (getURL() != null) {
  +        if (getPropString(PR_SRC) != null) {
               ExternalGraphicLayoutManager lm = new 
ExternalGraphicLayoutManager(this);
               list.add(lm);
           }
  
  
  
  1.13      +3 -0      xml-fop/src/java/org/apache/fop/fo/flow/MultiCase.java
  
  Index: MultiCase.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/MultiCase.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- MultiCase.java    11 Aug 2004 04:15:25 -0000      1.12
  +++ MultiCase.java    21 Aug 2004 19:48:00 -0000      1.13
  @@ -35,6 +35,9 @@
           super(parent);
       }
   
  +    /**
  +     * @see org.apache.fop.fo.FObj#getName()
  +     */
       public String getName() {
           return "fo:multi-case";
       }
  
  
  
  1.12      +55 -2     xml-fop/src/java/org/apache/fop/fo/flow/MultiProperties.java
  
  Index: MultiProperties.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/MultiProperties.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- MultiProperties.java      11 Aug 2004 04:15:25 -0000      1.11
  +++ MultiProperties.java      21 Aug 2004 19:48:00 -0000      1.12
  @@ -18,23 +18,76 @@
   
   package org.apache.fop.fo.flow;
   
  +// XML
  +import org.xml.sax.Attributes;
  +import org.xml.sax.Locator;
  +import org.xml.sax.SAXParseException;
  +
   // FOP
   import org.apache.fop.fo.FONode;
  -import org.apache.fop.fo.ToBeImplementedElement;
  +import org.apache.fop.fo.FObj;
   
   /**
    * Class modelling the fo:multi-properties object. See Sec. 6.9.6 of the XSL-FO
    * Standard.
    */
  -public class MultiProperties extends ToBeImplementedElement {
  +public class MultiProperties extends FObj {
  +
  +    static boolean notImplementedWarningGiven = false;
  +
  +    // used for input FO validation
  +    boolean hasMultiPropertySet = false;
  +    boolean hasWrapper = false;
   
       /**
        * @param parent FONode that is the parent of this object
        */
       public MultiProperties(FONode parent) {
           super(parent);
  +
  +        if (!notImplementedWarningGiven) {
  +            getLogger().warn("fo:multi-properties is not yet implemented.");
  +            notImplementedWarningGiven = true;
  +        }
  +    }
  +
  +    /**
  +     * @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String)
  +     * XSL Content Model: (multi-property-set+, wrapper)
  +     */
  +    protected void validateChildNode(Locator loc, String nsURI, String localName) 
  +        throws SAXParseException {
  +            if (nsURI == FO_URI && localName.equals("multi-property-set")) {
  +                if (hasWrapper) {
  +                    nodesOutOfOrderError(loc, "fo:multi-property-set", 
"fo:wrapper");
  +                } else {
  +                    hasMultiPropertySet = true;
  +                }
  +            } else if (nsURI == FO_URI && localName.equals("wrapper")) {
  +                if (hasWrapper) {
  +                    tooManyNodesError(loc, "fo:wrapper");
  +                } else {
  +                    hasWrapper = true;
  +                }
  +            } else {
  +                invalidChildError(loc, nsURI, localName);
  +            }
       }
   
  +    /**
  +     * Make sure content model satisfied, if so then tell the
  +     * FOInputHandler that we are at the end of the flow.
  +     * @see org.apache.fop.fo.FONode#end
  +     */
  +    protected void endOfNode() throws SAXParseException {
  +        if (!hasMultiPropertySet || !hasWrapper) {
  +            missingChildElementError("(multi-property-set+, wrapper)");
  +        }
  +    }
  +
  +    /**
  +     * @see org.apache.fop.fo.FObj#getName()
  +     */
       public String getName() {
           return "fo:multi-properties";
       }
  
  
  
  1.33      +1 -1      xml-fop/src/java/org/apache/fop/fo/flow/PageNumberCitation.java
  
  Index: PageNumberCitation.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/PageNumberCitation.java,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- PageNumberCitation.java   11 Aug 2004 04:15:26 -0000      1.32
  +++ PageNumberCitation.java   21 Aug 2004 19:48:00 -0000      1.33
  @@ -81,7 +81,7 @@
           this.blue = c.getBlue();
   
           this.wrapOption = this.propertyList.get(PR_WRAP_OPTION).getEnum();
  -        this.refId = this.propertyList.get(PR_REF_ID).getString();
  +        this.refId = getPropString(PR_REF_ID);
   
           if (this.refId.equals("")) {
               //throw new FOPException("page-number-citation must contain 
\"ref-id\"");
  
  
  
  1.16      +1 -2      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.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- RetrieveMarker.java       10 Aug 2004 05:33:15 -0000      1.15
  +++ RetrieveMarker.java       21 Aug 2004 19:48:00 -0000      1.16
  @@ -57,8 +57,7 @@
        */
       protected void addProperties(Attributes attlist) throws SAXParseException {
           super.addProperties(attlist);
  -        this.retrieveClassName =
  -            this.propertyList.get(PR_RETRIEVE_CLASS_NAME).getString();
  +        this.retrieveClassName = getPropString(PR_RETRIEVE_CLASS_NAME);
           this.retrievePosition =
               this.propertyList.get(PR_RETRIEVE_POSITION).getEnum();
           this.retrieveBoundary =
  
  
  
  1.38      +2 -2      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.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- PageSequence.java 11 Aug 2004 04:15:28 -0000      1.37
  +++ PageSequence.java 21 Aug 2004 19:48:00 -0000      1.38
  @@ -242,7 +242,7 @@
   
           // we are now on the first page of the page sequence
           thisIsFirstPage = true;
  -        ipnValue = this.propertyList.get(PR_INITIAL_PAGE_NUMBER).getString();
  +        ipnValue = getPropString(PR_INITIAL_PAGE_NUMBER);
   
           if (ipnValue.equals("auto")) {
               pageNumberType = AUTO;
  @@ -261,7 +261,7 @@
               }
           }
   
  -        String masterName = this.propertyList.get(PR_MASTER_REFERENCE).getString();
  +        String masterName = getPropString(PR_MASTER_REFERENCE);
           this.simplePageMaster =
                   this.layoutMasterSet.getSimplePageMaster(masterName);
           if (this.simplePageMaster == null) {
  
  
  
  1.19      +1 -1      
xml-fop/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java
  
  Index: PageSequenceMaster.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- PageSequenceMaster.java   8 Aug 2004 18:39:25 -0000       1.18
  +++ PageSequenceMaster.java   21 Aug 2004 19:48:00 -0000      1.19
  @@ -95,7 +95,7 @@
           subSequenceSpecifiers = new java.util.ArrayList();
           if (parent.getName().equals("fo:layout-master-set")) {
               this.layoutMasterSet = (LayoutMasterSet)parent;
  -            masterName = 
this.propertyList.get(Constants.PR_MASTER_NAME).getString();
  +            masterName = getPropString(PR_MASTER_NAME);
               if (masterName == null) {
                   getLogger().warn("page-sequence-master does not have "
                                          + "a master-name and so is being ignored");
  
  
  
  1.15      +1 -1      
xml-fop/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java
  
  Index: RepeatablePageMasterReference.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- RepeatablePageMasterReference.java        8 Aug 2004 18:39:25 -0000       1.14
  +++ RepeatablePageMasterReference.java        21 Aug 2004 19:48:00 -0000      1.15
  @@ -62,7 +62,7 @@
        */
       protected void addProperties(Attributes attlist) throws SAXParseException {
           super.addProperties(attlist);
  -        String mr = getProperty(PR_MAXIMUM_REPEATS).getString();
  +        String mr = getPropString(PR_MAXIMUM_REPEATS);
           if (mr.equals("no-limit")) {
               this.maximumRepeats = INFINITE;
           } else {
  
  
  
  1.3       +3 -3      
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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ExternalGraphicLayoutManager.java 13 Aug 2004 00:03:49 -0000      1.2
  +++ ExternalGraphicLayoutManager.java 21 Aug 2004 19:48:00 -0000      1.3
  @@ -74,7 +74,7 @@
        * @todo see if can simplify property handling logic
        */
       private void setup() {
  -        url = ImageFactory.getURL(graphic.getURL());
  +        url = ImageFactory.getURL(graphic.getPropString(PR_SRC));
   
           // assume lr-tb for now and just use the .optimum value of the range
           Length ipd = graphic.getPropertyList().get(PR_INLINE_PROGRESSION_DIMENSION).
  @@ -215,7 +215,7 @@
         * @return the viewport containing the image area
         */
        public InlineArea getExternalGraphicInlineArea() {
  -         Image imArea = new Image(graphic.getURL());
  +         Image imArea = new Image(graphic.getPropString(PR_SRC));
            Viewport vp = new Viewport(imArea);
            vp.setWidth(viewWidth);
            vp.setHeight(viewHeight);
  
  
  
  1.11      +2 -2      xml-fop/src/java/org/apache/fop/render/mif/MIFHandler.java
  
  Index: MIFHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/mif/MIFHandler.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- MIFHandler.java   19 Jun 2004 13:35:33 -0000      1.10
  +++ MIFHandler.java   21 Aug 2004 19:48:00 -0000      1.11
  @@ -115,7 +115,7 @@
       public void startPageSequence(PageSequence pageSeq) {
           // get the layout master set
           // setup the pages for this sequence
  -        String name = 
pageSeq.getProperty(Constants.PR_MASTER_REFERENCE).getString();
  +        String name = pageSeq.getPropString(Constants.PR_MASTER_REFERENCE);
           SimplePageMaster spm = 
pageSeq.getLayoutMasterSet().getSimplePageMaster(name);
           if (spm == null) {
               PageSequenceMaster psm = 
pageSeq.getLayoutMasterSet().getPageSequenceMaster(name);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to