All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class math.topol.Braid.braidCanvas

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----graphics.bezier.PlotCanvas
                           |
                           +----math.topol.Braid.braidCanvas

public class braidCanvas
extends PlotCanvas
implements ActionListener
Class braidCanvas encapsulates the data and methods required to draw braids and to interact with them on the screen.

Version:
$Id: braidCanvas.java,v 1.8 1999/02/11 21:03:55 djun Exp djun $

Variable Index

 o ColArray

Constructor Index

 o braidCanvas(Applet, ActionListener)
 o braidCanvas(Applet, ActionListener, int, int)

Method Index

 o actionPerformed(ActionEvent)
Takes care of ActionEvents in this braidCanvas.
 o addPopup(PopupMenu)
Add a popup menu.
 o draw()
Plots the braid.
 o drawBraid(braid)
Draws given braid in this braidCanvas.
 o drawCrossing(int, RealPoint)
Draws given elementary generator at the given basepoint.
 o initGfx()
Initializes the graphics.
 o paint(Graphics)
Calls update to refresh the canvas with the image of the braid.
 o processMouseEvent(MouseEvent)
Takes care of MouseEvents in this braidCanvas.
 o register(braid)
Registers this braid with the canvas so that various operations can dispense with such operations as threading the braid.
 o toPostScript(braid)
Generates PostScript output which draws this braid.
 o update(Graphics)
Update this image.

Variables

 o ColArray
 public static Color ColArray[]

Constructors

 o braidCanvas
 public braidCanvas(Applet a,
                    ActionListener al)
 o braidCanvas
 public braidCanvas(Applet a,
                    ActionListener al,
                    int width,
                    int height)

Methods

 o initGfx
 public void initGfx()
Initializes the graphics.

 o paint
 public void paint(Graphics g)
Calls update to refresh the canvas with the image of the braid.

Overrides:
paint in class PlotCanvas
 o register
 public void register(braid b)
Registers this braid with the canvas so that various operations can dispense with such operations as threading the braid. This is done once for every "new" braid.

 o update
 public void update(Graphics g)
Update this image.

Overrides:
update in class PlotCanvas
 o draw
 public void draw()
Plots the braid.

Overrides:
draw in class PlotCanvas
 o drawCrossing
 public void drawCrossing(int index,
                          RealPoint basepoint)
Draws given elementary generator at the given basepoint.

 o toPostScript
 public void toPostScript(braid b)
Generates PostScript output which draws this braid.

 o drawBraid
 public void drawBraid(braid b)
Draws given braid in this braidCanvas.

 o addPopup
 public void addPopup(PopupMenu pop)
Add a popup menu. We assume that the popup menu has had all of its menu items added, and that each has an action listener defined in another class.

 o processMouseEvent
 public void processMouseEvent(MouseEvent e)
Takes care of MouseEvents in this braidCanvas. Pops up the Popup Menu; most other events get passed upstream to superclasses of this class.

Overrides:
processMouseEvent in class Component
 o actionPerformed
 public void actionPerformed(ActionEvent e)
Takes care of ActionEvents in this braidCanvas. Everything here gets dispatched to the actionListener which is supplied in the constructor to this braidCanvas class.


All Packages  Class Hierarchy  This Package  Previous  Next  Index