Documentation of 'jv.number.PuBoolean' Java class
PuBoolean ("JavaView Reference Manual")
"JavaView? v5.03.003"
jv.number

Class 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.
    • 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)
"JavaView? v5.03.003"

"

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

You see the box below because you did not login.