Inheritance diagram for edu.cmu.hcii.calo.view.ImageStretchView:
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.
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. |
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.
The rules that can be used to determine whether stretch regions should stretch or tile.
This is currently ignored, and images are always stretched.
static void edu.cmu.hcii.calo.view.ImageStretchView.main | ( | String[] | args | ) | [static] |
Tests ImageStretchView to make sure it works correctly.
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.
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.
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.
img | the image to load |
final long edu.cmu.hcii.calo.view.ImageStretchView.serialVersionUID = -4412068157568869562L [static, private] |
MediaTracker edu.cmu.hcii.calo.view.ImageStretchView.tracker = new MediaTracker(this) [private] |
A MediaTracker to load all our images when the view is constructed.