All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jclass.chart.ChartCanvas

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

public abstract class ChartCanvas
extends JCComponent
implements Changeable
Generic Canvas class used by Chart. All renderable Chart components inherit from ChartCanvas, primarily because it is able to draw borders. ChartCanvas provides all the functionality of a basic AWT component, without the overhead of a peer. This is accomplished by overriding addNotify and disabling the peer.

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).
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).
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).
Top The Top property determines the location of the top of the ChartCanvas.
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).
Left The Left property determines the location of the left of the ChartCanvas.
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).
Width The Width property determines the width of the ChartCanvas.
WidthIsDefault The WidthIsDefault property determines whether the width of the chart canvas is calculated by Chart (true) or taken from the Width property (false).
Height The Height property determines the height of the ChartCanvas.
HeightIsDefault The HeightIsDefault property determines whether the height of the chart canvas is calculated by Chart (true) or taken from the Height property (false).


Method Index

 o getBorderType()
Gets the BorderType property of the ChartCanvas.
 o getBorderWidth()
Gets the BorderWidth property of the ChartCanvas.
 o getChanged()
Gets the value of the Changed property.
 o getHeight()
Gets the value of the Height property.
 o getHeightIsDefault()
Gets the value of the HeightIsDefault property.
 o getIsShowing()
Gets the value of the IsShowing property, which determines whether the ChartCanvas will appear on screen.
 o getLeft()
Gets the value of the Left property.
 o getLeftIsDefault()
Gets the value of the LeftIsDefault property.
 o getParameters()
Reads the parameter values from the HTML page using the component's applet.
 o getTop()
Gets the value of the Top property.
 o getTopIsDefault()
Gets the value of the TopIsDefault property.
 o getWidth()
Gets the value of the Width property.
 o getWidthIsDefault()
Gets the value of the WidthIsDefault property.
 o isChanged()
Gets the value of the Changed property.
 o minimumSize()
Returns the minimum size for this object.
 o paintComponent(Graphics)
Rendering method for ChartCanvas
 o preferredHeight()
Gets the subclass' preferred height (default: 100).
 o preferredSize()
Returns the preferred size for this object.
 o preferredWidth()
Gets the subclass' preferred width (default: 100).
 o processMouseEvent(MouseEvent)
 o recalc()
 o repaint()
Overridden repaint() method.
 o reshape(int, int, int, int)
Reshapes the Component to the specified bounding box.
 o setBackground(Color)
Sets the background color of the component.

HTML param name/value: "Background"/Color

 o setBorderType(int)
Sets the BorderType property of the ChartCanvas.
 o setBorderWidth(int)
Sets the BorderWidth property of the ChartCanvas.
 o setChanged(boolean)
Sets the value of the Changed property.
 o setChanged(boolean, boolean)
Sets the value of the Changed property.
 o setFont(Font)
Sets the font of the component.

HTML param name/value: "Font"/font

 o setForeground(Color)
Sets the foreground color of the component.

HTML param name/value: "Foreground"/Color

 o setHeight(int)
Sets the value of the Height property.
 o setHeightIsDefault(boolean)
Sets the value of the HeightIsDefault property.
 o setIsShowing(boolean)
Sets the value of the IsShowing property, which determines whether the ChartCanvas will appear on screen.
 o setLeft(int)
Sets the value of the Left property.
 o setLeftIsDefault(boolean)
Sets the value of the LeftIsDefault property.
 o setTop(int)
Sets the value of the Top property.
 o setTopIsDefault(boolean)
Sets the value of the TopIsDefault property.
 o setWidth(int)
Sets the value of the Width property.
 o setWidthIsDefault(boolean)
Sets the value of the WidthIsDefault property.
 o sizeChanged()
 o updateParent()
Internal method used to invalidate and repaint the parent of the ChartCanvas object.

Methods

 o processMouseEvent
 public void processMouseEvent(MouseEvent e)
Overrides:
processMouseEvent in class JCComponent
 o paintComponent
 public void paintComponent(Graphics gc)
Rendering method for ChartCanvas

Parameters:
gr - graphics context for drawing
Overrides:
paintComponent in class JCComponent
 o getIsShowing
 public boolean getIsShowing()
Gets the value of the IsShowing property, which determines whether the ChartCanvas will appear on screen.

Returns:
true if the ChartCanvas will appear, false otherwise.
 o setIsShowing
 public synchronized void setIsShowing(boolean vis)
Sets the value of the IsShowing property, which determines whether the ChartCanvas will appear on screen.

Parameters:
vis - true if the ChartCanvas will appear, false otherwise
 o setBorderType
 public synchronized void setBorderType(int bt)
Sets the BorderType property of the ChartCanvas. The BorderType property 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.

Parameters:
bt - enum specifying border type
Throws: IllegalArgumentException
If the BorderType isn't a valid shadow type from BWTEnum.
 o getBorderType
 public int getBorderType()
Gets the BorderType property of the ChartCanvas. The BorderType property 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.

Returns:
enum specifying border type
 o setBorderWidth
 public synchronized void setBorderWidth(int thick)
Sets the BorderWidth property of the ChartCanvas. The BorderWidth property determines the width of the border drawn around the canvas

Parameters:
thick - border width in pixels
Throws: IllegalArgumentException
If the BorderWidth isn't positive, throw an error.
 o getBorderWidth
 public int getBorderWidth()
Gets the BorderWidth property of the ChartCanvas. The BorderWidth property determines the width of the border drawn around the canvas

Returns:
Border width in pixels.
 o preferredSize
 public Dimension preferredSize()
Returns the preferred size for this object.

Overrides:
preferredSize in class JCComponent
 o minimumSize
 public Dimension minimumSize()
Returns the minimum size for this object. Simply makes a call to preferredSize().

Overrides:
minimumSize in class JCComponent
 o setTop
 public synchronized void setTop(int t)
Sets the value of the Top property. The Top property determines the location of the top of the ChartCanvas.

Parameters:
t - top value in pixels.
 o getTop
 public int getTop()
Gets the value of the Top property. The Top property determines the location of the top of the ChartCanvas.

Returns:
top value in pixels.
 o setTopIsDefault
 public synchronized void setTopIsDefault(boolean d)
Sets the value of the TopIsDefault property. The TopIsDefault property determines whether the top position of the chart canvas is calculated by Chart (true) or taken from the Top property (false).

Parameters:
d - true if the position is to be calculated, false otherwise.
 o getTopIsDefault
 public boolean getTopIsDefault()
Gets the value of the TopIsDefault property. The TopIsDefault property determines whether the top position of the chart canvas is calculated by Chart (true) or taken from the Top property (false).

Returns:
true if the position is to be calculated, false otherwise.
 o setLeft
 public synchronized void setLeft(int t)
Sets the value of the Left property. The Left property determines the location of the left of the ChartCanvas.

Parameters:
t - left value in pixels.
 o getLeft
 public int getLeft()
Gets the value of the Left property. The Left property determines the location of the left of the ChartCanvas.

Returns:
left value in pixels.
 o setLeftIsDefault
 public synchronized void setLeftIsDefault(boolean d)
Sets the value of the LeftIsDefault property. The LeftIsDefault property determines whether the left position of the chart canvas is calculated by Chart (true) or taken from the Left property (false).

Parameters:
d - true if the position is to be calculated, false otherwise.
 o getLeftIsDefault
 public boolean getLeftIsDefault()
Gets the value of the LeftIsDefault property. The LeftIsDefault property determines whether the left position of the chart canvas is calculated by Chart (true) or taken from the Left property (false).

Returns:
true if the position is to be calculated, false otherwise.
 o setWidth
 public synchronized void setWidth(int t)
Sets the value of the Width property. The Width property determines the width of the ChartCanvas.

Parameters:
t - width value in pixels.
 o getWidth
 public int getWidth()
Gets the value of the Width property. The Width property determines the location of the width of the ChartCanvas.

Returns:
width value in pixels.
 o setWidthIsDefault
 public synchronized void setWidthIsDefault(boolean d)
Sets the value of the WidthIsDefault property. The WidthIsDefault property determines whether the width of the chart canvas is calculated by Chart (true) or taken from the Width property (false).

Parameters:
d - true if the width is to be calculated, false otherwise.
 o getWidthIsDefault
 public boolean getWidthIsDefault()
Gets the value of the WidthIsDefault property. The WidthIsDefault property determines whether the width of the chart canvas is calculated by Chart (true) or taken from the Width property (false).

Returns:
true if the width is to be calculated, false otherwise.
 o setHeight
 public synchronized void setHeight(int t)
Sets the value of the Height property. The Height property determines the height of the ChartCanvas.

Parameters:
t - height value in pixels.
 o getHeight
 public int getHeight()
Gets the value of the Height property. The Height property determines the location of the height of the ChartCanvas.

Returns:
height value in pixels.
 o setHeightIsDefault
 public synchronized void setHeightIsDefault(boolean d)
Sets the value of the HeightIsDefault property. The HeightIsDefault property determines whether the height of the chart canvas is calculated by Chart (true) or taken from the Height property (false).

Parameters:
d - true if the height is to be calculated, false otherwise.
 o getHeightIsDefault
 public boolean getHeightIsDefault()
Gets the value of the HeightIsDefault property. The HeightIsDefault property determines whether the height of the chart canvas is calculated by Chart (true) or taken from the Height property (false).

Returns:
true if the height is to be calculated, false otherwise.
 o getChanged
 public boolean getChanged()
Gets the value of the Changed property. The Changed property determines whether the chart area requires to be recalculated.

 o isChanged
 public final boolean isChanged()
Gets the value of the Changed property. The Changed property determines whether the chart area requires to be recalculated.

 o setChanged
 public void setChanged(boolean nc)
Sets the value of the Changed property. The Changed property determines whether the chart area requires a recalculation. Note that this setChanged method forces its parent to update itself if the value of n is true.

 o setChanged
 public void setChanged(boolean n,
                        boolean updateParent)
Sets the value of the Changed property. The Changed property determines whether the chart area requires to be recalculated.

Parameters:
n - new boolean value for the Changed property
updateParent - if true, forces the parent to update itself. If false, it simply changes the value of the Changed property.
 o repaint
 public synchronized void repaint()
Overridden repaint() method. Works around delayed repaint problems by calling paint directly.

Overrides:
repaint in class JCComponent
 o updateParent
 public void updateParent()
Internal method used to invalidate and repaint the parent of the ChartCanvas object.

Overrides:
updateParent in class JCComponent
 o preferredWidth
 public int preferredWidth()
Gets the subclass' preferred width (default: 100).

Overrides:
preferredWidth in class JCComponent
 o preferredHeight
 public int preferredHeight()
Gets the subclass' preferred height (default: 100).

Overrides:
preferredHeight in class JCComponent
 o getParameters
 protected void getParameters()
Reads the parameter values from the HTML page using the component's applet.

Overrides:
getParameters in class JCComponent
 o reshape
 public synchronized void reshape(int x,
                                  int y,
                                  int width,
                                  int height)
Reshapes the Component to the specified bounding box.

Overrides:
reshape in class JCComponent
 o recalc
 public void recalc()
 o sizeChanged
 public boolean sizeChanged()
 o setBackground
 public synchronized void setBackground(Color c)
Sets the background color of the component.

HTML param name/value: "Background"/Color

Overrides:
setBackground in class JCComponent
 o setForeground
 public synchronized void setForeground(Color c)
Sets the foreground color of the component.

HTML param name/value: "Foreground"/Color

Overrides:
setForeground in class JCComponent
 o setFont
 public synchronized void setFont(Font f)
Sets the font of the component.

HTML param name/value: "Font"/font

Overrides:
setFont in class JCComponent

All Packages  Class Hierarchy  This Package  Previous  Next  Index