Package org.jcsp.awt

Class ActiveButtonState

java.lang.Object
org.jcsp.awt.ActiveButtonState

public class ActiveButtonState extends Object
A state of the ActiveButtonControl finite state machine.

Description

ActiveButtonState is one of the elements of the state table governing the behaviour of the finite state machine within an ActiveButtonControl. For each controlled button, it holds the index of the label to be displayed in this state, whether that button should be enabled or disabled and which state should be jumped to if that button is pressed. See the example documented in ActiveButtonControl.

See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    This gets thrown if a consistency check fails in the ActiveButtonState constructor.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) boolean[]
     
    (package private) int[]
     
    (package private) int[]
     
    private boolean
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    ActiveButtonState(int[] labelId, boolean[] enable, int[] next)
    Constructs a new ActiveButtonState, performing consistency checks on its supplied arguments.
    ActiveButtonState(int[] labelId, boolean[] enable, int[] next, boolean verbose)
    Constructs a new ActiveButtonState, performing consistency checks on its supplied arguments, with a verbose reporting option.
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) void
    check(int i, int nButtons, int nStates, String[][] label)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • labelId

      int[] labelId
    • enable

      boolean[] enable
    • next

      int[] next
    • verbose

      private boolean verbose
  • Constructor Details

    • ActiveButtonState

      public ActiveButtonState(int[] labelId, boolean[] enable, int[] next) throws ActiveButtonState.BadArguments
      Constructs a new ActiveButtonState, performing consistency checks on its supplied arguments.
      Parameters:
      labelId - the button labels for this state.
      enable - the enable/disable status of each button for this state (true invalid input: '<'==> enabled).
      next - the next state after each button is pushed.
      Throws:
      ActiveButtonState.BadArguments - if the consistency check fails. The exception contains details of the error.
    • ActiveButtonState

      public ActiveButtonState(int[] labelId, boolean[] enable, int[] next, boolean verbose) throws ActiveButtonState.BadArguments
      Constructs a new ActiveButtonState, performing consistency checks on its supplied arguments, with a verbose reporting option.
      Parameters:
      labelId - the button labels for this state.
      enable - the enable/disable status of each button for this state (true invalid input: '<'==> enabled).
      next - the next state after each button is pushed.
      verbose - if true, a running commentary is printed on the consistency checks.
      Throws:
      ActiveButtonState.BadArguments - if the consistency check fails. The exception contains details of the error.
  • Method Details