CVS: jfor/src/org/jfor/jfor/converter JForCmdProcessor.java,NONE,1.1 JforCmdAttributesConverter.java,NONE,1.1 AbstractBuilder.java,1.4,1.5
Marra Roberto <[email protected]> Wed, 26 Jun 2002 10:40:29 -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-serv25266 Modified Files: AbstractBuilder.java Added Files: JForCmdProcessor.java JforCmdAttributesConverter.java Log Message: V0.6.4 jfor-cmd implemented --- NEW FILE: JForCmdProcessor.java --- package org.jfor.jfor.converter; import java.io.IOException; import org.xml.sax.Attributes; import org.jfor.jfor.rtflib.rtfdoc.*; /*----------------------------------------------------------------------------- * 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): -----------------------------------------------------------------------------*/ /* * JForCmdProcessor called by AbstractBuilder * */ public class JForCmdProcessor { protected final AbstractBuilder m_builder; private RtfJforCmd m_rtfJforCmd=null; public JForCmdProcessor(AbstractBuilder builder) { m_builder = builder; } public void preStart(String rawName, Attributes atts) throws IOException { final IRtfJforCmdContainer c = (IRtfJforCmdContainer) m_builder.m_context.getContainer(IRtfJforCmdContainer.class,false,m_builder); if (c!=null) { final RtfAttributes rtfAttrib=JforCmdAttributesConverter.convertRowAttributes(atts); //JforCmdAttributesConverter return null if no jfor-cmd is found if(rtfAttrib!=null) { m_rtfJforCmd = c.newJforCmd(rtfAttrib); m_builder.m_context.pushContainer(m_rtfJforCmd); } } } public void postEnd() throws IOException { } } --- NEW FILE: JforCmdAttributesConverter.java --- package org.jfor.jfor.converter; import java.util.StringTokenizer; import org.xml.sax.Attributes; import org.jfor.jfor.rtflib.rtfdoc.RtfAttributes; import org.jfor.jfor.rtflib.rtfdoc.ITableAttributes; import org.jfor.jfor.rtflib.rtfdoc.BorderAttributesConverter; /*----------------------------------------------------------------------------- * 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 Andreas Putz, skynamics AG, * München, Germany, [email protected]. * Portions created by Andreas Putz are Copyright (C) 2001 skynamics AG, München, * Andreas Putz. All Rights Reserved. * * Contributor(s): * @author Roberto Marra [email protected] -----------------------------------------------------------------------------*/ /** * Provides methods to convert the attributes (padding) to RtfAttributes. */ public class JforCmdAttributesConverter { private JforCmdAttributesConverter() { } /** * Converts jfor-cmd to rtf attributes. * * @param attrs Given attributes * @return RtfAttributes or null if no jfor-cmd is found * * @throws ConverterException On convertion error */ static RtfAttributes convertRowAttributes(Attributes attrs) throws ConverterException { RtfAttributes attrib =null; //check for keep-together row attribute if(AbstractBuilder.attributeIsSet(attrs,"jfor-cmd")) { attrib = new RtfAttributes(); final String attrValue = new String(attrs.getValue("jfor-cmd")); final StringTokenizer st = new StringTokenizer(attrValue,";"); while (st.hasMoreTokens()) { attrib.set(st.nextToken()); } } return attrib; } } Index: AbstractBuilder.java =================================================================== RCS file: /cvsroot/jfor/jfor/src/org/jfor/jfor/converter/AbstractBuilder.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** AbstractBuilder.java 24 Jun 2002 16:09:42 -0000 1.4 --- AbstractBuilder.java 26 Jun 2002 17:40:26 -0000 1.5 *************** *** 35,38 **** --- 35,41 ---- // $Id$ // $Log$ + // Revision 1.5 2002/06/26 17:40:26 rmarra + // V0.6.4 jfor-cmd implemented + // // Revision 1.4 2002/06/24 16:09:42 bdelacretaz // V0.6.2 - preStart and postEnd hook methods added to IBuilder interface *************** *** 64,67 **** --- 67,71 ---- implements IBuilder { protected final BuilderContext m_context; + private JForCmdProcessor m_jforCmdProcessor=null; AbstractBuilder(BuilderContext ctx) { *************** *** 111,118 **** --- 115,125 ---- /** 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: Jabber Inc. Don't miss the IM event of the season | Special offer for OSDN members! JabberConf 2002, Aug. 20-22, Keystone, CO http://www.jabberconf.com/osdn