NetCharts Pro

netcharts.pro.charts.dial
Class NFDialchart

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

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 LEFT
          Dial clip window in left hemisphere.
static int NONE
          None
static int RIGHT
          Dial clip window in right hemisphere.
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, BOX, BUBBLE, COMBO, DIAGRAM, DIAL, LINE, 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.
 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.
 boolean getSectorActiveLabelsEnabled()
          Get whether or not popups over sectors are enabled.
 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 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 setSectorActiveLabelsEnabled(boolean sectorActiveLabelsEnabled)
          Set enable popup labels over sectors.
 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, getBackgroundFillPattern, getBackgroundRegion, getCDL, getChartElementSpacing, getChartName, getChartSize, getColorTable, getDataActiveLabelsEnabled, getDwell, getDwellOffset, getErrors, getFooter, getGraphFromTemplate, getGraphFromTemplate, getGraphFromTemplate, getGraphFromTemplate, getGraphFromTemplate, getGraphFromTemplate, getGraphFromTemplate, getGraphFromTemplate, getGraphGraphics, getHeader, getLeftTitle, getLegend, getMetaData, getMinimumSize, getNoteSeries, getNumberFormat, getNumErrors, getPanel, getPlotArea, getPreferredSize, getRightTitle, getRootPanel, getScaleFactor, 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, setBackgroundFillPattern, setBackgroundRegion, setChartElementSpacing, setChartName, setChartSize, setColorTable, setDataActiveLabelsEnabled, setDocumentBase, setDwell, setDwellOffset, setFooter, setHeader, setLeftTitle, setLegend, setLicenseKey, setMetaData, setNoteSeries, setNumberFormat, setParentApplet, setPlotArea, setRightTitle, setScaleFactor, setSize, setSize, start, stop, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NONE

public static final int NONE
None

TOPRIGHT

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

TOP

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

TOPLEFT

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

LEFT

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

BOTTOMLEFT

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

BOTTOM

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

BOTTOMRIGHT

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

RIGHT

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

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 -  

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 -  

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 -  

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.

getDefaultData

public java.lang.String getDefaultData()
Gets the default data - used to initialize IDE editors
Overrides:
getDefaultData in class NFGraph
Returns:
defaultData

getType

public int getType()
Gets the type of this chart.
Overrides:
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.
Overrides:
writeExternal in class NFGraph

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.
15825 Shady Grove Rd.
Suite 20
Rockville, MD 20850
800.308.0731
301.947.8293 FAX

Copyright © Visual Mining, Inc. 1996 - 2005
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: Feb 1, 2005