Bean Builder

com.adventnet.beans.charts
Class WebNMSPieChart

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--com.klg.jclass.chart.JCChart
                          |
                          +--com.klg.jclass.chart.beans.BaseChart
                                |
                                +--com.adventnet.beans.charts.WebNMSPieChart

public class WebNMSPieChart
extends BaseChart
implements JCPickListener

The WebNMSPieChart is a Chart bean that is useful to represent the numeric values, which are polled from one or more variables of a remote agent, visually in the form of Pie Representation.





To Plot the values in the chart, the various setItemValues methods are available.

To plot the dynamic values, the following code snippet can be used.

Set the number of Arcs value corresponding to the number of series.


  WebNMSPietChart.setItemValue(int intValue ,long[] longArg);
 
To Plot the static data: The code fragment must look like:

  WebNMSPieChart.setItemValues(long[] longArg);
 

It has plenty of options to show the details of the drawn data. This is done by setting the LegendVisible property of the Chart Bean to true. The title for the Legend along with the Labels for the Series can be set to the Chart.

The code fragment must look like:

  WebNMSPieChart.setLegendVisible(true);
  WebNMSPieChart.setLegendTitle("WebNMSPieChart");
  WebNMSPieChart.setItemLabels("Testing PieChart");
 
The Pie Chart allows you to draw the Chart in 3D View along with the Required Depth. The Option of Pick Listener allows the User to rotate or explode the Chart even during the Run Time. The Color to fill the chart can be achieved at any time by specifying the Color value for the respective Series Number. The code fragment must look like:

WebNMSPieChart.setFillPattern(0,Color.red);

See Also:
BaseChart, Serialized Form

Inner classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Field Summary
protected  JCDefaultDataSource dataSourceUsed
          The base data source used by the chart to handle the 'x'value data and the 'y'value data.
 
Fields inherited from class com.klg.jclass.chart.beans.BaseChart
AUTOMATIC, axesOrientationStrings, axesOrientationValues, dataSource, DAYS, EAST, HORIZONTAL, HOURS, MAX, MIN, MINUTES, MONTHS, NORTH, NORTHEAST, NORTHWEST, ORIENT_INVERTED_X_NORMAL_Y_NORMAL, ORIENT_INVERTED_X_NORMAL_Y_REVERSED, ORIENT_INVERTED_X_REVERSED_Y_NORMAL, ORIENT_INVERTED_X_REVERSED_Y_REVERSED, ORIENT_X_NORMAL_Y_NORMAL, ORIENT_X_NORMAL_Y_REVERSED, ORIENT_X_REVERSED_Y_NORMAL, ORIENT_X_REVERSED_Y_REVERSED, ORIGIN, POINT_LABELS, ROTATE_270, ROTATE_90, ROTATE_NONE, SECONDS, SOUTH, SOUTHEAST, SOUTHWEST, tableModel, TIME_LABELS, VALUE, VALUE_ANCHORED, VALUE_LABELS, VERTICAL, WEEKS, WEST, YEARS
 
Fields inherited from class com.klg.jclass.chart.JCChart
AREA, BAR, cancelKey, CANDLE, chartApplet, chartArea, chartAreaLayoutHints, chartLabelManager, customizer, customizerName, data, ERRMSG_INVALID_TRIGGER_INDEX, fillColorIndex, FILLED_RADAR, footer, footerLayoutHints, header, headerLayoutHints, HILO, HILO_OPEN_CLOSE, LAST_PREDEFINED_CHART_TYPE, legend, legendLayoutHints, legendManager, lineColorIndex, listeners, NONE, pickListeners, PIE, PLOT, POLAR, RADAR, resetKey, SCATTER_PLOT, STACKING_AREA, STACKING_BAR, symbolColorIndex, symbolShapeIndex, triggers
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
WebNMSPieChart()
          The Class WebNMSPieChart is an extended class of the BaseChart
 
Method Summary
 void addChartLabels()
          The default Labels for the chart are generated
 JCDefaultDataSource getDataSourceUsed()
          Returns the data source used by the PieChart.
 java.awt.Color[] getFillColor()
          Returns the Pie's Color of the PieChart.
 java.awt.Color getFillColor(int intValue)
          Returns the Color property of JCFillStyle, which determines the color used to paint the fill region.
 int getFillPattern(int intValue)
          Returns the Pattern property of JCFillStyle, which controls the pattern used to fill the specified region.
 java.lang.String[] getItemLabels()
          Returns the Item Labels of the PieChart.
 double[] getItemValues()
          Returns the Item Values of the PieChart.
 JCChartStyle getJCChartStyle(int intValue)
          Returns the JCChartStyle that can be used for setting the pie chart's fill properties.
 JCPieChartFormat getJCPieChartFormat()
          Returns the JCPieChartFormat with which the limitations and the setup of data can be modified.
 java.lang.String getLegendTitle()
          Returns the LegendTitle of the PieChart.
 int getNumberOfArcs()
          Returns the number of series specified for drawing the Pie Chart
 void pick(JCPickEvent e)
          The pie chart can be exploded by this 'Pick Listener' in a click and retained back with another click.
 void removeChartLabels()
          The generated default Labels can be Removed
 void setFillColor(java.awt.Color[] color)
          Sets the Pie's Color with the given Color Array.
 void setFillColor(int intValue, java.awt.Color color)
          Sets the Color property of JCFillStyle, which determines the color used to paint the fill region.
 void setFillPattern(int intValue, int patternValue)
          Sets the Pattern property of JCFillStyle, which controls the pattern used to fill the specified region.
 void setItemLabels(java.lang.String[] strValue)
          Sets the Legend Labels with the given String Array.
 void setItemValue(int intValue, double doubleValue)
          Sets the values for the Pie Chart's data source with the series value.
 void setItemValues(double[] doubleValue)
          Sets the double values for the Pie Chart's data source.
 void setItemValues(long[] longValue)
          Sets the long values for the Pie Chart's data source.
 void setLegendTitle(java.lang.String stringValue)
          Sets the Title for the Legend with the specified String value.
 void setNumberOfArcs(int intArg)
          Sets the number of series for drawing the Pie Chart
 
Methods inherited from class com.klg.jclass.chart.beans.BaseChart
getAxisOrientation, getChartType, getFooterFont, getFooterText, getHeaderFont, getHeaderText, getLegendAnchor, getLegendOrientation, getLegendVisible, getSwingDataModel, getView3D, getXAxisAnnotationMethod, getXAxisGridVisible, getXAxisLogarithmic, getXAxisMax, getXAxisMin, getXAxisMinMax, getXAxisNumSpacing, getXAxisTitleText, getXAxisVisible, getYAxisAnnotationMethod, getYAxisGridVisible, getYAxisLogarithmic, getYAxisMax, getYAxisMin, getYAxisMinMax, getYAxisNumSpacing, getYAxisTitleText, getYAxisVisible, setAxisOrientation, setChartType, setFooterFont, setFooterText, setHeaderFont, setHeaderText, setLegendAnchor, setLegendOrientation, setLegendVisible, setSwingDataModel, setView3D, setXAxisAnnotationMethod, setXAxisGridVisible, setXAxisLogarithmic, setXAxisMax, setXAxisMin, setXAxisMinMax, setXAxisNumSpacing, setXAxisTitleText, setXAxisVisible, setYAxisAnnotationMethod, setYAxisGridVisible, setYAxisLogarithmic, setYAxisMax, setYAxisMin, setYAxisMinMax, setYAxisNumSpacing, setYAxisTitleText, setYAxisVisible
 
Methods inherited from class com.klg.jclass.chart.JCChart
addChartListener, addDataView, addNotify, addPickListener, addTrigger, ancestorAdded, ancestorMoved, ancestorRemoved, cancel, createChartArea, createFooter, createHeader, createLegend, createLocalImage, createToolTip, doLayout, findDataView, findMatchingTrigger, firePaint, getAbout, getAllowUserChanges, getCancelKey, getChanged, getChanged, getChartArea, getChartLabelManager, getComponentArea, getComponentAt, getCustomizerName, getDataView, getDataView, getDrawingArea, getDrawingArea, getDrawingAreaHeight, getDrawingAreaWidth, getFillColorIndex, getFooter, getGraphics, getHeader, getLayoutHints, getLegend, getLineColorIndex, getNumData, getNumTriggers, getOriginalDataView, getResetKey, getSource, getSymbolColorIndex, getSymbolShapeIndex, getToolTipLocation, getToolTipText, getTrigger, getUI, getUIClassID, hasChartLabelManager, init, isBatched, isChanged, isChanged, isFocusTraversable, isWarningDialog, keyPressed, keyReleased, keyTyped, launchPropertyPage, main, makeChart, moreAddNotify, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, paint, paintChildren, paintComponent, pick, printAll, processKeyEvent, processMouseEvent, processMouseMotionEvent, recalc, registerUI, removeChartListener, removeDataView, removePickListener, removeTrigger, requestFocus, reset, resetDefaults, rotate, rotateEnd, rotateStart, scale, sendPickEvent, serverPaint, serverSnapshot, setAbout, setAllowUserChanges, setBackground, setBatched, setCancelKey, setChanged, setChanged, setChartArea, setChartLabelManager, setCustomizerName, setDataView, setDataView, setFillColorIndex, setFont, setFooter, setForeground, setGraphics, setHeader, setLayout, setLayoutHints, setLegend, setLineColorIndex, setOpaque, setResetKey, setSymbolColorIndex, setSymbolShapeIndex, setTrigger, setUI, setWarningDialog, snapshot, snapshot, snapshot, translate, translateStart, unpick, unpick, update, updateUI, zoom
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getHeight, getInsets, getInsets, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipText, getTopLevelAncestor, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, isDoubleBuffered, isFocusCycleRoot, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintImmediately, paintImmediately, paramString, print, processComponentKeyEvent, processFocusEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setMaximumSize, setMinimumSize, setNextFocusableComponent, setPreferredSize, setRequestFocusEnabled, setToolTipText, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setCursor, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hide, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processInputMethodEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

dataSourceUsed

protected JCDefaultDataSource dataSourceUsed
The base data source used by the chart to handle the 'x'value data and the 'y'value data.
Constructor Detail

WebNMSPieChart

public WebNMSPieChart()
The Class WebNMSPieChart is an extended class of the BaseChart
Method Detail

getNumberOfArcs

public int getNumberOfArcs()
Returns the number of series specified for drawing the Pie Chart
Returns:
'int'

setNumberOfArcs

public void setNumberOfArcs(int intArg)
Sets the number of series for drawing the Pie Chart
Parameters:
intArg - The Number of series in the form of Integer

setItemValues

public void setItemValues(long[] longValue)
Sets the long values for the Pie Chart's data source.
Parameters:
longValue - The values for drawing the pie chart is given in the form of long Array

setItemValues

public void setItemValues(double[] doubleValue)
Sets the double values for the Pie Chart's data source.
Parameters:
doubleValue - The values for drawing the PieChart is given in the form of double Array

setItemValue

public void setItemValue(int intValue,
                         double doubleValue)
Sets the values for the Pie Chart's data source with the series value.
Parameters:
intValue - The Series number in the form of integer value
doubleValue - The Data in the form of double value

getJCPieChartFormat

public JCPieChartFormat getJCPieChartFormat()
Returns the JCPieChartFormat with which the limitations and the setup of data can be modified.
Returns:
'JCPieChartFormat'
See Also:
JCPieChartFormat

getJCChartStyle

public JCChartStyle getJCChartStyle(int intValue)
Returns the JCChartStyle that can be used for setting the pie chart's fill properties.
Parameters:
intValue - The Series number in the form of integer value
Returns:
'JCChartStyle'
See Also:
ChartDataView.getChartStyle(), JCChartStyle

pick

public void pick(JCPickEvent e)
The pie chart can be exploded by this 'Pick Listener' in a click and retained back with another click.
Specified by:
pick in interface JCPickListener
Parameters:
e - The event value of the Mouse selects the pie chart

addChartLabels

public void addChartLabels()
The default Labels for the chart are generated

removeChartLabels

public void removeChartLabels()
The generated default Labels can be Removed

getFillColor

public java.awt.Color getFillColor(int intValue)
Returns the Color property of JCFillStyle, which determines the color used to paint the fill region.
Parameters:
intValue - The Number of series in the form of Integer
Returns:
'Color'
See Also:
JCChartStyle.getFillColor()

getFillPattern

public int getFillPattern(int intValue)
Returns the Pattern property of JCFillStyle, which controls the pattern used to fill the specified region.
Parameters:
intValue - The Number of series in the form of Integer
Returns:
'int'
See Also:
JCChartStyle.getFillPattern()

setFillColor

public void setFillColor(int intValue,
                         java.awt.Color color)
Sets the Color property of JCFillStyle, which determines the color used to paint the fill region.
Parameters:
intValue - The Number of series in the form of Integer
color - AWT Color class representing the color to be used to paint the fills. If null, the current color of the Graphics object is used to paint the fill.
See Also:
JCChartStyle.setFillColor(java.awt.Color)

setFillPattern

public void setFillPattern(int intValue,
                           int patternValue)
Sets the Pattern property of JCFillStyle, which controls the pattern used to fill the specified region.
Parameters:
intValue - The Number of series in the form of Integer
patternValue - Fill pattern, which is one of the following NONE, SOLID, 25_PERCENT, 50_PERCENT, 75_PERCENT,HORIZ_STRIPE, VERT_STRIPE, 45_STRIPE, 135_STRIPE, DIAG_HATCHED, CROSS_HATCHED,CUSTOM_FILL, or CUSTOM_STACK. (CUSTOM_STACK is only used by bar charts.)
See Also:
JCChartStyle.setFillPattern(int)

getDataSourceUsed

public JCDefaultDataSource getDataSourceUsed()
Returns the data source used by the PieChart.
Returns:
'JCDefaultDataSource'
See Also:
ChartDataView.getDataSource(), JCDefaultDataSource

setLegendTitle

public void setLegendTitle(java.lang.String stringValue)
Sets the Title for the Legend with the specified String value.
Parameters:
stringValue - The Legend Title in the form of String value
See Also:
JCDefaultDataSource.setName(java.lang.String)

getLegendTitle

public java.lang.String getLegendTitle()
Returns the LegendTitle of the PieChart.
Returns:
'String'

setItemLabels

public void setItemLabels(java.lang.String[] strValue)
Sets the Legend Labels with the given String Array.
Parameters:
strValue - The Legend Labels in the form of String Array
See Also:
JCDefaultDataSource.setSeriesLabels(java.lang.String[])

getItemLabels

public java.lang.String[] getItemLabels()
Returns the Item Labels of the PieChart.
Returns:
a String[] value

setFillColor

public void setFillColor(java.awt.Color[] color)
Sets the Pie's Color with the given Color Array.
Parameters:
color - The Pie's color in the form of Color[] Array
See Also:
JCChartStyle.setFillColor(java.awt.Color)

getFillColor

public java.awt.Color[] getFillColor()
Returns the Pie's Color of the PieChart.
Returns:
a Color[] value
See Also:
JCChartStyle.getFillColor()

getItemValues

public double[] getItemValues()
Returns the Item Values of the PieChart.
Returns:
a double[] value

Bean Builder

© 2010 ZOHO Corp., All Rights Reserved. Visit us at: http://www.webnms.com/webnms