com.lowagie.text.rtf
Class AbstractRtfField

java.lang.Object
  extended bycom.lowagie.text.Chunk
      extended bycom.lowagie.text.rtf.AbstractRtfField
All Implemented Interfaces:
Element, MarkupAttributes, RtfField
Direct Known Subclasses:
GenericRtfField

abstract class AbstractRtfField
extends Chunk
implements RtfField

This class implements an abstract RtfField. This class is based on the RtfWriter-package from Mark Hall.

Since:
Mon Aug 19 14:50:39 2002
Version:
$Id: AbstractRtfField.java,v 1.6 2004/02/07 10:29:03 blowagie Exp $
Author:
Dirk Weigenand

Field Summary
private static byte[] fldAlt
           
private static byte[] fldDirty
           
private static byte[] fldEdit
           
private static byte[] fldLock
           
private static byte[] fldPriv
           
private  boolean rtfFieldIsAlt
          Determines whether this RtfField shall refer to an end note.
private  boolean rtfFieldIsDirty
          Determines whether a formatting change has been made since the field was last updated.
private  boolean rtfFieldIsLocked
          Determines whether this RtfField is locked, i.e.
private  boolean rtfFieldIsPrivate
          Determines whether the field is in suitable form for display.
private  boolean rtfFieldWasEdited
          Determines whether text has been added, removed from thre field result since the field was last updated.
 
Fields inherited from class com.lowagie.text.Chunk
ACTION, attributes, BACKGROUND, COLOR, content, ENCODING, font, GENERICTAG, HYPHENATION, IMAGE, LOCALDESTINATION, LOCALGOTO, markupAttributes, NEWLINE, NEWPAGE, OBJECT_REPLACEMENT_CHARACTER, PDFANNOTATION, REMOTEGOTO, SKEW, SPLITCHARACTER, SUBSUPSCRIPT, TEXTRENDERMODE, UNDERLINE
 
Fields inherited from interface com.lowagie.text.Element
ALIGN_BASELINE, ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_JUSTIFIED, ALIGN_JUSTIFIED_ALL, ALIGN_LEFT, ALIGN_MIDDLE, ALIGN_RIGHT, ALIGN_TOP, ALIGN_UNDEFINED, ANCHOR, ANNOTATION, AUTHOR, CCITT_BLACKIS1, CCITT_ENCODEDBYTEALIGN, CCITT_ENDOFBLOCK, CCITT_ENDOFLINE, CCITTG3_1D, CCITTG3_2D, CCITTG4, CELL, CHAPTER, CHUNK, CREATIONDATE, CREATOR, GRAPHIC, HEADER, IMGRAW, IMGTEMPLATE, JPEG, KEYWORDS, LIST, LISTITEM, PARAGRAPH, PHRASE, PRODUCER, PTABLE, RECTANGLE, ROW, SECTION, SUBJECT, TABLE, TITLE
 
Constructor Summary
AbstractRtfField(String content, Font font)
          public constructor
 
Method Summary
 String content()
          empty implementation for Chunk.
 boolean isAlt()
          Determines whether this RtfField shall refer to an end note.
 boolean isDirty()
          Determines whether the field was changed since the field was last updated
 boolean isLocked()
          Determines whtether the field is locked, i.e.
 boolean isPrivate()
          Determines whether the field is in suitable form for display.
 void setAlt(boolean rtfFieldIsAlt)
          Determines whether this RtfField shall refer to an end note.
 void setDirty(boolean rtfFieldIsDirty)
          Set whether a formatting change has been made since the field was last updated
 void setEdited(boolean rtfFieldWasEdited)
          Set whether text has been added, removed from thre field result since the field was last updated.
 void setLocked(boolean rtfFieldIsLocked)
          Set whether the field can be updated.
 void setPrivate(boolean rtfFieldIsPrivate)
          Set whether the field is in suitable form for display.
 boolean wasEdited()
          Determines whether text has been added, removed from the field result since the field was last updated.
 void write(RtfWriter writer, OutputStream out)
          For Interface RtfField.
protected  void writeRtfFieldBegin(OutputStream out)
          Write the beginning of an RtfField to the OutputStream.
protected  void writeRtfFieldEnd(OutputStream out)
          Close the RtfField.
abstract  void writeRtfFieldInitializationStuff(OutputStream out)
          Abstract method for writing custom stuff to the Field Initialization Stuff part of an RtfField.
protected  void writeRtfFieldInstBegin(OutputStream out)
          Write RtfField Initialization Stuff to OutputStream.
protected  void writeRtfFieldInstEnd(OutputStream out)
          Write end of RtfField Initialization Stuff to OutputStream.
protected  void writeRtfFieldModifiers(OutputStream out)
          Write the modifiers defined for a RtfField to the OutputStream.
protected  void writeRtfFieldResultBegin(OutputStream out)
          Write beginning of RtfField Result to OutputStream.
protected  void writeRtfFieldResultEnd(OutputStream out)
          Write end of RtfField Result to OutputStream.
abstract  void writeRtfFieldResultStuff(OutputStream out)
          Abstract method for writing custom stuff to the Field Result part of an RtfField.
 
Methods inherited from class com.lowagie.text.Chunk
addToArray, append, font, getAttributes, getChunks, getImage, getKeySet, getMarkupAttribute, getMarkupAttributeNames, getMarkupAttributes, hasAttributes, isEmpty, isTag, process, setAction, setAnchor, setAnchor, setAnnotation, setBackground, setBackground, setFont, setGenericTag, setHyphenation, setLocalDestination, setLocalGoto, setMarkupAttribute, setMarkupAttributes, setNewPage, setRemoteGoto, setRemoteGoto, setSkew, setSplitCharacter, setTextRenderMode, setTextRise, setUnderline, type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.lowagie.text.Element
toString
 

Field Detail

fldDirty

private static final byte[] fldDirty

fldPriv

private static final byte[] fldPriv

fldLock

private static final byte[] fldLock

fldEdit

private static final byte[] fldEdit

fldAlt

private static final byte[] fldAlt

rtfFieldIsLocked

private boolean rtfFieldIsLocked
Determines whether this RtfField is locked, i.e. it cannot be updated. Defaults to false.


rtfFieldIsDirty

private boolean rtfFieldIsDirty
Determines whether a formatting change has been made since the field was last updated. Defaults to false.


rtfFieldWasEdited

private boolean rtfFieldWasEdited
Determines whether text has been added, removed from thre field result since the field was last updated. Defaults to false.


rtfFieldIsPrivate

private boolean rtfFieldIsPrivate
Determines whether the field is in suitable form for display. Defaults to false.


rtfFieldIsAlt

private boolean rtfFieldIsAlt
Determines whether this RtfField shall refer to an end note.

Constructor Detail

AbstractRtfField

public AbstractRtfField(String content,
                        Font font)
public constructor

Method Detail

isLocked

public final boolean isLocked()
Determines whtether the field is locked, i.e. it cannot be updated.

Returns:
true iff the field cannot be updated, false otherwise.

setLocked

public final void setLocked(boolean rtfFieldIsLocked)
Set whether the field can be updated.

Parameters:
rtfFieldIsLocked - true if the field cannot be updated, false otherwise.

setDirty

public final void setDirty(boolean rtfFieldIsDirty)
Set whether a formatting change has been made since the field was last updated

Parameters:
rtfFieldIsDirty - true if the field was changed since the field was last updated, false otherwise.

isDirty

public final boolean isDirty()
Determines whether the field was changed since the field was last updated

Returns:
true if the field was changed since the field was last updated, false otherwise.

setEdited

public final void setEdited(boolean rtfFieldWasEdited)
Set whether text has been added, removed from thre field result since the field was last updated.

Parameters:
rtfFieldWasEdited - Determines whether text has been added, removed from the field result since the field was last updated (true, false otherwise..

wasEdited

public final boolean wasEdited()
Determines whether text has been added, removed from the field result since the field was last updated.

Returns:
rtfFieldWasEdited true if text has been added, removed from the field result since the field was last updated, false otherwise.

setPrivate

public final void setPrivate(boolean rtfFieldIsPrivate)
Set whether the field is in suitable form for display. I.e. it's not a field with a picture as field result

Parameters:
rtfFieldIsPrivate - Determines whether the field is in suitable form for display: true it can be displayed, false it cannot be displayed.

isPrivate

public final boolean isPrivate()
Determines whether the field is in suitable form for display.

Returns:
whether the field is in suitable form for display: true yes, false no it cannot be displayed.

writeRtfFieldInitializationStuff

public abstract void writeRtfFieldInitializationStuff(OutputStream out)
                                               throws IOException
Abstract method for writing custom stuff to the Field Initialization Stuff part of an RtfField.

Throws:
IOException

writeRtfFieldResultStuff

public abstract void writeRtfFieldResultStuff(OutputStream out)
                                       throws IOException
Abstract method for writing custom stuff to the Field Result part of an RtfField.

Throws:
IOException

setAlt

public final void setAlt(boolean rtfFieldIsAlt)
Determines whether this RtfField shall refer to an end note.

Parameters:
rtfFieldIsAlt - true if this RtfField shall refer to an end note, false otherwise

isAlt

public final boolean isAlt()
Determines whether this RtfField shall refer to an end note.

Returns:
true if this RtfField shall refer to an end note, false otherwise.

content

public final String content()
empty implementation for Chunk.

Overrides:
content in class Chunk
Returns:
a String

write

public void write(RtfWriter writer,
                  OutputStream out)
           throws IOException
For Interface RtfField.

Specified by:
write in interface RtfField
Throws:
IOException

writeRtfFieldBegin

protected final void writeRtfFieldBegin(OutputStream out)
                                 throws IOException
Write the beginning of an RtfField to the OutputStream.

Throws:
IOException

writeRtfFieldModifiers

protected final void writeRtfFieldModifiers(OutputStream out)
                                     throws IOException
Write the modifiers defined for a RtfField to the OutputStream.

Throws:
IOException

writeRtfFieldInstBegin

protected final void writeRtfFieldInstBegin(OutputStream out)
                                     throws IOException
Write RtfField Initialization Stuff to OutputStream.

Throws:
IOException

writeRtfFieldInstEnd

protected final void writeRtfFieldInstEnd(OutputStream out)
                                   throws IOException
Write end of RtfField Initialization Stuff to OutputStream.

Throws:
IOException

writeRtfFieldResultBegin

protected final void writeRtfFieldResultBegin(OutputStream out)
                                       throws IOException
Write beginning of RtfField Result to OutputStream.

Throws:
IOException

writeRtfFieldResultEnd

protected final void writeRtfFieldResultEnd(OutputStream out)
                                     throws IOException
Write end of RtfField Result to OutputStream.

Throws:
IOException

writeRtfFieldEnd

protected final void writeRtfFieldEnd(OutputStream out)
                               throws IOException
Close the RtfField.

Throws:
IOException