sdsu.html
Class WebPage

java.lang.Object
  |
  +--sdsu.html.WebPage

public class WebPage
extends java.lang.Object

An HTML document has a minimal required structure ( HEAD, BODY, etc). This class generates the basic structure for a HTML document. Append HTML objects and/or HTML tags a Webpage object, then use the toString() method to get the HTML document in ascii format.

Version:
0.8 6 April 1997
Author:
Roger Whitney (whitney@cs.sdsu.edu)

Field Summary
static java.lang.String AQUA
          A color for use in a web page
static java.lang.String BLACK
           
static java.lang.String BLUE
           
static java.lang.String GRAY
           
static java.lang.String GREEN
           
static java.lang.String OLIVE
           
static java.lang.String RED
           
static java.lang.String TEAL
           
static java.lang.String WHITE
           
 
Constructor Summary
WebPage()
           
WebPage(java.lang.String title)
          Create a new page with the given title.
 
Method Summary
 void append(java.lang.Object item)
          Appends the string representation of item to the page.
 void appendLineBreak()
          Appends a line break to the page.
 void clearPageBody()
          Removes all elements from the body of the page.
 java.lang.String getPageBody()
          Returns in HTML format items append to page.
 java.lang.String getPageEnding()
          Returns in HTML format tags to end the page
 java.lang.String getPageHeader()
          Returns in HTML format the header information of the page.
 void setBackgroundColor(java.lang.String aColor)
          Sets the background color of the page.
 void setBackgroundImage(java.lang.String anImageURL)
          Sets the background image of the page.
 void setTextColor(java.lang.String aColor)
          Sets the color of the text on the page.
 java.lang.String toString()
          Return the WebPage as html in a string.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

AQUA

public static final java.lang.String AQUA
A color for use in a web page

BLACK

public static final java.lang.String BLACK

BLUE

public static final java.lang.String BLUE

GRAY

public static final java.lang.String GRAY

GREEN

public static final java.lang.String GREEN

OLIVE

public static final java.lang.String OLIVE

RED

public static final java.lang.String RED

TEAL

public static final java.lang.String TEAL

WHITE

public static final java.lang.String WHITE
Constructor Detail

WebPage

public WebPage()

WebPage

public WebPage(java.lang.String title)
Create a new page with the given title.
Method Detail

append

public void append(java.lang.Object item)
Appends the string representation of item to the page.

appendLineBreak

public void appendLineBreak()
Appends a line break to the page.

clearPageBody

public void clearPageBody()
Removes all elements from the body of the page.

setBackgroundImage

public void setBackgroundImage(java.lang.String anImageURL)
Sets the background image of the page.
Parameters:
anImageURL - a URL to an image suitable for a background

setBackgroundColor

public void setBackgroundColor(java.lang.String aColor)
Sets the background color of the page. Use either the predefined colors in static variables of the class or the format: #XXYYZZ where XX = hex value of red, YY = hex value of green, ZZ = hex value of blue So WHITE = #FFFFFF and BLACK = #000000

setTextColor

public void setTextColor(java.lang.String aColor)
Sets the color of the text on the page. Use either the predefined colors in static variables of the class or the format: #XXYYZZ where XX = hex value of red, YY = hex value of green, ZZ = hex value of blue So WHITE = #FFFFFF and BLACK = #000000

getPageHeader

public java.lang.String getPageHeader()
Returns in HTML format the header information of the page. Uses information set by setBackgroundColor and setBackgroundImage

getPageBody

public java.lang.String getPageBody()
Returns in HTML format items append to page.

getPageEnding

public java.lang.String getPageEnding()
Returns in HTML format tags to end the page

toString

public java.lang.String toString()
Return the WebPage as html in a string.
Overrides:
toString in class java.lang.Object