com.miginfocom.util.states
Interface StatesI

All Known Implementing Classes:
DefaultActivity, States

public interface StatesI

States interface


Method Summary
 boolean areStatesSet(int states, boolean allStatesSet)
          Returns the status of a state (or states).
 int[] getStateArray()
          Takes the state integer and split them up with a call to States.splitStates(int)
 int getStatesSet()
          Returns the states packed in an int
 boolean isAnyStateSet()
          Returns true if any state is set.
 boolean isStateSet(int state)
          Returns the status of a state.
 boolean setStates(int states, boolean b)
          Sets the status of a state (or states).
 

Method Detail

isStateSet

boolean isStateSet(int state)
Returns the status of a state. This is a short for areStatesSet(int, boolean) but only handles ONE state so and or or doesn't matter.

Parameters:
state - The state to be tested if it is on. eg. GenericStates.MOUSE_OVER_BIT
Returns:
true if the state was set (on), false otherwise.

areStatesSet

boolean areStatesSet(int states,
                     boolean allStatesSet)
Returns the status of a state (or states).

Parameters:
states - The state or states to be tested if they are all/some on. eg. GenericStates.MOUSE_OVER_BIT or (GenericStates.SELECTED_BIT | GenericStates.DRAGGING_BIT)
allStatesSet - If true all (and) of states must be set for true to be returned. If false only one of the (or) must be set for true to be returned.
Returns:
true if all (or some, depending on allStatesSet) states in state was on (set to true)

setStates

boolean setStates(int states,
                  boolean b)
Sets the status of a state (or states).

Parameters:
states - The state or states to be set to on (set to true). eg. GenericStates.MOUSE_OVER_BIT or (GenericStates.SELECTED_BIT | GenericStates.DRAGGING_BIT)
b - true means on
Returns:
If the state/states for the activity actually changed

isAnyStateSet

boolean isAnyStateSet()
Returns true if any state is set.

Returns:
true if any state is set.

getStatesSet

int getStatesSet()
Returns the states packed in an int

Returns:
The states packed in an int

getStateArray

int[] getStateArray()
Takes the state integer and split them up with a call to States.splitStates(int)

Returns:
The states splitted into an array


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.