All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class datarep.common.ImageHandler

java.lang.Object
   |
   +----datarep.common.ImageHandler

public class ImageHandler
extends Object
The ImageHandler class handles the loading and scaling of images.

Version:
1.2
Author:
Data Representations, Inc.

Constructor Index

 o ImageHandler(File, Component)
 o ImageHandler(Image, Component)
 o ImageHandler(String, Component)
Creates a new ImageHandler.
 o ImageHandler(String, String, Component)
Creates a new ImageHandler, with the image specified by the directory and the (file)name, and using the component specified by comp.
 o ImageHandler(URL, Component)

Method Index

 o crop(int, int, int, int)
 o crop(Rectangle)
returns a new imagehandler for the current image, but cropped to the given Rectangle.
 o getHeight()
 o getImage()
 o getScalingType()
gets the type of scaling
 o getSize()
 o getWidth()
 o gray()
 o gray(boolean, int)
returns a new imageHandler for the current image, but with a percent gray and brightness as specified.
 o scale(Dimension)
Returns a new imagehandler for the current image, but scaled to the given dimension.
 o scale(int, int)
 o setScalingType(int)
Sets the scaling type for the imageHandler.

Constructors

 o ImageHandler
 public ImageHandler(Image original,
                     Component comp)
 o ImageHandler
 public ImageHandler(String dir,
                     String name,
                     Component comp)
Creates a new ImageHandler, with the image specified by the directory and the (file)name, and using the component specified by comp.

 o ImageHandler
 public ImageHandler(String name,
                     Component comp)
Creates a new ImageHandler. The string "name" can either be a URL or a more traditional file name which specifies the location of the desired image.

 o ImageHandler
 public ImageHandler(File file,
                     Component comp)
 o ImageHandler
 public ImageHandler(URL url,
                     Component comp)

Methods

 o setScalingType
 public ImageHandler setScalingType(int scalingType)
Sets the scaling type for the imageHandler.
 o getScalingType
 public int getScalingType()
gets the type of scaling

 o getImage
 public Image getImage()
 o getWidth
 public int getWidth()
 o getHeight
 public int getHeight()
 o getSize
 public Dimension getSize()
 o scale
 public ImageHandler scale(Dimension d)
Returns a new imagehandler for the current image, but scaled to the given dimension.

Returns:
a new ImageHandler scaled to the given Dimension.
 o scale
 public ImageHandler scale(int width,
                           int height)
 o crop
 public ImageHandler crop(Rectangle r)
returns a new imagehandler for the current image, but cropped to the given Rectangle.

 o crop
 public ImageHandler crop(int x,
                          int y,
                          int width,
                          int height)
 o gray
 public ImageHandler gray()
 o gray
 public ImageHandler gray(boolean brighter,
                          int percent)
returns a new imageHandler for the current image, but with a percent gray and brightness as specified.


All Packages  Class Hierarchy  This Package  Previous  Next  Index