NetCharts Pro

netcharts.pro.charts.dial
Class NFDialchart

java.lang.Object
  extended by netcharts.pro.common.NFGraph
      extended by netcharts.pro.common.circular.NFSizedChart
          extended by netcharts.pro.charts.dial.NFDialchart
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, NFDragObserver, NFDwellObserver, NFGraphObserver, NFScrollObserver

public class NFDialchart
extends NFSizedChart

The dialchart is based on a circle that has 0 degrees as North. Positive angles go clockwise and negative angles counterclockwise. When you specify angles, you can use both positive and negative values. For example, a dial's start angle could be -90 and its stop angle 90. Each DialChart can have multiple dials. Each dial can have multiple sectors and hands. The dial's tics and the dial's sectors can have labels. Furthermore, all sectors and hands can have Active Labels. You can set hands and sectors to enable dragging by users. Enabling dragging results in active modification of the sector or hand value.

See Also:
Serialized Form

Field Summary
static int BOTTOM
          Dial clip window in lower hemisphere.
static int BOTTOMLEFT
          Dial clip window in lower left quarter.
static int BOTTOMRIGHT
          Dial clip window in bottom right quarter.
static java.util.Hashtable dialClipMap
          The set of allowed dial clips.
static int HAND_ANIMATION_STYLE_FADE
          Hand animation style fade
static int HAND_ANIMATION_STYLE_GROW
          Hand animation style grow
static int HAND_ANIMATION_STYLE_NONE
          No hand animation
static int LEFT
          Dial clip window in left hemisphere.
static int NONE
          None
static int RIGHT
          Dial clip window in right hemisphere.
static int SECTOR_ANIMATION_STYLE_FADE
          Sector animation style fade
static int SECTOR_ANIMATION_STYLE_GROW
          Sector animation style grow
static int SECTOR_ANIMATION_STYLE_NONE
          No sector animation style
static int TOP
          Dial clip window in top hemisphere.
static int TOPLEFT
          Dial clip window in upper left quarter.
static int TOPRIGHT
          Dial clip window in upper right quarter.
 
Fields inherited from class netcharts.pro.common.circular.NFSizedChart
SIZE_MAX_HEIGHT_DEFAULT, SIZE_MAX_WIDTH_DEFAULT, SIZE_MIN_HEIGHT_DEFAULT, SIZE_MIN_WIDTH_DEFAULT
 
Fields inherited from class netcharts.pro.common.NFGraph
ANTIALIAS_OFF, ANTIALIAS_ON, ANTIALIAS_ONDRAW, ANTIALIAS_ONTEXT, antiAliasModeMap, BAR, BAR3D, BOX, BUBBLE, COMBO, DIAGRAM, DIAL, DWELL_ANIMATION_STYLE_HIGHLIGHT, DWELL_ANIMATION_STYLE_NONE, FADE, HEATMAP, HIGHLIGHT, HISTOGRAM, LABEL_ANIMATION_STYLE_FADE, LABEL_ANIMATION_STYLE_NONE, LEGEND_ANIMATION_STYLE_FADE, LEGEND_ANIMATION_STYLE_NONE, LEGEND_DWELL_ANIMATION_STYLE_HIGHLIGHT, LEGEND_DWELL_ANIMATION_STYLE_NONE, LINE, MULTIPIE, PARETO, PIE, POLAR, RADAR, STOCK, STRIP, TIME, XY
 
Constructor Summary
NFDialchart()
          Constructs a default chart object.
NFDialchart(javax.swing.JPanel panel)
          Constructs a chart object on the given JPanel.
NFDialchart(javax.swing.JPanel panel, java.util.Properties initProperties)
          Constructs a chart object on the given JPanel.
NFDialchart(java.util.Properties initProperties)
          Constructs a chart object on the given JPanel.
 
Method Summary
 void addDial(NFDial dial)
          Adds a dial to the dial series.
 java.lang.String getDefaultData()
          Gets the default data - used to initialize IDE editors
 NFDial getDial()
          Gets the dial object for this chart.
 boolean getDialActiveLabelsEnabled()
          Get whether or not popups over dials are enabled.
 int getDialClip()
          Gets the location of the clip window of the dial chart.
 int getDialClipPad()
          Gets the padding of the clip window of the dial chart.
 NFDialOuterBorder getDialOuterBorder()
          Get the dial outer border attributes
 NFFillPattern getDialOuterFillPattern()
          Get the dial outer fill pattern
 NFDialSeries getDialSeries()
          Gets the dial objects for this chart.
 boolean getDialSquare()
          Get dial square
 boolean getHandActiveLabelsEnabled()
          Get whether or not popups over hands are enabled.
 int getHandAnimationStyle()
          Get the hand animation style.
 NFLine getHandButtonBorder()
          Get the border for the hand button
 NFCircularEdgeHighlightSeries getHandButtonEdgeHighlightSeries()
          Get the hand edge highlight series.
 NFDropShadow getHandDropShadow()
          Get the drop shadow for the hands
 boolean getSectorActiveLabelsEnabled()
          Get whether or not popups over sectors are enabled.
 int getSectorAnimationStyle()
          Get the sector animation style.
 NFCircularEdgeHighlightSeries getSectorEdgeHighlightSeries()
          Get the sector edge highlight series.
 int getType()
          Gets the type of this chart.
 void resetState()
          Resets all of the parameter values to their initial state.
 void setDial(NFDial dial)
          Sets a dial object for this chart.
 void setDialActiveLabelsEnabled(boolean dialActiveLabelsEnabled)
          Set enable popup labels over dials.
 void setDialClip(int dialClip)
          Sets the location of the clip window of the dial chart.
 void setDialClipPad(int dialClipPad)
          Sets the padding of the clip window of the dial chart.
 void setDialOuterBorder(NFDialOuterBorder dialOuterBorder)
          Set the dial outer border attributes.
 void setDialOuterFillPattern(NFFillPattern dialOuterFillPattern)
          Set the dial outer fill pattern.
 void setDialSeries(NFDialSeries dialSeries)
          Sets the dial objects for this chart.
 void setDialSize(int minWidth, int minHeight, int maxWidth, int maxHeight)
          Set the minimum and maximum size of the Dialchart.
 void setDialSquare(boolean dialSquare)
          Set dial square
 void setHandActiveLabelsEnabled(boolean handActiveLabelsEnabled)
          Set enable popup labels over hands.
 void setHandAnimationStyle(int style)
          Set the hand animation style.
 void setHandButtonBorder(NFLine handButtonBorder)
          Set the border for the hand button
 void setHandButtonEdgeHighlightSeries(NFCircularEdgeHighlightSeries handButtonEdgeHighlightSeries)
          Set the hand edge highlight series.
 void setHandDropShadow(NFDropShadow handDropShadow)
          Set the drop shadow for the hands
 void setSectorActiveLabelsEnabled(boolean sectorActiveLabelsEnabled)
          Set enable popup labels over sectors.
 void setSectorAnimationStyle(int style)
          Set the sector animation style.
 void setSectorEdgeHighlightSeries(NFCircularEdgeHighlightSeries sectorEdgeHighlightSeries)
          Set the sector edge highlight series.
 void writeChart(java.lang.StringBuffer sb)
          Writes this chart into a string buffer
 void writeExternal(java.io.ObjectOutput out)
          Writes this chart into an object for serialization.
 
Methods inherited from class netcharts.pro.common.circular.NFSizedChart
getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, setMaxHeight, setMaxWidth, setMinHeight, setMinWidth
 
Methods inherited from class netcharts.pro.common.NFGraph
addChartActionListener, addGraphObserver, addNote, addPropertyChangeListener, display, dwellDisplay, dwellPress, finalize, getActiveClicks, getAlwaysUpdate, getAntiAlias, getAntiAliasMode, getBackgroundActiveLabel, getBackgroundFillPattern, getBackgroundRegion, getBuildAnimationEnabled, getCDL, getChartElementSpacing, getChartName, getChartSize, getColorTable, getDataActiveLabelsEnabled, getDwell, getDwellAnimation, getDwellAnimationHighlight, getDwellAnimationStyle, getDwellOffset, getErrors, getFooter, getGraph, getGraphFromTemplate, getGraphFromTemplate, getGraphFromTemplate, getGraphFromTemplate, getGraphFromTemplate, getGraphFromTemplate, getGraphFromTemplate, getGraphFromTemplate, getGraphGraphics, getHeader, getLabelAnimationStyle, getLeftTitle, getLegend, getLegendAnimationStyle, getLegendDwellAnimation, getLegendDwellAnimationHighlight, getLegendDwellAnimationStyle, getLicenseActivationKey, getMetaData, getMinimumSize, getNoteSeries, getNumberFormat, getNumErrors, getPanel, getPlotArea, getPreferredSize, getRightTitle, getRootPanel, getRubberband, getScaleFactor, getTitleSpacing, getToggleDataVisibility, getVersion, graphDrawn, graphTooSmall, initializeFromFile, initializeFromString, initializeFromURL, loadFromTemplate, loadFromTemplate, loadFromTemplate, loadLicenseFile, paint, postDrag, postScroll, preDrag, preScroll, readExternal, removeChartActionListener, removeGraphObserver, removePropertyChangeListener, sendData, sendData, sendData, sendData, sendUpdate, set, set, set, set, set, set, setActiveClicks, setAlwaysUpdate, setAntiAlias, setAntiAliasMode, setBackgroundActiveLabel, setBackgroundFillPattern, setBackgroundRegion, setBuildAnimationEnabled, setChartElementSpacing, setChartName, setChartSize, setColorTable, setDataActiveLabelsEnabled, setDocumentBase, setDwell, setDwellAnimation, setDwellAnimationHighlight, setDwellAnimationStyle, setDwellOffset, setFooter, setHeader, setLabelAnimationStyle, setLeftTitle, setLegend, setLegendAnimationStyle, setLegendDwellAnimation, setLegendDwellAnimationHighlight, setLegendDwellAnimationStyle, setLicenseKey, setLicenseKey, setLicenseLocation, setMetaData, setNoteSeries, setNumberFormat, setParentApplet, setPlotArea, setRightTitle, setRubberband, setScaleFactor, setSize, setSize, setTitleSpacing, setToggleDataVisibility, start, stop, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

HAND_ANIMATION_STYLE_NONE

public static final int HAND_ANIMATION_STYLE_NONE
No hand animation

See Also:
Constant Field Values

HAND_ANIMATION_STYLE_GROW

public static final int HAND_ANIMATION_STYLE_GROW
Hand animation style grow

See Also:
Constant Field Values

HAND_ANIMATION_STYLE_FADE

public static final int HAND_ANIMATION_STYLE_FADE
Hand animation style fade

See Also:
Constant Field Values

SECTOR_ANIMATION_STYLE_NONE

public static final int SECTOR_ANIMATION_STYLE_NONE
No sector animation style

See Also:
Constant Field Values

SECTOR_ANIMATION_STYLE_GROW

public static final int SECTOR_ANIMATION_STYLE_GROW
Sector animation style grow

See Also:
Constant Field Values

SECTOR_ANIMATION_STYLE_FADE

public static final int SECTOR_ANIMATION_STYLE_FADE
Sector animation style fade

See Also:
Constant Field Values

NONE

public static final int NONE
None

See Also:
Constant Field Values

TOPRIGHT

public static final int TOPRIGHT
Dial clip window in upper right quarter.

See Also:
Constant Field Values

TOP

public static final int TOP
Dial clip window in top hemisphere.

See Also:
Constant Field Values

TOPLEFT

public static final int TOPLEFT
Dial clip window in upper left quarter.

See Also:
Constant Field Values

LEFT

public static final int LEFT
Dial clip window in left hemisphere.

See Also:
Constant Field Values

BOTTOMLEFT

public static final int BOTTOMLEFT
Dial clip window in lower left quarter.

See Also:
Constant Field Values

BOTTOM

public static final int BOTTOM
Dial clip window in lower hemisphere.

See Also:
Constant Field Values

BOTTOMRIGHT

public static final int BOTTOMRIGHT
Dial clip window in bottom right quarter.

See Also:
Constant Field Values

RIGHT

public static final int RIGHT
Dial clip window in right hemisphere.

See Also:
Constant Field Values

dialClipMap

public static java.util.Hashtable dialClipMap
The set of allowed dial clips. Consists of NONE, TOP, BOTTOM, LEFT, RIGHT, TOPLEFT, TOPRIGHT, BOTTOMLEFT, BOTTOMRIGHT.

Constructor Detail

NFDialchart

public NFDialchart()
Constructs a default chart object.


NFDialchart

public NFDialchart(javax.swing.JPanel panel)
Constructs a chart object on the given JPanel.

Parameters:
panel - Panel to draw chart on.

NFDialchart

public NFDialchart(java.util.Properties initProperties)
Constructs a chart object on the given JPanel.

Parameters:
initProperties - A java.util.Properties object containing the set of runtime properties to use when generating the chart. See the netcharts.pro.common.NFGraph(java.util.Properties) constructor for a list of valid Properties.

NFDialchart

public NFDialchart(javax.swing.JPanel panel,
                   java.util.Properties initProperties)
Constructs a chart object on the given JPanel.

Parameters:
panel - Panel to draw chart on.
initProperties - A java.util.Properties object containing the set of runtime properties to use when generating the chart. See the netcharts.pro.common.NFGraph(java.util.Properties) constructor for a list of valid Properties.
Method Detail

addDial

public void addDial(NFDial dial)
             throws NFParamException
Adds a dial to the dial series. A new dial series object will be created if not present.

Parameters:
dial -
Throws:
NFParamException

setDial

public void setDial(NFDial dial)
             throws NFParamException
Sets a dial object for this chart. Will override any other calls to addDial or setDialSeries

Parameters:
dial -
Throws:
NFParamException

getDial

public NFDial getDial()
Gets the dial object for this chart. If more than one dial has been set, then this method will return the first dial. If no dials have been set, null is returned.

Returns:
dial or null

setDialSeries

public void setDialSeries(NFDialSeries dialSeries)
                   throws NFParamException
Sets the dial objects for this chart. An easier interface for most applications is to use addDial(dial); To set a property on the dial series, you must first retrieve the series, then set the property (properties) and finally set the dial series.
     NFDialchart chart = new NFDialchart();
     NFDialSeries ds = chart.getDialSeries();
     NFDial dial = (NFDial)ds.elementAt(0);
     // Set some of the properties on the NFDial
     ...
     ds.setElementAt(dial, 0);
     chart.setDialSeries(ds);
 

Parameters:
dialSeries -
Throws:
NFParamException

getDialSeries

public NFDialSeries getDialSeries()
Gets the dial objects for this chart. To set a property on the dial series, you must first retrieve the series, then set the property (properties) and finally set the dial series.
     NFDialchart chart = new NFDialchart();
     NFDialSeries ds = chart.getDialSeries();
     NFDial dial = (NFDial)ds.elementAt(0);
     // Set some of the properties on the NFDial
     ...
     ds.setElementAt(dial, 0);
     chart.setDialSeries(ds);
 

Returns:
dialSeries or null if not set.

setDialClip

public void setDialClip(int dialClip)
Sets the location of the clip window of the dial chart. Only the clip window will be displayed in the resultant dial chart. One of
 NONE - The entire dial will be displayed.
 TOP - Only the top hemisphere of the dial will be displayed.
 BOTTOM - Only the bottom hemisphere of the dial will be displayed.
 LEFT - Only the left hemisphere of the dial will be displayed.
 RIGHT - Only the right hemisphere of the dial will be displayed.
 TOPLEFT - Only the top left quarter of the dial will be displayed.
 TOPRIGHT - Only the top right quarter of the dial will be displayed.
 BOTTOMLEFT - Only the bottom left quarter of the dial will be displayed.
 BOTTOMRIGHT - Only the bottom right quarter of the dial will be displayed.
 

If the value passed is not a valid dial clip type an IllegalArgumentException will be thrown.

Parameters:
dialClip - One of NONE, TOP, BOTTOM, LEFT, RIGHT, TOPLEFT, TOPRIGHT, BOTTOMLEFT, BOTTOMRIGHT

setDialClipPad

public void setDialClipPad(int dialClipPad)
Sets the padding of the clip window of the dial chart.

Parameters:
dialClipPad - clip window padding

getDialClip

public int getDialClip()
Gets the location of the clip window of the dial chart.

Returns:
dialClip, one of NONE, TOP, BOTTOM, LEFT, RIGHT, TOPLEFT, TOPRIGHT, BOTTOMLEFT, BOTTOMRIGHT or NONE if not defined.

getDialClipPad

public int getDialClipPad()
Gets the padding of the clip window of the dial chart.

Returns:
the padding of the clip window

setSectorActiveLabelsEnabled

public void setSectorActiveLabelsEnabled(boolean sectorActiveLabelsEnabled)
Set enable popup labels over sectors.

Parameters:
sectorActiveLabelsEnabled - When popups will appear over sectors of the chart.

getSectorActiveLabelsEnabled

public boolean getSectorActiveLabelsEnabled()
Get whether or not popups over sectors are enabled.

Returns:
sectorActiveLabelsEnabled When popups will appear over sectors of the chart.

setDialActiveLabelsEnabled

public void setDialActiveLabelsEnabled(boolean dialActiveLabelsEnabled)
Set enable popup labels over dials.

Parameters:
dialActiveLabelsEnabled - When popups will appear over dials of the chart.

getDialActiveLabelsEnabled

public boolean getDialActiveLabelsEnabled()
Get whether or not popups over dials are enabled.

Returns:
dialActiveLabelsEnabled When popups will appear over dials of the chart.

setHandActiveLabelsEnabled

public void setHandActiveLabelsEnabled(boolean handActiveLabelsEnabled)
Set enable popup labels over hands.

Parameters:
handActiveLabelsEnabled - When popups will appear over hands of the chart.

getHandActiveLabelsEnabled

public boolean getHandActiveLabelsEnabled()
Get whether or not popups over hands are enabled.

Returns:
handsActiveLabelsEnabled When popups will appear over hands of the chart.

setDialSquare

public void setDialSquare(boolean dialSquare)
Set dial square

Parameters:
dialSquare - When true, the dial will always have a consistent width and height. When false, the dial will attempt to use all available width and height

getDialSquare

public boolean getDialSquare()
Get dial square

Returns:
dialSquare When true, the dial will always have a consistent width and height. When false, the dial will attempt to use all available width and height

setDialSize

public void setDialSize(int minWidth,
                        int minHeight,
                        int maxWidth,
                        int maxHeight)
                 throws NFParamException
Set the minimum and maximum size of the Dialchart. To specify no value, set to -1.

Parameters:
minWidth - The minimum width of the Dialchart.
minHeight - The minimum height of the Dialchart.
maxWidth - The maximum width of the Dialchart.
maxHeight - The maximum height of the Dialchart.
Throws:
NFParamException

setDialOuterBorder

public void setDialOuterBorder(NFDialOuterBorder dialOuterBorder)
Set the dial outer border attributes. DialClip must be set to NONE for this option.

Parameters:
dialOuterBorder - Dial outer border attributes

getDialOuterBorder

public NFDialOuterBorder getDialOuterBorder()
Get the dial outer border attributes

Returns:
dial outer border attributes

setDialOuterFillPattern

public void setDialOuterFillPattern(NFFillPattern dialOuterFillPattern)
Set the dial outer fill pattern. DialClip must be set to NONE for this option.

Parameters:
dialOuterFillPattern - Dial outer fill pattern

getDialOuterFillPattern

public NFFillPattern getDialOuterFillPattern()
Get the dial outer fill pattern

Returns:
dial outer fill pattern

setHandAnimationStyle

public void setHandAnimationStyle(int style)
Set the hand animation style.

If the value passed is not a valid hand animation style then HAND_ANIMATION_STYLE_NONE will be used

Parameters:
style - One Of HAND_ANIMATION_STYLE_NONE (default), HAND_ANIMATION_STYLE_GROW, HAND_ANIMATION_STYLE_FADE

getHandAnimationStyle

public int getHandAnimationStyle()
Get the hand animation style.

Returns:
style one of HAND_ANIMATION_STYLE_NONE, HAND_ANIMATION_STYLE_GROW, HAND_ANIMATION_STYLE_FADE or HAND_ANIMATION_STYLE_NONE if not defined.

setSectorAnimationStyle

public void setSectorAnimationStyle(int style)
Set the sector animation style.

If the value passed is not a valid sector animation style then SECTOR_ANIMATION_STYLE_NONE will be used

Parameters:
style - One Of SECTOR_ANIMATION_STYLE_NONE (default), SECTOR_ANIMATION_STYLE_GROW, SECTOR_ANIMATION_STYLE_FADE

getSectorAnimationStyle

public int getSectorAnimationStyle()
Get the sector animation style.

Returns:
style one of SECTOR_ANIMATION_STYLE_NONE, SECTOR_ANIMATION_STYLE_GROW, SECTOR_ANIMATION_STYLE_FADE or SECTOR_ANIMATION_STYLE_NONE if not defined.

setHandDropShadow

public void setHandDropShadow(NFDropShadow handDropShadow)
Set the drop shadow for the hands

Parameters:
handDropShadow - The drop shadow to use under the hands

getHandDropShadow

public NFDropShadow getHandDropShadow()
Get the drop shadow for the hands

Returns:
The drop shadow to use under the hands

setHandButtonBorder

public void setHandButtonBorder(NFLine handButtonBorder)
Set the border for the hand button

Parameters:
handButtonBorder - The border for the hand button

getHandButtonBorder

public NFLine getHandButtonBorder()
Get the border for the hand button

Returns:
The border for the hand button

setHandButtonEdgeHighlightSeries

public void setHandButtonEdgeHighlightSeries(NFCircularEdgeHighlightSeries handButtonEdgeHighlightSeries)
Set the hand edge highlight series.

Parameters:
handButtonEdgeHighlightSeries - The series of hand edge highlights

getHandButtonEdgeHighlightSeries

public NFCircularEdgeHighlightSeries getHandButtonEdgeHighlightSeries()
Get the hand edge highlight series.

Returns:
The series of hand edge highlights

setSectorEdgeHighlightSeries

public void setSectorEdgeHighlightSeries(NFCircularEdgeHighlightSeries sectorEdgeHighlightSeries)
Set the sector edge highlight series.

Parameters:
sectorEdgeHighlightSeries - The series of sector edge highlights

getSectorEdgeHighlightSeries

public NFCircularEdgeHighlightSeries getSectorEdgeHighlightSeries()
Get the sector edge highlight series.

Returns:
The series of sector edge highlights

getDefaultData

public java.lang.String getDefaultData()
Gets the default data - used to initialize IDE editors

Specified by:
getDefaultData in class NFGraph
Returns:
defaultData

getType

public int getType()
Gets the type of this chart.

Specified by:
getType in class NFGraph
Returns:
the type of this chart, always netcharts.pro.charts.dial.NFGraph.DIAL

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Writes this chart into an object for serialization.

Specified by:
writeExternal in interface java.io.Externalizable
Overrides:
writeExternal in class NFGraph
Throws:
java.io.IOException

writeChart

public void writeChart(java.lang.StringBuffer sb)
Writes this chart into a string buffer

Overrides:
writeChart in class NFSizedChart

resetState

public void resetState()
Resets all of the parameter values to their initial state.

Overrides:
resetState in class NFSizedChart

NetCharts Pro


Visual Mining, Inc.
2099 Gaither Rd.
Suite 220
Rockville, MD 20850
800.308.0731
301.947.8293 FAX

Copyright © Visual Mining, Inc. 1996 - 2011
All Rights Reserved.

NetCharts Pro TM is a registered trademark of Visual Mining, Inc. Other brands and their products are trademarks of their respective holders.

Last Modified: Jun 28, 2011