| java.util.ArrayList com.lowagie.text.Section com.lowagie.text.Chapter
All known Subclasses: com.lowagie.text.ChapterAutoNumber,
Chapter | public class Chapter extends Section (Code) | | A 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);
|
Constructor Summary | |
public | Chapter(int number) Constructs a new Chapter . | public | Chapter(Paragraph title, int number) Constructs a new Chapter . | public | Chapter(String title, int number) Constructs a new Chapter . | public | Chapter(java.util.Properties attributes, int number) Creates a new Chapter following a set of attributes. |
Method Summary | |
public int | type() Gets the type of the text element. |
Chapter | public Chapter(int number)(Code) | | Constructs a new Chapter .
Parameters: number - the Chapter number |
Chapter | public Chapter(Paragraph title, int number)(Code) | | Constructs a new Chapter .
Parameters: title - the Chapter title (as a Paragraph ) Parameters: number - the Chapter number |
Chapter | public Chapter(String title, int number)(Code) | | Constructs a new Chapter .
Parameters: title - the Chapter title (as a String ) Parameters: number - the Chapter number |
Chapter | public Chapter(java.util.Properties attributes, int number)(Code) | | Creates a new Chapter following a set of attributes.
Parameters: attributes - the attributes Parameters: number - a userdefined Chapter number |
type | public int type()(Code) | | Gets the type of the text element.
a type |
|
|