org.zaval.lw
Class LwImgSetRender

java.lang.Object
  |
  +--org.zaval.util.ValidationObject
        |
        +--org.zaval.lw.LwView
              |
              +--org.zaval.lw.LwRender
                    |
                    +--org.zaval.lw.LwImgRender
                          |
                          +--org.zaval.lw.LwImgSetRender
All Implemented Interfaces:
Validationable

public class LwImgSetRender
extends LwImgRender

This class is the same LwImgRender render but it allows to render specified part of the target image object.


Fields inherited from class org.zaval.lw.LwView
MOSAIC, ORIGINAL, STRETCH
 
Fields inherited from class org.zaval.util.ValidationObject
isValidFlag
 
Constructor Summary
LwImgSetRender(java.awt.Image img, int x, int y, int w, int h, int type)
          Constructs the render with the specified target image, the view type and the specified rectangular image part that should be rendered.
LwImgSetRender(java.lang.String name, int x, int y, int w, int h, int type)
          Constructs the render with the specified target image name, the view type and the specified rectangular image part that should be rendered.
 
Method Summary
protected  java.awt.Dimension calcPreferredSize()
          Calculates and returns the view preferred size.
 void paint(java.awt.Graphics g, int x, int y, int w, int h, Drawable d)
          Paints the view using a given width and height.
 
Methods inherited from class org.zaval.lw.LwImgRender
getImage
 
Methods inherited from class org.zaval.lw.LwRender
getTarget, setTarget, targetWasChanged
 
Methods inherited from class org.zaval.lw.LwView
getInsets, getPreferredSize, getType, ownerChanged, paint, recalc, setType
 
Methods inherited from class org.zaval.util.ValidationObject
invalidate, isValid, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LwImgSetRender

public LwImgSetRender(java.lang.String name,
                      int x,
                      int y,
                      int w,
                      int h,
                      int type)
Constructs the render with the specified target image name, the view type and the specified rectangular image part that should be rendered.
Parameters:
name - the specified target image name.
x - the x coordinate of the top left corner the rendered part of the image.
y - the y coordinate of the top left corner the rendered part of the image.
w - the width the rendered part of the image.
h - the height the rendered part of the image.
type - the specified view type.

LwImgSetRender

public LwImgSetRender(java.awt.Image img,
                      int x,
                      int y,
                      int w,
                      int h,
                      int type)
Constructs the render with the specified target image, the view type and the specified rectangular image part that should be rendered.
Parameters:
img - the specified target image to be rendered.
x - the x coordinate of the top left corner the rendered part of the image.
y - the y coordinate of the top left corner the rendered part of the image.
w - the width the rendered part of the image.
h - the height the rendered part of the image.
type - the specified view type.
Method Detail

paint

public void paint(java.awt.Graphics g,
                  int x,
                  int y,
                  int w,
                  int h,
                  Drawable d)
Description copied from class: LwImgRender
Paints the view using a given width and height. The location where the view has to be painted is determined with x and y coordinates.
Overrides:
paint in class LwImgRender
Following copied from class: org.zaval.lw.LwImgRender
Parameters:
g - the specified context to be used for painting.
x - the x coordinate.
y - the y coordinate.
w - the width of the view.
h - the height of the view.
d - the owner component.

calcPreferredSize

protected java.awt.Dimension calcPreferredSize()
Calculates and returns the view preferred size. The render returns the target image size as the "pure" preferred size.
Overrides:
calcPreferredSize in class LwImgRender
Returns:
a "pure" preferred size of the view.


Copyright © Zaval Creative Engineering Group, 2000-2005.
http://www.zaval.org