Package jisa.gui
Interface Button
-
- All Superinterfaces:
SubElement
- All Known Implementing Classes:
Button.ButtonWrapper
,Button.MenuItemWrapper
public interface Button extends SubElement
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
Button.ButtonWrapper
static class
Button.MenuItemWrapper
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
getText()
Returns the text displayed in the button.boolean
isDisabled()
Returns whether the button is disabled (greyed-out and un-clickable).boolean
isVisible()
Returns whether the button is visible or not.void
remove()
Removes the button from the GUI.void
setDisabled(boolean disabled)
Sets whether the button is disabled or not (greyed-out and un-clickable).void
setOnClick(SRunnable onClick)
Sets what should happen when the button is clicked.void
setText(java.lang.String text)
Changes the text displayed in the button.void
setVisible(boolean visible)
Sets whether the button is visible or not.
-
-
-
Method Detail
-
isDisabled
boolean isDisabled()
Returns whether the button is disabled (greyed-out and un-clickable).- Returns:
- Disabled?
-
setDisabled
void setDisabled(boolean disabled)
Sets whether the button is disabled or not (greyed-out and un-clickable).- Parameters:
disabled
- Disabled?
-
isVisible
boolean isVisible()
Returns whether the button is visible or not.- Specified by:
isVisible
in interfaceSubElement
- Returns:
- Visible?
-
setVisible
void setVisible(boolean visible)
Sets whether the button is visible or not.- Specified by:
setVisible
in interfaceSubElement
- Parameters:
visible
- Visible?
-
getText
java.lang.String getText()
Returns the text displayed in the button.- Returns:
- Text in button
-
setText
void setText(java.lang.String text)
Changes the text displayed in the button.- Parameters:
text
- New text to display
-
setOnClick
void setOnClick(SRunnable onClick)
Sets what should happen when the button is clicked.- Parameters:
onClick
- Lambda
-
remove
void remove()
Removes the button from the GUI.- Specified by:
remove
in interfaceSubElement
-
-