All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jclass.chart.JCLegend

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----jclass.bwt.JCComponent
                           |
                           +----jclass.chart.ChartCanvas
                                   |
                                   +----jclass.chart.JCLegend

public class JCLegend
extends ChartCanvas
JCLegend manages and renders the legend for a chart.

Properties

Name Method
IsShowing If true, the ChartCanvas will appear on the screen. If false, it will not appear on the screen. (Note that legend, header, footer and chart area are all ChartCanvas instances). Default value is false.
BorderType Determines the style of border drawn around the ChartCanvas. 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. (Note that legend, header, footer and chart area are all ChartCanvas instances). Default value is BWTEnum.SHADOW_IN.
BorderWidth The BorderWidth property determines the width of the border drawn around the canvas. (Note that legend, header, footer and chart area are all ChartCanvas instances). The default value is 2.
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.
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.
Top The Top property determines the location of the top of the ChartCanvas. The default value is calculated.
TopIsDefault The TopIsDefault property determines whether the top position of the chart canvas is calculated by Chart (true) or taken from the Top property (false). The default value is true.
Left The Left property determines the location of the left of the ChartCanvas. The default value is calculated.
LeftIsDefault The LeftIsDefault property determines whether the left position of the chart canvas is calculated by Chart (true) or taken from the Left property (false). The default value is true.
Width The Width property determines the width of the ChartCanvas. The default value is calculated.
WidthIsDefault The WidthIsDefault property determines whether the width of the chart canvas is calculated by Chart (true) or taken from the Width property (false). The default value is true.
Height The Height property determines the height of the ChartCanvas. The default value is calculated.
HeightIsDefault The HeightIsDefault property determines whether the height of the chart canvas is calculated by Chart (true) or taken from the Height property (false). The default value is true.


Variable Index

 o EAST
 o EASTWEST_MASK
 o HORIZONTAL
 o NORTH
 o NORTHEAST
 o NORTHSOUTH_MASK
 o NORTHWEST
 o SOUTH
 o SOUTHEAST
 o SOUTHWEST
 o VERTICAL
 o WEST

Constructor Index

 o JCLegend()
Internal constructor for legend

Method Index

 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 paintComponent(Graphics)
Paint method for the legend.
 o preferredSize()
Calculates and returns the preferred size for the legend.
 o recalc()
Recalculates extents of the legend.
 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

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 synchronized 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 synchronized 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 ChartCanvas
 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 ChartCanvas
 o paintComponent
 public synchronized void paintComponent(Graphics gc)
Paint method for the legend.

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

Returns:
preferred size.
Overrides:
preferredSize in class ChartCanvas

All Packages  Class Hierarchy  This Package  Previous  Next  Index