All Packages  This Package  Class Hierarchy  Class Search  Index

Class com.activated.jimi.component.JimiCanvasLW
java.lang.Object
   |
   +----java.awt.Component
           |
           +----com.activated.jimi.component.JimiCanvasLW

  Summary

public class  JimiCanvasLW
     extends java.awt.Component
{
          // Fields 12
     public static final int BEST_FIT;
     public static final int CENTER;
     public static final int CROP_AS_NECESSARY;
     public static final int EAST;
     public static final int NORTH;
     public static final int NORTHEAST;
     public static final int NORTHWEST;
     public static final int SCALE;
     public static final int SOUTH;
     public static final int SOUTHEAST;
     public static final int SOUTHWEST;
     public static final int WEST;

          // Constructors 3
     public JimiCanvasLW();
     public JimiCanvasLW(Image);
     public JimiCanvasLW(URL);

          // Methods 14
     public Image getImage();
     public URL getImageLocation();
     public int getJustificationPolicy();
     public Dimension getPreferredSize();
     public int getResizePolicy();
     public boolean getWillSizeToFit();
     public synchronized void paint(Graphics);
     public synchronized void setImage(Image);
     public synchronized void setImageLocation(URL);
     public synchronized void setJustificationPolicy(int);
     public synchronized void setResizePolicy(int);
     public synchronized void setWillSizeToFit(boolean);
     public void update(Graphics);
     public void update_(Graphics);
}

An java.awt.Canvas for easily displaying any image in a J.I.M.I. supported image format, or any java.awt.Image. Subclasses will support using this as a Bean.

The following features exist :




  Fields

· EAST

Summary  |  Top

   public static final int EAST

One of nine possible justification policies.

See Also: setJustificationPolicy


· NORTH

Summary  |  Top
   public static final int NORTH

One of nine possible justification policies.

See Also: setJustificationPolicy


· NORTHEAST

Summary  |  Top
   public static final int NORTHEAST

One of nine possible justification policies.

See Also: setJustificationPolicy


· NORTHWEST

Summary  |  Top
   public static final int NORTHWEST

One of nine possible justification policies.

See Also: setJustificationPolicy


· SOUTH

Summary  |  Top
   public static final int SOUTH

One of nine possible justification policies.

See Also: setJustificationPolicy


· SOUTHEAST

Summary  |  Top
   public static final int SOUTHEAST

One of nine possible justification policies.

See Also: setJustificationPolicy


· SOUTHWEST

Summary  |  Top
   public static final int SOUTHWEST

One of nine possible justification policies.

See Also: setJustificationPolicy


· WEST

Summary  |  Top
   public static final int WEST

One of nine possible justification policies.

See Also: setJustificationPolicy


· CENTER

Summary  |  Top
   public static final int CENTER

One of nine possilbe justification policies.

See Also: setJustificationPolicy


· BEST_FIT

Summary  |  Top
   public static final int BEST_FIT

One of three possible scaling policies. Will scale the image so that one of the axis totally fills the available space, and the other maintains aspect ratio.

See Also: setResizePolicy, CROP_AS_NECESSARY, SCALE


· CROP_AS_NECESSARY

Summary  |  Top
   public static final int CROP_AS_NECESSARY

One of three possible scaling policies. No scaling is done. instead, if the image will not fit within the available space, it is cropped.

See Also: setResizePolicy, BEST_FIT, SCALE


· SCALE

Summary  |  Top
   public static final int SCALE

One of three possible scaling policies. Both axis are independently scaled to totally fill the available space. This may cause distortion.

See Also: setResizePolicy, BEST_FIT, CROP_AS_NECESSARY


  Constructors

· JimiCanvasLW

Summary  |  Top

   public JimiCanvasLW() 

No argument constructor for use in beanboxes.



· JimiCanvasLW

Summary  |  Top
   public JimiCanvasLW(Image anImage) 

Create me

Parameter Description
anImage The image to display

See Also: setImage



· JimiCanvasLW

Summary  |  Top
   public JimiCanvasLW(URL aLocation) 

Create me

Parameter Description
aLocation Where to load the image using J.I.M.I. from

See Also: setImageLocation



  Methods

· setJustificationPolicy

Summary  |  Top
   public synchronized void setJustificationPolicy(int newPolicy) 

Which of the nine justification policies we use to place the image on the canvas

Parameter Description
newPolicy The new justification policy

See Also: CENTER, NORTH, NORTHEAST, EAST, SOUTHEAST, SOUTH, SOUTHWEST, WEST, NORTHWEST



· getJustificationPolicy

Summary  |  Top
   public int getJustificationPolicy() 

Which of the nine justification policies we use to place the image on the canvas return One of nine justification policies

See Also: CENTER, NORTH, NORTHEAST, EAST, SOUTHEAST, SOUTH, SOUTHWEST, WEST, NORTHWEST



· setResizePolicy

Summary  |  Top
   public synchronized void setResizePolicy(int newPolicy) 

Do we crop the image, scale it, or scale it so that it fits best?

Parameter Description
newPolicy One of three policies which specify how to fit the image into the canvas

See Also: CROP_AS_NECESSARY, SCALE, BEST_FIT



· getResizePolicy

Summary  |  Top
   public int getResizePolicy() 

Do we crop the image, scale it, or scale it so that it fits best?

See Also: CROP_AS_NECESSARY, SCALE, BEST_FIT



· setWillSizeToFit

Summary  |  Top
   public synchronized void setWillSizeToFit(boolean newPolicy) 

If true, the canvas will resize itself so that it exactly fits the the canvas.

Parameter Description
newPolicy If true, will resize the canvas to fit the new image

See Also: setImage, setImageLocation



· getWillSizeToFit

Summary  |  Top
   public boolean getWillSizeToFit() 

If true, the canvas will resize itself so that it exactly fits the canvas.

Returns:
True if the canvas will be automatically sized to fit the image


· setImageLocation

Summary  |  Top
   public synchronized void setImageLocation(URL newLocation) 

Where should J.I.M.I. look to find the image?
This value need not be set, and is mutually exclusive with setImage. setImagetakes precedence.

Parameter Description
newLocation Where J.I.M.I. should go to find the image

See Also: getImageLocation, setImage, getImage



· getImageLocation

Summary  |  Top
   public URL getImageLocation() 

Where J.I.M.I. should look to find the image.
If the image was set with setImage this value may be null

Returns:
The URL location of the image

See Also: setImageLocation, setImage, getImage



· setImage

Summary  |  Top
   public synchronized void setImage(Image anImage) 

We can explicitly set an Image instead of relying upon J.I.M.I. to load it. The two ways of specifying the image location are mutually exclusive. setImage takes precedence over setImageLocation

Parameter Description
anImage The java.awt.Image that we wish to display

See Also: setImageLocation, getImageLocation, getImage



· getImage

Summary  |  Top
   public Image getImage() 

The image that this canvas is currently displaying. This is not the cropped nor resized image, but the base image that is being used to create the cropped or scaled image.

Returns:
Image The base image that we're displaying currently

See Also: setImage, setImageLocation, getImageLocation



· getPreferredSize

Summary  |  Top
   public Dimension getPreferredSize() 

If 'willSizeToFit', ask for the size of the image.

Overrides:
getPreferredSize in class Component


· update

Summary  |  Top
   public void update(Graphics g) 
Overrides:
update in class Component


· update_

Summary  |  Top
   public void update_(Graphics g) 

Double-buffered update.

Parameter Description
g The java.awt.Graphics context to use to update.

See Also: paint



· paint

Summary  |  Top
   public synchronized void paint(Graphics g) 
Overrides:
paint in class Component


All Packages  This Package  Class Hierarchy  Class Search  Index
Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7