com.jthomas.mailfaces
Class FaceButton

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Canvas
              |
              +--com.jthomas.util.ImageLabel
                    |
                    +--com.jthomas.util.ImageButton
                          |
                          +--com.jthomas.mailfaces.FaceButton
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class FaceButton
extends ImageButton

FaceButton is a subclass of ImageButton that adds the ability to add a number that indicates the number of mailmsgs represented by this FaceButton.


 SubClass of ImageButton(
            	Marty Hall,
				hall@apl.jhu.edu,
				href="http://www.apl.jhu.edu/~hall/java"
 This adds the ability to override the image with a number that represents the
 number of mailmsgs represented by this FaceButton

 It also adds the action method to do something when the user presses the button

 Note that the ImageButton uses the old event model so FaceButton 
 also needs to use the old event model.  At some point we will move
 this to the JFC ImageButton (Swing 1.0) 
 

Author:
John Thomas jthomas@cruzio.com
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.awt.Canvas
java.awt.Canvas.AccessibleAWTCanvas
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class com.jthomas.util.ImageButton
darkness, defaultBorderColor, defaultBorderWidth, grayImage
 
Fields inherited from class com.jthomas.util.ImageLabel
debug, defaultImageString, explicitSize, height, image, imageString, margin, marginColor, width
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
FaceButton(java.awt.Image image)
          FaceButton Constructor Create an ImageButton using the image specified.
 
Method Summary
 boolean action(java.awt.Event event, java.lang.Object arg)
          action: It will take control when the user clicks on a Face button.
 boolean mouseEnter(java.awt.Event evt, int x, int y)
          Method: mouseEnter Mouse entered this FaceButon - Repaint it
 void paint(java.awt.Graphics g)
          paint: Draws the number of messages into the left bottom corner of the imageButton.
 void reset()
          reset() This is called when the containing FaceBoard is reset
 void setCount(int count)
          setCount Set the Count of mailmsgs represented (used by paint()
 void setFace(Face face)
          setFace Set a reference to the Face Object represented by this ImageButton The Face object is needed by the action() method
 void setText(java.lang.String[] overlay)
          setText Set the Text that we will overlay onto the Button
 
Methods inherited from class com.jthomas.util.ImageButton
getBorderColor, getBorderWidth, mouseDown, mouseExit, mouseUp, setBorderColor, setBorderWidth
 
Methods inherited from class com.jthomas.util.ImageLabel
centerAt, contains, debug, drawRect, getMinimumSize, getPreferredSize, setBounds, setSize, waitForImage
 
Methods inherited from class java.awt.Canvas
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy, update
 
Methods inherited from class java.awt.Component
add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDrag, mouseMove, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FaceButton

public FaceButton(java.awt.Image image)
FaceButton Constructor Create an ImageButton using the image specified.

Method Detail

reset

public void reset()
reset() This is called when the containing FaceBoard is reset


setCount

public void setCount(int count)
setCount Set the Count of mailmsgs represented (used by paint()


setText

public void setText(java.lang.String[] overlay)
setText Set the Text that we will overlay onto the Button


setFace

public void setFace(Face face)
setFace Set a reference to the Face Object represented by this ImageButton The Face object is needed by the action() method


paint

public void paint(java.awt.Graphics g)
paint: Draws the number of messages into the left bottom corner of the imageButton. It first places a white square in this area to make the number easy to read _Paint1 will handle when we paint 2 and then need to repaint with 1.

Overrides:
paint in class ImageButton

action

public boolean action(java.awt.Event event,
                      java.lang.Object arg)
action: It will take control when the user clicks on a Face button. It creates a MailList object and passes the Face Object to it MailList will display the Mailmsgs that are assocaited with this Face object If this is the "NoMail" button there will not be a reference to the Face object.

Overrides:
action in class ImageButton
See Also:
Component.action(java.awt.Event, java.lang.Object)

mouseEnter

public boolean mouseEnter(java.awt.Event evt,
                          int x,
                          int y)
Method: mouseEnter Mouse entered this FaceButon - Repaint it

Overrides:
mouseEnter in class java.awt.Component