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

Quick Search    Search Deep

org.jfor.jfor.rtflib.rtfdoc
Class RtfParagraph  view RtfParagraph download RtfParagraph.java

java.lang.Object
  extended byorg.jfor.jfor.rtflib.rtfdoc.RtfElement
      extended byorg.jfor.jfor.rtflib.rtfdoc.RtfContainer
          extended byorg.jfor.jfor.rtflib.rtfdoc.RtfBookmarkContainerImpl
              extended byorg.jfor.jfor.rtflib.rtfdoc.RtfParagraph
All Implemented Interfaces:
IRtfBookmarkContainer, IRtfExternalGraphicContainer, IRtfHyperLinkContainer, IRtfPageBreakContainer, IRtfPageNumberCitationContainer, IRtfPageNumberContainer, IRtfTextContainer
Direct Known Subclasses:
RtfListItem.RtfListItemParagraph

public class RtfParagraph
extends RtfBookmarkContainerImpl
implements IRtfTextContainer, IRtfPageBreakContainer, IRtfHyperLinkContainer, IRtfExternalGraphicContainer, IRtfPageNumberContainer, IRtfPageNumberCitationContainer

Model of an RTF paragraph, which can contain RTF text elements.


Field Summary
private  RtfExternalGraphic m_externalGraphic
           
private  RtfHyperLink m_hyperlink
           
private  boolean m_keepn
           
private  RtfPageNumber m_pageNumber
           
private  RtfPageNumberCitation m_pageNumberCitation
           
private  boolean m_resetProperties
           
private  RtfText m_text
           
private static java.lang.String[] PARA_ATTRIBUTES
          Set of attributes that must be copied at the start of a paragraph
private  boolean writeForBreak
           
 
Fields inherited from class org.jfor.jfor.rtflib.rtfdoc.RtfBookmarkContainerImpl
mBookmark
 
Fields inherited from class org.jfor.jfor.rtflib.rtfdoc.RtfContainer
 
Fields inherited from class org.jfor.jfor.rtflib.rtfdoc.RtfElement
m_attrib, m_parent, m_writer
 
Constructor Summary
(package private) RtfParagraph(IRtfParagraphContainer parent, java.io.Writer w)
          Create an RTF paragraph as a child of given container with default attributes
(package private) RtfParagraph(IRtfParagraphContainer parent, java.io.Writer w, RtfAttributes attr)
          Create an RTF paragraph as a child of given container with given attributes
 
Method Summary
private  void closeAll()
           
private  void closeCurrentHyperLink()
           
private  void closeCurrentText()
           
 java.lang.String getText()
           
 RtfAttributes getTextAttributes()
          get the attributes of our text
 RtfAttributes getTextContainerAttributes()
          IRtfTextContainer requirement: return a copy of our attributes
private  boolean mustWriteAttributes()
          true if we must write our own (non-text) attributes in the RTF
private  boolean mustWriteGroupMark()
          true if we must write a group mark around this paragraph TODO is this correct, study interaction with mustWriteAttributes() <-- On implementation i have noticed if the groupmark set, the format attributes are only for this content, i think this implementation is ok
 RtfHyperLink newHyperLink(java.lang.String str, RtfAttributes attr)
          Creates a new hyperlink.
 RtfExternalGraphic newImage()
          start a new external graphic after closing all other elements
 void newLineBreak()
          add a line break
 void newPageBreak()
          add a page break
 RtfPageNumber newPageNumber()
           
 RtfPageNumberCitation newPageNumberCitation(java.lang.String id)
          Added by Boris POUDEROUS on 2002/07/09
 RtfText newText(java.lang.String str)
          close current text run if any and start a new one with default attributes
 RtfText newText(java.lang.String str, RtfAttributes attr)
          close current text run if any and start a new one
protected  boolean okToWriteRtf()
          depending on RtfOptions, do not emit any RTF for empty paragraphs
 void setKeepn()
          Set the keepn attribute for this paragraph
 void setResetProperties()
          Force reset properties
protected  void writeRtfPrefix()
          overridden to write our attributes before our content
protected  void writeRtfSuffix()
          overridden to close paragraph
 
Methods inherited from class org.jfor.jfor.rtflib.rtfdoc.RtfBookmarkContainerImpl
newBookmark
 
Methods inherited from class org.jfor.jfor.rtflib.rtfdoc.RtfContainer
addChild, containsText, dump, getChildCount, getChildren, getOptions, isEmpty, setChildren, setOptions, toString, writeRtfContent
 
Methods inherited from class org.jfor.jfor.rtflib.rtfdoc.RtfElement
close, getParentOfClass, getRtfAttributes, getRtfFile, isClosed, writeAttributes, writeControlWord, writeControlWordNS, writeExceptionInRtf, writeGroupMark, writeOneAttribute, writeOneAttributeNS, writeRtf, writeStarControlWord, writeStarControlWordNS
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_text

private RtfText m_text

m_hyperlink

private RtfHyperLink m_hyperlink

m_externalGraphic

private RtfExternalGraphic m_externalGraphic

m_pageNumber

private RtfPageNumber m_pageNumber

m_pageNumberCitation

private RtfPageNumberCitation m_pageNumberCitation

m_keepn

private boolean m_keepn

m_resetProperties

private boolean m_resetProperties

writeForBreak

private boolean writeForBreak

PARA_ATTRIBUTES

private static final java.lang.String[] PARA_ATTRIBUTES
Set of attributes that must be copied at the start of a paragraph

Constructor Detail

RtfParagraph

RtfParagraph(IRtfParagraphContainer parent,
             java.io.Writer w)
       throws java.io.IOException
Create an RTF paragraph as a child of given container with default attributes


RtfParagraph

RtfParagraph(IRtfParagraphContainer parent,
             java.io.Writer w,
             RtfAttributes attr)
       throws java.io.IOException
Create an RTF paragraph as a child of given container with given attributes

Method Detail

getText

public java.lang.String getText()

setKeepn

public void setKeepn()
Set the keepn attribute for this paragraph


setResetProperties

public void setResetProperties()
Force reset properties


getTextContainerAttributes

public RtfAttributes getTextContainerAttributes()
IRtfTextContainer requirement: return a copy of our attributes

Specified by:
getTextContainerAttributes in interface IRtfTextContainer

writeRtfPrefix

protected void writeRtfPrefix()
                       throws java.io.IOException
overridden to write our attributes before our content

Overrides:
writeRtfPrefix in class RtfElement

writeRtfSuffix

protected void writeRtfSuffix()
                       throws java.io.IOException
overridden to close paragraph

Overrides:
writeRtfSuffix in class RtfElement

newText

public RtfText newText(java.lang.String str)
                throws java.io.IOException
close current text run if any and start a new one with default attributes

Specified by:
newText in interface IRtfTextContainer

newText

public RtfText newText(java.lang.String str,
                       RtfAttributes attr)
                throws java.io.IOException
close current text run if any and start a new one

Specified by:
newText in interface IRtfTextContainer

newPageBreak

public void newPageBreak()
                  throws java.io.IOException
add a page break

Specified by:
newPageBreak in interface IRtfPageBreakContainer

newLineBreak

public void newLineBreak()
                  throws java.io.IOException
add a line break

Specified by:
newLineBreak in interface IRtfTextContainer

newPageNumber

public RtfPageNumber newPageNumber()
                            throws java.io.IOException
Specified by:
newPageNumber in interface IRtfPageNumberContainer

newPageNumberCitation

public RtfPageNumberCitation newPageNumberCitation(java.lang.String id)
                                            throws java.io.IOException
Added by Boris POUDEROUS on 2002/07/09

Specified by:
newPageNumberCitation in interface IRtfPageNumberCitationContainer

newHyperLink

public RtfHyperLink newHyperLink(java.lang.String str,
                                 RtfAttributes attr)
                          throws java.io.IOException
Creates a new hyperlink.

Specified by:
newHyperLink in interface IRtfHyperLinkContainer

newImage

public RtfExternalGraphic newImage()
                            throws java.io.IOException
start a new external graphic after closing all other elements

Specified by:
newImage in interface IRtfExternalGraphicContainer

closeCurrentText

private void closeCurrentText()
                       throws java.io.IOException

closeCurrentHyperLink

private void closeCurrentHyperLink()
                            throws java.io.IOException

closeAll

private void closeAll()
               throws java.io.IOException

okToWriteRtf

protected boolean okToWriteRtf()
depending on RtfOptions, do not emit any RTF for empty paragraphs

Overrides:
okToWriteRtf in class RtfContainer

mustWriteAttributes

private boolean mustWriteAttributes()
true if we must write our own (non-text) attributes in the RTF


mustWriteGroupMark

private boolean mustWriteGroupMark()
true if we must write a group mark around this paragraph TODO is this correct, study interaction with mustWriteAttributes() <-- On implementation i have noticed if the groupmark set, the format attributes are only for this content, i think this implementation is ok


getTextAttributes

public RtfAttributes getTextAttributes()
get the attributes of our text