Class DialWidgetDefinition
- java.lang.Object
-
- org.jfree.data.general.AbstractDataset
-
- org.jfree.data.general.DefaultValueDataset
-
- org.pentaho.platform.uifoundation.chart.WidgetDefinition
-
- org.pentaho.platform.uifoundation.chart.DialWidgetDefinition
-
- All Implemented Interfaces:
ObjectInputValidation
,Serializable
,Cloneable
,org.jfree.data.general.Dataset
,org.jfree.data.general.ValueDataset
,org.jfree.data.Value
,org.jfree.util.PublicCloneable
,ChartDefinition
public class DialWidgetDefinition extends WidgetDefinition implements ChartDefinition
This class represents the definition of a dashboard dial. It holds:- The value to be displayed on the dial
- Minimum value of the dial
- Maximum value of the dial
- A list of intervals with the dial. Each interval specifies a minimum, maximum and information about how the interval should be painted.
- Painting information
- Background paint
- Dial paint
- Needle paint
org.pentaho.core.ui.component.JFreeChartEngine
Example Dial
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface org.pentaho.platform.uifoundation.chart.ChartDefinition
AREA_CHART_STR, BACKGROUND_ALPHA_NODE_NAME, BACKGROUND_TYPE_ATTRIBUTE_NAME, BAR_CHART_STR, BAR_LINE_CHART_STR, BUBBLE_CHART_STR, CATEGORY_DATASET_STR, CHART_BACKGROUND_NODE_NAME, CHART_BORDER_PAINT_NODE_NAME, CHART_BORDER_VISIBLE_NODE_NAME, COLOR_NODE_NAME, COLOR_TYPE_NAME, DATASET_TYPE_NODE_NAME, DAY_PERIOD_TYPE_STR, DIAL_CHART_STR, DIFFERENCE_CHART_STR, DISPLAY_LABELS_NODE_NAME, DISPLAY_LEGEND_BORDER_NODE_NAME, DOT_CHART_STR, DOT_HEIGHT_NODE_NAME, DOT_WIDTH_NODE_NAME, FIXEDMILLISECOND_PERIOD_TYPE_STR, FOREGROUND_ALPHA_NODE_NAME, GRADIENT_TYPE_NAME, HEIGHT_NODE_NAME, HORIZONTAL_ORIENTATION, HOUR_PERIOD_TYPE_STR, IMAGE_TYPE_NAME, INCLUDE_LEGEND_NODE_NAME, LEGEND_FONT_NODE_NAME, LEGEND_POSITION_NODE_NAME, LINE_CHART_STR, LINE_STYLE_DASH_STR, LINE_STYLE_DASHDOT_STR, LINE_STYLE_DASHDOTDOT_STR, LINE_STYLE_DOT_STR, LINE_STYLE_NODE_NAME, LINE_STYLE_SOLID_STR, LINE_WIDTH_NODE_NAME, MARKER_VISIBLE_NODE_NAME, MILLISECOND_PERIOD_TYPE_STR, MINUTE_PERIOD_TYPE_STR, MONTH_PERIOD_TYPE_STR, PALETTE_NODE_NAME, PIE_CHART_STR, PIE_GRID_CHART_STR, PLOT_BACKGROUND_NODE_NAME, QUARTER_PERIOD_TYPE_STR, SECOND_PERIOD_TYPE_STR, STACKED_NODE_NAME, STEP_AREA_CHART_STR, STEP_CHART_STR, SUBTITLE_NODE_NAME, SUBTITLES_NODE_NAME, TEXTURE_TYPE_NAME, THREED_NODE_NAME, TIME_SERIES_COLLECTION_STR, TITLE_FONT_NODE_NAME, TITLE_NODE_NAME, TITLE_POSITION_NODE_NAME, TYPE_NODE_NAME, VERTICAL_ORIENTATION, WEEK_PERIOD_TYPE_STR, WIDTH_NODE_NAME, XY_SERIES_COLLECTION_STR, XYZ_SERIES_COLLECTION_STR, YEAR_PERIOD_TYPE_STR
-
-
Constructor Summary
Constructors Constructor Description DialWidgetDefinition(double value, double minimum, double maximum, boolean rangeLimited)
DialWidgetDefinition(org.dom4j.Document document, double value, int width, int height, org.pentaho.platform.api.engine.IPentahoSession session)
TODO: PROBLEM HERE! See the note on the constructor above.DialWidgetDefinition(org.pentaho.commons.connection.IPentahoResultSet data, boolean byRow, org.dom4j.Node chartAttributes, int width, int height, org.pentaho.platform.api.engine.IPentahoSession session)
TODO PROBLEM HERE! If you use this constructor, the XML schema for the chart attributes is different than if you use the constructor with the arguments public DialWidgetDefinition( Document document, double value, int width, int height, IPentahoSession session).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addInterval(org.jfree.chart.plot.MeterInterval interval)
Add an interval (MeterInterval) to the dial definition.void
addSubTitle(String subTitle)
void
addSubTitles(List subTitleNodes)
static void
createDial(DialWidgetDefinition widgetDefinition, org.dom4j.Node dialNode, int width, int height, org.pentaho.platform.api.engine.IPentahoSession session)
Create a dial definition object from an XML documentvoid
deriveMinMax(double value)
Float
getBackgroundAlpha()
Paint
getBorderPaint()
Image
getChartBackgroundImage()
Paint
getChartBackgroundPaint()
org.jfree.chart.plot.DialShape
getDialShape()
Return the shape to be used for the dial.Float
getForegroundAlpha()
int
getHeight()
List
getIntervals()
Return a list of the intervals for the dial.Font
getLegendFont()
Return the java.awt.Font to be used to display the legend itemsorg.jfree.ui.RectangleEdge
getLegendPosition()
static org.apache.commons.logging.Log
getLogger()
Paint
getNeedlePaint()
Return the java.awt.Paint used to paint the needle of the dial imagePaint[]
getPaintSequence()
Image
getPlotBackgroundImage()
Paint
getPlotBackgroundPaint()
Return the java.awt.Paint object to be used to paint the backound of the dial.List
getSubtitles()
Paint
getTickPaint()
int
getTickSize()
String
getTitle()
Font
getTitleFont()
Return the java.awt.Font to be used to display the dial titleorg.jfree.ui.RectangleEdge
getTitlePosition()
String
getUnits()
Font
getValueFont()
Paint
getValuePaint()
int
getWidth()
boolean
isBorderVisible()
boolean
isDisplayLabels()
boolean
isLegendBorderVisible()
Return the boolen that states if the legend border is visibleboolean
isLegendIncluded()
boolean
isThreeD()
void
setBackgroundAlpha(org.dom4j.Node backgroundAlphaNode)
void
setChartBackgroundPaint(Paint chartBackgroundPaint)
void
setDialShape(org.jfree.chart.plot.DialShape dialShape)
Sets the shape to be used for the dial.void
setForegroundAlpha(org.dom4j.Node foregroundAlphaNode)
void
setLegendBorderVisible(boolean legendBorderVisible)
void
setLegendBorderVisible(org.dom4j.Node legendBorderVisibleNode)
void
setLegendFont(Font legendFont)
Set java.awt.Font to be used to display the legend itemsvoid
setLegendFont(org.dom4j.Node legendFontNode)
void
setNeedlePaint(Paint needlePaint)
Sets the java.awt.Paint object to be used to paint the needle of the dial image.void
setPlotBackgroundPaint(Paint plotBackgroundPaint)
Return the java.awt.Paint object to be used to paint the backound of the dial.void
setTickPaint(Paint tickPaint)
void
setTickSize(int tickSize)
void
setTitleFont(Font tFont)
void
setUnits(String units)
void
setValue(double value)
Sets the value to be displayed on the dial imagevoid
setValueFont(Font valueFont)
void
setValuePaint(Paint valuePaint)
-
Methods inherited from class org.pentaho.platform.uifoundation.chart.WidgetDefinition
getMaximum, getMinimum, getNoDataMessage, setMaximum, setMinimum
-
Methods inherited from class org.jfree.data.general.DefaultValueDataset
equals, getValue, hashCode, setValue
-
Methods inherited from class org.jfree.data.general.AbstractDataset
addChangeListener, clone, fireDatasetChanged, getGroup, hasListener, notifyListeners, removeChangeListener, setGroup, validateObject
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.pentaho.platform.uifoundation.chart.ChartDefinition
getNoDataMessage
-
-
-
-
Constructor Detail
-
DialWidgetDefinition
public DialWidgetDefinition(double value, double minimum, double maximum, boolean rangeLimited)
-
DialWidgetDefinition
public DialWidgetDefinition(org.pentaho.commons.connection.IPentahoResultSet data, boolean byRow, org.dom4j.Node chartAttributes, int width, int height, org.pentaho.platform.api.engine.IPentahoSession session)
TODO PROBLEM HERE! If you use this constructor, the XML schema for the chart attributes is different than if you use the constructor with the arguments public DialWidgetDefinition( Document document, double value, int width, int height, IPentahoSession session). This constructor expects the chart attribute nodes to be children of thenode, whereas the latter constructor expects the attributes to be children of a node. This does not help us with our parity situation, and should be deprecated and reconciled. - Parameters:
data
-byRow
-chartAttributes
-width
-height
-session
-
-
DialWidgetDefinition
public DialWidgetDefinition(org.dom4j.Document document, double value, int width, int height, org.pentaho.platform.api.engine.IPentahoSession session)
TODO: PROBLEM HERE! See the note on the constructor above.- Parameters:
document
-value
-width
-height
-session
-
-
-
Method Detail
-
getLogger
public static org.apache.commons.logging.Log getLogger()
-
createDial
public static void createDial(DialWidgetDefinition widgetDefinition, org.dom4j.Node dialNode, int width, int height, org.pentaho.platform.api.engine.IPentahoSession session)
Create a dial definition object from an XML document- Parameters:
doc
- definition XML document
-
setUnits
public void setUnits(String units)
-
getUnits
public String getUnits()
-
deriveMinMax
public void deriveMinMax(double value)
-
addInterval
public void addInterval(org.jfree.chart.plot.MeterInterval interval)
Add an interval (MeterInterval) to the dial definition. The interval defines a range and how it should be painted. The dial images here have three intervals. The lowest interval has a minimum of 0 and a maximum of 30. Intervals have a color. In this image the lowest interval color is set to red.
Intervals have a text color. In this image the lowest interval text color is set to red. This affects the outer rim, the interval value text
- Parameters:
interval
- A MeterInterval that defines an interval (range) on the dial
-
setValue
public void setValue(double value)
Sets the value to be displayed on the dial image- Parameters:
value
- The value to be displayed
-
getPlotBackgroundPaint
public Paint getPlotBackgroundPaint()
Return the java.awt.Paint object to be used to paint the backound of the dial.- Specified by:
getPlotBackgroundPaint
in interfaceChartDefinition
- Returns:
- The Paint to be used
-
setPlotBackgroundPaint
public void setPlotBackgroundPaint(Paint plotBackgroundPaint)
Return the java.awt.Paint object to be used to paint the backound of the dial. In this image the background paint has been set to red
-
getNeedlePaint
public Paint getNeedlePaint()
Return the java.awt.Paint used to paint the needle of the dial image- Returns:
- The Paint to use for the needle of this dial
-
setNeedlePaint
public void setNeedlePaint(Paint needlePaint)
Sets the java.awt.Paint object to be used to paint the needle of the dial image. In this image the needle paint has been set to red.
- Parameters:
needlePaint
- The Paint to use for ths needle of this dial
-
getDialShape
public org.jfree.chart.plot.DialShape getDialShape()
Return the shape to be used for the dial.- Returns:
- DialShape The DialShape for this dial
-
getTitleFont
public Font getTitleFont()
Return the java.awt.Font to be used to display the dial title- Specified by:
getTitleFont
in interfaceChartDefinition
- Returns:
- Font The Font for the title of this dial
-
setTitleFont
public void setTitleFont(Font tFont)
-
setDialShape
public void setDialShape(org.jfree.chart.plot.DialShape dialShape)
Sets the shape to be used for the dial. This affects the area of dial outside the range that the needle covers.CIRCLE CHORD PIE - Parameters:
dialShape
- The shape for this dial
-
getIntervals
public List getIntervals()
Return a list of the intervals for the dial. Each object in the list is a MeterInterval object.- Returns:
- List The list of MeterInterval objects for this dial
-
getPaintSequence
public Paint[] getPaintSequence()
- Specified by:
getPaintSequence
in interfaceChartDefinition
-
getPlotBackgroundImage
public Image getPlotBackgroundImage()
- Specified by:
getPlotBackgroundImage
in interfaceChartDefinition
-
getSubtitles
public List getSubtitles()
- Specified by:
getSubtitles
in interfaceChartDefinition
-
addSubTitles
public void addSubTitles(List subTitleNodes)
-
addSubTitle
public void addSubTitle(String subTitle)
-
getChartBackgroundPaint
public Paint getChartBackgroundPaint()
- Specified by:
getChartBackgroundPaint
in interfaceChartDefinition
-
getChartBackgroundImage
public Image getChartBackgroundImage()
- Specified by:
getChartBackgroundImage
in interfaceChartDefinition
-
isBorderVisible
public boolean isBorderVisible()
- Specified by:
isBorderVisible
in interfaceChartDefinition
-
getBorderPaint
public Paint getBorderPaint()
- Specified by:
getBorderPaint
in interfaceChartDefinition
-
getTitlePosition
public org.jfree.ui.RectangleEdge getTitlePosition()
- Specified by:
getTitlePosition
in interfaceChartDefinition
-
getLegendPosition
public org.jfree.ui.RectangleEdge getLegendPosition()
- Specified by:
getLegendPosition
in interfaceChartDefinition
-
setChartBackgroundPaint
public void setChartBackgroundPaint(Paint chartBackgroundPaint)
- Parameters:
chartBackgroundPaint
- The chartBackgroundPaint to set.
-
getHeight
public int getHeight()
- Specified by:
getHeight
in interfaceChartDefinition
-
getWidth
public int getWidth()
- Specified by:
getWidth
in interfaceChartDefinition
-
getTitle
public String getTitle()
- Specified by:
getTitle
in interfaceChartDefinition
-
isLegendIncluded
public boolean isLegendIncluded()
- Specified by:
isLegendIncluded
in interfaceChartDefinition
-
isThreeD
public boolean isThreeD()
- Specified by:
isThreeD
in interfaceChartDefinition
-
getValuePaint
public Paint getValuePaint()
-
getTickPaint
public Paint getTickPaint()
-
getTickSize
public int getTickSize()
-
setValuePaint
public void setValuePaint(Paint valuePaint)
-
setTickPaint
public void setTickPaint(Paint tickPaint)
-
setTickSize
public void setTickSize(int tickSize)
-
getValueFont
public Font getValueFont()
- Specified by:
getValueFont
in classWidgetDefinition
-
setValueFont
public void setValueFont(Font valueFont)
-
isDisplayLabels
public boolean isDisplayLabels()
- Specified by:
isDisplayLabels
in interfaceChartDefinition
-
getLegendFont
public Font getLegendFont()
Return the java.awt.Font to be used to display the legend items- Specified by:
getLegendFont
in interfaceChartDefinition
- Returns:
- Font The font for the legend items
-
setLegendFont
public void setLegendFont(Font legendFont)
Set java.awt.Font to be used to display the legend items- Parameters:
Font
- The java.awt.Font for the legend items
-
setLegendFont
public void setLegendFont(org.dom4j.Node legendFontNode)
-
setLegendBorderVisible
public void setLegendBorderVisible(org.dom4j.Node legendBorderVisibleNode)
-
setLegendBorderVisible
public void setLegendBorderVisible(boolean legendBorderVisible)
- Parameters:
boolean
- legendBorderVisible Set the visibility of the legend border.
-
isLegendBorderVisible
public boolean isLegendBorderVisible()
Return the boolen that states if the legend border is visible- Specified by:
isLegendBorderVisible
in interfaceChartDefinition
- Returns:
- boolean Is the legend border visible
-
getBackgroundAlpha
public Float getBackgroundAlpha()
- Specified by:
getBackgroundAlpha
in interfaceChartDefinition
-
setBackgroundAlpha
public void setBackgroundAlpha(org.dom4j.Node backgroundAlphaNode)
-
getForegroundAlpha
public Float getForegroundAlpha()
- Specified by:
getForegroundAlpha
in interfaceChartDefinition
-
setForegroundAlpha
public void setForegroundAlpha(org.dom4j.Node foregroundAlphaNode)
-
-