ks.client.gamefactory.skin
Class ImageCopier

java.lang.Object
  |
  +--ks.client.gamefactory.skin.ImageCopier

public class ImageCopier
extends java.lang.Object

Visitor class to fills rectangles with parts of an image. Creation date: (10/9/01 7:22:11 PM)


Field Summary
protected  java.awt.Graphics myGraphics
          The graphics context in which to draw.
protected  java.awt.Image myImage
          The image from which to extract the rectangles.
protected  java.awt.image.ImageObserver myObserver
          The image observer visible on the screen.
 
Constructor Summary
ImageCopier(java.awt.Image i, java.awt.image.ImageObserver observer, java.awt.Graphics g)
          ImageCopier by default uses this color as the fillRect color when transfering a filled Rectangle.
 
Method Summary
 void setVisible(boolean visible)
          Visitor's chance to free up resources at end of being displayed
 void visit(RectangleHierarchy node)
          Copy the appropriate image onto Graphics g at (x,y,width,height).
 void visit(RectangleHierarchy node, java.awt.Rectangle clip)
          Copy the appropriate image onto Graphics g at (x,y,width,height).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myImage

protected java.awt.Image myImage
The image from which to extract the rectangles.


myObserver

protected java.awt.image.ImageObserver myObserver
The image observer visible on the screen.


myGraphics

protected java.awt.Graphics myGraphics
The graphics context in which to draw.

Constructor Detail

ImageCopier

public ImageCopier(java.awt.Image i,
                   java.awt.image.ImageObserver observer,
                   java.awt.Graphics g)
ImageCopier by default uses this color as the fillRect color when transfering a filled Rectangle.

Method Detail

setVisible

public void setVisible(boolean visible)
Visitor's chance to free up resources at end of being displayed

Parameters:
visible - boolean

visit

public void visit(RectangleHierarchy node)
Copy the appropriate image onto Graphics g at (x,y,width,height).


visit

public void visit(RectangleHierarchy node,
                  java.awt.Rectangle clip)
Copy the appropriate image onto Graphics g at (x,y,width,height).

Note: only Leaf nodes are drawn.

In 2.1 Fixed defect where CHILDREN where being passed NULL clip region.

Clip to the given Rectangle clip area. [clip is unaffected by this invocation.]