jv.number

## Class PuBoolean

- java.lang.Object
- - jv.object.PsObject
  - - jv.number.PuBoolean

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, PsUpdateIf

      public final class PuBoolean
      extends PsObject

  Basic boolean class with update functionality and panel containing a checkbox.

  Usage demonstrated in a sample class:

              public class PjExprOde {
          protected  PuBoolean  m_flag;
          public PjExprOde() {
             // Create a new instance of PuBoolean and register 'this' as update listener
             // to receive update events whenever user has modified the inspector.
             m_flag  = new PuBoolean("Flag", this);
          }
          public void init() {
             m_flag.setDefState(true);         // Set default value.
             m_flag.init();                    // Initiate or reset to default values.
          }
          public boolean update(Object event) {
             // Catch update events sent whenever user has modified inspector.
             if (event == m_flag) {
                solve(m_flag.getState());      // Do something application depended
                return true;
             }
          }
       }

  Since:
    JavaView 3.97.040
  See Also:
    Serialized Form
  Author:
    Konrad Polthier
  Version:
    26.10.08, 1.10 revised (fk) new constructor PuBoolean(name, parent, defState). 09.12.06, 1.00 created (kp) From existing PuDouble.

- - ### Field Summary

    - ### Fields inherited from class jv.object.PsObject

      `HAS_BOUNDARY_PANEL, HAS_CONFIG_PANEL, HAS_INFO_PANEL, HAS_LABEL_PANEL, HAS_MATERIAL_PANEL, HAS_TEXTURE_PANEL, HAS_VECTOR_PANEL, INSPECTOR_INFO, INSPECTOR_INFO_EXT, IS_DELETED, IS_FIXED, IS_FOCUSSED, IS_PICKED, IS_SELECTED, IS_USED, NUM_TAGS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PuBoolean(java.lang.String name)` Create new instance with given name.
    `PuBoolean(java.lang.String name, PsUpdateIf parent)` Create new instance with given name and parent.
    `PuBoolean(java.lang.String name, PsUpdateIf parent, boolean defState)` Create new instance with given name, parent, and default state.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.awt.Color` | `getBackground()` Get color of background of info panel.
    `boolean` | `getDefState()` Get the default state which is used when this object is reset.
    `boolean` | `getState()` Get current boolean state.
    `void` | `init()` Assign default state, and may be used to reset instance.
    `boolean` | `isEnabled()` Check whether inspector is enabled or disabled.
    `void` | `setBackground(java.awt.Color color)` Set color of background of info panel.
    `void` | `setDefState(boolean state)` Set default state to be assigned when `init()` is called as reset.
    `void` | `setEnabled(boolean flag)` Enable or disable the inspector for interactive use.
    `void` | `setState(boolean state)` Set state of boolean.

    - ### Methods inherited from class jv.object.PsObject

      `addInspector, addUpdateListener, assureInspector, clearTag, clone, clone, clone, copy, getFather, getInfoPanel, getInspector, getName, getNumObjects, getSymbol, hasInspector, hasTag, hasUpdateListener, instanceOf, instanceOf, newInspector, newInspector, removeInspector, removeInspector, removeUpdateListener, setName, setParent, setSymbol, setTag, toString, update, updatePanels`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### PuBoolean

          public PuBoolean(java.lang.String name)

      Create new instance with given name. The name appears as label on the inspector.

      In order to receive update events of this inspector one might either assign a parent or register an update listener.

      Parameters:
        `name` - Name of boolean to appear as label of checkbox.

    - #### PuBoolean

          public PuBoolean(java.lang.String name,
                           PsUpdateIf parent)

      Create new instance with given name and parent. The name appears as label on the inspector, and the parent is informed whenever this variable has changed using `parent.update(this)`.
      Parameters:
        `name` - Name of boolean to appear as label in inspector
        `parent` - Parent of boolean to receive update events.

    - #### PuBoolean

          public PuBoolean(java.lang.String name,
                           PsUpdateIf parent,
                           boolean defState)

      Create new instance with given name, parent, and default state. The name appears as label on the inspector, and the parent is informed whenever this variable has changed using `parent.update(this)`.
      Parameters:
        `name` - Name of boolean to appear as label in inspector
        `parent` - Parent of boolean to receive update events.
        `defState` - Default state of the checkbox.
      Author:
        Felix Kaelberer
      Version:
        29.10.2008, 1.00 created (fk) Created from PuBoolean(String, PsUpdateIf).

  - ### Method Detail

    - #### init

          public void init()

      Assign default state, and may be used to reset instance.
      Overrides:
        `init` in class `PsObject`

    - #### setState

          public void setState(boolean state)

      Set state of boolean.

      This routine called from outside to set the state. Only here we update the panel.

    - #### getState

          public boolean getState()

      Get current boolean state.

    - #### getDefState

          public boolean getDefState()

      Get the default state which is used when this object is reset.
      See Also:
        `setDefState(boolean)`, `getState()`

    - #### setDefState

          public void setDefState(boolean state)

      Set default state to be assigned when `init()` is called as reset.

    - #### isEnabled

          public boolean isEnabled()

      Check whether inspector is enabled or disabled.

    - #### setEnabled

          public void setEnabled(boolean flag)

      Enable or disable the inspector for interactive use. If disabled, the variable can still be modified by calls `setState(boolean)`, and the inspector is always updated.

    - #### getBackground

          public java.awt.Color getBackground()

      Get color of background of info panel.
      Since:
        JavaView 3.50.003
      Version:
        01.08.04, 1.00 created (kp)

    - #### setBackground

          public void setBackground(java.awt.Color color)

      Set color of background of info panel.
      Since:
        JavaView 3.50.003
      Version:
        01.08.04, 1.00 created (kp)

"

The software JavaView? is copyright protected. All Rights Reserved.
"