All Packages Class Hierarchy This Package Previous Next Index
Class COM.ibm.beans.charting.VerticalBarChartView
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----COM.ibm.desktop.ModelView
|
+----COM.ibm.beans.charting.ChartView
|
+----COM.ibm.beans.charting.BarChartView
|
+----COM.ibm.beans.charting.VerticalBarChartView
- public class VerticalBarChartView
- extends BarChartView
VerticalBarChartView extends from the BarChartView class, implements a
vertical bar chart representation of the Model, and responds to mouse events to allow
alteration of the data, whenever a bar is dragged to a new height.
-
VerticalBarChartView()
- Default constructor.
-
calculateBars()
- Calculates the location of the bars representing each data value.
-
initialize()
- Initializes the view, and registers itself as a MouseListener and
a MouseMotionListener, so as to catch mouse drag events, and update
the chart accordingly.
-
mouseDragged(MouseEvent)
- Called if the mouse is dragged (the mouse button is down).
-
mousePressed(MouseEvent)
- Called if the mouse is down.
-
mouseReleased(MouseEvent)
- Called if the mouse is up.
-
paint(Graphics)
- Paints the entire Bar Chart by painting the bars, the values
and labels, and the legend, and draws the off-screen buffer to the
the current graphics context.
-
paintBars()
- Paint the bars representing each data value.
-
paintLabels()
- Paints the labels under the X axis for each bar.
-
paintScale()
- Paints the scale on the Y axis.
-
paintValues()
- Paints the values that each bar represents, above the bars.
VerticalBarChartView
public VerticalBarChartView()
- Default constructor.
initialize
public void initialize()
- Initializes the view, and registers itself as a MouseListener and
a MouseMotionListener, so as to catch mouse drag events, and update
the chart accordingly.
This method is called after the Model, View, and ComponentController
are constructed.
- Overrides:
- initialize in class BarChartView
mousePressed
public void mousePressed(MouseEvent evt)
- Called if the mouse is down.
Checks to see if the user clicked anywhere near the top of a bar.
If so, the relevant information is recorded, inorder to track the user
dragging the mouse to change a bar's height.
- Parameters:
- evt - the mouse event
- Overrides:
- mousePressed in class BarChartView
mouseDragged
public void mouseDragged(MouseEvent evt)
- Called if the mouse is dragged (the mouse button is down).
The mouse position is tracked, and the view is updated to change
the selected bar's height.
- Parameters:
- evt - the mouse event
- Overrides:
- mouseDragged in class BarChartView
mouseReleased
public void mouseReleased(MouseEvent evt)
- Called if the mouse is up.
At this time, the data in the model is updated for the new value that
the selected bar's height represents.
- Parameters:
- evt - the mouse event
- Overrides:
- mouseReleased in class BarChartView
paint
public void paint(Graphics g)
- Paints the entire Bar Chart by painting the bars, the values
and labels, and the legend, and draws the off-screen buffer to the
the current graphics context.
- Parameters:
- g - the Graphics object
- Overrides:
- paint in class BarChartView
calculateBars
protected void calculateBars()
- Calculates the location of the bars representing each data value.
- Overrides:
- calculateBars in class BarChartView
paintBars
protected void paintBars()
- Paint the bars representing each data value.
- Overrides:
- paintBars in class BarChartView
paintLabels
protected void paintLabels()
- Paints the labels under the X axis for each bar.
- Overrides:
- paintLabels in class BarChartView
paintValues
protected void paintValues()
- Paints the values that each bar represents, above the bars.
- Overrides:
- paintValues in class BarChartView
paintScale
protected void paintScale()
- Paints the scale on the Y axis.
- Overrides:
- paintScale in class ChartView
All Packages Class Hierarchy This Package Previous Next Index