Toggle Button
A ToggleButton may be used as a Button that is either selected or not selected. An important feature of ToggleButtons is the ToggleGroup.
ToggleGroups can be used to group ToggleButtons.
All ToggleButtons that keep the same instance of a ToggleGroup belong to that ToggleGroup. Only one ToggleButton may be selected in a ToggleGroup. This means whenever a ToggleButton changes its selected state to true
, all other ToggleButtons in the same ToggleGroup get deselected.
An exception to this rule is, whenever a new ToggleButton that is currently selected gets added to the ToggleGroup.
See also
Parameters
Horizontal coordinate for this ToggleButton. Default: 0.
Vertical coordinate for this ToggleButton. Default: 0.
Width for this ToggleButton. Default: DEFAULT_TOGGLE_BUTTON_WIDTH.
Height for this ToggleButton. Default: DEFAULT_TOGGLE_BUTTON_HEIGHT.
Text to be displayed for this ToggleButton.
Font to be used for this ToggleButton. Default: default Font constructor.
Alignment to be used for this ToggleButton.
Defines if text should be wrapped, if it exceeds the label's width. Default: false
.
The initial state for this ToggleButton. Default: false
.
The ToggleGroup of this ToggleButton. Default: empty group.
Background Visual. Default: Visual.EMPTY.
Constructors
Creates a ToggleButton.
Functions
Adds an offset to this ComponentView's Position.
Removes this component from its parent.
Repositions this ComponentView to the specified coordinates.
Rotates this ComponentView by the given number of degrees.
Scales this ComponentView by the given scalar.
Scales this ComponentView's width by the given scalar.
Scales this ComponentView's height by the given scalar.
Puts the ComponentView to the back inside its parent and Changes its zIndex accordingly.
Puts the ComponentView to the front inside its parent and Changes its zIndex accordingly.
Properties
The actual height for this ComponentView considering scale.
Horizontal position of this ComponentView considering scale.
Vertical position of this ComponentView considering scale.
The actual width for this ComponentView considering scale.
Property for the Alignment of this LabeledUIComponent.
Css style that gets applied to this UIComponent's background.
Property for the css style that gets applied to this UIComponent's background.
Css style that gets applied to this UIComponent.
Property for the css style that gets applied to this UIComponent.
Returns whether this ComponentView is a valid drop target for the dragged component in the given DragEvent or not.
Property for the Font of this UIComponent. Usage depends on subclass.
Property for the height of this ComponentView.
Controls if user input events cause input functions of this ComponentView to get invoked.
Property that controls if user input events cause input functions of this ComponentView to get invoked.
Controls whether this ComponentView is focusable or not.
Property that controls whether this ComponentView is focusable or not.
Property for the visibility of this ComponentView.
Defines if text should be wrapped, if it exceeds the Label's width.
Property for the isWrapText state of this Label.
Returns a CoordinatePlain containing the component's corner Coordinates and its layout bounds.
Gets invoked with a DragEvent whenever a drag and drop gesture finishes over this ComponentView and the dropAcceptor returns true
for the given DragEvent.
Gets invoked with a DragEvent whenever the mouse enters this ComponentView while performing a drag gesture.
Gets invoked with a DragEvent whenever the mouse leaves this ComponentView while performing a drag gesture.
Gets invoked with a KeyEvent whenever a key is pressed while this ComponentView has focus.
Gets invoked with a KeyEvent whenever a key is released while this ComponentView has focus.
Gets invoked with a KeyEvent whenever a Character is typed while this ComponentView has focus. Gets invoked after onKeyPressed.
Gets invoked with a MouseEvent whenever the mouse is clicked inside this ComponentView. Gets invoked after onMousePressed and onMouseReleased.
Gets invoked with a MouseEvent whenever the mouse enters this ComponentView.
Gets invoked with a MouseEvent whenever the mouse leaves this ComponentView.
Gets invoked with a MouseEvent whenever the mouse is pressed inside this ComponentView.
Gets invoked with a MouseEvent whenever the mouse is released inside this ComponentView.
Gets invoked with a ScrollEvent whenever the mouse wheel is turned while the mouse is inside this ComponentView.
Property for the opacity of this ComponentView.
Property for the horizontal position of this ComponentView.
Property for the vertical position of this ComponentView.
Property for the rotation of this ComponentView in degrees.
Property for the horizontal scale of this ComponentView.
Property for the vertical scale of this ComponentView.
Property for the selected state of this ToggleButton.
Property for the label of this LabeledUIComponent.
Property for the width of this ComponentView.
Property for the order of ComponentView inside of parent.#