![]() | |
Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
ArrayList
com.lowagie.text.Section
Section
is a part of a Document
containing
other Section
s, Paragraph
s, List
and/or Table
s.
Remark: you can not construct a Section
yourself.
You will have to ask an instance of Section
to the
Chapter
or Section
to which you want to
add the new Section
.
Example:
Paragraph title2 = new Paragraph("This is Chapter 2", FontFactory.getFont(FontFactory.HELVETICA, 18, Font.BOLDITALIC, new Color(0, 0, 255))); Chapter chapter2 = new Chapter(title2, 2); Paragraph someText = new Paragraph("This is some text"); chapter2.add(someText); Paragraph title21 = new Paragraph("This is Section 1 in Chapter 2", FontFactory.getFont(FontFactory.HELVETICA, 16, Font.BOLD, new Color(255, 0, 0))); Section section1 = chapter2.addSection(title21); Paragraph someSectionText = new Paragraph("This is some silly paragraph in a chapter and/or section. It contains some text to test the functionality of Chapters and Section."); section1.add(someSectionText); Paragraph title211 = new Paragraph("This is SubSection 1 in Section 1 in Chapter 2", FontFactory.getFont(FontFactory.HELVETICA, 14, Font.BOLD, new Color(255, 0, 0))); Section section11 = section1.addSection(40, title211, 2); section11.add(someSectionText);
Field Summary | |
protected boolean |
|
protected String |
|
protected float |
|
protected float |
|
protected int |
|
protected ArrayList |
|
protected float |
|
private static long | |
protected int |
|
protected Paragraph |
|
protected boolean |
|
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 , CCITTG3_1D , CCITTG3_2D , CCITTG4 , CCITT_BLACKIS1 , CCITT_ENCODEDBYTEALIGN , CCITT_ENDOFBLOCK , CCITT_ENDOFLINE , CELL , CHAPTER , CHUNK , CREATIONDATE , CREATOR , GRAPHIC , HEADER , IMGRAW , IMGTEMPLATE , JPEG , KEYWORDS , LIST , LISTITEM , MULTI_COLUMN_TEXT , PARAGRAPH , PHRASE , PRODUCER , PTABLE , RECTANGLE , ROW , SECTION , SUBJECT , TABLE , TITLE |
Constructor Summary | |
| |
Method Summary | |
boolean |
|
void |
|
boolean |
|
Section |
|
Section |
|
Section |
|
Section |
|
Section |
|
Section |
|
Section |
|
Section |
|
Section |
|
int |
|
Paragraph |
|
ArrayList |
|
float |
|
float |
|
float |
|
boolean |
|
boolean |
|
boolean |
|
static boolean |
|
static boolean |
|
boolean |
|
int |
|
boolean |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
private void |
|
void | |
void |
|
Paragraph |
|
int |
|
protected boolean bookmarkOpen
false if the bookmark children are not visible
protected String bookmarkTitle
The bookmark title if different from the content title
protected float indentationLeft
The indentation of this section on the left side.
protected float indentationRight
The indentation of this section on the right side.
protected int numberDepth
This is the number of sectionnumbers that has to be shown before the section title.
protected ArrayList numbers
This is the complete list of sectionnumbers of this section and the parents of this section.
protected float sectionIndent
The additional indentation of the content of this section.
private static final long serialVersionUID
- Field Value:
- 3324172577544748043L
protected int subsections
This is the number of subsections.
protected boolean triggerNewPage
true if the section has to trigger a new page
protected Section()
Constructs a newSection
.
(package private) Section(Paragraph title, int numberDepth)
Constructs a newSection
.
- Parameters:
title
- aParagraph
numberDepth
- the numberDepth
public boolean add(Object o)
Adds aParagraph
,List
,Table
or anotherSection
to thisSection
.
- Specified by:
- add in interface TextElementArray
- Parameters:
o
- an object of typeParagraph
,List
,Table
or anotherSection
- Returns:
- a boolean
public void add(int index, Object o)
Adds aParagraph
,List
orTable
to thisSection
.
- Parameters:
index
- index at which the specified element is to be insertedo
- an object of typeParagraph
,List
orTable
=
public boolean addAll(Collection collection)
Adds a collection ofElement
s to thisSection
.
- Parameters:
collection
- a collection ofParagraph
s,List
s and/orTable
s
- Returns:
true
if the action succeeded,false
if not.
public Section addSection(Properties attributes)
Creates a givenSection
following a set of attributes and adds it to this one.
- Parameters:
attributes
- the attributes
- Returns:
- a Section
public Section addSection(String title)
Adds aSection
to thisSection
and returns it.
- Parameters:
title
- the title of the new section
- Returns:
- a new Section object
public Section addSection(String title, int numberDepth)
Adds aSection
to thisSection
and returns it.
- Parameters:
title
- the title of the new sectionnumberDepth
- the numberDepth of the section
- Returns:
- a new Section object
public Section addSection(Paragraph title)
Creates aSection
, adds it to thisSection
and returns it.
- Parameters:
title
- the title of the new section
- Returns:
- a new Section object
public Section addSection(Paragraph title, int numberDepth)
Creates aSection
, add it to thisSection
and returns it.
- Parameters:
title
- the title of the new sectionnumberDepth
- the numberDepth of the section
- Returns:
- a new Section object
public Section addSection(float indentation, String title)
Adds aSection
to thisSection
and returns it.
- Parameters:
indentation
- the indentation of the new sectiontitle
- the title of the new section
- Returns:
- a new Section object
public Section addSection(float indentation, String title, int numberDepth)
Adds aSection
to thisSection
and returns it.
- Parameters:
indentation
- the indentation of the new sectiontitle
- the title of the new sectionnumberDepth
- the numberDepth of the section
- Returns:
- a new Section object
public Section addSection(float indentation, Paragraph title)
Creates aSection
, adds it to thisSection
and returns it.
- Parameters:
indentation
- the indentation of the new sectiontitle
- the title of the new section
- Returns:
- a new Section object
public Section addSection(float indentation, Paragraph title, int numberDepth)
Creates aSection
, adds it to thisSection
and returns it.
- Parameters:
indentation
- the indentation of the new sectiontitle
- the title of the new sectionnumberDepth
- the numberDepth of the section
- Returns:
- a new Section object
public int depth()
Returns the depth of this section.
- Returns:
- the depth
public Paragraph getBookmarkTitle()
Gets the bookmark title.
- Returns:
- the bookmark title
public ArrayList getChunks()
Gets all the chunks in this element.
- Returns:
- an
ArrayList
public float indentation()
Returns the indentation of the content of thisSection
.
- Returns:
- the indentation
public float indentationLeft()
Returns the indentation of thisSection
on the left side.
- Returns:
- the indentation
public float indentationRight()
Returns the indentation of thisSection
on the right side.
- Returns:
- the indentation
public boolean isBookmarkOpen()
Getter for property bookmarkOpen.
- Returns:
- Value of property bookmarkOpen.
public boolean isChapter()
Checks if this object is aChapter
.
- Returns:
true
if it is aChapter
,false
if it is aSection
.
public boolean isSection()
Checks if this object is aSection
.
- Returns:
true
if it is aSection
,false
if it is aChapter
.
public static boolean isTag(String tag)
Checks if a given tag corresponds with this object.
- Parameters:
tag
- the given tag
- Returns:
- true if the tag corresponds
public static boolean isTitle(String tag)
Checks if a given tag corresponds with a title tag for this object.
- Parameters:
tag
- the given tag
- Returns:
- true if the tag corresponds
public boolean isTriggerNewPage()
Getter for property bookmarkOpen.
- Returns:
- Value of property triggerNewPage.
public int numberDepth()
Returns the numberdepth of thisSection
.
- Returns:
- the numberdepth
public boolean process(ElementListener listener)
Processes the element by adding it (or the different parts) to anElementListener
.
- Parameters:
listener
- theElementListener
- Returns:
true
if the element was processed successfully
public void set(Properties attributes)
Alters the attributes of thisSection
.
- Parameters:
attributes
- the attributes
public void setBookmarkOpen(boolean bookmarkOpen)
Setter for property bookmarkOpen.
- Parameters:
bookmarkOpen
- false if the bookmark children are not visible.
public void setBookmarkTitle(String bookmarkTitle)
Sets the bookmark title. The bookmark title is the same as the section title but can be changed with this method.
- Parameters:
bookmarkTitle
- the bookmark title
public void setIndentation(float indentation)
Sets the indentation of the content of thisSection
.
- Parameters:
indentation
- the indentation
public void setIndentationLeft(float indentation)
Sets the indentation of thisSection
on the left side.
- Parameters:
indentation
- the indentation
public void setIndentationRight(float indentation)
Sets the indentation of thisSection
on the right side.
- Parameters:
indentation
- the indentation
public void setNumberDepth(int numberDepth)
Sets the depth of the sectionnumbers that will be shown preceding the title. If the numberdepth is 0, the sections will not be numbered. If the numberdepth is 1, the section will be numbered with their own number. If the numberdepth is higher (for instance x > 1), the numbers of x - 1 parents will be shown.
- Parameters:
numberDepth
- the new numberDepth
private void setNumbers(int number, ArrayList numbers)
Sets the number of this section.
- Parameters:
number
- the number of this sectionnumbers
- anArrayList
, containing the numbers of the Parent
public void setTitle(Paragraph title)
Sets the title of this section.
- Parameters:
title
- the new title
public void setTriggerNewPage(boolean triggerNewPage)
Setter for property triggerNewPage.
- Parameters:
triggerNewPage
- true if a new page has to be triggered.
public Paragraph title()
Returns the title, preceeded by a certain number of sectionnumbers.
- Returns:
- a
Paragraph