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.


Constructor Index

 o HorizontalBarChartView()
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 paintBars()
Paint the bars representing each data value.
 o paintLabels()
Paints the labels to the left of the Y axis for each bar.
 o paintScale()
Paints the scale on the X axis.
 o paintValues()
Paints the values that each bar represents, to the right of the bars.

Constructors

 o HorizontalBarChartView
 public HorizontalBarChartView()
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 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
 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 length.

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 length represents.

Parameters:
evt - the mouse event
Overrides:
mouseReleased 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 to the left of the Y axis for each bar.

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

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