T
- The type of data to be stored in the buttonpublic class Buttons<T> extends java.lang.Object implements Drawable
Modifier and Type | Field and Description |
---|---|
static boolean |
CLOSE |
static boolean |
DOWN |
static boolean |
OPEN |
static boolean |
UP |
Constructor and Description |
---|
Buttons(boolean pressed,
boolean lit,
T data)
Creates a button based on the provided parameters
|
Buttons(T data)
Creates a basic, unpressed and unlit, Button with some data
|
Modifier and Type | Method and Description |
---|---|
T |
getData() |
javafx.scene.image.ImageView |
getRepresentation()
Gets the reference to an object of type ImageView in which this Drawable stores its representation.
|
boolean |
isLit() |
boolean |
isPressed() |
Buttons<T> |
press()
Used to set the pressed status of the button to true Note: this does NOT light the button.
|
Drawable |
setImageView(javafx.scene.image.ImageView representation)
Sets the reference to an object of type ImageView into which this Drawable should store its representation.
|
Buttons<T> |
setLit()
Used to toggle the light status of a button
|
Buttons<T> |
setLit(boolean lit)
Used to set the light status of a button
|
Buttons<T> |
setPressed(boolean pressed)
Used to set the pressed status of a button
|
Buttons<T> |
togglePress()
Used to toggle the pressed status of a button
|
java.lang.String |
toString() |
Drawable |
updateRepresentation()
Updates the stored reference with a representation that represents the state of this Drawable
|
public static final boolean UP
public static final boolean OPEN
public static final boolean DOWN
public static final boolean CLOSE
public Buttons(T data)
data
- The data used to identify the function of this buttonpublic Buttons(boolean pressed, boolean lit, T data)
pressed
- Boolean state representing whether the Button has been pressedlit
- Boolean state representing whether the Button is currently litdata
- The data used to identify the function of this buttonpublic boolean isPressed()
public boolean isLit()
public Buttons<T> setLit(boolean lit)
lit
- Boolean state representing whether the Button is currently litpublic T getData()
public Buttons<T> press()
public Buttons<T> setPressed(boolean pressed)
pressed
- Boolean state representing whether the Button is currently pressedpublic Buttons<T> togglePress()
public Drawable setImageView(javafx.scene.image.ImageView representation)
Drawable
setImageView
in interface Drawable
representation
- The reference to the ImageView in which the representation of this Drawable should be placedpublic javafx.scene.image.ImageView getRepresentation()
Drawable
getRepresentation
in interface Drawable
public Drawable updateRepresentation()
Drawable
updateRepresentation
in interface Drawable
public java.lang.String toString()
toString
in class java.lang.Object