All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jclass.chart.JCLegend

java.lang.Object
   |
   +----jclass.chart.TrackChange
           |
           +----jclass.chart.ChartRegion
                   |
                   +----jclass.chart.JCLegend

public class JCLegend
extends ChartRegion
implements HTMLHandler
JCLegend manages and renders the legend for a chart.

Properties

Name Description
Anchor The Anchor property determines the position of the legend relative to the ChartArea. Valid values include JCLegend.NORTH, JCLegend.SOUTH, JCLegend.EAST, JCLegend.WEST, JCLegend.NORTHWEST, JCLegend.SOUTHWEST, JCLegend.NORTHEAST and JCLegend.SOUTHEAST. The default value is JCLegend.EAST.
Background The Background property determines the background color used to draw inside the legend. Note that the Background property is inherited from the parent ChartRegion.
BorderType Determines the style of border drawn around the legend. Valid values come from BWTEnum, and include SHADOW_NONE, SHADOW_ETCHED_IN, SHADOW_ETCHED_OUT, SHADOW_IN, SHADOW_OUT, SHADOW_PLAIN, SHADOW_FRAME_IN, SHADOW_FRAME_OUT. Default value is BWTEnum.SHADOW_IN.
BorderWidth The BorderWidth property determines the width of the border drawn around the legend. The default value is 2.
Font The Font property determines what font is used to render text inside the legend. Note that the Font property is inherited from the parent ChartRegion.
Foreground The Foreground property determines the foreground color used to draw inside the legend. Note that the Foreground property is inherited from the parent ChartRegion.
Height The Height property determines the height of the legend. The default value is calculated. Note that the property is inherited from the parent ChartRegion.
HeightIsDefault The HeightIsDefault property determines whether the height of the legend is calculated by Chart (true) or taken from the Height property (false). The default value is true. Note that the property is inherited from the parent ChartRegion.
IsShowing The IsShowing property determines whether the legend is currently visible. Default value is false.
Left The Left property determines the location of the left of the legend. The default value is calculated. Note that the property is inherited from the parent ChartRegion.
LeftIsDefault The LeftIsDefault property determines whether the left position of the legend is calculated by Chart (true) or taken from the Left property (false). The default value is true. Note that the property is inherited from the parent ChartRegion.
Name The Name property specifies a string identifier for the JCLegend object. Note that this property is inherited from ChartRegion.
Orientation The Orientation property determines how legend information is laid out. Valid values include JCLegend.VERTICAL and JCLegend.HORIZONTAL. The default value is JCLegend.VERTICAL.
Parent The Parent property assures the connection to the chart on which the JCLegenf appears. Default value is null. Note that this property is inherited from ChartRegion.
ParentRegion The ParentRegion property is the JCLegend's ChartRegion parent. Default value is null. Note that this property is inherited from ChartRegion.
Top The Top property determines the location of the top of the legend. The default value is calculated. Note that the property is inherited from the parent ChartRegion.
TopIsDefault The TopIsDefault property determines whether the top position of the legend is calculated by Chart (true) or taken from the Top property (false). The default value is true. Note that the property is inherited from the parent ChartRegion.
Width The Width property determines the width of the legend. The default value is calculated. Note that the property is inherited from the parent ChartRegion.
WidthIsDefault The WidthIsDefault property determines whether the width of the legend is calculated by Chart (true) or taken from the Width property (false). The default value is true. Note that the property is inherited from the parent ChartRegion.


Variable Index

 o anchor_strings
 o anchor_values
 o border_strings
 o border_values
 o EAST
 o EASTWEST_MASK
 o HORIZONTAL
 o NORTH
 o NORTHEAST
 o NORTHSOUTH_MASK
 o NORTHWEST
 o orientation_strings
 o orientation_values
 o SOUTH
 o SOUTHEAST
 o SOUTHWEST
 o VERTICAL
 o WEST

Constructor Index

 o JCLegend()
Internal constructor for legend

Method Index

 o draw(Graphics)
Paint method for the legend.
 o getAnchor()
Gets the Anchor property, which determines the position of the legend relative to the ChartArea.
 o getChanged()
Gets the value of the Changed property.
 o getOrientation()
Gets the Orientation property, which determines how the legend information is laid out.
 o loadParams(String, JCChart)
Load JCChart parameters from HTML file
 o preferredSize()
Calculates and returns the preferred size for the legend.
 o recalc()
Recalculates extents of the legend.
 o saveParams(String, JCChart)
Save JCChart parameters as HTML tags
 o setAnchor(int)
Sets the Anchor property, which determines the position of the legend relative to the ChartArea.
 o setOrientation(int)
Sets the Orientation property, which determines how the legend information is laid out.

Variables

 o NORTH
 public static final int NORTH
 o SOUTH
 public static final int SOUTH
 o EAST
 public static final int EAST
 o WEST
 public static final int WEST
 o NORTHEAST
 public static final int NORTHEAST
 o NORTHWEST
 public static final int NORTHWEST
 o SOUTHEAST
 public static final int SOUTHEAST
 o SOUTHWEST
 public static final int SOUTHWEST
 o NORTHSOUTH_MASK
 public static final int NORTHSOUTH_MASK
 o EASTWEST_MASK
 public static final int EASTWEST_MASK
 o HORIZONTAL
 public static final int HORIZONTAL
 o VERTICAL
 public static final int VERTICAL
 o anchor_strings
 public static final String anchor_strings[]
 o anchor_values
 public static final int anchor_values[]
 o orientation_strings
 public static final String orientation_strings[]
 o orientation_values
 public static final int orientation_values[]
 o border_strings
 public static final String border_strings[]
 o border_values
 public static final int border_values[]

Constructors

 o JCLegend
 public JCLegend()
Internal constructor for legend

Methods

 o getAnchor
 public int getAnchor()
Gets the Anchor property, which determines the position of the legend relative to the ChartArea.

Returns:
one of NORTH, SOUTH, EAST, WEST, NORTHWEST, SOUTHWEST, NORTHEAST, or SOUTHEAST
 o getOrientation
 public int getOrientation()
Gets the Orientation property, which determines how the legend information is laid out.

Returns:
one of VERTICAL or HORIZONTAL
 o setAnchor
 public void setAnchor(int a)
Sets the Anchor property, which determines the position of the legend relative to the ChartArea.

Parameters:
anchor - one of NORTH, SOUTH, EAST, WEST, NORTHWEST, SOUTHWEST, NORTHEAST or SOUTHEAST
IllegalArgumentException - If the anchor value is not one of NORTH, SOUTH, EAST, WEST, NORTHEAST, NORTHWEST, SOUTHEAST or SOUTHWEST.
 o setOrientation
 public void setOrientation(int orient)
Sets the Orientation property, which determines how the legend information is laid out.

Parameters:
orient - one of VERTICAL or HORIZONTAL
IllegalArgumentException - If the orientation value is not one of VERTICAL or HORIZONTAL.
 o recalc
 public void recalc()
Recalculates extents of the legend.

Overrides:
recalc in class ChartRegion
 o getChanged
 public boolean getChanged()
Gets the value of the Changed property. The Changed property is an internal property that determines whether the component needs to be recalculated.

Overrides:
getChanged in class TrackChange
 o draw
 public void draw(Graphics gc)
Paint method for the legend.

Parameters:
gc - graphics context to use for drawing
Overrides:
draw in class ChartRegion
 o preferredSize
 public Dimension preferredSize()
Calculates and returns the preferred size for the legend.

Returns:
preferred size.
Overrides:
preferredSize in class ChartRegion
 o saveParams
 public void saveParams(String name,
                        JCChart comp)
Save JCChart parameters as HTML tags

Parameters:
name - the PARAM NAME
chart - the JCChart component
Overrides:
saveParams in class ChartRegion
 o loadParams
 public void loadParams(String name,
                        JCChart comp)
Load JCChart parameters from HTML file

Parameters:
name - the PARAM NAME
chart - the JCChart component
Overrides:
loadParams in class ChartRegion

All Packages  Class Hierarchy  This Package  Previous  Next  Index