Groovy Documentation

griffon.coverflow.ui
[Java] Class ImageFlowItem

java.lang.Object
  griffon.coverflow.ui.ImageFlowItem

public class ImageFlowItem
extends Object

Defines an item that can be displayed in an ImageFlow.

Provides lazy-loading capabilities of images.

Authors:
Kevin.Long
Andres.Almiray


Nested Class Summary
private static class ImageFlowItem.FileLazyImageLoader

private static class ImageFlowItem.ImageLazyImageLoader

private static class ImageFlowItem.InputStreamLazyImageLoader

private static class ImageFlowItem.LazyImageLoader

static class ImageFlowItem.Resource

Helper class to locate classpath resources.

private static class ImageFlowItem.ResourceLazyImageLoader

private static class ImageFlowItem.URLLazyImageLoader

 
Field Summary
private ImageFlowItem.LazyImageLoader imageLoader

private String label

 
Constructor Summary
ImageFlowItem(ImageFlowItem.Resource resource)

Creates a new item using a classpath Resource as image source, and "" as label.

ImageFlowItem(ImageFlowItem.Resource resource, String label)

Creates a new item using a classpath Resource as image source, and the provided label.

ImageFlowItem(Image image)

Creates a new item using an Image as image source, and "" as label.

ImageFlowItem(Image image, String label)

Creates a new item using an Image as image source, and the provided label.

ImageFlowItem(String fileName)

Creates a new item using a String pointing to a filename as image source, and "" as label.

ImageFlowItem(String fileName, String label)

Creates a new item using a String pointing to a filename as image source, and the provided label.

ImageFlowItem(File file)

Creates a new item using a File as image source, and "" as label.

ImageFlowItem(File file, String label)

Creates a new item using a File as image source, and the provided label.

ImageFlowItem(InputStream is)

Creates a new item using an InputStream as image source, and "" as label.

ImageFlowItem(InputStream is, String label)

Creates a new item using an InputStream as image source, and the provided label.

ImageFlowItem(URL url)

Creates a new item using an URL as image source, and "" as label.

ImageFlowItem(URL url, String label)

Creates a new item using an URL as image source, and the provided label.

private ImageFlowItem(ImageFlowItem.LazyImageLoader imageLoader, String label)

 
Method Summary
Image getImage()

Returns the Image of this item.

String getLabel()

Returns the item's label.

static List loadFromDirectory(File directory)

Builds a list of ImageFlowItems, one per each file in directory

String toString()

 
Methods inherited from class Object
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll
 

Field Detail

imageLoader

private final ImageFlowItem.LazyImageLoader imageLoader


label

private final String label


 
Constructor Detail

ImageFlowItem

public ImageFlowItem(ImageFlowItem.Resource resource)
Creates a new item using a classpath Resource as image source, and "" as label.
Parameters:
resource - a classpath Resource pointing to an image that can be loaded with ImageIO.


ImageFlowItem

public ImageFlowItem(ImageFlowItem.Resource resource, String label)
Creates a new item using a classpath Resource as image source, and the provided label.
Parameters:
resource - a classpath Resource pointing to an image that can be loaded with ImageIO.
label - a non-null String.


ImageFlowItem

public ImageFlowItem(Image image)
Creates a new item using an Image as image source, and "" as label.
Parameters:
image - an Image object.


ImageFlowItem

public ImageFlowItem(Image image, String label)
Creates a new item using an Image as image source, and the provided label.
Parameters:
image - an Image object.
label - a non-null String.


ImageFlowItem

public ImageFlowItem(String fileName)
Creates a new item using a String pointing to a filename as image source, and "" as label.
Parameters:
fileName - a fileName pointing to an image that can be loaded with ImageIO.


ImageFlowItem

public ImageFlowItem(String fileName, String label)
Creates a new item using a String pointing to a filename as image source, and the provided label.
Parameters:
fileName - a fileName pointing to an image that can be loaded with ImageIO.
label - a non-null String.


ImageFlowItem

public ImageFlowItem(File file)
Creates a new item using a File as image source, and "" as label.
Parameters:
file - a file pointing to an image that can be loaded with ImageIO.


ImageFlowItem

public ImageFlowItem(File file, String label)
Creates a new item using a File as image source, and the provided label.
Parameters:
file - a file pointing to an image that can be loaded with ImageIO.
label - a non-null String.


ImageFlowItem

public ImageFlowItem(InputStream is)
Creates a new item using an InputStream as image source, and "" as label.
Parameters:
is - an inputStream pointing to an image that can be loaded with ImageIO.


ImageFlowItem

public ImageFlowItem(InputStream is, String label)
Creates a new item using an InputStream as image source, and the provided label.
Parameters:
is - an inputStream pointing to an image that can be loaded with ImageIO.
label - a non-null String.


ImageFlowItem

public ImageFlowItem(URL url)
Creates a new item using an URL as image source, and "" as label.
Parameters:
url - an url pointing to an image that can be loaded with ImageIO.


ImageFlowItem

public ImageFlowItem(URL url, String label)
Creates a new item using an URL as image source, and the provided label.
Parameters:
url - an url pointing to an image that can be loaded with ImageIO.
label - a non-null String.


ImageFlowItem

private ImageFlowItem(ImageFlowItem.LazyImageLoader imageLoader, String label)


 
Method Detail

getImage

public Image getImage()
Returns the Image of this item.

If the image is not loaded then it will atempt loading it from its source.

Returns:
an Image.


getLabel

public String getLabel()
Returns the item's label.
Returns:
a String as the item's label.


loadFromDirectory

public static List loadFromDirectory(File directory)
Builds a list of ImageFlowItems, one per each file in directory
Parameters:
directory - a File that contains image files.
Returns:
a List of ImageFlowItems.


toString

de
	public
public String toString()


 

Groovy Documentation