edu.cmu.hcii.calo.view.notification.NotificationView Class Reference

Inherits edu.cmu.hcii.calo.view.CALOComponent.

Inheritance diagram for edu.cmu.hcii.calo.view.notification.NotificationView:

Inheritance graph
[legend]
Collaboration diagram for edu.cmu.hcii.calo.view.notification.NotificationView:

Collaboration graph
[legend]
List of all members.

Detailed Description

A view class that displays a single notification.

Author:
Will Haines


Public Member Functions

 NotificationView (Notification n)
 Constructs a NotificationView.
Notification getNotification ()
 Returns the Notification associated with this view.
void mouseClicked (MouseEvent e)
 Defines the behavior of a mouse click on a notification; that is, nothing happens.
void mouseDragged (MouseEvent e)
 Defines the behavior of a mouse drag on this notification view; that is, nothing happens.
void mouseEntered (MouseEvent e)
 Updates the mouse over state of this notification view.
void mouseExited (MouseEvent e)
 Updates the mouse over state of this notification view.
void mouseMoved (MouseEvent e)
 Defines the behavior of a mouse motion in the notification view; that is, nothing happens.
void mousePressed (MouseEvent e)
 Updates the pressed state of this notification view.
void mouseReleased (MouseEvent e)
 Updates the pressed state of this notification view.
String toString ()
 Returns a string representation of this NotificationView.
void update ()
 Causes the view to synchronize itself with the Notification model.
Dimension getPreferredSize ()
 
See also:
javax.swing.JComponent.getPreferredSize()


Static Public Member Functions

static void main (String[] args)
 Runs a small test program to verify that NotificationView works correctly.

Protected Attributes

Notification notification
 The notification being represented by this view.

Private Member Functions

void setup ()
 Sets up the appearance of the NotificationView.
void updateAppearance ()
 Updates the appearance of the view when something changes.

Private Attributes

boolean isPressed
 Whether or not the NotificationView is currently pressed.
boolean isMouseOver
 Whether or not the mouse is currently over the view.
JLabel notificationTextLabel
 The text of this notification.
IconButton deleteButton
 The button to delete this notification.
Borders
These constants are the various border styles that are applied to the NotificationView under various circumstances.

Note that the rather badly-named Border actually determines the background color of the NotificationView as well.

final NotificationViewBorder MOUSEOVER_BORDER
final NotificationViewBorder NORMAL_BORDER

Static Private Attributes

static final long serialVersionUID = 2199089034199693989L
 Prevent serialization collisions.
Colors
These constants represent colors that are used in displaying the NotificationView.

static final Color NOTIFICATION_COLOR = new Color(0.93f, 0.93f, 0.93f)
static final Color MOUSEOVER_NOTIFICATION_COLOR = new Color(0.97f, 0.97f, 0.97f)
static final Color NOTIFICATION_STROKE_COLOR = SystemColor.controlShadow


Constructor & Destructor Documentation

edu.cmu.hcii.calo.view.notification.NotificationView.NotificationView ( Notification  n  ) 

Constructs a NotificationView.


Member Function Documentation

static void edu.cmu.hcii.calo.view.notification.NotificationView.main ( String[]  args  )  [static]

Runs a small test program to verify that NotificationView works correctly.

Parameters:
args command-line args; don't bother passing any

Notification edu.cmu.hcii.calo.view.notification.NotificationView.getNotification (  ) 

Returns the Notification associated with this view.

void edu.cmu.hcii.calo.view.notification.NotificationView.mouseClicked ( MouseEvent  e  ) 

Defines the behavior of a mouse click on a notification; that is, nothing happens.

Parameters:
e the mouse event
See also:
java.awt.event.MouseListener.mouseClicked(java.awt.event.MouseEvent)

void edu.cmu.hcii.calo.view.notification.NotificationView.mouseDragged ( MouseEvent  e  ) 

Defines the behavior of a mouse drag on this notification view; that is, nothing happens.

Parameters:
e the mouse event
See also:
java.awt.event.MouseMotionListener.mouseDragged(java.awt.event.MouseEvent)

void edu.cmu.hcii.calo.view.notification.NotificationView.mouseEntered ( MouseEvent  e  ) 

Updates the mouse over state of this notification view.

Parameters:
e the mouse event
See also:
java.awt.event.MouseListener.mouseEntered(java.awt.event.MouseEvent)

void edu.cmu.hcii.calo.view.notification.NotificationView.mouseExited ( MouseEvent  e  ) 

Updates the mouse over state of this notification view.

Parameters:
e the mouse event
See also:
java.awt.event.MouseListener.mouseExited(java.awt.event.MouseEvent)

void edu.cmu.hcii.calo.view.notification.NotificationView.mouseMoved ( MouseEvent  e  ) 

Defines the behavior of a mouse motion in the notification view; that is, nothing happens.

Parameters:
e the mouse event
See also:
java.awt.event.MouseMotionListener.mouseMoved(java.awt.event.MouseEvent)

void edu.cmu.hcii.calo.view.notification.NotificationView.mousePressed ( MouseEvent  e  ) 

Updates the pressed state of this notification view.

Parameters:
e the mouse event
See also:
java.awt.event.MouseListener.mousePressed(java.awt.event.MouseEvent)

void edu.cmu.hcii.calo.view.notification.NotificationView.mouseReleased ( MouseEvent  e  ) 

Updates the pressed state of this notification view.

Parameters:
e the mouse event
See also:
java.awt.event.MouseListener.mouseReleased(java.awt.event.MouseEvent)

void edu.cmu.hcii.calo.view.notification.NotificationView.setup (  )  [private]

Sets up the appearance of the NotificationView.

String edu.cmu.hcii.calo.view.notification.NotificationView.toString (  ) 

Returns a string representation of this NotificationView.

Useful only for debugging.

void edu.cmu.hcii.calo.view.notification.NotificationView.update (  ) 

Causes the view to synchronize itself with the Notification model.

void edu.cmu.hcii.calo.view.notification.NotificationView.updateAppearance (  )  [private]

Updates the appearance of the view when something changes.

Dimension edu.cmu.hcii.calo.view.notification.NotificationView.getPreferredSize (  ) 

See also:
javax.swing.JComponent.getPreferredSize()


Member Data Documentation

final long edu.cmu.hcii.calo.view.notification.NotificationView.serialVersionUID = 2199089034199693989L [static, private]

Prevent serialization collisions.

Reimplemented from edu.cmu.hcii.calo.view.CALOComponent.

Notification edu.cmu.hcii.calo.view.notification.NotificationView.notification [protected]

The notification being represented by this view.

final NotificationViewBorder edu.cmu.hcii.calo.view.notification.NotificationView.MOUSEOVER_BORDER [private]

Initial value:

        new NotificationViewBorder( NotificationView.MOUSEOVER_NOTIFICATION_COLOR,
                                    NotificationView.NOTIFICATION_STROKE_COLOR)

final NotificationViewBorder edu.cmu.hcii.calo.view.notification.NotificationView.NORMAL_BORDER [private]

Initial value:

        new NotificationViewBorder( NotificationView.NOTIFICATION_COLOR,
                                    NotificationView.NOTIFICATION_STROKE_COLOR)

boolean edu.cmu.hcii.calo.view.notification.NotificationView.isPressed [private]

Whether or not the NotificationView is currently pressed.

This may be true even if the mouse is not within the bounds of the view.

boolean edu.cmu.hcii.calo.view.notification.NotificationView.isMouseOver [private]

Whether or not the mouse is currently over the view.

JLabel edu.cmu.hcii.calo.view.notification.NotificationView.notificationTextLabel [private]

The text of this notification.

IconButton edu.cmu.hcii.calo.view.notification.NotificationView.deleteButton [private]

The button to delete this notification.


The documentation for this class was generated from the following file:
Generated on Mon Aug 13 15:06:25 2007 for CALO by  doxygen 1.5.2