Package kameleon.document

Examples of kameleon.document.Paragraph


   * @throws  KameleonException
   *       if there was an error while generating the file
   */
  public void generate() throws KameleonException {
    //System.out.println("Generator.generate()");
    Paragraph previous = null ;
    Iterator<Paragraph> iter = this.document.iterator() ;
    boolean hasNext = true;
    /* The document is empty. */
    if (!iter.hasNext()) {
      return ;
    }// if
    /* The document has at least one Paragraph */
    Paragraph p = iter.next() ;
    while (hasNext) {
      try {
        Method methode = Generator.class.getDeclaredMethod(
            GENERATE_FUNC, p.getClass()) ;
        methode.invoke(this, p) ;
        previous = p ;
        hasNext = iter.hasNext();
        if (hasNext) {
          p = iter.next() ;
View Full Code Here


    refactorParagraphs(d.getParagraphs()) ;
  }// removeEmptyParagraphs(Document)

  protected static void refactorParagraphs(Paragraphs paragraphs) {
    for(Iterator<Paragraph> iter=paragraphs.iterator(); iter.hasNext(); ) {
      Paragraph p = iter.next() ;
      if (p instanceof TextParagraph) {
        TextParagraph tp = (TextParagraph) p ;
        if (tp.getCount() == 0) {
          iter.remove() ;
        } else {
View Full Code Here

        Row firstRow = array.iterator().next() ;
        boolean isHeaderRow = true ;
        for(Iterator<Cell> iter = firstRow.iterator(); iter.hasNext() && isHeaderRow; ) {
          Cell cell = iter.next() ;
          for(Iterator<Paragraph> cellIter = cell.iterator(); cellIter.hasNext() && isHeaderRow; ) {
            Paragraph paragraph = cellIter.next() ;
            if (paragraph instanceof TextParagraph) {
              TextParagraph tp = (TextParagraph) paragraph ;
              for(Iterator<TextParagraphElement> tpIter = tp.iterator(); tpIter.hasNext() && isHeaderRow; ) {
                TextParagraphElement element = tpIter.next() ;
                try {
View Full Code Here

TOP

Related Classes of kameleon.document.Paragraph

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.