<HTML>
<HEAD>
<TITLE>Untitled file 'DrawPanel.html'</TITLE>
<!-- Copyright (c) 1996 by The Geometry Center. All Rights Reserved. -->
</HEAD>
<BODY BGCOLOR="FFFFFF">
<!-- *Navigation-Links -->
<B>Up:</B> <A HREF="source.html"><I>Java Kali Source Code and Documentation</I></A><BR>
<HR>
<p>

<!-- *Begin-Document-Body -->
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc on Wed Sep 18 15:47:52 CDT 1996 -->
<A NAME="_top_"></A>
<TITLE>
  Class DrawPanel
</TITLE>
</HEAD>
<BODY BGCOLOR="FFFFFF">
<H1>Class DrawPanel</H1>
<PRE>
<A HREF="http://www.javasoft.com/products/JDK/CurrentRelease/api/java.lang.Object.html">java.lang.Object</A>
   |
   +----<A HREF="http://www.javasoft.com/products/JDK/CurrentRelease/api/java.awt.Component.html">java.awt.Component</A>
           |
           +----<A HREF="http://www.javasoft.com/products/JDK/CurrentRelease/api/java.awt.Container.html">java.awt.Container</A>
                   |
                   +----<A HREF="http://www.javasoft.com/products/JDK/CurrentRelease/api/java.awt.Panel.html">java.awt.Panel</A>
                           |
                           +----DrawPanel
</PRE>
<HR>
<DL>
  <DT>class <B>DrawPanel</B>
  <DT>extends <A HREF="http://www.javasoft.com/products/JDK/CurrentRelease/api/java.awt.Panel.html">Panel</A>
</DL>
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.
<p>
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.
<HR>
<A NAME="index"></A>
<H2><IMG SRC="images/constructor-index.gif" WIDTH=275 HEIGHT=38 ALT="Constructor Index"></H2>
<DL>
  <DT><IMG SRC="images/yellow-ball-small.gif" WIDTH=6 HEIGHT=6 ALT=" o ">
	<A HREF="#DrawPanel(Panorama, KaliCanvas)"><B>DrawPanel</B></A>(Panorama, KaliCanvas)
  <DD>Create a new DrawPanel object.
</DL>
<H2><IMG SRC="images/method-index.gif" WIDTH=207 HEIGHT=38 ALT="Method Index"></H2>
<DL>
  <DT><IMG SRC="images/red-ball-small.gif" WIDTH=6 HEIGHT=6 ALT=" o ">
	<A HREF="#clear()"><B>clear</B></A>()
  <DD>Erase the screen and clear the list of segments

  <DT><IMG SRC="images/red-ball-small.gif" WIDTH=6 HEIGHT=6 ALT=" o ">
	<A HREF="#handleEvent(java.awt.Event)"><B>handleEvent</B></A>(Event)
  <DD>Handle mouse events

  <DT><IMG SRC="images/red-ball-small.gif" WIDTH=6 HEIGHT=6 ALT=" o ">
	<A HREF="#paint(java.awt.Graphics)"><B>paint</B></A>(Graphics)
<DD>Paint the panel, by looping through all the segements
and calling the panorama object's drawSegment() method
for each one.
  <DT><IMG SRC="images/red-ball-small.gif" WIDTH=6 HEIGHT=6 ALT=" o ">
	<A HREF="#update(java.awt.Graphics)"><B>update</B></A>(Graphics)
  <DD>Update the screen, with doublebuffering.
</DL>
<A NAME="constructors"></A>
<H2><IMG SRC="images/constructors.gif" WIDTH=231 HEIGHT=38 ALT="Constructors"></H2>
<A NAME="DrawPanel"></A>
<A NAME="DrawPanel(Panorama, KaliCanvas)"><IMG SRC="images/yellow-ball.gif" WIDTH=12 HEIGHT=12 ALT=" o "></A>
<B>DrawPanel</B>
<PRE>
  public DrawPanel(<A HREF="Panorama.html#_top_">Panorama</A> panorama,
                   <A HREF="KaliCanvas.html#_top_">KaliCanvas</A> kaliCanvas)
</PRE>
<DL>
  <DD>Create a new DrawPanel object.
  <DL>
    <DT><B>Parameters:</B>
    <DD>panorama - The Panorama object that this DrawPanel
			relates to.
    <DD>kaliCanvas - The KaliCanvas object that this DrawPanel
			relates to.
  </DL>
</DL>
<A NAME="methods"></A>
<H2><IMG SRC="images/methods.gif" WIDTH=151 HEIGHT=38 ALT="Methods"></H2>
<A NAME="clear()"><IMG SRC="images/red-ball.gif" WIDTH=12 HEIGHT=12 ALT=" o "></A>
<A NAME="clear"><B>clear</B></A>
<PRE>
  public void clear()
</PRE>
<DL>
  <DD>Erase the screen and clear the list of segments
</DL>
<A NAME="handleEvent(java.awt.Event)"><IMG SRC="images/red-ball.gif" WIDTH=12 HEIGHT=12 ALT=" o "></A>
<A NAME="handleEvent"><B>handleEvent</B></A>
<PRE>
  public boolean handleEvent(<A HREF="http://www.javasoft.com/products/JDK/CurrentRelease/api/java.awt.Event.html">Event</A> e)
</PRE>
<DL>
  <DD>Handle mouse events
  <DL>
    <DT><B>Overrides:</B>
    <DD><A HREF="http://www.javasoft.com/products/JDK/CurrentRelease/api/java.awt.Component.html">handleEvent</A> in class <A HREF="http://www.javasoft.com/products/JDK/CurrentRelease/api/java.awt.Component.html">Component</A>
  </DL>
</DL>
<A NAME="paint(java.awt.Graphics)"><IMG SRC="images/red-ball.gif" WIDTH=12 HEIGHT=12 ALT=" o "></A>
<A NAME="paint"><B>paint</B></A>
<PRE>
  public void paint(<A HREF="http://www.javasoft.com/products/JDK/CurrentRelease/api/java.awt.Graphics.html">Graphics</A> g)
</PRE>
<DL>
  <DD>Paint the panel, by looping through all the segements
and calling the panorama object's drawSegment() method
for each one.
  <DL>
    <DT><B>Overrides:</B>
    <DD><A HREF="http://www.javasoft.com/products/JDK/CurrentRelease/api/java.awt.Component.html">paint</A> in class <A HREF="http://www.javasoft.com/products/JDK/CurrentRelease/api/java.awt.Component.html">Component</A>
  </DL>
</DL>
<A NAME="update(java.awt.Graphics)"><IMG SRC="images/red-ball.gif" WIDTH=12 HEIGHT=12 ALT=" o "></A>
<A NAME="update"><B>update</B></A>
<PRE>
  public void update(<A HREF="http://www.javasoft.com/products/JDK/CurrentRelease/api/java.awt.Graphics.html">Graphics</A> screeng)
</PRE>
<DL>
  <DD>Update the screen, with doublebuffering.
  <DL>
    <DT><B>Overrides:</B>
    <DD><A HREF="http://www.javasoft.com/products/JDK/CurrentRelease/api/java.awt.Component.html">update</A> in class <A HREF="http://www.javasoft.com/products/JDK/CurrentRelease/api/java.awt.Component.html">Component</A>
  </DL>
</DL>
<!-- *End-Document-Body -->
<p>

<!-- *Navigation-Links -->
<HR>
<B>Up:</B> <A HREF="source.html"><I>Java Kali Source Code and Documentation</I></A><BR>

<!-- *GC-Common-Footer -->
<HR>
<NOBR><A HREF="/"><IMG SRC="/pix/home.gif" ALT="[HOME]" ALIGN=MIDDLE></A>
<I>The Geometry Center Home Page</I></NOBR>
<p>
Author: <A HREF="http://www.geom.umn.edu/locate/mbp">Mark Phillips</A><BR>
Comments to:
<A HREF="/admin/mail/webmaster.html">webmaster@geom.umn.edu</A><BR>
Created:  Sep 18 1996 --- 
<!-- hhmts start -->
Last modified: Sep 18 1996
<!-- hhmts end -->
</BODY>
</HTML>
