NetCharts Pro

netcharts.pro.charts.dial
Class NFDialHand

java.lang.Object
  extended by netcharts.pro.common.NFBaseClass
      extended by netcharts.pro.charts.dial.NFDialHand
All Implemented Interfaces:
java.lang.Cloneable

public class NFDialHand
extends NFBaseClass

Dial hand object. A dial hand is represented by a line drawn to the given value with the given length. The value of a hand is mapped according the the scale of the dial. The length of the hand is a percentage where 100 will draw to the dial's border.


Field Summary
static int BLOCK
          BLOCK Hand Style.
static java.util.Hashtable handStyle
          The set of allowed hand styles.
static int LINE
          LINE Hand Style.
static int NEEDLEBUTTON
          NEEDLEBUTTON Hand Style.
static int NEEDLEFILL
          NEEDLEFILL Hand Style.
static int NEEDLELINE
          NEEDLELINE Hand Style.
static int NONE
          NONE Hand Style.
static int RECTBUTTON
          RECTBUTTON Hand Style.
static int ROUND
          ROUND Hand Style.
static int SHARP
          SHARP Hand Style.
 
Constructor Summary
NFDialHand()
          Constructs a default dial hand.
NFDialHand(java.lang.String handName)
          Constructs a dial hand with the given name.
 
Method Summary
 java.lang.Object clone()
          Does a deep copy of this dial hand object
 NFActiveLabel getActiveLabel()
          Get the active label for this hand.
 boolean getActiveLabelModified()
          Gets if the hand active label has been modified
 NFLine getBorder()
          Get the border for this hand.
 boolean getBorderModified()
          Gets if the hand border has been modified
 java.lang.String getCDLHand(java.lang.String dialName)
          Generate CDL parameters representing this hand
 java.lang.String getCDLHandActiveLabel()
          Generate CDL parameters representing this hand's active label
 java.lang.String getCDLHandBorder()
          Generate CDL parameters representing this hand's border
 java.lang.String getCDLHandData()
          Generate CDL parameters representing this hand's data
 java.lang.String getCDLHandLabelStyle()
          Generate CDL parameters representing this hand's label style
 java.lang.String getCDLHandStyle()
          Generate CDL parameters representing this hand's display style
 boolean getDataModified()
          Gets if the hand data has been modified
 int getEndStyle()
          Get how the end of the hand is to be drawn.
 java.lang.String getHandLabel()
          Get this dial hand's label.
 double getHandLabelPosition()
          Get the position of a hand label relative to the radius of the dial.
 NFTextStyle getHandLabelStyle()
          Get the text style of the hand label.
 boolean getHandModified()
          Gets if the hand definition has been modified
 java.lang.String getHandName()
          Get this dial hand's name.
 boolean getLabelModified()
          Gets if the hand's label style has been modified
 double getLength()
          Get the hand length.
 java.awt.Color getShaftColor()
          Set the hand shaft (line) color.
 double getShaftWidth()
          Get the width of the hand's shaft (line)
 boolean getShowHandLabel()
          Get whether or not the label should be shown for the hand.
 boolean getStyleModified()
          Gets if the hand style has been modified
 java.awt.Color getTipColor()
          Get the color of the end of the hand.
 double getTipWidth()
          Get the width of the hand end.
 double getValue()
          Get the hand value.
 void setActiveLabel(NFActiveLabel activeLabel)
          Set the active label for this hand.
 void setBorder(NFLine border)
          Set the border for this hand.
 void setCDLBorder(java.lang.String cdl)
          Configures this object from a CDL parameter representation.
 void setCDLHand(java.lang.String cdl)
          Configures this object from a CDL parameter representation.
 void setCDLHandActiveLabel(java.lang.String cdl)
          Configures this object from a CDL parameter representation.
 void setCDLHandData(java.lang.String cdl)
          Configures this object from a CDL parameter representation.
 void setCDLHandLabelStyle(java.lang.String cdl)
          Configures this object from a CDL parameter representation.
 void setCDLHandStyle(java.lang.String cdl)
          Configures this object from a CDL parameter representation.
 void setEndStyle(int endStyle)
          Set how the end of the hand is to be drawn.
 void setHandLabel(java.lang.String handLabel)
          Set this dial hand's label.
 void setHandLabelPosition(double handLabelPosition)
          Set the position of a hand label relative to the radius of the dial.
 void setHandLabelStyle(NFTextStyle handLabelStyle)
          Set the text style of the hand label.
 void setHandName(java.lang.String handName)
          Set this hand's name.
 void setLength(double length)
          Set the hand length.
 void setShaftColor(java.awt.Color shaftColor)
          Set the hand shaft (line) color.
 void setShaftWidth(double shaftWidth)
          Set the width of the hand's shaft (line)
 void setShowHandLabel(boolean showHandLabel)
          Set whether or not the label should be shown for the hand.
 void setTipColor(java.awt.Color tipColor)
          Set the color of the end of the hand.
 void setTipWidth(double tipWidth)
          Set the width of the hand end.
 void setValue(double value)
          Set the hand value.
 
Methods inherited from class netcharts.pro.common.NFBaseClass
getModified, getUserObject, setModified, setUserObject
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

handStyle

public static java.util.Hashtable handStyle
The set of allowed hand styles. Consists of NONE, LINE, BLOCK, SHARP, ROUND, NEEDLELINE, NEEDLEFILL, NEEDLEBUTTON.


NONE

public static final int NONE
NONE Hand Style. Causes the hand not to be drawn.


LINE

public static final int LINE
LINE Hand Style. Makes a line-drawn head.


BLOCK

public static final int BLOCK
BLOCK Hand Style. Makes a triangular tip.


SHARP

public static final int SHARP
SHARP Hand Style. Makes a triangular tip that has sharper corners than BLOCK.


ROUND

public static final int ROUND
ROUND Hand Style. Makes a circular tip.


NEEDLELINE

public static final int NEEDLELINE
NEEDLELINE Hand Style. Draws an outlined needle based hand (angular with thicker bottom).


NEEDLEFILL

public static final int NEEDLEFILL
NEEDLEFILL Hand Style. Draws a filled needle based hand (angular with thicker bottom).


NEEDLEBUTTON

public static final int NEEDLEBUTTON
NEEDLEBUTTON Hand Style. Draws a filled needle based hand with a circular base.


RECTBUTTON

public static final int RECTBUTTON
RECTBUTTON Hand Style. Draws a filled rectangular needle based hand with a circular base.

Constructor Detail

NFDialHand

public NFDialHand()
Constructs a default dial hand. Sets the default name to HandN where N is a random number


NFDialHand

public NFDialHand(java.lang.String handName)
Constructs a dial hand with the given name.

Parameters:
handName -
Method Detail

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Does a deep copy of this dial hand object

Overrides:
clone in class NFBaseClass
Returns:
Object
Throws:
java.lang.CloneNotSupportedException

setHandName

public void setHandName(java.lang.String handName)
Set this hand's name. The dial hand's name is used mostly when reading or generating a CDL representation of the chart.

Parameters:
handName - The name of the hand.

getHandName

public java.lang.String getHandName()
Get this dial hand's name. The dial hand name is used mostly when reading or generating a CDL representation of the chart.

Returns:
the name of this dial hand. If a name has not been set, an automatically generated name will be provided.

setHandLabel

public void setHandLabel(java.lang.String handLabel)
Set this dial hand's label. The dial hand label is only used when displaying the label (vs the name which identifies the hand)

Parameters:
handLabel - Text to use for this dial hand.

getHandLabel

public java.lang.String getHandLabel()
Get this dial hand's label. The dial hand label is only used when displaying the label (vs the name which identifies the hand)

Returns:
the handlabel for this dial hand.

setTipColor

public void setTipColor(java.awt.Color tipColor)
Set the color of the end of the hand. Has no effect if the end style has been set to None

Parameters:
tipColor - Color of the end of the hand.

getTipColor

public java.awt.Color getTipColor()
Get the color of the end of the hand.

Returns:
color of the end of the hand or null if not defined.

setShaftColor

public void setShaftColor(java.awt.Color shaftColor)
Set the hand shaft (line) color.

Parameters:
shaftColor - The line color

getShaftColor

public java.awt.Color getShaftColor()
Set the hand shaft (line) color.

Returns:
the shaft (line) color or null if not defined.

setValue

public void setValue(double value)
Set the hand value. This is mapped to a dial scale in order to determine hand angle.

Parameters:
value - The value of this hand.

getValue

public double getValue()
Get the hand value.

Returns:
the value of this hand or 0.0 if not defined.

setLength

public void setLength(double length)
Set the hand length. This is the length of the hand as a percentage of the dial's radius.

Parameters:
length - The length of the hand.

getLength

public double getLength()
Get the hand length.

Returns:
the length of the hand or 100.0 if not defined.

setEndStyle

public void setEndStyle(int endStyle)
Set how the end of the hand is to be drawn.

If the value passed is not a valid end style type an IllegalArgumentException will be thrown.

Parameters:
endStyle - One of NONE, LINE, BLOCK, SHARP, ROUND, NEEDLELINE, NEEDLEFILL, NEEDLEBUTTON

getEndStyle

public int getEndStyle()
Get how the end of the hand is to be drawn.

Returns:
endStyle or SHARP if not defined.

setTipWidth

public void setTipWidth(double tipWidth)
Set the width of the hand end.

Parameters:
tipWidth - Width in pixels of the hand end.

getTipWidth

public double getTipWidth()
Get the width of the hand end.

Returns:
width in pixels of the hand end or 5 if not defined.

setShaftWidth

public void setShaftWidth(double shaftWidth)
Set the width of the hand's shaft (line)

Parameters:
shaftWidth - Width in pixels of the shaft.

getShaftWidth

public double getShaftWidth()
Get the width of the hand's shaft (line)

Returns:
width in pixels of the shaft or 1.0 if not defined.

setActiveLabel

public void setActiveLabel(NFActiveLabel activeLabel)
Set the active label for this hand.

Parameters:
activeLabel - The hand's active label.

getActiveLabel

public NFActiveLabel getActiveLabel()
Get the active label for this hand.

Returns:
the hand's active label.

setBorder

public void setBorder(NFLine border)
Set the border for this hand.

Parameters:
border - The hand's border.

getBorder

public NFLine getBorder()
Get the border for this hand.

Returns:
the hand's border.

setShowHandLabel

public void setShowHandLabel(boolean showHandLabel)
Set whether or not the label should be shown for the hand.

Parameters:
showHandLabel - If true, show the label.

getShowHandLabel

public boolean getShowHandLabel()
Get whether or not the label should be shown for the hand.

Returns:
true if the label is to be shown, false(default) otherwise.

setHandLabelPosition

public void setHandLabelPosition(double handLabelPosition)
Set the position of a hand label relative to the radius of the dial. A value of 1.1 will place the label just outside the dial.

Parameters:
handLabelPosition - The radial position of the label.

getHandLabelPosition

public double getHandLabelPosition()
Get the position of a hand label relative to the radius of the dial.

Returns:
the radial position of the label or 0.6 if not defined.

setHandLabelStyle

public void setHandLabelStyle(NFTextStyle handLabelStyle)
Set the text style of the hand label.

Parameters:
handLabelStyle - The text style object for hand label.

getHandLabelStyle

public NFTextStyle getHandLabelStyle()
Get the text style of the hand label.

Returns:
the text style object for the hand label or null if not defined.

getCDLHand

public java.lang.String getCDLHand(java.lang.String dialName)
Generate CDL parameters representing this hand

Parameters:
dialName - The dial that this hand is associated with.
Returns:
CDL in the form: ("handName", tipColor, shaftColor, "dialName")

setCDLHand

public void setCDLHand(java.lang.String cdl)
Configures this object from a CDL parameter representation.

Parameters:
cdl - CDL in the form: ("handName", tipColor, shaftColor, "dialName")

getCDLHandData

public java.lang.String getCDLHandData()
Generate CDL parameters representing this hand's data

Returns:
CDL in the form: ("handName", value, length)

setCDLHandData

public void setCDLHandData(java.lang.String cdl)
Configures this object from a CDL parameter representation.

Parameters:
cdl - CDL in the form: ("handName", value, length)

getCDLHandLabelStyle

public java.lang.String getCDLHandLabelStyle()
Generate CDL parameters representing this hand's label style

Returns:
CDL in the form: ("handName", showHandLabel, handLabelPosition, textColor, font, fontsize, angle)

setCDLHandLabelStyle

public void setCDLHandLabelStyle(java.lang.String cdl)
Configures this object from a CDL parameter representation.

Parameters:
cdl - CDL in the form: ("handName", showHandLabel, handLabelPosition, textColor, font, fontsize, angle)

getCDLHandStyle

public java.lang.String getCDLHandStyle()
Generate CDL parameters representing this hand's display style

Returns:
CDL in the form: ("handName", handStyle, tipWidth, shaftWidth)

setCDLHandStyle

public void setCDLHandStyle(java.lang.String cdl)
Configures this object from a CDL parameter representation.

Parameters:
cdl - CDL in the form: ("handName", handStyle, tipWidth, shaftWidth)

getCDLHandActiveLabel

public java.lang.String getCDLHandActiveLabel()
Generate CDL parameters representing this hand's active label

Returns:
CDL in the form: ("handName", "label", "url", "target")

getCDLHandBorder

public java.lang.String getCDLHandBorder()
Generate CDL parameters representing this hand's border

Returns:
CDL in the form: ("handName", style, thickness, color)

setCDLHandActiveLabel

public void setCDLHandActiveLabel(java.lang.String cdl)
Configures this object from a CDL parameter representation.

Parameters:
cdl - CDL in the form: ("handName", "label", "url", "target")

setCDLBorder

public void setCDLBorder(java.lang.String cdl)
Configures this object from a CDL parameter representation.

Parameters:
cdl - CDL in the form: ("handName", style, thickness, color)

getHandModified

public boolean getHandModified()
Gets if the hand definition has been modified

Returns:
modified

getDataModified

public boolean getDataModified()
Gets if the hand data has been modified

Returns:
modified

getLabelModified

public boolean getLabelModified()
Gets if the hand's label style has been modified

Returns:
modified

getStyleModified

public boolean getStyleModified()
Gets if the hand style has been modified

Returns:
modified

getActiveLabelModified

public boolean getActiveLabelModified()
Gets if the hand active label has been modified

Returns:
modified

getBorderModified

public boolean getBorderModified()
Gets if the hand border has been modified

Returns:
modified

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