public class Chapter extends Section implements TextElementArray
Chapter
is a special Section
.
A chapter number has to be created using a Paragraph
as title
and an int
as chapter number. The chapter number is shown be
default. If you don't want to see the chapter number, you have to set the
numberdepth to 0.
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); chapter2.setNumberDepth(0); 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);
bookmarkOpen, bookmarkTitle, indentationLeft, indentationRight, numberDepth, numbers, sectionIndent, subsections, title
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, MULTI_COLUMN_TEXT, PARAGRAPH, PHRASE, PRODUCER, PTABLE, RECTANGLE, ROW, SECTION, SUBJECT, TABLE, TITLE
Constructor and Description |
---|
Chapter(Paragraph title,
int number)
Constructs a new
Chapter . |
Chapter(java.util.Properties attributes,
int number)
Creates a new
Chapter following a set of attributes. |
Chapter(java.lang.String title,
int number)
Constructs a new
Chapter . |
Modifier and Type | Method and Description |
---|---|
static boolean |
isTag(java.lang.String tag)
Checks if a given tag corresponds with this object.
|
int |
type()
Gets the type of the text element.
|
add, add, addAll, addSection, addSection, addSection, addSection, addSection, addSection, addSection, addSection, addSection, depth, getBookmarkTitle, getChunks, indentation, indentationLeft, indentationRight, isBookmarkOpen, isChapter, isSection, isTitle, numberDepth, process, set, setBookmarkOpen, setBookmarkTitle, setIndentation, setIndentationLeft, setIndentationRight, setNumberDepth, setTitle, title
addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeRange, retainAll, set, size, subList, toArray, toArray, trimToSize
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
add
public Chapter(Paragraph title, int number)
Chapter
.title
- the Chapter title (as a Paragraph
)number
- the Chapter numberpublic Chapter(java.lang.String title, int number)
Chapter
.title
- the Chapter title (as a String
)number
- the Chapter numberpublic Chapter(java.util.Properties attributes, int number)
Chapter
following a set of attributes.attributes
- the attributesnumber
- a userdefined Chapter number