com.jinsight.jetchart
Class SliceLegend

java.lang.Object
  extended bycom.jinsight.jetchart.SliceLegend

public class SliceLegend
extends java.lang.Object

This class implements the properties and methods of a slice legend. A SliceLegend object has no public construtor. It is owned by a Slice object and can only be accessed through a 'get' method implemented in Slice.

Slice legends can be displayed inside slices or outside pie bounds. The content of a slice legend can be specified as a value, a percentage, a label, a label and a value, a label and a percentage or a value and a percentage. The legend border can be displayed in three different styles: shadowed, lowered bevel and raised bevel.

See Also:
PieGraph, PieSerie, Slice, Slice.getSliceLegend()

Field Summary
static int INSIDE
          Constant used to place slice legend inside the respective slice area.
static int LABEL
          Constant used to set the slice legend content to respective slice title.
static int LABEL_AND_PERCENT
          Constant used to set the slice legend content to respective slice title and percentage.
static int LABEL_AND_VALUE
          Constant used to set the slice legend content to respective slice title and value.
static int LOWERED_BEVEL
          Constant used to set the slice legend border to lowered bevel.
static int OUTSIDE
          Constant used to place slice legend outside pie series bounds.
static int PERCENT
          Constant used to set the slice legend content to a percentage.
static int RAISED_BEVEL
          Constant used to set the slice legend border to raised bevel.
static int SHADOWED
          Constant used to set the slice legend border to shadowed.
static int VALUE
          Constant used to set the slice legend content to the respective slice value.
static int VALUE_AND_PERCENT
          Constant used to set slice legend content to respective slice value and percentage.
 
Method Summary
protected  void finalize()
           
 void setArrowColor(java.awt.Color arrowColor)
          Deprecated.  
 void setBackground(java.awt.Color background)
          Sets the background color.
 void setBorder(int border)
          Sets the border type of the slice legend.
 void setConnectorColor(java.awt.Color connectorColor)
          Sets the color of the line that connect a slice legend to respective slice.
 void setConnectorLength(int connectorLength)
          Sets the length of the line that connects a slice legend to respective slice.
 void setContent(int content)
          Sets the content type of the slice legend.
 void setEnabled(boolean isEnabled)
          Enables/disables slice legend.
 void setFont(java.awt.Font font)
          Sets the font of the slice legend.
 void setForeground(java.awt.Color foreground)
          Sets the color of the text displayed in a slice legend.
 void setOpacityEnabled(boolean isOpaque)
          Enables/disables slice legend opacity.
 void setPosition(int position)
          Sets the position of this slice legend.
 void setVertexDistance(double vertexDistance)
          Sets the distance of the slice legend from slice vertex.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VALUE

public static final int VALUE
Constant used to set the slice legend content to the respective slice value.

See Also:
Constant Field Values

PERCENT

public static final int PERCENT
Constant used to set the slice legend content to a percentage.

See Also:
Constant Field Values

LABEL

public static final int LABEL
Constant used to set the slice legend content to respective slice title.

See Also:
Constant Field Values

LABEL_AND_VALUE

public static final int LABEL_AND_VALUE
Constant used to set the slice legend content to respective slice title and value.

See Also:
Constant Field Values

LABEL_AND_PERCENT

public static final int LABEL_AND_PERCENT
Constant used to set the slice legend content to respective slice title and percentage.

See Also:
Constant Field Values

VALUE_AND_PERCENT

public static final int VALUE_AND_PERCENT
Constant used to set slice legend content to respective slice value and percentage.

See Also:
Constant Field Values

INSIDE

public static final int INSIDE
Constant used to place slice legend inside the respective slice area.

See Also:
Constant Field Values

OUTSIDE

public static final int OUTSIDE
Constant used to place slice legend outside pie series bounds.

See Also:
Constant Field Values

SHADOWED

public static final int SHADOWED
Constant used to set the slice legend border to shadowed.

See Also:
Constant Field Values

LOWERED_BEVEL

public static final int LOWERED_BEVEL
Constant used to set the slice legend border to lowered bevel.

See Also:
Constant Field Values

RAISED_BEVEL

public static final int RAISED_BEVEL
Constant used to set the slice legend border to raised bevel.

See Also:
Constant Field Values
Method Detail

setPosition

public void setPosition(int position)
Sets the position of this slice legend. If the position is set to SliceLegend.OUTSIDE, the slice legend is displayed outside pie bounds and connected with a line to the slice it is associated with. Slice legends are by default displayed inside slices.
This method has no effect if slice legends are stacked along the left and right sides of the chart area.

Parameters:
position - An integer value
See Also:
OUTSIDE, INSIDE, Slice, PieSerie.setStackedSliceLegendsEnabled(boolean)

setEnabled

public void setEnabled(boolean isEnabled)
Enables/disables slice legend.

Parameters:
isEnabled - A boolean value(true/false)

setBackground

public void setBackground(java.awt.Color background)
Sets the background color. The background is only painted if slice legend opacity is set to true. Default color is white.

Parameters:
background - A Color object.
See Also:
setOpacityEnabled(boolean)

setForeground

public void setForeground(java.awt.Color foreground)
Sets the color of the text displayed in a slice legend. Default color is black.

Parameters:
foreground - A Color object.

setFont

public void setFont(java.awt.Font font)
Sets the font of the slice legend.

Parameters:
font - A Font object.

setContent

public void setContent(int content)
Sets the content type of the slice legend. A slice legend content is by default the respective slice value.

Parameters:
content - One of the constants used to define the slice legend content type.
See Also:
VALUE, LABEL, PERCENT, LABEL_AND_VALUE, LABEL_AND_PERCENT, VALUE_AND_PERCENT

setBorder

public void setBorder(int border)
Sets the border type of the slice legend. The border is shadowed by defau.t

Parameters:
border - One of the constants used to define the slice legend border type.
See Also:
SHADOWED, LOWERED_BEVEL, RAISED_BEVEL

setVertexDistance

public void setVertexDistance(double vertexDistance)
Sets the distance of the slice legend from slice vertex. By default it is 0.7.

Parameters:
vertexDistance - A double precision number. It can vary from 0 to 1.

setOpacityEnabled

public void setOpacityEnabled(boolean isOpaque)
Enables/disables slice legend opacity. By default slice legends are transparent.

Parameters:
isOpaque - A boolean value(true/false).
See Also:
setBackground(java.awt.Color)

setArrowColor

public void setArrowColor(java.awt.Color arrowColor)
Deprecated.  

This method has been deprecated. Use setConnectorColor instead.

Parameters:
arrowColor - A Color object.

setConnectorColor

public void setConnectorColor(java.awt.Color connectorColor)
Sets the color of the line that connect a slice legend to respective slice. The connector is displayed if slice legend is painted outside pie bounds.

Parameters:
connectorColor - A Color object.
See Also:
setPosition(int)

setConnectorLength

public void setConnectorLength(int connectorLength)
Sets the length of the line that connects a slice legend to respective slice. The connector is displayed if slice legend is painted outside and around pie series area or all slice legends are stacked at the left and right sides of the pie chart area.
This method only has effect if slice legends are displayed around the pie series area. The default and minimum length is 20 pixels.

Parameters:
connectorLength - A integer number
See Also:
PieSerie.setStackedSliceLegendsEnabled(boolean), setPosition(int)

finalize

protected void finalize()
                 throws java.lang.Throwable
Throws:
java.lang.Throwable