net.sf.magicproject.tools
Class StatePicture

java.lang.Object
  extended by net.sf.magicproject.tools.StatePicture

public class StatePicture
extends java.lang.Object

StatePicture.java Created on 3 mars 2004 Followin the state, draw a picture at a determined position.

Since:
0.60, 0.82 the register index is now used. If state value is 0, the string representing the value of register is written on the graphic.
Author:
Fabrice Daugan

Constructor Summary
StatePicture(java.io.InputStream inputFile)
          read from the specified stream the state picture options.
 
Method Summary
 boolean hasState(int fullState)
          Indicates if this state suits to the specified stete
 boolean paint(MCard owner, java.awt.Graphics g, int currentX, int currentY)
          Draw this state on the specified card using the given graphics.
 java.lang.String toString()
          Return the state name.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StatePicture

public StatePicture(java.io.InputStream inputFile)
             throws java.io.IOException
read from the specified stream the state picture options. The current offset of the stream must pointing on the number of state pictures.

Parameters:
inputFile - file containing the states picture
Throws:
java.io.IOException - If some other I/O error occurs
Method Detail

paint

public boolean paint(MCard owner,
                     java.awt.Graphics g,
                     int currentX,
                     int currentY)
Draw this state on the specified card using the given graphics. If the test of this state is evaluated to false, no picture and no text will be drawn and false value will be returned.

Parameters:
owner - the card this state is applied on.
g - the graphics.
currentX - current relative X position of cursor
currentY - current relative Y position of cursor
Returns:
true if this state picture has been drawn just after the given relative poistion of cursor.
See Also:
Component.paint(java.awt.Graphics)

hasState

public boolean hasState(int fullState)
Indicates if this state suits to the specified stete

Parameters:
fullState - the full state number
Returns:
true if this state suits to the specified stete

toString

public java.lang.String toString()
Return the state name.

Overrides:
toString in class java.lang.Object
Returns:
the state name.


Copyright © 2003-2007 Magic-Project. All Rights Reserved.