All Packages Class Hierarchy This Package Previous Next Index
Class COM.ibm.beans.charting.HorizontalBarChartView
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.HorizontalBarChartView
- public class HorizontalBarChartView
- extends BarChartView
HorizontalBarChartView extends from the BarChartView class, implements a
horizontal 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 length.
-
HorizontalBarChartView()
- 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.
-
paintBars()
- Paint the bars representing each data value.
-
paintLabels()
- Paints the labels to the left of the Y axis for each bar.
-
paintScale()
- Paints the scale on the X axis.
-
paintValues()
- Paints the values that each bar represents, to the right of the bars.
HorizontalBarChartView
public HorizontalBarChartView()
- 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 end/tip of a bar.
If so, the relevant information is recorded, inorder to track the user
dragging the mouse to change a bar's length.
- 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 length.
- 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 length represents.
- Parameters:
- evt - the mouse event
- Overrides:
- mouseReleased 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 to the left of the Y axis for each bar.
- Overrides:
- paintLabels in class BarChartView
paintValues
protected void paintValues()
- Paints the values that each bar represents, to the right of the bars.
- Overrides:
- paintValues in class BarChartView
paintScale
protected void paintScale()
- Paints the scale on the X axis.
- Overrides:
- paintScale in class ChartView
All Packages Class Hierarchy This Package Previous Next Index