edu.cmu.hcii.calo.view.TranslucentView Class Reference

Inherited by edu.cmu.hcii.calo.view.CALOComponent.

Inheritance diagram for edu.cmu.hcii.calo.view.TranslucentView:

Inheritance graph
[legend]
List of all members.

Detailed Description

A simple JComponent subclass that supports composited (i.e., translucent) drawing using an image buffer.

Author:
Brian Ellis


Public Member Functions

 TranslucentView ()
 Constructs a fully opaque TranslucentView.
double getOpacity ()
 Returns the opacity of this view.
void paint (Graphics g)
 Paints this view.
void setOpacity (double opacity)
 Sets the opacity of this TranslucentView.

Protected Member Functions

void paintComponent (Graphics g)
 Paints this component.

Private Attributes

double opacity = 1.0
 The current opacity of this view.

Static Private Attributes

static final long serialVersionUID = -6453869157181923665L
 Prevent serialization collisions.


Constructor & Destructor Documentation

edu.cmu.hcii.calo.view.TranslucentView.TranslucentView (  ) 

Constructs a fully opaque TranslucentView.


Member Function Documentation

double edu.cmu.hcii.calo.view.TranslucentView.getOpacity (  ) 

Returns the opacity of this view.

0.0 is completely transparent, and 1.0 is completely opaque.

Returns:
the opacity

void edu.cmu.hcii.calo.view.TranslucentView.paint ( Graphics  g  ) 

Paints this view.

If the view's opacity is at least 1.0 (fully opaque), the view is painted normally. Otherwise, it is painted to an offscreen image buffer and then composited into place with the given transparency, and will therefore appear translucent. Note that this is somewhat more expensive than painting normally.

Parameters:
g the graphics context to paint into

Reimplemented in edu.cmu.hcii.calo.view.AnimatedPane, and edu.cmu.hcii.calo.view.task.TaskSubpaneView.

void edu.cmu.hcii.calo.view.TranslucentView.paintComponent ( Graphics  g  )  [protected]

Paints this component.

Overridden to ensure that this component's background is fully filled in with the background color if it is marked as "opaque" (which is different from having an opacity of 1.0).

Parameters:
g the graphics context to paint into
See also:
javax.swing.JComponent.paintComponent(java.awt.Graphics)

Reimplemented in edu.cmu.hcii.calo.view.iconwell.IconWellView, edu.cmu.hcii.calo.view.ImageStretchView, edu.cmu.hcii.calo.view.notification.NotificationCenterView, edu.cmu.hcii.calo.view.panes.PaneTitleView, edu.cmu.hcii.calo.view.schedule.BlockScheduleView, edu.cmu.hcii.calo.view.schedule.ScheduleItemView, and edu.cmu.hcii.calo.view.task.TaskSubpaneView.

void edu.cmu.hcii.calo.view.TranslucentView.setOpacity ( double  opacity  ) 

Sets the opacity of this TranslucentView.

0.0 is completely transparent, and 1.0 is completely opaque.

Parameters:
opacity the opacity to set


Member Data Documentation

final long edu.cmu.hcii.calo.view.TranslucentView.serialVersionUID = -6453869157181923665L [static, private]

Prevent serialization collisions.

Reimplemented in edu.cmu.hcii.calo.thinkaloud.WOZFrontEndNotificationPanel, edu.cmu.hcii.calo.thinkaloud.WOZFrontEndTaskPanel, edu.cmu.hcii.calo.view.CALOComponent, edu.cmu.hcii.calo.view.CALOScrollPane, edu.cmu.hcii.calo.view.iconwell.IconWellView, edu.cmu.hcii.calo.view.ImageStretchView, edu.cmu.hcii.calo.view.notification.NotificationCenterView, edu.cmu.hcii.calo.view.notification.NotificationGroupTitleView, edu.cmu.hcii.calo.view.notification.NotificationGroupView, edu.cmu.hcii.calo.view.notification.NotificationView, edu.cmu.hcii.calo.view.panes.CALOPane, edu.cmu.hcii.calo.view.panes.PaneTitleView, edu.cmu.hcii.calo.view.relevantstuff.RelevantStuffPaneView, edu.cmu.hcii.calo.view.schedule.BlockScheduleView, edu.cmu.hcii.calo.view.schedule.ScheduleItemView, edu.cmu.hcii.calo.view.schedule.SchedulePaneView, edu.cmu.hcii.calo.view.task.ExpandedTaskInfoPanel, edu.cmu.hcii.calo.view.task.TaskPaneView, and edu.cmu.hcii.calo.view.task.TaskSubpaneContainerView.

double edu.cmu.hcii.calo.view.TranslucentView.opacity = 1.0 [private]

The current opacity of this view.


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