All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class COM.ibm.beans.charting.LineChartView

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.LineChartView

public class LineChartView
extends ChartView
implements MouseListener, MouseMotionListener
LineChartView extends from the ChartView class, implements a line chart representation of the Model, and responds to mouse events to allow alteration of the data, whenever a point on the chart is dragged to a new height.


Constructor Index

 o LineChartView()
Default constructor.

Method Index

 o handleModelChange(ModelChangeEvent)
Handles model changes by repainting.
 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 legendFits()
Checks to see if the legend will fit in the chart's current drawing area.
 o mouseClicked(MouseEvent)
Called if the mouse is clicked.
 o mouseDragged(MouseEvent)
Called if the mouse is dragged (the mouse button is down).
 o mouseEntered(MouseEvent)
Called if the mouse enters this chart.
 o mouseExited(MouseEvent)
Called if the mouse leaves this chart.No action is taken.
 o mouseMoved(MouseEvent)
Called when the mouse moves over this chart.
 o mousePressed(MouseEvent)
Called if the mouse is down.
 o mouseReleased(MouseEvent)
Called if the mouse is up.
 o paint(Graphics)
Paints the entire Line Chart by painting the points and the line, the values and labels, and the legend, and draws the off-screen buffer to the the current graphics context.
 o paintScale()
Paints the scale on the Y axis.
 o update(Graphics)
Updates the chart by causing a repaint.

Constructors

 o LineChartView
 public LineChartView()
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 ChartView
 o mousePressed
 public void mousePressed(MouseEvent evt)
Called if the mouse is down. Checks to see if the user clicked anywhere near a charted data point. If so, the relevant information is recorded, inorder to track the user dragging the mouse to change the value of the data.

Parameters:
evt - the mouse event
 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 point's position.

Parameters:
evt - the mouse event
 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 point's position represents.

Parameters:
evt - the mouse event
 o mouseClicked
 public void mouseClicked(MouseEvent e)
Called if the mouse is clicked. No action is taken.

Parameters:
evt - the mouse event
 o mouseEntered
 public void mouseEntered(MouseEvent e)
Called if the mouse enters this chart. No action is taken.

Parameters:
evt - the mouse event
 o mouseExited
 public void mouseExited(MouseEvent e)
Called if the mouse leaves this chart.No action is taken.

Parameters:
evt - the mouse event
 o mouseMoved
 public void mouseMoved(MouseEvent e)
Called when the mouse moves over this chart. No action is taken.

Parameters:
evt - the mouse event
 o handleModelChange
 public void handleModelChange(ModelChangeEvent event)
Handles model changes by repainting.

Parameters:
event - the ModelChange event
Overrides:
handleModelChange in class ChartView
 o update
 public void update(Graphics g)
Updates the chart by causing a repaint.

Parameters:
g - the Graphics object
Overrides:
update in class ChartView
 o paint
 public void paint(Graphics g)
Paints the entire Line Chart by painting the points and the line, 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 ChartView
 o paintScale
 protected void paintScale()
Paints the scale on the Y axis.

Overrides:
paintScale in class ChartView
 o legendFits
 protected boolean legendFits()
Checks to see if the legend will fit in the chart's current drawing area. The size of the legend depends on what is to be shown in the legend; the labels and / or the values in the ChartModel. (The LineChartView always returns false for this method.)

Overrides:
legendFits in class ChartView

All Packages  Class Hierarchy  This Package  Previous  Next  Index