codeblockutil
Class GlassCard

java.lang.Object
  extended by codeblockutil.GlassCard
All Implemented Interfaces:
java.awt.event.ActionListener, java.beans.PropertyChangeListener, java.util.EventListener

public class GlassCard
extends java.lang.Object
implements java.awt.event.ActionListener, java.beans.PropertyChangeListener

A GlassCard is used by glass explorers explorers as a mediator to their canvases. It wraps a button, a scrollpane, and a invoker. The button uses information about the current color and highlight of the canvas to dipict itself. The scrollpane takes the canvas and puts it inside a scroll pane so that users can navigate a very large canvas in small space. The invoker respnds to button presses and invokes the right method in the explorer.


Constructor Summary
GlassCard(int i, Canvas canvas, GlassExplorer ex)
          constructor
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          When the user presses the button, the explorer selects the corresponding canvas
(package private)  java.awt.Color getBackgorundColor()
           
(package private)  javax.swing.JComponent getButton()
           
(package private)  javax.swing.JComponent getScroll()
           
 void propertyChange(java.beans.PropertyChangeEvent e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GlassCard

GlassCard(int i,
          Canvas canvas,
          GlassExplorer ex)
constructor

Parameters:
i -
canvas -
ex -
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
When the user presses the button, the explorer selects the corresponding canvas

Specified by:
actionPerformed in interface java.awt.event.ActionListener

getButton

javax.swing.JComponent getButton()
Returns:
the button

getScroll

javax.swing.JComponent getScroll()
Returns:
the scroll

getBackgorundColor

java.awt.Color getBackgorundColor()
Returns:
the background color of the glass pane

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent e)
Specified by:
propertyChange in interface java.beans.PropertyChangeListener