Java Reference
In-Depth Information
public SimpleDocumenter( String p_bgColor,
String p_titleColor,
String p_infoColor) {
bgColor # p_bgColor;
titleColor # p_titleColor;
infoColor # p_infoColor;
}
// The three elements (placeholders) that will be set up by
// the setupFramework method and filled in during parsing
// by the appropriate methods
// Container that will contain the text representing the
// title of the HTML page, i.e. the name of the class
private Composite titlePlaceholder;
// Container that will contain the list of public members
private Composite membersPlaceholder;
// The head of the page, will contain the name of the
// class
private Head head;
// contains the overall structure of the page
private Body body;
// contains the result at the end of the parsing
Page page;
// Creates the overall structure of the page, which is
// independent of the specific information. Inside this
// generic structure some placeholders are inserted that
// will be filled in during parsing
private void setupFramework() {
head # null ;
body # new Body(bgColor);
// create the title placeholder and insert it into the
// body
Heading title # new Heading();
Composite titleFont # new Font(" ! 2", titleColor,
"Tahoma");
title.addChild(titleFont);
body.addChild(title);
titlePlaceholder # titleFont;
// add a short introductory text that say that a list of
// public members follows
Composite introduction # new Font(" ! 2", titleColor,
"Arial");
introduction.addChild( new Text("Public members:"));
body.addChild(introduction);
body.addChild( new Br());
// create the public members list placeholder and insert
// it into the body
Search WWH ::




Custom Search