net.charlesames.utility.html
Class DiscreteGraphBuilder

java.lang.Object
  extended by net.charlesames.utility.html.HtmlBuilder
      extended by net.charlesames.utility.html.DiscreteGraphBuilder

public class DiscreteGraphBuilder
extends HtmlBuilder

Generates discrete graphs using HTML formatting tags.

Author:
Charles Ames

Nested Class Summary
 class DiscreteGraphBuilder.Column
           
 class DiscreteGraphBuilder.Row
           
 
Nested classes/interfaces inherited from class net.charlesames.utility.html.HtmlBuilder
HtmlBuilder.Tags
 
Field Summary
 
Fields inherited from class net.charlesames.utility.html.HtmlBuilder
FILE_EXTENSION
 
Constructor Summary
DiscreteGraphBuilder()
          Constructor for DiscreteGraphBuilder instances.
 
Method Summary
 DiscreteGraphBuilder.Column addColumn()
          Create a new Column instance.
 DiscreteGraphBuilder.Row addRow(int value, boolean occurence)
          Create a new Row instance.
 java.lang.String build()
           
 void clear()
          Clear existing data.
 HtmlColor getBarColor()
           
 int getCellWidth()
           
 void plotRect(java.lang.String cellAttributes, int width, int height, HtmlColor color)
          Plot a rectangle as a table cell
 void plotRow(int value, int height, HtmlColor defaultColor)
          Plot a row
 void plotSpacerRow()
          Plot a spacer row
 void setBarColor(HtmlColor barColor)
           
 void setCellWidth(int cellWidth)
           
 
Methods inherited from class net.charlesames.utility.html.HtmlBuilder
addTableCell, append, appendLineBreak, beginBlockQuote, beginBody, beginCenter, beginDiv, beginHead, beginHtml, beginListItem, beginOrderedList, beginParagraph, beginSpan, beginStyle, beginStyleRule, beginTable, beginTableBody, beginTableCell, beginTableHeader, beginTableHeaderCell, beginTableRow, beginTag, beginUnorderedList, buildAttribute, buildColorDeclaration, buildLink, buildStyleDeclaration, endBlockQuote, endBody, endCenter, endDiv, endHead, endHtml, endListItem, endOrderedList, endParagraph, endSpan, endStyle, endStyleRule, endTable, endTableBody, endTableCell, endTableHeader, endTableHeaderCell, endTableRow, endTag, endUnorderedList, newline, popTag, pushTag, reset, save, tab, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DiscreteGraphBuilder

public DiscreteGraphBuilder()
Constructor for DiscreteGraphBuilder instances.

Method Detail

clear

public void clear()
Clear existing data.


getBarColor

public HtmlColor getBarColor()
Returns:
The bar color

setBarColor

public void setBarColor(HtmlColor barColor)
Parameters:
barColor - The bar color.

getCellWidth

public int getCellWidth()
Returns:
The cell width.

setCellWidth

public void setCellWidth(int cellWidth)
Parameters:
cellWidth - The cell width.

addColumn

public DiscreteGraphBuilder.Column addColumn()
Create a new Column instance.

Returns:
The newly created Column instance.

addRow

public DiscreteGraphBuilder.Row addRow(int value,
                                       boolean occurence)
Create a new Row instance.

Parameters:
value - The value associated with this Row instance.
occurence - Flag indicating whether something happened in this row.
Returns:
The newly created Row instance.

build

public java.lang.String build()
Returns:
HTML representation of a discrete graph.

plotRow

public void plotRow(int value,
                    int height,
                    HtmlColor defaultColor)
Plot a row

Parameters:
value - The row value.
height - The row height.
defaultColor - The color to be used if the cell does not contain a value.

plotSpacerRow

public void plotSpacerRow()
Plot a spacer row


plotRect

public void plotRect(java.lang.String cellAttributes,
                     int width,
                     int height,
                     HtmlColor color)
Plot a rectangle as a table cell

Parameters:
cellAttributes -
width -
height -
color -