Up: Java Kali Source Code and Documentation
Class DrawPanel
Class DrawPanel
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----DrawPanel
- class DrawPanel
- extends Panel
The DrawPanel object is Kali's actual drawing area. It receives
and handles the mouse events related to drawing, maintains the list
of line segments that have been drawn (and their colors), keeps
track of whether we're drawing a temporary segment (the segment
that follows the mouse during drawing), and if so, its coordinates.
The screen is drawn in Kali whenever the system calls the
DrawPanel's paint() method; this method goes through the list of
current segments, and calls the Panorama's drawSegement() method
for each one.

DrawPanel(Panorama, KaliCanvas)
- Create a new DrawPanel object.

clear()
- Erase the screen and clear the list of segments
handleEvent(Event)
- Handle mouse events
paint(Graphics)
- Paint the panel, by looping through all the segements
and calling the panorama object's drawSegment() method
for each one.
update(Graphics)
- Update the screen, with doublebuffering.

DrawPanel
public DrawPanel(Panorama panorama,
KaliCanvas kaliCanvas)
- Create a new DrawPanel object.
- Parameters:
- panorama - The Panorama object that this DrawPanel
relates to.
- kaliCanvas - The KaliCanvas object that this DrawPanel
relates to.

clear
public void clear()
- Erase the screen and clear the list of segments
handleEvent
public boolean handleEvent(Event e)
- Handle mouse events
- Overrides:
- handleEvent in class Component
paint
public void paint(Graphics g)
- Paint the panel, by looping through all the segements
and calling the panorama object's drawSegment() method
for each one.
- Overrides:
- paint in class Component
update
public void update(Graphics screeng)
- Update the screen, with doublebuffering.
- Overrides:
- update in class Component
Up: Java Kali Source Code and Documentation
The Geometry Center Home Page
Author: Mark Phillips
Comments to:
webmaster@www.geom.uiuc.edu
Created: Sep 18 1996 ---
Last modified: Sep 18 1996