All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class convexHull.MouseCanvas

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----convexHull.MouseCanvas

public class MouseCanvas
extends Panel
This is a container for a canvas. This container will display rulers around the canvas (on the top and left).


Variable Index

 o leftCanvas
canvas for the left ruler
 o mainCanvas
the main canvas
 o topCanvas
canvas for the top ruler

Constructor Index

 o MouseCanvas(Canvas)
Lays out its children (top & left rulers + the user defined canvas).

Method Index

 o doLayout()
Makes sure that the rulers and the main canvas are always properly laid out.
 o mouseCB(MouseEvent)
Callback for the mouse
 o setBackground(Color)
This method allows the user to set the background.

Variables

 o topCanvas
 private TopCanvas topCanvas
canvas for the top ruler

 o leftCanvas
 private LeftCanvas leftCanvas
canvas for the left ruler

 o mainCanvas
 private Canvas mainCanvas
the main canvas

Constructors

 o MouseCanvas
 public MouseCanvas(Canvas mainCanvas)
Lays out its children (top & left rulers + the user defined canvas). Associates callbacks with various mouse events, so that the rulers can be properly updated.

Parameters:
mainCanvas - java.awt.Canvas - the real user-graphics canvas

Methods

 o doLayout
 public void doLayout()
Makes sure that the rulers and the main canvas are always properly laid out.

Overrides:
doLayout in class Container
 o mouseCB
 public void mouseCB(MouseEvent e)
Callback for the mouse

Parameters:
e - java.awt.Event.MouseEvent - mouse event that triggered this event
 o setBackground
 public void setBackground(Color col)
This method allows the user to set the background.

Parameters:
col - java.awt.Color - the user defined color
Overrides:
setBackground in class Component

All Packages  Class Hierarchy  This Package  Previous  Next  Index