All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jclass.chart.ChartRegion

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

public class ChartRegion
extends TrackChange
implements Drawable, JCSerializable, HTMLHandler
ChartRegion is a utility class used inside JCChart to represent a drawable region on a JCChart. It is used for all axis annotations as a lightweight component or gadget.

Properties

Name Description
Background The Background property determines the background color used to draw inside the chart region. Note that the Background property is inherited from the parent JCChart.
BorderType Determines the style of border drawn around the ChartRegion. 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.
BorderWidth The BorderWidth property determines the width of the border drawn around the region.
Font The Font property determines what font is used to render text inside the chart region. Note that the Font property is inherited from the parent JCChart.
Foreground The Foreground property determines the foreground color used to draw inside the chart region. Note that the Foreground property is inherited from the parent JCChart.
Height The Height property determines the height of the ChartRegion.
HeightIsDefault The HeightIsDefault property determines whether the height of the chart region is calculated by Chart (true) or taken from the Height property (false).
IsShowing The IsShowing property determines whether the associated ChartRegion is currently visible.
Left The Left property determines the location of the left of the ChartRegion
LeftIsDefault The LeftIsDefault property determines whether the left position of the chart region is calculated by Chart (true) or taken from the Left property (false).
Name The Name property specifies a string identifier for the ChartRegion object.
Parent The Parent property assures the connection to the chart on which the ChartRegion appears. Default value is null.
ParentRegion The ParentRegion property is the ChartRegion parent. Default value is null.
Top The Top property determines the location of the top of the ChartRegion.
TopIsDefault The TopIsDefault property determines whether the top position of the chart region is calculated by Chart (true) or taken from the Top property (false).
Width The Width property determines the width of the ChartRegion.
WidthIsDefault The WidthIsDefault property determines whether the width of the chart region is calculated by Chart (true) or taken from the Width property (false).


Variable Index

 o border_strings
 o border_values

Constructor Index

 o ChartRegion()
Default constructor for chart region
 o ChartRegion(ChartRegion)
 o ChartRegion(JCChart)
Constructor that connects the ChartRegion to a parent JCChart.

Method Index

 o draw(Graphics)
Draws the chart region.
 o getBackground()
Gets the value of the Background property.
 o getBorderType()
Gets the BorderType property of the ChartRegion.
 o getBorderWidth()
Gets the BorderWidth property of the ChartRegion.
 o getDrawingArea()
Gets the bounding rectangle of the component's drawing area, (its area minus the shadows and insets).
 o getDrawingArea(Rectangle)
Gets the bounding rectangle of the component's drawing area, (its area minus the shadows and insets).
 o getFont()
Gets the value of the Font property.
 o getForeground()
Gets the value of the Foreground property.
 o getHeight()
Gets the value of the Height property.
 o getHeightIsDefault()
Gets the value of the HeightIsDefault property.
 o getInsets()
Returns the previously set insets.
 o getIsShowing()
Gets the value of the IsShowing property The IsShowing property determines whether the associated ChartRegion is currently visible.
 o getLeft()
Gets the value of the Left property.
 o getLeftIsDefault()
Gets the value of the LeftIsDefault property.
 o getName()
Gets the value of the Name property.
 o getParent()
 o getParentRegion()
 o getRegionLock()
 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 hide()
 o insets()
Returns the previously set insets.
 o inside(int, int)
 o loadParams(String, JCChart)
Load JCChart parameters from HTML file
 o location()
 o move(int, int)
Moves the chart region to the provided position relative to the chart.
 o preferredSize()
Returns the preferred size for the JCTitle instance.
 o recalc()
Recalculates the contents of the chart region.
 o repaint()
 o reshape(int, int, int, int)
Reshapes (ie resizes and moves) the chart region according to the provided parameters.
 o resize(int, int)
Resizes the chart region to the provided width and height.
 o saveParams(String, JCChart)
Save JCChart parameters as HTML tags
 o setBackground(Color)
Sets the value of the Background property.
 o setBorderType(int)
Sets the BorderType property of the ChartRegion.
 o setBorderWidth(int)
Sets the BorderWidth property of the ChartRegion.
 o setChanged(boolean, int)
Sets the value of the Changed property and updates the parent object.
 o setChanged(boolean, int, boolean)
Sets the value of the Changed property.
 o setFont(Font)
Sets the value of the Font property.
 o setForeground(Color)
Sets the value of the Foreground property.
 o setHeight(int)
Sets the value of the Height property.
 o setHeightIsDefault(boolean)
Sets the value of the HeightIsDefault property.
 o setInsets(Insets)
Sets the component's margins (default: 0).

HTML param name/value: "Insets"/Insets

 o setIsShowing(boolean)
Sets the value of the IsShowing property The IsShowing property determines whether the associated ChartRegion is currently visible.
 o setLeft(int)
Sets the value of the Left property.
 o setLeftIsDefault(boolean)
Sets the value of the LeftIsDefault property.
 o setName(String)
Sets the value of the Name property.
 o setParent(JCChart)
Connects the chart region to a JCChart.
 o setParentRegion(ChartRegion)
 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 show()
 o size()
 o sizeChanged()
 o updateParent(int)

Variables

 o border_strings
 public static final String border_strings[]
 o border_values
 public static final int border_values[]

Constructors

 o ChartRegion
 public ChartRegion()
Default constructor for chart region

 o ChartRegion
 public ChartRegion(JCChart p)
Constructor that connects the ChartRegion to a parent JCChart.

Parameters:
p - Parent chart.
 o ChartRegion
 public ChartRegion(ChartRegion r)

Methods

 o setParent
 public void setParent(JCChart p)
Connects the chart region to a JCChart.

Parameters:
p - Parent chart.
 o getParent
 public JCChart getParent()
 o getRegionLock
 public Object getRegionLock()
 o setParentRegion
 public void setParentRegion(ChartRegion r)
 o getParentRegion
 public ChartRegion getParentRegion()
 o getFont
 public Font getFont()
Gets the value of the Font property. The Font property determines what font is used to render text inside the chart region. Note that the Font property is inherited from the parent JCChart.

Returns:
Font used to render text in the chart region.
 o setFont
 public void setFont(Font f)
Sets the value of the Font property. The Font property determines what font is used to render text inside the chart region. Note that the Font property is inherited from the parent JCChart.

Parameters:
f - Font to use to render text in the chart region.
 o getName
 public String getName()
Gets the value of the Name property. The Name property specifies a string identifier for the ChartRegion object.

Returns:
New name for the object.n
 o setName
 public void setName(String s)
Sets the value of the Name property. The Name property specifies a string identifier for the ChartRegion object.

Parameters:
s - New name for the object.n
 o getForeground
 public Color getForeground()
Gets the value of the Foreground property. The Foreground property determines the foreground color used to draw inside the chart region. Note that the Foreground property is inherited from the parent JCChart.

Returns:
Foreground color used to draw the chart region.
 o setForeground
 public void setForeground(Color c)
Sets the value of the Foreground property. The Foreground property determines the foreground color used to draw inside the chart region. Note that the Foreground property is inherited from the parent JCChart.

Parameters:
c - Foreground color used to draw the chart region.
 o getBackground
 public Color getBackground()
Gets the value of the Background property. The Background property determines the foreground color used to draw inside the chart region. Note that the Background property is inherited from the parent JCChart.

Returns:
Background color used to draw the chart region.
 o setBackground
 public void setBackground(Color c)
Sets the value of the Background property. The Background property determines the foreground color used to draw inside the chart region. Note that the Background property is inherited from the parent JCChart.

Parameters:
c - Background color used to draw the chart region.
 o getIsShowing
 public boolean getIsShowing()
Gets the value of the IsShowing property The IsShowing property determines whether the associated ChartRegion is currently visible.

Returns:
true if the chart region is showing, false otherwise
 o setIsShowing
 public void setIsShowing(boolean is)
Sets the value of the IsShowing property The IsShowing property determines whether the associated ChartRegion is currently visible.

Parameters:
is - true if the chart region is showing, false otherwise
 o recalc
 public void recalc()
Recalculates the contents of the chart region. Not used in the base class.

Overrides:
recalc in class TrackChange
 o reshape
 public void reshape(int newx,
                     int newy,
                     int neww,
                     int newh)
Reshapes (ie resizes and moves) the chart region according to the provided parameters.

Parameters:
newx - New x position relative to the parent chart.
newy - New y position relative to the parent chart.
neww - New width.
newh - New height.
 o move
 public void move(int newx,
                  int newy)
Moves the chart region to the provided position relative to the chart.

Parameters:
newx - New x position relative to the parent chart.
newy - New y position relative to the parent chart.
 o resize
 public void resize(int neww,
                    int newh)
Resizes the chart region to the provided width and height.

Parameters:
neww - New width.
newh - New height.
 o setTop
 public void setTop(int t)
Sets the value of the Top property. The Top property determines the location of the top of the ChartRegion.

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 ChartRegion.

Returns:
top value in pixels.
 o setTopIsDefault
 public void setTopIsDefault(boolean d)
Sets the value of the TopIsDefault property. The TopIsDefault property determines whether the top position of the chart region 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 region 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 void setLeft(int t)
Sets the value of the Left property. The Left property determines the location of the left of the ChartRegion.

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 ChartRegion.

Returns:
left value in pixels.
 o setLeftIsDefault
 public void setLeftIsDefault(boolean d)
Sets the value of the LeftIsDefault property. The LeftIsDefault property determines whether the left position of the chart region 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 region 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 void setWidth(int t)
Sets the value of the Width property. The Width property determines the width of the ChartRegion.

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 ChartRegion.

Returns:
width value in pixels.
 o setWidthIsDefault
 public void setWidthIsDefault(boolean d)
Sets the value of the WidthIsDefault property. The WidthIsDefault property determines whether the width of the chart region 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 region 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 void setHeight(int t)
Sets the value of the Height property. The Height property determines the height of the ChartRegion.

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 ChartRegion.

Returns:
height value in pixels.
 o setHeightIsDefault
 public void setHeightIsDefault(boolean d)
Sets the value of the HeightIsDefault property. The HeightIsDefault property determines whether the height of the chart region 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 region is calculated by Chart (true) or taken from the Height property (false).

Returns:
true if the height is to be calculated, false otherwise.
 o setBorderType
 public void setBorderType(int bt)
Sets the BorderType property of the ChartRegion. The BorderType property determines the style of border drawn around the ChartRegion. 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 ChartRegion. The BorderType property determines the style of border drawn around the ChartRegion. 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 void setBorderWidth(int thick)
Sets the BorderWidth property of the ChartRegion. The BorderWidth property determines the width of the border drawn around the region.

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 ChartRegion. The BorderWidth property determines the width of the border drawn around the region.

Returns:
Border width in pixels.
 o draw
 public void draw(Graphics gc)
Draws the chart region.

Parameters:
gc - Graphics context to use for drawing.
 o setChanged
 public void setChanged(boolean c,
                        int cf)
Sets the value of the Changed property and updates the parent object. The Changed property determines whether the object needs to be recalculated.

Parameters:
n - New value for Changed.
Overrides:
setChanged in class TrackChange
 o setChanged
 public void setChanged(boolean n,
                        int cf,
                        boolean updateParent)
Sets the value of the Changed property.

Overrides:
setChanged in class TrackChange
 o repaint
 public void repaint()
 o preferredSize
 public Dimension preferredSize()
Returns the preferred size for the JCTitle instance.

Returns:
preferred size
 o location
 public Point location()
 o size
 public Dimension size()
 o getDrawingArea
 public Rectangle getDrawingArea()
Gets the bounding rectangle of the component's drawing area, (its area minus the shadows and insets).

See Also:
setInsets
 o getDrawingArea
 public void getDrawingArea(Rectangle rect)
Gets the bounding rectangle of the component's drawing area, (its area minus the shadows and insets).

See Also:
setInsets
 o inside
 public boolean inside(int x,
                       int y)
 o show
 public void show()
 o hide
 public void hide()
 o setInsets
 public void setInsets(Insets insets)
Sets the component's margins (default: 0).

HTML param name/value: "Insets"/Insets

See Also:
toInsets
 o insets
 public Insets insets()
Returns the previously set insets.

See Also:
setInsets
 o getInsets
 public Insets getInsets()
Returns the previously set insets.

See Also:
setInsets
 o sizeChanged
 public boolean sizeChanged()
 o updateParent
 public void updateParent(int cf)
 o saveParams
 public void saveParams(String name,
                        JCChart comp)
Save JCChart parameters as HTML tags

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

Parameters:
name - the PARAM NAME
chart - the JCChart component

All Packages  Class Hierarchy  This Package  Previous  Next  Index