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.
-
LineChartView()
- Default constructor.
-
handleModelChange(ModelChangeEvent)
- Handles model changes by repainting.
-
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.
-
legendFits()
- Checks to see if the legend will fit in the chart's current drawing area.
-
mouseClicked(MouseEvent)
- Called if the mouse is clicked.
-
mouseDragged(MouseEvent)
- Called if the mouse is dragged (the mouse button is down).
-
mouseEntered(MouseEvent)
- Called if the mouse enters this chart.
-
mouseExited(MouseEvent)
- Called if the mouse leaves this chart.No action is taken.
-
mouseMoved(MouseEvent)
- Called when the mouse moves over this chart.
-
mousePressed(MouseEvent)
- Called if the mouse is down.
-
mouseReleased(MouseEvent)
- Called if the mouse is up.
-
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.
-
paintScale()
- Paints the scale on the Y axis.
-
update(Graphics)
- Updates the chart by causing a repaint.
LineChartView
public LineChartView()
- 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 ChartView
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
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
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
mouseClicked
public void mouseClicked(MouseEvent e)
- Called if the mouse is clicked. No action is taken.
- Parameters:
- evt - the mouse event
mouseEntered
public void mouseEntered(MouseEvent e)
- Called if the mouse enters this chart. No action is taken.
- Parameters:
- evt - the mouse event
mouseExited
public void mouseExited(MouseEvent e)
- Called if the mouse leaves this chart.No action is taken.
- Parameters:
- evt - the mouse event
mouseMoved
public void mouseMoved(MouseEvent e)
- Called when the mouse moves over this chart. No action is taken.
- Parameters:
- evt - the mouse event
handleModelChange
public void handleModelChange(ModelChangeEvent event)
- Handles model changes by repainting.
- Parameters:
- event - the ModelChange event
- Overrides:
- handleModelChange in class ChartView
update
public void update(Graphics g)
- Updates the chart by causing a repaint.
- Parameters:
- g - the Graphics object
- Overrides:
- update in class ChartView
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
paintScale
protected void paintScale()
- Paints the scale on the Y axis.
- Overrides:
- paintScale in class ChartView
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