net.sf.magicproject.action.context
Class ActionContextWrapper

java.lang.Object
  extended by net.sf.magicproject.action.context.ActionContextWrapper

public final class ActionContextWrapper
extends java.lang.Object

Since:
0.86
Author:
Fabrice Daugan

Field Summary
 MAction action
          Action owning this context
 ActionContext actionContext
          Specific data saved during the init/... steps.
 JChoosenAction actionUI
          The JCostAction object associated to this context.
 int contextID
          Action index within the chain of cost
 int done
          Times already done.
 int recordIndex
          Is -1 if this action has not been completed.
 int repeat
          Times to repeat this action
 
Constructor Summary
ActionContextWrapper(int contextID, MAction action, ActionContext actionContext, int repeat)
          Create a new instance of this class.
 
Method Summary
 boolean isCompleted()
          Is this action is completed?
 boolean isRefreshText()
          Is the text is being to be refreshed.
 void refreshText(Ability ability, ContextEventListener context)
          Refresh the text of associated action UI component.
 java.lang.String toHtmlString(Ability ability, ContextEventListener context)
          Return the HTML code representing this action.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

action

public MAction action
Action owning this context


actionUI

public JChoosenAction actionUI
The JCostAction object associated to this context. Is null if the action is not a ChoosenAction class.


actionContext

public ActionContext actionContext
Specific data saved during the init/... steps.


contextID

public int contextID
Action index within the chain of cost


repeat

public int repeat
Times to repeat this action


done

public int done
Times already done. In range [0,repeat].


recordIndex

public int recordIndex
Is -1 if this action has not been completed. Otherwise this corresponds to the record id. Start from 0.

Constructor Detail

ActionContextWrapper

public ActionContextWrapper(int contextID,
                            MAction action,
                            ActionContext actionContext,
                            int repeat)
Create a new instance of this class.

Parameters:
contextID - the action ID.
action - the action.
actionContext - the context of this action
repeat - times this action has to be refreshed.
Method Detail

isCompleted

public boolean isCompleted()
Is this action is completed?

Returns:
true if this action is completed.

toHtmlString

public java.lang.String toHtmlString(Ability ability,
                                     ContextEventListener context)
Return the HTML code representing this action. If no picture is associated to this action, only text will be returned.

Parameters:
ability - is the ability owning this test. The card component of this ability should correspond to the card owning this test too.
context - is the context attached to this action.
Returns:
the HTML code representing this action. If no picture is associated to this action, only text will be returned.
Since:
0.85

refreshText

public void refreshText(Ability ability,
                        ContextEventListener context)
Refresh the text of associated action UI component.

Parameters:
ability - is the ability owning this test. The card component of this ability should correspond to the card owning this test too.
context - is the context attached to this action.

isRefreshText

public boolean isRefreshText()
Is the text is being to be refreshed.

Returns:
true if the text is being to be refreshed.


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