Package jme3utilities

Class SimpleControl

java.lang.Object
com.jme3.scene.control.AbstractControl
jme3utilities.SimpleControl
All Implemented Interfaces:
com.jme3.export.Savable, com.jme3.scene.control.Control, com.jme3.util.clone.JmeCloneable, Cloneable
Direct Known Subclasses:
SubtreeControl

public abstract class SimpleControl extends com.jme3.scene.control.AbstractControl
A simplified AbstractControl.

Although this is an abstract class, it defines all required methods in order to simplify the development of subclasses -- unlike AbstractControl. It also validates parameters of its public methods and finalizes isEnabled().

Each instance is enabled at creation.

  • Field Summary

    Fields inherited from class com.jme3.scene.control.AbstractControl

    enabled, spatial
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    A no-arg constructor to avoid javadoc warnings from JDK 18.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    controlRender(com.jme3.renderer.RenderManager renderManager, com.jme3.renderer.ViewPort viewPort)
    Render this Control.
    protected void
    controlUpdate(float updateInterval)
    Update this Control.
    final boolean
    Test whether this Control is enabled.
    void
    Toggle the enabled status of this Control.

    Methods inherited from class com.jme3.scene.control.AbstractControl

    cloneFields, cloneForSpatial, getSpatial, jmeClone, read, render, setEnabled, setSpatial, update, write

    Methods inherited from class java.lang.Object

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

    • SimpleControl

      protected SimpleControl()
      A no-arg constructor to avoid javadoc warnings from JDK 18.
  • Method Details

    • toggleEnabled

      public void toggleEnabled()
      Toggle the enabled status of this Control.
    • controlRender

      protected void controlRender(com.jme3.renderer.RenderManager renderManager, com.jme3.renderer.ViewPort viewPort)
      Render this Control. Invoked when the controlled spatial is about to be rendered to a ViewPort.

      This implementation only performs checks and is meant to be overridden.

      Specified by:
      controlRender in class com.jme3.scene.control.AbstractControl
      Parameters:
      renderManager - the renderer which is rendering the controlled spatial (not null)
      viewPort - the ViewPort where the controlled spatial will be rendered (not null)
    • controlUpdate

      protected void controlUpdate(float updateInterval)
      Update this Control. Invoked once per frame during the logical-state update, provided the Control is enabled and added to a Spatial. Should not be invoked directly from user code.

      This implementation only performs checks and is meant to be overridden.

      Specified by:
      controlUpdate in class com.jme3.scene.control.AbstractControl
      Parameters:
      updateInterval - time interval between frames (in seconds, ≥0)
    • isEnabled

      public final boolean isEnabled()
      Test whether this Control is enabled.
      Overrides:
      isEnabled in class com.jme3.scene.control.AbstractControl
      Returns:
      true if enabled, otherwise false