CVS: jfor/src/org/jfor/jfor/converter ParagraphBuilder.java,1.8,1.9 AbstractBuilder.java,1.8,1.9

Marra Roberto <[email protected]> Mon, 23 Sep 2002 06:17:03 -0700
Newsgroups gmane.text.xml.jfor.cvs
Message-ID <[email protected]>
Update of /cvsroot/jfor/jfor/src/org/jfor/jfor/converter
In directory usw-pr-cvs1:/tmp/cvs-serv12334

Modified Files:
	ParagraphBuilder.java AbstractBuilder.java 
Log Message:
Jfor-cmd processing added

Index: ParagraphBuilder.java
===================================================================
RCS file: /cvsroot/jfor/jfor/src/org/jfor/jfor/converter/ParagraphBuilder.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** ParagraphBuilder.java	22 Aug 2002 19:23:51 -0000	1.8
--- ParagraphBuilder.java	23 Sep 2002 13:17:01 -0000	1.9
***************
*** 63,66 ****
--- 63,69 ----
  // $Id$
  // $Log$
+ // Revision 1.9  2002/09/23 13:17:01  rmarra
+ // Jfor-cmd processing added
+ //
  // Revision 1.8  2002/08/22 19:23:51  rmarra
  // keep-together nested blocks added
***************
*** 123,135 ****
      private Attributes m_attrib;
      private RtfParagraph m_para;
!     
  
!  	/** 
!  	 *	Determine if this block contains the attribute keep-together
!      *  If this flag is set all nesteds blocks will be created whith RTF "keepn" attribute  
!      *
!      */
!     private static int m_paraKeepTogetherOpen=0;
!     
      /**
       * Determine if this block is the owner of the keep-together attribute
--- 126,132 ----
      private Attributes m_attrib;
      private RtfParagraph m_para;
!     private ParagraphKeeptogetherContext m_paragraphKeeptogetherContext;
  
!  
      /**
       * Determine if this block is the owner of the keep-together attribute
***************
*** 153,161 ****
  	        throw new Error("unexpected ConverterException in ParagraphBuilder constructor");
  	    }
! 	   
      }
      
     
-     
      /** called by Converter at the start of an element */
      public void start(String rawName, Attributes attrs) throws IOException {
--- 150,158 ----
  	        throw new Error("unexpected ConverterException in ParagraphBuilder constructor");
  	    }
! 	    
! 	    m_paragraphKeeptogetherContext=ParagraphKeeptogetherContext.getInstance();
      }
      
     
      /** called by Converter at the start of an element */
      public void start(String rawName, Attributes attrs) throws IOException {
***************
*** 166,170 ****
          if (attrs.getValue(ATTRIBUTE_FO_KEEP_TOGETHER)!=null) {
          	m_paraKeepOpenOwner=true;
!         	m_paraKeepTogetherOpen++;
          	
          	RtfParagraphKeepTogether paraKeep = startParagraphKeepTogether();
--- 163,170 ----
          if (attrs.getValue(ATTRIBUTE_FO_KEEP_TOGETHER)!=null) {
          	m_paraKeepOpenOwner=true;
!         	
!         	m_paragraphKeeptogetherContext.KeepTogetherOpen();
!         	
!  
          	
          	RtfParagraphKeepTogether paraKeep = startParagraphKeepTogether();
***************
*** 190,195 ****
         		
         		m_paraKeepOpenOwner=false;
!     		m_paraKeepTogetherOpen--;   
      	}	
          
  	    if(m_nestedInto!=null) {
--- 190,196 ----
         		
         		m_paraKeepOpenOwner=false;
!        		m_paragraphKeeptogetherContext.KeepTogetherClose();    	   
      	}	
+     	
          
  	    if(m_nestedInto!=null) {
***************
*** 281,285 ****
  
  		//Test if we are inside a keep-together block
! 		if (!m_paraKeepOpenOwner && m_paraKeepTogetherOpen>0) para.setKeepn();      
          
          // break page if required
--- 282,293 ----
  
  		//Test if we are inside a keep-together block
! 		if (!m_paraKeepOpenOwner && m_paragraphKeeptogetherContext.getKeepTogetherOpenValue()>0) para.setKeepn();
! 	
! 		
! 		//Check if properties must be reseted for next paragraph 
! 		if (m_paragraphKeeptogetherContext.paragraphResetProperties()) {
! 			para.setResetProperties();
! 			m_paragraphKeeptogetherContext.setParagraphResetPropertiesUsed();
! 		}
          
          // break page if required

Index: AbstractBuilder.java
===================================================================
RCS file: /cvsroot/jfor/jfor/src/org/jfor/jfor/converter/AbstractBuilder.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** AbstractBuilder.java	12 Jul 2002 08:08:31 -0000	1.8
--- AbstractBuilder.java	23 Sep 2002 13:17:01 -0000	1.9
***************
*** 60,63 ****
--- 60,66 ----
  // $Id$
  // $Log$
+ // Revision 1.9  2002/09/23 13:17:01  rmarra
+ // Jfor-cmd processing added
+ //
  // Revision 1.8  2002/07/12 08:08:31  bdelacretaz
  // License changed to jfor Apache-style license
***************
*** 101,104 ****
--- 104,108 ----
  implements IBuilder {
      protected final BuilderContext m_context;
+     private  JForCmdProcessor m_jforCmdProcessor=null;
      
      AbstractBuilder(BuilderContext ctx) {
***************
*** 148,157 ****
      /** called by Converter before calling start()   */
      public void preStart(String rawName, Attributes atts) throws IOException {
! 
      }
      
      /** called by Converter after calling end()   */
      public void postEnd() throws IOException {
! 
      }
  }
--- 152,162 ----
      /** called by Converter before calling start()   */
      public void preStart(String rawName, Attributes atts) throws IOException {
!     	m_jforCmdProcessor = new JForCmdProcessor(this);
!     	m_jforCmdProcessor.preStart(rawName,atts);
      }
      
      /** called by Converter after calling end()   */
      public void postEnd() throws IOException {
! 		m_jforCmdProcessor.postEnd();
      }
  }



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf