visual.statik.sampled
Class ContentFactory

java.lang.Object
  extended by visual.statik.sampled.ContentFactory

public class ContentFactory
extends java.lang.Object

A utility class for constructing/creating visual.statik.sampled.Content objects

See Also:
"The Design and Implementation of Multimedia Software © 2011"

Constructor Summary
ContentFactory()
          Default Constructor
ContentFactory(ResourceFinder finder)
          Explicit Value Constructor
 
Method Summary
 Content createContent(java.awt.image.BufferedImage image)
          Create a Content from a BufferedImage
 Content createContent(java.awt.image.BufferedImage image, boolean rotatable)
          Create a Content from a BufferedImage
 Content createContent(java.awt.Image image)
          Create a Content (with the default number of channels) from an Image
 Content createContent(java.awt.Image image, boolean rotatable)
          Create a Content (with the default number of channels) from an Image
 Content createContent(java.awt.Image image, int channels)
          Create a Content from an Image
 Content createContent(java.awt.Image image, int channels, boolean rotatable)
          Create a Content from an Image
 Content createContent(java.lang.String name)
          Create a Content (with the default number of channels) from a file/resource containing an Image
 Content createContent(java.lang.String name, boolean rotatable)
          Create a Content (with the default number of channels) from a file containing an Image
 Content createContent(java.lang.String name, int channels)
          Create a Content from a file/resource containing an Image
 Content createContent(java.lang.String name, int channels, boolean rotatable)
          Create a Content from a file/resource containing an Image
 Content[] createContents(java.lang.String[] names, int channels)
          Create an array of Content objects from an array of images in files/resources
 Content[] createContents(java.lang.String path, java.io.FilenameFilter filter)
          Create an array Content (with the default number of channels) from a group of files containing images
 Content[] createContents(java.lang.String path, java.io.FilenameFilter filter, int channels)
          Create an array of Content objects from a group of files/resources containing images
 Content[] createContents(java.lang.String name, int n, int channels)
          Create an array of Content objects from an "array" of images in a file
 Content[][] createContents(java.lang.String name, int rows, int columns, int channels)
          Create an array of Content objects from a table-oriented Image in a file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContentFactory

public ContentFactory()
Default Constructor


ContentFactory

public ContentFactory(ResourceFinder finder)
Explicit Value Constructor

Parameters:
finder - The ResourceFinder to use (if needed)
Method Detail

createContent

public Content createContent(java.awt.image.BufferedImage image,
                             boolean rotatable)
Create a Content from a BufferedImage

Parameters:
image - The BufferedImage
rotatable - false to prevent rotations (and improve performance)
Returns:
The Content

createContent

public Content createContent(java.awt.image.BufferedImage image)
Create a Content from a BufferedImage

Parameters:
image - The BufferedImage
Returns:
The Content

createContent

public Content createContent(java.awt.Image image,
                             int channels,
                             boolean rotatable)
Create a Content from an Image

Parameters:
image - The original Image
channels - 3 for RGB; 4 for ARGB
rotatable - false to prevent rotations (and improve performance)
Returns:
The Content

createContent

public Content createContent(java.awt.Image image,
                             int channels)
Create a Content from an Image

Parameters:
image - The original Image
channels - 3 for RGB; 4 for ARGB
Returns:
The Content

createContent

public Content createContent(java.awt.Image image,
                             boolean rotatable)
Create a Content (with the default number of channels) from an Image

Parameters:
image - The original Image
rotatable - false to prevent rotations (and improve performance)
Returns:
The Content

createContent

public Content createContent(java.awt.Image image)
Create a Content (with the default number of channels) from an Image

Parameters:
image - The original Image
Returns:
The Content

createContent

public Content createContent(java.lang.String name,
                             int channels,
                             boolean rotatable)
Create a Content from a file/resource containing an Image

Parameters:
name - The name of the file/resource
channels - 3 for RGB; 4 for ARGB
rotatable - false to prevent rotations (and improve performance)
Returns:
The Content

createContent

public Content createContent(java.lang.String name,
                             int channels)
Create a Content from a file/resource containing an Image

Parameters:
name - The name of the file
channels - 3 for RGB; 4 for ARGB
Returns:
The Content

createContent

public Content createContent(java.lang.String name,
                             boolean rotatable)
Create a Content (with the default number of channels) from a file containing an Image

Parameters:
name - The name of the file
rotatable - false to prevent rotations (and improve performance)
Returns:
The Content

createContent

public Content createContent(java.lang.String name)
Create a Content (with the default number of channels) from a file/resource containing an Image

Parameters:
name - The name of the file
Returns:
The Content

createContents

public Content[] createContents(java.lang.String[] names,
                                int channels)
Create an array of Content objects from an array of images in files/resources

Parameters:
names - The names of the file/resource
channels - 3 for RGB, 4 for ARGB
Returns:
The Content objects

createContents

public Content[] createContents(java.lang.String path,
                                java.io.FilenameFilter filter,
                                int channels)
Create an array of Content objects from a group of files/resources containing images

Parameters:
path - The path to the directory containing the images
filter - The FilenameFilter to use
channels - 3 for RGB; 4 for ARGB
Returns:
The array of Content objects

createContents

public Content[] createContents(java.lang.String path,
                                java.io.FilenameFilter filter)
Create an array Content (with the default number of channels) from a group of files containing images

Parameters:
path - The path to the directory containing the images
filter - The FilenameFilter to use
Returns:
The array of Content objects

createContents

public Content[] createContents(java.lang.String name,
                                int n,
                                int channels)
Create an array of Content objects from an "array" of images in a file

Parameters:
name - The name of the file/resource
n - The number of images
channels - 3 for RGB, 4 for ARGB
Returns:
The Content objects or null if an Exception was thrown

createContents

public Content[][] createContents(java.lang.String name,
                                  int rows,
                                  int columns,
                                  int channels)
Create an array of Content objects from a table-oriented Image in a file

Parameters:
name - The name of the file/resource
rows - The number of rows
columns - The number of columns
channels - 3 for RGB, 4 for ARGB
Returns:
The Content objects or null if an Exception was thrown


Design and Implementation of Multimedia Software, Jones and Bartlett Publishers