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.


Constructor Index

 o VerticalBarChartView()
Default constructor.

Method Index

 o calculateBars()
Calculates the location of the bars representing each data value.
 o 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.
 o mouseDragged(MouseEvent)
Called if the mouse is dragged (the mouse button is down).
 o mousePressed(MouseEvent)
Called if the mouse is down.
 o mouseReleased(MouseEvent)
Called if the mouse is up.
 o 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.
 o paintBars()
Paint the bars representing each data value.
 o paintLabels()
Paints the labels under the X axis for each bar.
 o paintScale()
Paints the scale on the Y axis.
 o paintValues()
Paints the values that each bar represents, above the bars.

Constructors

 o VerticalBarChartView
 public VerticalBarChartView()
Default constructor.

Methods

 o 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
 o 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
 o 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
 o 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
 o 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
 o calculateBars
 protected void calculateBars()
Calculates the location of the bars representing each data value.

Overrides:
calculateBars in class BarChartView
 o paintBars
 protected void paintBars()
Paint the bars representing each data value.

Overrides:
paintBars in class BarChartView
 o paintLabels
 protected void paintLabels()
Paints the labels under the X axis for each bar.

Overrides:
paintLabels in class BarChartView
 o paintValues
 protected void paintValues()
Paints the values that each bar represents, above the bars.

Overrides:
paintValues in class BarChartView
 o 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