planetj.formatters
Class HorizontalGraphFormatter

java.lang.Object
  extended byplanetj.formatters.AbstractFormatter
      extended byplanetj.formatters.HorizontalGraphFormatter
All Implemented Interfaces:
IFormatter

public class HorizontalGraphFormatter
extends AbstractFormatter

This class uses an HTML image tag to produce a horizontal bar graph.


Constructor Summary
HorizontalGraphFormatter()
           
 
Method Summary
 java.lang.String formatValue(java.lang.Object value, Field f)
          Formats a value for display.
 double getMaxGraphSizeInPixels()
          Return the longest size to use for the graph bar.
 boolean isPrepareFieldValue(Field field, ExecutingContext ec)
          Checks whether or not this fields value should be prepared.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HorizontalGraphFormatter

public HorizontalGraphFormatter()
Method Detail

isPrepareFieldValue

public boolean isPrepareFieldValue(Field field,
                                   ExecutingContext ec)
Description copied from interface: IFormatter
Checks whether or not this fields value should be prepared. For example, there could be an HTML formatter that generates HTML and it's resulting value should not be altered.

Specified by:
isPrepareFieldValue in interface IFormatter
Overrides:
isPrepareFieldValue in class AbstractFormatter

getMaxGraphSizeInPixels

public double getMaxGraphSizeInPixels()
Return the longest size to use for the graph bar. Subclasses can override.


formatValue

public java.lang.String formatValue(java.lang.Object value,
                                    Field f)
Description copied from interface: IFormatter
Formats a value for display. This method is only used when formating a read-only display value

Parameters:
value - The value to format
f - The field whose value is being formatted
Returns:
The formatted display value of the value