Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: org/jfor/jfor/rtflib/rtfdoc/RtfPageArea.java


1   package org.jfor.jfor.rtflib.rtfdoc;
2   
3   import java.io.Writer;
4   import java.io.IOException;
5   import java.io.*;
6   
7   /*-----------------------------------------------------------------------------
8    * jfor - Open-Source XSL-FO to RTF converter - see www.jfor.org
9    *
10   * ====================================================================
11   * jfor Apache-Style Software License.
12   * Copyright (c) 2002 by the jfor project. All rights reserved.
13   *
14   * Redistribution and use in source and binary forms, with or without
15   * modification, are permitted provided that the following conditions
16   * are met:
17   *
18   * 1. Redistributions of source code must retain the above copyright
19   * notice, this list of conditions and the following disclaimer.
20   *
21   * 2. Redistributions in binary form must reproduce the above copyright
22   * notice, this list of conditions and the following disclaimer in
23   * the documentation and/or other materials provided with the
24   * distribution.
25   *
26   * 3. The end-user documentation included with the redistribution,
27   * if any, must include the following acknowledgment:
28   * "This product includes software developed
29   * by the jfor project (http://www.jfor.org)."
30   * Alternately, this acknowledgment may appear in the software itself,
31   * if and wherever such third-party acknowledgments normally appear.
32   *
33   * 4. The name "jfor" must not be used to endorse
34   * or promote products derived from this software without prior written
35   * permission.  For written permission, please contact info@jfor.org.
36   *
37   * 5. Products derived from this software may not be called "jfor",
38   * nor may "jfor" appear in their name, without prior written
39   * permission of info@jfor.org.
40   *
41   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
42   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
43   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
44   * DISCLAIMED.  IN NO EVENT SHALL THE JFOR PROJECT OR ITS CONTRIBUTORS BE
45   * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
46   * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
47   * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
48   * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
49   * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
50   * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
51   * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
52   * ====================================================================
53   * Contributor(s):
54   * Christopher Scott, scottc@westinghouse.com
55   * Portions created by Christopher Scott are Coypright (C) 2001
56   * Westinghouse Electric Company. All Rights Reserved.
57  -----------------------------------------------------------------------------*/
58  
59  //------------------------------------------------------------------------------
60  // $Id: RtfPageArea.java,v 1.2 2002/07/12 08:08:31 bdelacretaz Exp $
61  // $Log: RtfPageArea.java,v $
62  // Revision 1.2  2002/07/12 08:08:31  bdelacretaz
63  // License changed to jfor Apache-style license
64  //
65  // Revision 1.1  2001/12/28 17:10:23  bdelacretaz
66  // V0.5.2 - first integration of Chris Scott's changes
67  //
68  //------------------------------------------------------------------------------
69  
70  public class RtfPageArea
71  extends RtfContainer
72  {
73      private RtfPage m_currentPage;
74      private RtfNull nullChild;
75      private RtfAttributes childAttributes;
76      
77      /** Create an RTF element as a child of given container */
78      RtfPageArea(RtfFile f,Writer w) throws IOException
79      {
80          super(f,w);
81      }
82      
83      /** close current Rtfpage if any and create a new one */
84      public RtfPage newPage(RtfAttributes attr) throws IOException
85      {
86          if(m_currentPage != null){
87            m_currentPage.close();
88          }
89          m_currentPage = new RtfPage(this,m_writer,attr);
90  
91          return m_currentPage;
92      }
93    
94    protected boolean okToWriteRtf()
95    {
96      return true;
97    }
98  }