com.jalios.jtaglib
Class ChartTagBeautifier

java.lang.Object
  extended by com.jalios.util.Beautifier
      extended by com.jalios.jtaglib.ChartTagBeautifier
Direct Known Subclasses:
BeautifierCrossingData

public class ChartTagBeautifier
extends Beautifier

Since:
jcms-5.0.0
Version:
$Revision: 27752 $
Author:
Olivier Jaquemet

Field Summary
static String REVISION
           
 
Fields inherited from class com.jalios.util.Beautifier
html, locale, truncate
 
Constructor Summary
ChartTagBeautifier()
           
ChartTagBeautifier(Beautifier beautifier)
           
ChartTagBeautifier(Beautifier beautifier, Beautifier legendBeautifier)
           
 
Method Summary
 String beautify(String str)
          String beautifier.
 String beautifyLegend(String legend)
          Called for each legend of the the chart with no value.
 String beautifyLegend(String legend, Integer[] values)
          Called for each legend of the chart which has a value associated to it.
 String beautifyTitle(String title)
          String beautifier for the chart title.
 void printChartElementClass(StringBuffer sb, String legend, int value, String display)
          Called for each value in chart, allow you to add any class to this value.
 void printChartElementStyle(StringBuffer sb, String legend, int value, String display)
          Called for each value in chart, allow you to add any style to this value.
 void setLocale(Locale locale)
           
 
Methods inherited from class com.jalios.util.Beautifier
getHtml, getLocale, setHtml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REVISION

public static final String REVISION
See Also:
Constant Field Values
Constructor Detail

ChartTagBeautifier

public ChartTagBeautifier()

ChartTagBeautifier

public ChartTagBeautifier(Beautifier beautifier)

ChartTagBeautifier

public ChartTagBeautifier(Beautifier beautifier,
                          Beautifier legendBeautifier)
Method Detail

beautify

public String beautify(String str)
String beautifier.

Overrides:
beautify in class Beautifier

printChartElementStyle

public void printChartElementStyle(StringBuffer sb,
                                   String legend,
                                   int value,
                                   String display)
Called for each value in chart, allow you to add any style to this value. For example: if (value > 90) { sb.append("background-color: red;"); } else { sb.append("background-color: blue;"); }

Parameters:
sb - the string buffer to append to
legend - the legend associated with this value
value - the value printed
display - the format of the chart (see CharTag.DISPLAY_VCHART ChartTag.DISPLAY_HCHART)

printChartElementClass

public void printChartElementClass(StringBuffer sb,
                                   String legend,
                                   int value,
                                   String display)
Called for each value in chart, allow you to add any class to this value. For example: if (value > 90) { sb.append("importantValue"); } else { sb.append("basicValue"); }

Parameters:
sb - the string buffer to append to
legend - the legend associated with this value
value - the value printed
display - the format of the chart (see CharTag.DISPLAY_VCHART ChartTag.DISPLAY_HCHART)

beautifyTitle

public String beautifyTitle(String title)
String beautifier for the chart title.

Parameters:
title - string to beautify
Returns:
the beautified string

beautifyLegend

public String beautifyLegend(String legend,
                             Integer[] values)
Called for each legend of the chart which has a value associated to it.

Parameters:
legend - the legend to beautify
values - the value associated with this legend
Returns:
the beautified legend

beautifyLegend

public String beautifyLegend(String legend)
Called for each legend of the the chart with no value.

Parameters:
legend - the legend to beautify
Returns:
the beautified legend

setLocale

public void setLocale(Locale locale)
Overrides:
setLocale in class Beautifier


Copyright © 2001-2010 Jalios SA. All Rights Reserved.