nankin.zheng.gatem.view
Class DrawCommand

java.lang.Object
  |
  +--nankin.zheng.gatem.view.DrawCommand

public class DrawCommand
extends java.lang.Object

DrawCommand is an object which is passed to DisplayCache, telling it what to draw onto the screen and where and how. It contains an anchored image, a position which contains the logical coordonate of the background, and a depth, which indicates the priority of drawing.

Version:
1.0, Date 2003-04-11
Author:
ZHENG Zhong

Field Summary
private  AnchoredImage anchoredImage
           
private static int createdInstanceCount
           
private  int depth
           
private static int finalizedInstanceCount
           
private  Position position
           
 
Constructor Summary
DrawCommand(AnchoredImage aimg, Position pos, int dep)
          Constructor.
 
Method Summary
 int getAnchorX()
          Get anchor x.
 int getAnchorY()
          Get anchor y.
static int getCreatedInstanceCount()
           
 int getDepth()
          Get depth, which represents the drawing priority of this command.
static int getFinalizedInstanceCount()
           
 java.awt.Image getImage()
          Get image.
 Position getPosition()
          Get position.
 java.lang.String toString()
          Convert to String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

createdInstanceCount

private static int createdInstanceCount

finalizedInstanceCount

private static int finalizedInstanceCount

anchoredImage

private AnchoredImage anchoredImage

position

private Position position

depth

private int depth
Constructor Detail

DrawCommand

public DrawCommand(AnchoredImage aimg,
                   Position pos,
                   int dep)
Constructor. NOTE that anchored image is provided by RoleView, which is static inside RoleView and will never change. Position and depth is taken from the Role's attribute set, while the attribute set is dynamic. Position must be cloned ! because the draw command may be flushed to screen later than the Role's attribute set is changed.

Parameters:
aimg - anchored image
pos - position of the background, indicating where to draw
dep - depth, indicating the priority of drawing
Throws:
java.lang.NullPointerException - if aimg or pos is null.
Method Detail

getCreatedInstanceCount

public static int getCreatedInstanceCount()

getFinalizedInstanceCount

public static int getFinalizedInstanceCount()

getImage

public java.awt.Image getImage()
Get image.

Returns:
image which is contained in the AnchoredImage object

getAnchorX

public int getAnchorX()
Get anchor x.

Returns:
x value of the anchor of the anchored image

getAnchorY

public int getAnchorY()
Get anchor y.

Returns:
y value of the anchor of the anchored image

getPosition

public Position getPosition()
Get position.

Returns:
position of the background

getDepth

public int getDepth()
Get depth, which represents the drawing priority of this command.

Returns:
depth

toString

public java.lang.String toString()
Convert to String.

Overrides:
toString in class java.lang.Object