org.malai.stateMachine
Interface IStateMachine

All Known Implementing Classes:
AbortableDnD, ButtonPressed, CheckBoxModified, DnD, DoubleClick, Interaction, KeyInteraction, KeyPressure, KeysPressure, KeysScrolling, KeysTyped, KeyTyped, ListSelectionModified, MenuItemPressed, MultiClick, PointInteraction, Press, Scrolling, SimpleClick, SpinnerModified, TabSelected, TextChanged, WindowClosed

public interface IStateMachine

This interface defines the notion of state machine.

This file is part of Malai.
Copyright (c) 2009-2012 Arnaud BLOUIN

Malai is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
Malai is distributed without any warranty; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

01/09/2011

Since:
0.2
Version:
0.2
Author:
Arnaud BLOUIN

Method Summary
 void addState(IState state)
          Adds a state to the state machine.
 boolean isRunning()
           
 void onAborting()
          Aborts the state machine.
 void onStarting()
          Starts the state machine.
 void onTerminating()
          Terminates the state machine.
 void onUpdating()
          Updates the state machine.
 void reinit()
          Reinits the state machine.
 void setActivated(boolean activated)
          Defines if the state machine is activated.
 

Method Detail

onTerminating

void onTerminating()
                   throws MustAbortStateMachineException
Terminates the state machine.

Throws:
MustAbortStateMachineException - If something happens requiring the interaction to abort.

onAborting

void onAborting()
Aborts the state machine.


onStarting

void onStarting()
                throws MustAbortStateMachineException
Starts the state machine.

Throws:
MustAbortStateMachineException - If something happens requiring the interaction to abort.

onUpdating

void onUpdating()
                throws MustAbortStateMachineException
Updates the state machine.

Throws:
MustAbortStateMachineException - If something happens requiring the interaction to abort.

addState

void addState(IState state)
Adds a state to the state machine.

Parameters:
state - The state to add. Must not be null.
Since:
0.2

reinit

void reinit()
Reinits the state machine.

Since:
0.2

setActivated

void setActivated(boolean activated)
Defines if the state machine is activated.

Parameters:
activated - True: the state machine will be activated.
Since:
0.2

isRunning

boolean isRunning()
Returns:
True: the state machine is running.
Since:
0.2