You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by pb...@apache.org on 2002/10/06 16:15:11 UTC

cvs commit: xml-fop/src/org/apache/fop/fo/pagination FoPageSequenceMaster.java

pbwest      2002/10/06 07:15:11

  Modified:    src/org/apache/fop/fo/pagination Tag: FOP_0-20-0_Alt-Design
                        FoPageSequenceMaster.java
  Log:
  Remove all SubSequenceSpecifier code.
  Removed no-event constructor.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.5   +14 -93    xml-fop/src/org/apache/fop/fo/pagination/Attic/FoPageSequenceMaster.java
  
  Index: FoPageSequenceMaster.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/pagination/Attic/FoPageSequenceMaster.java,v
  retrieving revision 1.1.2.4
  retrieving revision 1.1.2.5
  diff -u -r1.1.2.4 -r1.1.2.5
  --- FoPageSequenceMaster.java	2 Oct 2002 15:19:59 -0000	1.1.2.4
  +++ FoPageSequenceMaster.java	6 Oct 2002 14:15:11 -0000	1.1.2.5
  @@ -20,11 +20,14 @@
   import org.apache.fop.apps.FOPException;
   import org.apache.fop.fo.expr.PropertyException;
   import org.apache.fop.fo.Properties;
  +import org.apache.fop.fo.PropNames;
   import org.apache.fop.fo.FOPropertySets;
   import org.apache.fop.fo.FObjectNames;
   import org.apache.fop.fo.FOTree;
   import org.apache.fop.fo.FONode;
   import org.apache.fop.datastructs.Tree;
  +import org.apache.fop.datatypes.PropertyValue;
  +import org.apache.fop.datatypes.NCName;
   
   /**
    * Implements the fo:page-sequence-master flow object.  These Fos are
  @@ -42,30 +45,19 @@
   
       private ArrayList subSequenceList = new ArrayList(1);
   
  -    public FoPageSequenceMaster
  -        (FOTree foTree, FONode parent, String masterName)
  -        throws Tree.TreeException, FOPException, PropertyException
  -    {
  -        super(foTree, FObjectNames.PAGE_SEQUENCE_MASTER, parent, null,
  -              FOPropertySets.LAYOUT_SET);
  -        this.masterName = masterName;
  -    }
  -
       public FoPageSequenceMaster(FOTree foTree, FONode parent, XMLEvent event)
           throws Tree.TreeException, FOPException, PropertyException
       {
           super(foTree, FObjectNames.PAGE_SEQUENCE_MASTER, parent, event,
  -              FOPropertySets.LAYOUT_SET);
  -        if (event == null) {
  -            System.out.println("Null event; throwing FOPException");
  -            throw new FOPException
  -                    ("Null event passed to FoPageSequenceMaster constructor");
  -        }
  -        try {
  -            masterName = foAttributes.getFoAttrValue("master-name");
  -        } catch (PropertyException e) {
  -            throw new FOPException(e.getMessage());
  -        }
  +                                              FOPropertySets.SEQ_MASTER_SET);
  +        // Check that the property has been set
  +        PropertyValue name = propertySet[PropNames.MASTER_NAME];
  +        if (name == null)
  +            throw new PropertyException("master-name property not set");
  +        if (name.getType() != PropertyValue.NCNAME)
  +            throw new PropertyException
  +                                ("master-name property not an NCName.");
  +        masterName = ((NCName)name).getNCName();
           // Process sequence members here
           LinkedList list = new LinkedList();
           list.add((Object)(new XMLEvent.UriLocalName
  @@ -108,75 +100,4 @@
           return masterName;
       }
   
  -    /**
  -     * <i>SubSequenceSpecifer</i> objects contain the information about an
  -     * individual sub-sequence.  They do <i>not</i> extend <tt>FONode</tt>
  -     * because they are maintained only in the <i>subSequenceList</i> of an
  -     * <tt>FoPageSequenceMaster</tt> object.
  -     * <p>When created from <i>fo:single-page-master-reference</i>,
  -     * <i>fo:repeatable-page-master-reference</i> or
  -     * <i>fo:repeatable-page-master-alternatives</i> and
  -     * <i>fo:conditional-page-master-reference</i>s, the attributes on those
  -     * nodes are merged into the attributes of the parent
  -     * <tt>FoPageSequenceMaster</tt> object, so that they will be available
  -     * to any children of this node, both
  -     * during the parsing of the fo input and during the page construction
  -     * process.
  -     * <p>Note that there is some ambiguity about the place of properties
  -     * defined on the members of the <i>layout-master-set</i> subtree.  Do
  -     * these properties participate in the properties environment of
  -     * elements in page-sequence subtrees?
  -     */
  -    public class SubSequenceSpecifier {
  -        public static final int UNBOUNDED = -1;
  -        private int minRepeats = 1;
  -        private int maxRepeats = UNBOUNDED;
  -        private ArrayList conditionals = new ArrayList(1);
  -
  -        public SubSequenceSpecifier() {
  -            // Insert the SSS into the parent FoPageSequenceMaster's
  -            // list
  -            FoPageSequenceMaster.this.subSequenceList.add(this);
  -        }
  -
  -        public SubSequenceSpecifier(int maxRepeats) {
  -            this();
  -            minRepeats = 0;
  -            this.maxRepeats = maxRepeats;
  -        }
  -
  -        public SubSequenceSpecifier(int minRepeats, int maxRepeats) {
  -            this(maxRepeats);
  -            this.minRepeats = minRepeats;
  -        }
  -
  -        /**
  -         * <i>ConditionalPageMasterReference</i> objects implement the
  -         * corresponding flow object.  The encode a set of conditions in
  -         * the indicated master-reference (to a
  -         * <tt>SimplePageMasterReference</tt>) will be activated.
  -         */
  -        public class ConditionalPageMasterReference {
  -            private String masterReference = "";
  -            private int pagePosition = Properties.PagePosition.ANY;
  -            private int oddOrEven = Properties.OddOrEven.ANY;
  -            private int blankOrNotBlank = Properties.BlankOrNotBlank.ANY;
  -
  -            public ConditionalPageMasterReference(String masterReference) {
  -                // Insert into including SubSequenceSpecifier's
  -                // conditionals list
  -                SubSequenceSpecifier.this.conditionals.add(this);
  -                this.masterReference = masterReference;
  -            }
  -
  -            public ConditionalPageMasterReference
  -                (String masterReference, int pagePosition,
  -                 int oddOrEven, int blankOrNotBlank) {
  -                this(masterReference);
  -                this.pagePosition = pagePosition;
  -                this.oddOrEven = oddOrEven;
  -                this.blankOrNotBlank = blankOrNotBlank;
  -            }
  -        }
  -    }
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-cvs-help@xml.apache.org