public enum ScrollBarOrientation extends Enum<ScrollBarOrientation>
JScrollBar
. The methods in this enumeration
allow for orentation-agnostic calculations, which can be used when laying out a scroll bar. A
scroll bar, regargless of it's orientation, has a length and thickness. These values correspond
to different dimensions (x or y) depending on the orientation.Enum Constant and Description |
---|
HORIZONTAL |
VERTICAL |
Modifier and Type | Method and Description |
---|---|
static ScrollBarOrientation |
getOrientation(int swingScrollBarOrientation)
Converts a Swing scroll bar orientation (either
SwingConstants.HORIZONTAL or
SwingConstants.VERTICAL to a ScrollBarOrientation . |
static ScrollBarOrientation |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ScrollBarOrientation[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ScrollBarOrientation HORIZONTAL
public static final ScrollBarOrientation VERTICAL
public static ScrollBarOrientation[] values()
for (ScrollBarOrientation c : ScrollBarOrientation.values()) System.out.println(c);
public static ScrollBarOrientation valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant
with the specified nameNullPointerException
- if the argument is nullpublic static ScrollBarOrientation getOrientation(int swingScrollBarOrientation)
SwingConstants.HORIZONTAL
or
SwingConstants.VERTICAL
to a ScrollBarOrientation
.swingScrollBarOrientation
- the Swing scroll bar orientation, either
SwingConstants.HORIZONTAL
or SwingConstants.VERTICAL
ScrollBarOrientation
to the corresponding Swing scroll bar orientation.IllegalArgumentException
- if the given Swing scroll bar orientation is not valid.