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

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

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

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

Collaboration graph
[legend]
List of all members.

Detailed Description

A view class that takes up to nine images and lays them out in a grid consisting of four corners, four stretch regions along the edge, and one stretch region in the middle.

This is useful for mocking up arbitrarily-sized views from image-based prototypes, though it is currently unused in this application. It is also only somewhat tested.

Author:
Brian Ellis


Public Types

enum  ImageOverlapPolicy
 The rules that can be used to determine which corner images should overlap which others when the view is too small to show stretch regions. More...
enum  ImageStretchPolicy
 The rules that can be used to determine whether stretch regions should stretch or tile. More...

Public Member Functions

Dimension getPreferredSize ()
 Returns the preferred size of this component.
Image Accessors
Accessors for the various images.

Image getBottomLeftImage ()
Image getBottomRightImage ()
Image getBottomStretchImage ()
Image getCenterStretchImage ()
Image getLeftStretchImage ()
Image getRightStretchImage ()
Image getTopLeftImage ()
Image getTopRightImage ()
Image getTopStretchImage ()
Policy Accessors
Accessors for the various overlap and stretch policies.

ImageStretchPolicy getCenterStretchPolicy ()
ImageOverlapPolicy getHorizontalOverlapPolicy ()
ImageStretchPolicy getHorizontalStretchPolicy ()
ImageOverlapPolicy getVerticalOverlapPolicy ()
ImageStretchPolicy getVerticalStretchPolicy ()
Image Setters
Setters for the various images.

None of these call repaint(), so you should do this yourself if you need the new image to display immediately.

void setBottomLeftImage (Image bottomLeftImage)
void setBottomRightImage (Image bottomRightImage)
void setBottomStretchImage (Image bottomStretchImage)
void setCenterStretchImage (Image centerStretchImage)
void setLeftStretchImage (Image leftStretchImage)
void setRightStretchImage (Image rightStretchImage)
void setTopLeftImage (Image topLeftImage)
void setTopRightImage (Image topRightImage)
void setTopStretchImage (Image topStretchImage)
Policy Setters
Setters for the various overlap and stretch policies.

None of these call repaint(), so you should do this yourself if you need the new policy to take effect immediately.

void setCenterStretchPolicy (ImageStretchPolicy centerStretchPolicy)
void setHorizontalOverlapPolicy (ImageOverlapPolicy horizontalOverlapPolicy)
void setHorizontalStretchPolicy (ImageStretchPolicy horizontalStretchPolicy)
void setVerticalOverlapPolicy (ImageOverlapPolicy verticalOverlapPolicy)
void setVerticalStretchPolicy (ImageStretchPolicy verticalStretchPolicy)

Static Public Member Functions

static void main (String[] args)
 Tests ImageStretchView to make sure it works correctly.

Protected Member Functions

void paintComponent (Graphics g)
 Paints this view.

Private Member Functions

List< Image > getOrderedStaticImages ()
 Returns all the static (corner) images in the order they should be drawn given the current overlap policies.
Image loadImage (Image img)
 Causes the view to load the given image and wait for it to be fully rendered before continuing.

Private Attributes

MediaTracker tracker = new MediaTracker(this)
 A MediaTracker to load all our images when the view is constructed.
Images
The images that are shown in the view.

Image topLeftImage
Image topRightImage
Image bottomLeftImage
Image bottomRightImage
Image topStretchImage
Image leftStretchImage
Image bottomStretchImage
Image rightStretchImage
Image centerStretchImage
Policies
The overlap and stretch policies applied to the horizontal and vertical dimensions of the view.

ImageOverlapPolicy horizontalOverlapPolicy = ImageOverlapPolicy.LEFT_OVER_RIGHT
ImageOverlapPolicy verticalOverlapPolicy = ImageOverlapPolicy.TOP_OVER_BOTTOM
ImageStretchPolicy horizontalStretchPolicy = ImageStretchPolicy.STRETCH
ImageStretchPolicy verticalStretchPolicy = ImageStretchPolicy.STRETCH
ImageStretchPolicy centerStretchPolicy = ImageStretchPolicy.STRETCH

Static Private Attributes

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


Member Enumeration Documentation

enum edu::cmu::hcii::calo::view::ImageStretchView::ImageOverlapPolicy

The rules that can be used to determine which corner images should overlap which others when the view is too small to show stretch regions.

Author:
Brian Ellis

enum edu::cmu::hcii::calo::view::ImageStretchView::ImageStretchPolicy

The rules that can be used to determine whether stretch regions should stretch or tile.

This is currently ignored, and images are always stretched.

Author:
Administrator


Member Function Documentation

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

Tests ImageStretchView to make sure it works correctly.

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

Dimension edu.cmu.hcii.calo.view.ImageStretchView.getPreferredSize (  ) 

Returns the preferred size of this component.

Overridden to always return the width and height required to display all four corners with no stretch regions unless this component's preferred size has been explicitly set, in which case that value is returned instead.

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

Paints this view.

Parameters:
g the graphics context to paint into

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

List<Image> edu.cmu.hcii.calo.view.ImageStretchView.getOrderedStaticImages (  )  [private]

Returns all the static (corner) images in the order they should be drawn given the current overlap policies.

Returns:
an ordered list of the static images

Image edu.cmu.hcii.calo.view.ImageStretchView.loadImage ( Image  img  )  [private]

Causes the view to load the given image and wait for it to be fully rendered before continuing.

Parameters:
img the image to load


Member Data Documentation

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

Prevent serialization collisions.

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

MediaTracker edu.cmu.hcii.calo.view.ImageStretchView.tracker = new MediaTracker(this) [private]

A MediaTracker to load all our images when the view is constructed.


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