Class org.violetlib.vaquaclient.SegmentedControlBuilder
Inherited members: ShowHide
Deprecated: ShowHide
org.violetlib.vaquaclient
Class SegmentedControlBuilder
Object
SegmentedControlBuilder
public class SegmentedControlBuilder
extends Object
Assemble a horizontal collection of buttons with the appropriate client properties to be displayed as a segmented
control when using the Aqua or VAqua look and feel on macOS. In other circumstances, ordinary buttons will be used and
separated horizontally by a specified distance. The displayed order depends upon the component orientation and is
updated automatically.
Fields
Modifier and Type
Field and Description
GRADIENT
static String GRADIENT
public static final String GRADIENT
LARGE
static String LARGE
public static final String LARGE
MINI
static String MINI
public static final String MINI
REGULAR
static String REGULAR
public static final String REGULAR
ROUND_RECT
static String ROUND_RECT
public static final String ROUND_RECT
SEPARATED
static String SEPARATED
public static final String SEPARATED
SMALL
static String SMALL
public static final String SMALL
TEXTURED
static String TEXTURED
public static final String TEXTURED
TEXTURED_SEPARATED
static String TEXTURED_SEPARATED
public static final String TEXTURED_SEPARATED
Constructors
Constructor and Description
SegmentedControlBuilder
SegmentedControlBuilder(String style,
boolean isExclusive,
String controlSize,
int defaultSeparation)
Create a builder of a segmented control.
public SegmentedControlBuilder(String style,
boolean isExclusive,
String controlSize,
int defaultSeparation)
Create a builder of a segmented control. The builder can be used only once.
isExclusive - True to ensure that exactly one button is selected at any time; false to allow any number of
buttons to be selected or to allow ordinary push buttons. When this parameter is true, only toggle buttons may
be added to the control; otherwise, this parameter has no effect if there are fewer than two buttons.
controlSize - A specification of the control size. Available sizes are
LARGE, REGULAR, SMALL, and MINI. The supported combinations of style and
size depend upon the macOS release.
If null, the regular size is used.
defaultSeparation - The horizontal separation between buttons to use when not using the Aqua or VAqua look
and feel.
Methods
Modifier and Type
Method and Description
add
void add(JButton b)
Add a push button to the collection.
public void add(JButton b)
Add a push button to the collection. This operation is not supported if the control is exclusive.
add
void add(JToggleButton b)
Add a toggle button to the collection.
public void add(JToggleButton b)
Add a toggle button to the collection.
build
JPanel build()
Create and return the segmented control component.
public JPanel build()
Create and return the segmented control component.