edu.washington.cs.supple.customization.state
Class State

java.lang.Object
  extended byedu.washington.cs.supple.customization.state.State

public class State
extends java.lang.Object

The state of the user interface as it is relevant to customization. This class contains references to a record of previous modifications that were done to currently loaded UI (history), a list of customization commands that are applied everytime a new part of the UI is loaded (plan), as well as conditions that check if the current UI state is legal.

Author:
raphael

Constructor Summary
State()
          Creates a new state object.
 
Method Summary
 java.lang.String getApplication()
          Returns the application name of the application that currently runs SUPPLE.
 Conditions getConditions()
          Returns a set of conditions that are required to hold at the current state of the UI.
 DeviceProperties getDevice()
          Returns a pointer to the device description of the currently used device that runs SUPPLE.
 ApplicationFunctions getFunctions()
          Returns a set of application functions that the customizer is aware of at the current state of the UI.
 History getHistory()
          Returns the history of all previous modifications that were applied to this part of the UI.
 Plan getPlan()
          Returns the current customization plan, which contains all customization commands that are applied to any new part of the UI that is loaded.
 Specifications getSpecifications()
          Returns a set of the functional specifications of all loaded parts of the UI.
 void reverseLastActionAndTrimHistory()
          Reverses the last action that was performed and removes this action from the history of performed actions.
 void setApplication(java.lang.String app)
          Sets the application name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

State

public State()
Creates a new state object. The state is initialized to an empty history of applied actions, an empty customization command plan, empty conditions set, and an empty application functions set.

Method Detail

getSpecifications

public Specifications getSpecifications()
Returns a set of the functional specifications of all loaded parts of the UI.

Returns:
set of functional specifications

getApplication

public java.lang.String getApplication()
Returns the application name of the application that currently runs SUPPLE.

Returns:
application name

setApplication

public void setApplication(java.lang.String app)
Sets the application name. If it is set, it can be used to define patterns for how to generalize customization commands.

Parameters:
app - application name

getDevice

public DeviceProperties getDevice()
Returns a pointer to the device description of the currently used device that runs SUPPLE.

Returns:
pointer to device description

getHistory

public History getHistory()
Returns the history of all previous modifications that were applied to this part of the UI. Each modification is represented by an action.

Returns:
customization history

getPlan

public Plan getPlan()
Returns the current customization plan, which contains all customization commands that are applied to any new part of the UI that is loaded.

Returns:
customization plan

getConditions

public Conditions getConditions()
Returns a set of conditions that are required to hold at the current state of the UI.

Returns:
a set of conditions

getFunctions

public ApplicationFunctions getFunctions()
Returns a set of application functions that the customizer is aware of at the current state of the UI.

Returns:
list of application functions

reverseLastActionAndTrimHistory

public void reverseLastActionAndTrimHistory()
Reverses the last action that was performed and removes this action from the history of performed actions. Note that this method does not operate on the command list but on the history list which contains actions and not commands. To prevent confusion undo commands, we deliberately did not name this method undo.