Class Widget

java.lang.Object
virtualbreadboard.cdk.widget.Widget
Direct Known Subclasses:
ButtonWidget, ChargeButtonWidget, HorizontalSliderWidget, RotorWidget, ToggleButtonWidget, VerticalSliderWidget, XYSliderWidget

public class Widget extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    double
    returns the normalised value of the widget from -1.0 to 1.0
    void
    keyPressed(int ascii)
    simulate a keyPressed event injecting ascii value
    void
    keyReleased(int ascii)
    simulate a keyPressed event injecting ascii value
    void
    simulate a mouse released event
    void
    simulate a mouse release event
    void
    setValue(double v)
    assigns a normalised value to the widget between -1.0 to 1.0

    Methods inherited from class java.lang.Object

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

    • Widget

      public Widget()
  • Method Details

    • mouseReleased

      public void mouseReleased()
      simulate a mouse release event
    • mousePressed

      public void mousePressed()
      simulate a mouse released event
    • keyPressed

      public void keyPressed(int ascii)
      simulate a keyPressed event injecting ascii value
      Parameters:
      ascii -
    • keyReleased

      public void keyReleased(int ascii)
      simulate a keyPressed event injecting ascii value
      Parameters:
      ascii -
    • getValue

      public double getValue()
      returns the normalised value of the widget from -1.0 to 1.0
      Returns:
      the current widget value
    • setValue

      public void setValue(double v)
      assigns a normalised value to the widget between -1.0 to 1.0
      Parameters:
      v - the normalises value
    • getId

      public String getId()
      Returns:
      the unique identifier of the widget