org.pentaho.platform.uifoundation.chart
Class DashboardWidgetComponent

java.lang.Object
  extended by org.pentaho.platform.engine.core.system.PentahoBase
      extended by org.pentaho.platform.engine.services.PentahoMessenger
          extended by org.pentaho.platform.uifoundation.component.BaseUIComponent
              extended by org.pentaho.platform.uifoundation.component.xml.XmlComponent
                  extended by org.pentaho.platform.uifoundation.chart.DashboardWidgetComponent
All Implemented Interfaces:
Serializable, ILogger, IUIComponent, IXMLComponent

public class DashboardWidgetComponent
extends XmlComponent

This class is a Pentaho user interface component.

It generates dial images that can be embedded into JSPs, portals or other HTML supporting user interface.

  1. The creating object sets the width, height, the type of the dial, and the name of the dial.xml file that contains the definition of the dial.
  2. This class creates an instance of a DialWidgetDefinition using the specified XML definition file. The XML files are located in the solution folders and have .dial.xml extenstions. The dial XML files define the attributes that define how the dial looks.
  3. It uses the JFreeChartEngine to create an image of the dial.
  4. Once the image has been created this class creates an XML document describing the dial
  5. It uses an XSL to tranforms the XML description into HTML.
This is an example image

See Also:
Serialized Form

Field Summary
static int TYPE_DIAL
           
static int TYPE_THERMOMETER
           
 
Fields inherited from class org.pentaho.platform.uifoundation.component.BaseUIComponent
debug
 
Fields inherited from class org.pentaho.platform.engine.core.system.PentahoBase
EMPTYLOGID, LOGID_MASK1, LOGID_MASK2, LOGID_SEPARATOR
 
Fields inherited from interface org.pentaho.platform.api.engine.ILogger
ACTIVITY_LOG, DEBUG, ERROR, FATAL, INFO, INSTANCE_LOG, SESSION_LOG, SOLUTION_LOG, TRACE, UNKNOWN, WARN
 
Constructor Summary
DashboardWidgetComponent(int type, String definitionPath, int width, int height, IPentahoUrlFactory urlFactory, List messages)
          Creates a DashboardWidgetComponent.
 
Method Summary
 void dispose()
           
 Log getLogger()
          Gets the logger for his component.
 Document getXmlContent()
          Create a dial image.
 void setTitle(String title)
          Sets the title for the dial
 void setUnits(String units)
          Sets the unit for the dial value
 void setValue(double value)
          Sets the value to be displayed by the dial.
 boolean validate()
          Validate that this component can generate the requested dial
 
Methods inherited from class org.pentaho.platform.uifoundation.component.xml.XmlComponent
getContent
 
Methods inherited from class org.pentaho.platform.uifoundation.component.BaseUIComponent
done, getObjectParameter, getParameter, getParameterAsArray, getParameterProviders, getXsl, getXslProperties, handleRequest, setParameterProvider, setParameterProviders, setRequestHandler, setUrlFactory, setXsl, setXslProperty, validate
 
Methods inherited from class org.pentaho.platform.engine.services.PentahoMessenger
debug, debug, error, error, fatal, fatal, getMessages, getUserString, info, info, setMessages, trace, trace, warn, warn
 
Methods inherited from class org.pentaho.platform.engine.core.system.PentahoBase
genLogIdFromInfo, genLogIdFromInfo, genLogIdFromSession, getLoggingLevel, getLogId, getObjectName, setLoggingLevel, setLogId
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_DIAL

public static final int TYPE_DIAL
See Also:
Constant Field Values

TYPE_THERMOMETER

public static final int TYPE_THERMOMETER
See Also:
Constant Field Values
Constructor Detail

DashboardWidgetComponent

public DashboardWidgetComponent(int type,
                                String definitionPath,
                                int width,
                                int height,
                                IPentahoUrlFactory urlFactory,
                                List messages)
Creates a DashboardWidgetComponent.

After creating an instance of this class validate should be called.

Parameters:
type - The type of the widget, currently only TYPE_DIAL is supported
definitionPath - The path and name of the XML definition of the dial
width - The width of the image to be created
height - The height of the image to be created
urlFactory - The urlFactory for the content
messages - The messages list for any logger messages
Method Detail

setValue

public void setValue(double value)
Sets the value to be displayed by the dial.

Parameters:
value - The dial value

setTitle

public void setTitle(String title)
Sets the title for the dial

Parameters:
title - The title of the dial

setUnits

public void setUnits(String units)
Sets the unit for the dial value

Parameters:
units - The dial units

getLogger

public Log getLogger()
Gets the logger for his component.

Specified by:
getLogger in class BaseUIComponent
Returns:
logger This component's logger

validate

public boolean validate()
Validate that this component can generate the requested dial

Specified by:
validate in interface IUIComponent
Specified by:
validate in class BaseUIComponent

getXmlContent

public Document getXmlContent()
Create a dial image.

Specified by:
getXmlContent in interface IXMLComponent
Specified by:
getXmlContent in class XmlComponent
Returns:
The XML document describing this dial

dispose

public void dispose()