Package virtualbreadboard.cdk.widget
Class Widget
java.lang.Object
virtualbreadboard.cdk.widget.Widget
- Direct Known Subclasses:
ButtonWidget
,ChargeButtonWidget
,HorizontalSliderWidget
,RotorWidget
,ToggleButtonWidget
,VerticalSliderWidget
,XYSliderWidget
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetId()
double
getValue()
returns the normalised value of the widget from -1.0 to 1.0void
keyPressed
(int ascii) simulate a keyPressed event injecting ascii valuevoid
keyReleased
(int ascii) simulate a keyPressed event injecting ascii valuevoid
simulate a mouse released eventvoid
simulate a mouse release eventvoid
setValue
(double v) assigns a normalised value to the widget between -1.0 to 1.0
-
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
- Returns:
- the unique identifier of the widget
-