JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.chart
Class ChartInteriorRegion

java.lang.Object
  |
  +--com.klg.jclass.chart.TrackChange
        |
        +--com.klg.jclass.chart.ChartInteriorRegion
All Implemented Interfaces:
Changeable, Changeable, com.klg.jclass.chart.Drawable, com.klg.jclass.util.JCName, Serializable
Direct Known Subclasses:
ChartText, JCAxis

public class ChartInteriorRegion
extends TrackChange
implements com.klg.jclass.chart.Drawable, Serializable, com.klg.jclass.util.JCName

A utility class used inside JClass Chart to represent a drawable region on a chart. It is used for all axis annotations as a lightweight component or gadget.

See Also:
Serialized Form

Field Summary
protected  Color background
          Background color used in the chart region.
protected  boolean dimIsDefaultChangedToTrue
           
protected  Font font
          Font used to draw text in the chart region.
protected  Color foreground
          Foreground color used in the chart region.
protected  boolean groupingUsed
           
protected  com.klg.jclass.chart.DerivedInt height
           
protected  Insets insets
           
protected  boolean inUpdate
           
protected  com.klg.jclass.chart.DerivedInt left
           
protected  String name
          Name of the ChartInteriorRegion object.
protected  boolean needsRepaint
           
protected  boolean numberLocalization
           
protected  com.klg.jclass.chart.JCChart parentChart
          Connection to the chart on which the ChartInteriorRegion appears.
protected  com.klg.jclass.chart.ChartRegion parentRegion
           
protected  com.klg.jclass.chart.DerivedInt top
           
protected  boolean transparent
           
protected  boolean updateParent
          Used to turn off updates to parent in certain cases.
protected  boolean visible
          Determines whether the chart region is visible.
protected  com.klg.jclass.chart.DerivedInt width
           
 
Fields inherited from class com.klg.jclass.chart.TrackChange
changed, changedFlag
 
Fields inherited from interface com.klg.jclass.chart.Changeable
BASIC_CHANGE_MASK, NOTIFY_AXES_RECALC, NOTIFY_AXES_REDRAW, NOTIFY_CA_RECALC, NOTIFY_CA_REDRAW, NOTIFY_LEGEND_RECALC, NOTIFY_LEGEND_REDRAW
 
Fields inherited from interface com.klg.jclass.util.Changeable
LAYOUT, NO_CHANGE, NOTIFY_PARENT_LAYOUT, RECALC, REDRAW
 
Constructor Summary
ChartInteriorRegion()
          Default constructor for chart region.
ChartInteriorRegion(com.klg.jclass.chart.ChartRegion r)
           
ChartInteriorRegion(com.klg.jclass.chart.JCChart p)
          Constructor that connects the ChartInteriorRegion to a parent JCChart.
 
Method Summary
 void draw(Graphics gc)
          Draws the chart region.
 Color getBackground()
          Gets the value of the Background property.
 Rectangle getDrawingArea()
          Gets the bounding rectangle of the component's drawing area, (its area minus the shadows and insets).
 void getDrawingArea(Rectangle rect)
          Gets the bounding rectangle of the component's drawing area, (its area minus the shadows and insets).
 Font getFont()
          Gets the value of the Font property.
 Color getForeground()
          Gets the value of the Foreground property.
 Graphics getGraphics()
          Gets the current graphics object used.
 boolean getGroupingUsed()
          Gets the value of the GroupingUsed property.
 int getHeight()
          Gets the value of the Height property.
 boolean getHeightIsDefault()
          Gets the value of the HeightIsDefault property.
 Insets getInsets()
          Returns the previously set insets.
 int getLeft()
          Gets the value of the Left property.
 boolean getLeftIsDefault()
          Gets the value of the LeftIsDefault property.
 String getName()
          Gets the value of the Name property.
 com.klg.jclass.chart.JCChartNumberFormat getNumberFormatter()
          Gets the number formatter (used for number localization).
 boolean getNumberLocalization()
          Gets the value of the NumberLocalization property.
 com.klg.jclass.chart.JCChart getParentChart()
           
 com.klg.jclass.chart.ChartRegion getParentRegion()
           
 Dimension getSize()
          Returns the size of the region.
 int getTop()
          Gets the value of the Top property.
 boolean getTopIsDefault()
          Gets the value of the TopIsDefault property.
 int getWidth()
          Gets the value of the Width property.
 boolean getWidthIsDefault()
          Gets the value of the WidthIsDefault property.
 void hide()
          Hides the region and repaints the parent.
 Insets insets()
          Returns the previously set insets.
 boolean inside(int x, int y)
          Is the point (x,y) within the drawing area?.
 boolean isVisible()
          Gets the value of the Visible property.
 Point location()
          Gets the location of the drawing region based on the margins.
 Dimension preferredSize()
          Returns the preferred size for the ChartInteriorRegion instance.
 void recalc()
          Recalculates the contents of the chart region.
 void repaint()
          Repaints, taking into account the parent region.
 void setBackground(Color c)
          Sets the value of the Background property.
 void setBounds(int newx, int newy, int neww, int newh)
          Reshapes (in ohter words, resizes and moves) the chart region according to the provided parameters.
 void setChanged(boolean c, int cf)
          Sets the value of the Changed property and updates the parent object.
 void setChanged(boolean n, int cf, boolean updateParent)
          Sets the value of the Changed property.
 void setFont(Font f)
          Sets the value of the Font property.
 void setForeground(Color c)
          Sets the value of the Foreground property.
 void setGroupingUsed(boolean groupingUsed)
          Sets the value of the GroupingUsed property.
 void setHeight(int t)
          Sets the value of the Height property.
 void setHeightIsDefault(boolean d)
          Sets the value of the HeightIsDefault property.
 void setInsets(Insets insets)
          Sets the component's margins (default is 0).
 void setLeft(int t)
          Sets the value of the Left property.
 void setLeftIsDefault(boolean d)
          Sets the value of the LeftIsDefault property.
 void setLocation(int newx, int newy)
          Moves the chart region to the provided position relative to the chart.
 void setName(String s)
          Sets the value of the Name property.
 void setNumberFormatterLocale(Locale l)
          Sets the value of the number formatting locale.
 void setNumberLocalization(boolean numberLocalization)
          Sets whether to localize numbers.
 void setParentChart(com.klg.jclass.chart.JCChart p)
          Connects the chart region to a JCChart.
 void setParentRegion(com.klg.jclass.chart.ChartRegion r)
           
 void setSize(int neww, int newh)
          Resizes the chart region to the provided width and height.
 void setTop(int t)
          Sets the value of the Top property.
 void setTopIsDefault(boolean d)
          Sets the value of the TopIsDefault property.
 void setVisible(boolean is)
          Sets the value of the Visible property.
 void setWidth(int t)
          Sets the value of the Width property.
 void setWidthIsDefault(boolean d)
          Sets the value of the WidthIsDefault property.
 void show()
          Makes the region visible and repaints the parent.
 Dimension size()
          Gets the size of the region.
 boolean sizeChanged()
          Checks if the size has changed.
 void updateParent(int cf)
          Updates the parent based on the passed in flag.
 
Methods inherited from class com.klg.jclass.chart.TrackChange
getChanged, getChanged, isBatched, isChanged, isChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

insets

protected Insets insets

left

protected com.klg.jclass.chart.DerivedInt left

top

protected com.klg.jclass.chart.DerivedInt top

width

protected com.klg.jclass.chart.DerivedInt width

height

protected com.klg.jclass.chart.DerivedInt height

font

protected Font font
Font used to draw text in the chart region. Inherited from parent.


name

protected String name
Name of the ChartInteriorRegion object.


foreground

protected Color foreground
Foreground color used in the chart region. Inherited from parent.


background

protected Color background
Background color used in the chart region. Inherited from parent.


parentChart

protected com.klg.jclass.chart.JCChart parentChart
Connection to the chart on which the ChartInteriorRegion appears.


parentRegion

protected com.klg.jclass.chart.ChartRegion parentRegion

visible

protected boolean visible
Determines whether the chart region is visible. Used in JCAxis.


updateParent

protected boolean updateParent
Used to turn off updates to parent in certain cases.


dimIsDefaultChangedToTrue

protected boolean dimIsDefaultChangedToTrue

inUpdate

protected boolean inUpdate

needsRepaint

protected boolean needsRepaint

transparent

protected boolean transparent

numberLocalization

protected boolean numberLocalization

groupingUsed

protected boolean groupingUsed
Constructor Detail

ChartInteriorRegion

public ChartInteriorRegion()
Default constructor for chart region.


ChartInteriorRegion

public ChartInteriorRegion(com.klg.jclass.chart.JCChart p)
Constructor that connects the ChartInteriorRegion to a parent JCChart.

Parameters:
p - parent chart

ChartInteriorRegion

public ChartInteriorRegion(com.klg.jclass.chart.ChartRegion r)
Method Detail

setParentChart

public void setParentChart(com.klg.jclass.chart.JCChart p)
Connects the chart region to a JCChart.

Parameters:
p - parent chart

getParentChart

public com.klg.jclass.chart.JCChart getParentChart()

setParentRegion

public void setParentRegion(com.klg.jclass.chart.ChartRegion r)

getParentRegion

public com.klg.jclass.chart.ChartRegion getParentRegion()

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: The Font property is inherited from the parent JCChart.

Returns:
font used to render text in the chart region

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: The Font property is inherited from the parent JCChart.

Parameters:
f - font to use to render text in the chart region

getName

public String getName()
Gets the value of the Name property. The Name property specifies a String identifier for the ChartInteriorRegion object.

Specified by:
getName in interface com.klg.jclass.util.JCName
Returns:
new name for the object.n

setName

public void setName(String s)
Sets the value of the Name property. The Name property specifies a String identifier for the ChartInteriorRegion object.

Specified by:
setName in interface com.klg.jclass.util.JCName
Parameters:
s - new name for the object.n

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: The Foreground property is inherited from the parent JCChart.

Returns:
foreground color used to draw the chart region

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: The Foreground property is inherited from the parent JCChart.

Parameters:
c - foreground color used to draw the chart region

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: The Background property is inherited from the parent JCChart.

Returns:
background color used to draw the chart region

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: The Background property is inherited from the parent JCChart.

Parameters:
c - background color used to draw the chart region

isVisible

public boolean isVisible()
Gets the value of the Visible property. The Visible property determines whether the associated ChartInteriorRegion is currently visible.

Returns:
true if the chart region is showing; false otherwise

setVisible

public void setVisible(boolean is)
Sets the value of the Visible property. The Visible property determines whether the associated ChartInteriorRegion is currently visible.

Parameters:
is - true if the chart region is showing; false otherwise

recalc

public void recalc()
Recalculates the contents of the chart region. Not used in the base class.

Specified by:
recalc in class TrackChange

setBounds

public void setBounds(int newx,
                      int newy,
                      int neww,
                      int newh)
Reshapes (in ohter words, 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

setLocation

public void setLocation(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

setSize

public void setSize(int neww,
                    int newh)
Resizes the chart region to the provided width and height.

Parameters:
neww - new width
newh - new height

getSize

public Dimension getSize()
Returns the size of the region.

Returns:
the size of this ChartInteriorRegion

setTop

public void setTop(int t)
Sets the value of the Top property. The Top property determines the location of the top of the ChartInteriorRegion.

Parameters:
t - top value in pixels

getTop

public int getTop()
Gets the value of the Top property. The Top property determines the location of the top of the ChartInteriorRegion.

Returns:
top value in pixels

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 is taken from the Top property (false).

Parameters:
d - true if the position is to be calculated; false otherwise

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 is taken from the Top property (false).

Returns:
true if the position is to be calculated; false otherwise

setLeft

public void setLeft(int t)
Sets the value of the Left property. The Left property determines the location of the left of the ChartInteriorRegion.

Parameters:
t - left value in pixels

getLeft

public int getLeft()
Gets the value of the Left property. The Left property determines the location of the left of the ChartInteriorRegion.

Returns:
left value in pixels

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 is taken from the Left property (false).

Parameters:
d - true if the position is to be calculated; false otherwise

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 is taken from the Left property (false).

Returns:
true if the position is to be calculated; false otherwise

setWidth

public void setWidth(int t)
Sets the value of the Width property. The Width property determines the width of the ChartInteriorRegion.

Parameters:
t - width value in pixels

getWidth

public int getWidth()
Gets the value of the Width property. The Width property determines the location of the width of the ChartInteriorRegion.

Returns:
width value in pixels

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

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

setHeight

public void setHeight(int t)
Sets the value of the Height property. The Height property determines the height of the ChartInteriorRegion.

Parameters:
t - height value in pixels

getHeight

public int getHeight()
Gets the value of the Height property. The Height property determines the location of the height of the ChartInteriorRegion.

Returns:
height value in pixels

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

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

getNumberFormatter

public com.klg.jclass.chart.JCChartNumberFormat getNumberFormatter()
Gets the number formatter (used for number localization).

Returns:
the current JCChartNumberFormat object used for localizing numbers

setNumberLocalization

public void setNumberLocalization(boolean numberLocalization)
Sets whether to localize numbers.

Parameters:
numberLocalization - the new value of the NumberLocalization property

getNumberLocalization

public boolean getNumberLocalization()
Gets the value of the NumberLocalization property.

Returns:
true if number localization is being used

getGroupingUsed

public boolean getGroupingUsed()
Gets the value of the GroupingUsed property. The GroupingUsed property determines whether or not grouping will be used in formatting numbers.

Returns:
the current grouping used

setGroupingUsed

public void setGroupingUsed(boolean groupingUsed)
Sets the value of the GroupingUsed property. The GroupingUsed property determines whether or not grouping will be used in formatting numbers. Default value is false.

Parameters:
groupingUsed - the new value of the GroupingUsed property

setNumberFormatterLocale

public void setNumberFormatterLocale(Locale l)
Sets the value of the number formatting locale. Default value is the current locale.

Parameters:
l - the new number formatting locale

draw

public void draw(Graphics gc)
Draws the chart region.

Specified by:
draw in interface com.klg.jclass.chart.Drawable
Parameters:
gc - graphics context to use for drawing

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.

Specified by:
setChanged in interface Changeable
Overrides:
setChanged in class TrackChange
Parameters:
c - new value for Changed
cf - the value with which to update the changed flag

setChanged

public void setChanged(boolean n,
                       int cf,
                       boolean updateParent)
Sets the value of the Changed property. The Changed property determines whether the object needs to be recalculated.

Specified by:
setChanged in interface Changeable
Overrides:
setChanged in class TrackChange
Parameters:
n - new value for Changed
cf - the value with which to update the changed flag
updateParent - if true, the parent is updated; otherwise, the parent is not updated (the "update" semantics are up to the implementor)

updateParent

public void updateParent(int cf)
Updates the parent based on the passed in flag.

Parameters:
cf - the flag which determines the kind of update

getGraphics

public Graphics getGraphics()
Gets the current graphics object used.

Returns:
the current graphics object used

repaint

public void repaint()
Repaints, taking into account the parent region. Uses the gc of the parent chart.


preferredSize

public Dimension preferredSize()
Returns the preferred size for the ChartInteriorRegion instance.

Returns:
preferred size

location

public Point location()
Gets the location of the drawing region based on the margins.

Returns:
the current location of the drawing region

size

public Dimension size()
Gets the size of the region.

Returns:
the current size of the region

getDrawingArea

public Rectangle getDrawingArea()
Gets the bounding rectangle of the component's drawing area, (its area minus the shadows and insets).

Returns:
the current bounding rectangle of the component's drawing area
See Also:
setInsets(java.awt.Insets)

getDrawingArea

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

Parameters:
rect - an object in which the bounding rectangle of the component's drawing area is returned
See Also:
setInsets(java.awt.Insets)

inside

public boolean inside(int x,
                      int y)
Is the point (x,y) within the drawing area?.

Parameters:
x - the x value of the point
y - the y value of the point
Returns:
true, if the point is within the drawing area

show

public void show()
Makes the region visible and repaints the parent.


hide

public void hide()
Hides the region and repaints the parent.


setInsets

public void setInsets(Insets insets)
Sets the component's margins (default is 0).

HTML param name/value: "Insets"/Insets

Parameters:
insets - the new component margins
See Also:
JCSwingTypeConverter.toInsets(java.lang.String, java.awt.Insets)

insets

public Insets insets()
Returns the previously set insets.

Returns:
the current component margins
See Also:
setInsets(java.awt.Insets)

getInsets

public Insets getInsets()
Returns the previously set insets.

Returns:
the current component margins
See Also:
setInsets(java.awt.Insets)

sizeChanged

public boolean sizeChanged()
Checks if the size has changed.

Returns:
true, if the size has changed

Copyright © 2004 Quest Software Inc..
All rights reserved.