Class HelpBuilder

java.lang.Object
jme3utilities.ui.HelpBuilder

public class HelpBuilder extends Object
Generate hotkey clues for action-oriented applications.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Logger
    message logger for this class
  • Constructor Summary

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

    Modifier and Type
    Method
    Description
    com.jme3.scene.Node
    buildDetailedNode(InputMode inputMode, com.jme3.font.Rectangle bounds, com.jme3.font.BitmapFont font, com.jme3.texture.image.ColorSpace colorSpace)
    Build a Node to describe the hotkey mappings of the specified InputMode in detail.
    com.jme3.scene.Node
    buildMinimalNode(InputMode inputMode, com.jme3.font.Rectangle bounds, com.jme3.font.BitmapFont font, com.jme3.texture.image.ColorSpace colorSpace)
    Build a Node to describe the "toggle help" hotkey mappings of the specified InputMode.
    com.jme3.math.ColorRGBA
    copyBackgroundColor(com.jme3.math.ColorRGBA storeResult)
    Copy the color of the background.
    static String
    describe(Combo combo)
    Compactly describe the specified Combo using compressed local hotkey names.
    float
    Return the amount of padding between the content bounds and the edges of the background.
    float
    Return the amount of horizontal space between hotkey descriptions.
    void
    setBackgroundColor(com.jme3.math.ColorRGBA newColor)
    Alter the color for backgrounds.
    void
    setPadding(float newPadding)
    Alter the amount of padding between the content bounds and the edges of the background.
    void
    setSeparation(float newSeparation)
    Alter the amount of horizontal space between hotkey descriptions.

    Methods inherited from class java.lang.Object

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

    • logger

      public static final Logger logger
      message logger for this class
  • Constructor Details

    • HelpBuilder

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

    • buildDetailedNode

      public com.jme3.scene.Node buildDetailedNode(InputMode inputMode, com.jme3.font.Rectangle bounds, com.jme3.font.BitmapFont font, com.jme3.texture.image.ColorSpace colorSpace)
      Build a Node to describe the hotkey mappings of the specified InputMode in detail.
      Parameters:
      inputMode - the InputMode to describe (not null, unaffected)
      bounds - (in framebuffer pixels, relative to the resulting node, not null, unaffected)
      font - the font to use (not null, unaffected)
      colorSpace - the ColorSpace to use (not null)
      Returns:
      a new orphan Node, suitable for attachment to the GUI node
    • buildMinimalNode

      public com.jme3.scene.Node buildMinimalNode(InputMode inputMode, com.jme3.font.Rectangle bounds, com.jme3.font.BitmapFont font, com.jme3.texture.image.ColorSpace colorSpace)
      Build a Node to describe the "toggle help" hotkey mappings of the specified InputMode.
      Parameters:
      inputMode - the InputMode to describe (not null, unaffected)
      bounds - (in framebuffer pixels, relative to the resulting node, not null, unaffected)
      font - the font to use (not null, unaffected)
      colorSpace - the ColorSpace to use (not null)
      Returns:
      a new orphan Node, suitable for attachment to the GUI node
    • copyBackgroundColor

      public com.jme3.math.ColorRGBA copyBackgroundColor(com.jme3.math.ColorRGBA storeResult)
      Copy the color of the background.
      Parameters:
      storeResult - storage for the result (modified if not null)
      Returns:
      the gamma-encoded color (either storeResult or a new instance)
    • describe

      public static String describe(Combo combo)
      Compactly describe the specified Combo using compressed local hotkey names. Compare with Combo.toStringLocal().
      Parameters:
      combo - the Combo to describe (not null)
      Returns:
      a textual description (not null)
    • padding

      public float padding()
      Return the amount of padding between the content bounds and the edges of the background.
      Returns:
      the padding (in framebuffer pixels, ≥0)
    • separation

      public float separation()
      Return the amount of horizontal space between hotkey descriptions.
      Returns:
      the separation (in framebuffer pixels, >0)
    • setBackgroundColor

      public void setBackgroundColor(com.jme3.math.ColorRGBA newColor)
      Alter the color for backgrounds.
      Parameters:
      newColor - the desired color (not null, unaffected, gamma-encoded, default=opaque black)
    • setPadding

      public void setPadding(float newPadding)
      Alter the amount of padding between the content bounds and the edges of the background.
      Parameters:
      newPadding - the desired padding (in framebuffer pixels, ≥0, default=5)
    • setSeparation

      public void setSeparation(float newSeparation)
      Alter the amount of horizontal space between hotkey descriptions.
      Parameters:
      newSeparation - the desired separation (in framebuffer pixels, >0, default=20)