CVS: jfor/src/org/jfor/jfor/rtflib/rtfdoc IRtfParagraphKeepTogetherContainer.java,NONE,1.1 RtfParagraphKeepTogether.java,NONE,1.1 IRtfParagraphContainer.java,1.2,1.3 RtfParagraph.java,1.8,1.9 RtfSection.java,1.6,1.7 RtfTable.java,1.5,1.6 IRtfJforCmdContainer.java,1.1,NONE RtfJforCmd.java,1.1,NONE RtfParagraphKeepWithNext.java,1.2,NONE RtfTableRowKeepWith.java,1.2,NONE
Marra Roberto <[email protected]> Mon, 01 Jul 2002 06:26:43 -0700
| Newsgroups | gmane.text.xml.jfor.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/jfor/jfor/src/org/jfor/jfor/rtflib/rtfdoc In directory usw-pr-cvs1:/tmp/cvs-serv30419 Modified Files: IRtfParagraphContainer.java RtfParagraph.java RtfSection.java RtfTable.java Added Files: IRtfParagraphKeepTogetherContainer.java RtfParagraphKeepTogether.java Removed Files: IRtfJforCmdContainer.java RtfJforCmd.java RtfParagraphKeepWithNext.java RtfTableRowKeepWith.java Log Message: V0.6.5 jfor-cmd removed, ParagraphKeepTogether implemented using standard FO "keep-together" element attribute. --- NEW FILE: IRtfParagraphKeepTogetherContainer.java --- package org.jfor.jfor.rtflib.rtfdoc; import java.io.IOException; /*----------------------------------------------------------------------------- * jfor - Open-Source XSL-FO to RTF converter - see www.jfor.org * * The contents of this file are subject to the Mozilla Public * License Version 1.1 (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.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or * implied. See the License for the specific language governing * rights and limitations under the License. * * The Original Code is the contents of this java source file, as distributed * on www.sourceforge.net/projects/jfor and/or www.jfor.org. * * The Initial Developer of the Original Code is Bertrand Delacrétaz, * codeconsult, Cugy/Lausanne, Switzerland [email protected]. * Portions created by Bertrand Delacrétaz are Copyright (C) 2001 codeconsult, * Bertrand Delacrétaz. All Rights Reserved. * * Contributor(s): -----------------------------------------------------------------------------*/ public interface IRtfParagraphKeepTogetherContainer { /** close current paragraph if any and start a new one */ public RtfParagraphKeepTogether newParagraphKeepTogether() throws IOException; } --- NEW FILE: RtfParagraphKeepTogether.java --- package org.jfor.jfor.rtflib.rtfdoc; import java.io.Writer; import java.io.*; import java.util.*; import java.io.IOException; /*----------------------------------------------------------------------------- * jfor - Open-Source XSL-FO to RTF converter - see www.jfor.org * * The contents of this file are subject to the Mozilla Public * License Version 1.1 (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.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or * implied. See the License for the specific language governing * rights and limitations under the License. * * The Original Code is the contents of this java source file, as distributed * on www.sourceforge.net/projects/jfor and/or www.jfor.org. * * The Initial Developer of the Original Code is Bertrand Delacrétaz, * codeconsult, Cugy/Lausanne, Switzerland [email protected]. * Portions created by Bertrand Delacrétaz are Copyright (C) 2001 codeconsult, * Bertrand Delacrétaz. All Rights Reserved. * * Contributor(s): -----------------------------------------------------------------------------*/ public class RtfParagraphKeepTogether extends RtfContainer{ public static final int STATUS_NULL=0; public static final int STATUS_OPEN_PARAGRAPH=1; public static final int STATUS_CLOSE_PARAGRAPH=2; private int m_status =STATUS_NULL; /** RtfParagraphKeepTogether*/ RtfParagraphKeepTogether(IRtfParagraphContainer parent, Writer w) throws IOException { super((RtfContainer)parent,w); } protected void writeRtfContent() throws IOException { //First reet paragraph properties // create a new one with keepn if (m_status==STATUS_OPEN_PARAGRAPH) { writeControlWord("pard"); writeControlWord("par"); writeControlWord("keepn"); writeGroupMark(true); m_status = STATUS_NULL; } if (m_status == STATUS_CLOSE_PARAGRAPH) { writeGroupMark(false); m_status = STATUS_NULL; } } public void setStatus(int status) { m_status = status; } /** true if this element would generate no "useful" RTF content */ public boolean isEmpty() { return false; } } Index: IRtfParagraphContainer.java =================================================================== RCS file: /cvsroot/jfor/jfor/src/org/jfor/jfor/rtflib/rtfdoc/IRtfParagraphContainer.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IRtfParagraphContainer.java 31 Aug 2001 07:51:01 -0000 1.2 --- IRtfParagraphContainer.java 1 Jul 2002 13:26:41 -0000 1.3 *************** *** 34,37 **** --- 34,40 ---- // $Id$ // $Log$ + // Revision 1.3 2002/07/01 13:26:41 rmarra + // V0.6.5 jfor-cmd removed, ParagraphKeepTogether implemented using standard FO "keep-together" element attribute. + // // Revision 1.2 2001/08/31 07:51:01 bdelacretaz // MPL license text added + javadoc class comments corrected *************** *** 55,57 **** --- 58,61 ---- /** close current paragraph if any and start a new one with specified attributes */ public RtfParagraph newParagraph(RtfAttributes attr) throws IOException; + } Index: RtfParagraph.java =================================================================== RCS file: /cvsroot/jfor/jfor/src/org/jfor/jfor/rtflib/rtfdoc/RtfParagraph.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** RtfParagraph.java 28 Dec 2001 17:22:25 -0000 1.8 --- RtfParagraph.java 1 Jul 2002 13:26:41 -0000 1.9 *************** *** 38,41 **** --- 38,44 ---- // $Id$ // $Log$ + // Revision 1.9 2002/07/01 13:26:41 rmarra + // V0.6.5 jfor-cmd removed, ParagraphKeepTogether implemented using standard FO "keep-together" element attribute. + // // Revision 1.8 2001/12/28 17:22:25 bdelacretaz // CreateTestDocuments did not work anymore, repaired *************** *** 100,103 **** --- 103,108 ---- private RtfExternalGraphic m_externalGraphic; private RtfPageNumber m_pageNumber; + + /* needed for importing Rtf into FrameMaker FrameMaker is not as forgiving as word in rtf *************** *** 141,144 **** --- 146,150 ---- } + // do not write text attributes here, they are handled // by RtfText *************** *** 148,151 **** --- 154,159 ---- if(mustWriteGroupMark()) writeGroupMark(true); + + if(mustWriteAttributes()) { writeAttributes(m_attrib, new String [] {"cs"}); *************** *** 170,177 **** } if(writeMark) { ! writeControlWord("par"); } if(mustWriteGroupMark()) writeGroupMark(false); } --- 178,187 ---- } if(writeMark) { ! writeControlWord("par"); } if(mustWriteGroupMark()) writeGroupMark(false); + + } *************** *** 207,210 **** --- 217,221 ---- return m_pageNumber; } + /** Creates a new hyperlink. */ Index: RtfSection.java =================================================================== RCS file: /cvsroot/jfor/jfor/src/org/jfor/jfor/rtflib/rtfdoc/RtfSection.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** RtfSection.java 26 Jun 2002 17:41:29 -0000 1.6 --- RtfSection.java 1 Jul 2002 13:26:41 -0000 1.7 *************** *** 38,41 **** --- 38,44 ---- // $Id$ // $Log$ + // Revision 1.7 2002/07/01 13:26:41 rmarra + // V0.6.5 jfor-cmd removed, ParagraphKeepTogether implemented using standard FO "keep-together" element attribute. + // // Revision 1.6 2002/06/26 17:41:29 rmarra // V0.6.4 jfor-cmd implemented *************** *** 69,73 **** public class RtfSection extends RtfContainer ! implements IRtfParagraphContainer,IRtfTableContainer,IRtfListContainer,IRtfExternalGraphicContainer,IRtfBeforeContainer, IRtfJforCmdContainer { private RtfParagraph m_paragraph; --- 72,76 ---- public class RtfSection extends RtfContainer ! implements IRtfParagraphContainer,IRtfTableContainer,IRtfListContainer,IRtfExternalGraphicContainer,IRtfBeforeContainer,IRtfParagraphKeepTogetherContainer { private RtfParagraph m_paragraph; *************** *** 76,81 **** private RtfExternalGraphic m_externalGraphic; private RtfBefore m_before; ! private RtfJforCmd m_jforCmd; ! /** Create an RTF container as a child of given container */ RtfSection(RtfDocumentArea parent, Writer w) throws IOException { --- 79,83 ---- private RtfExternalGraphic m_externalGraphic; private RtfBefore m_before; ! /** Create an RTF container as a child of given container */ RtfSection(RtfDocumentArea parent, Writer w) throws IOException { *************** *** 102,105 **** --- 104,112 ---- } + /** close current paragraph if any and start a new one */ + public RtfParagraphKeepTogether newParagraphKeepTogether() throws IOException { + return new RtfParagraphKeepTogether(this,m_writer); + } + /** start a new table after closing current paragraph, list and table */ public RtfTable newTable() throws IOException { *************** *** 130,138 **** } ! public RtfJforCmd newJforCmd(RtfAttributes attrs) throws IOException { ! m_jforCmd = new RtfJforCmd(this,m_writer,attrs); ! return m_jforCmd; ! } ! /** can be overridden to write RTF prefix code, what comes before our children */ --- 137,141 ---- } ! /** can be overridden to write RTF prefix code, what comes before our children */ *************** *** 143,159 **** /** can be overridden to write RTF suffix code, what comes after our children */ protected void writeRtfSuffix() throws IOException { - checkKeepWithParagraphClosed(); writeControlWord("sect"); } ! /** Check for RtfParagraphKeepWithNext not closed */ ! private void checkKeepWithParagraphClosed() throws IOException { ! if (!RtfParagraphKeepWithNext.isParagraphClosed()) { ! this.getRtfFile ().getLog ().logInfo ("Warning: Paragraph keep-with-next not correctly closed!"); ! RtfParagraphKeepWithNext para = new RtfParagraphKeepWithNext(this,m_writer); ! para.writeRtfEndParagraph(); ! } ! } ! private void closeCurrentTable() throws IOException { if(m_table != null) m_table.close(); --- 146,153 ---- /** can be overridden to write RTF suffix code, what comes after our children */ protected void writeRtfSuffix() throws IOException { writeControlWord("sect"); } ! private void closeCurrentTable() throws IOException { if(m_table != null) m_table.close(); Index: RtfTable.java =================================================================== RCS file: /cvsroot/jfor/jfor/src/org/jfor/jfor/rtflib/rtfdoc/RtfTable.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** RtfTable.java 25 Jun 2002 13:26:55 -0000 1.5 --- RtfTable.java 1 Jul 2002 13:26:41 -0000 1.6 *************** *** 36,39 **** --- 36,42 ---- // $Id$ // $Log$ + // Revision 1.6 2002/07/01 13:26:41 rmarra + // V0.6.5 jfor-cmd removed, ParagraphKeepTogether implemented using standard FO "keep-together" element attribute. + // // Revision 1.5 2002/06/25 13:26:55 rmarra // Keep paragraph with the next paragraph implemented. *************** *** 82,86 **** highestRow++; - newRtfTableRowKeepWith(m_attrib); m_row = new RtfTableRow(this,m_writer,m_attrib,highestRow); return m_row; --- 85,88 ---- *************** *** 101,122 **** if(m_row != null) m_row.close(); highestRow++; ! ! ! newRtfTableRowKeepWith(attr); m_row = new RtfTableRow(this,m_writer,attr,highestRow); return m_row; } ! ! /** ! * Added as child of this table container before a new table row. ! * The RtfTableRowKeepWith class create a new RtfParagraphKeepWithNext oobject with the RTF option "Keep paragraph with the next paragraph" ! * This class process the fo:keep-with-next and fo:keep-with-previous. ! * Because the paragraph can include the next rows, it must be written before the row. ! * The paragraph stay open until a fo:keep-with-previous is reached. ! */ ! private void newRtfTableRowKeepWith(RtfAttributes attrs) throws IOException { ! new RtfTableRowKeepWith(this,m_writer,attrs); ! } /** overridden to write RTF prefix code, what comes before our children */ --- 103,112 ---- if(m_row != null) m_row.close(); highestRow++; ! m_row = new RtfTableRow(this,m_writer,attr,highestRow); return m_row; } ! /** overridden to write RTF prefix code, what comes before our children */ --- IRtfJforCmdContainer.java DELETED --- --- RtfJforCmd.java DELETED --- --- RtfParagraphKeepWithNext.java DELETED --- --- RtfTableRowKeepWith.java DELETED --- ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf