Package swingtree
Enum Class UI.Corner
- All Implemented Interfaces:
Serializable,Comparable<UI.Corner>,Constable,UIEnum<UI.Corner>
- Enclosing class:
UI
Names one corner of a component, or, as
EVERY, all four of them at once.
Pass one to ComponentStyleDelegate.borderRadiusAt(swingtree.UI.Corner, double, double)
in the style API (see UIForAnySwing.withStyle(Styler)) to round that corner
by itself, which is how a component takes a shape other than a plain rectangle.
opposite() names the corner diagonally across the component, so that a
shape rounding two facing corners can be driven by a single value, and
toPlacement() turns the corner into the point sitting at it, for the parts
of the API which place things by UI.Placement.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe bottom left corner.The bottom right corner.All four corners at once, rather than any single one of them.The top left corner.The top right corner. -
Method Summary
Modifier and TypeMethodDescriptionopposite()Returns the corner diagonally across the component from this one.Returns the point at this corner, which is how a corner is handed to the parts of the API that place things byUI.Placement, such asImageConf.placement(Placement).static UI.CornerReturns the enum constant of this class with the specified name.static UI.Corner[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
EVERY
All four corners at once, rather than any single one of them. -
TOP_LEFT
The top left corner. -
TOP_RIGHT
The top right corner. -
BOTTOM_LEFT
The bottom left corner. -
BOTTOM_RIGHT
The bottom right corner.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
opposite
Returns the corner diagonally across the component from this one.- Returns:
BOTTOM_RIGHTforTOP_LEFTand so on, withEVERYreturning itself, because it names no single corner.
-
toPlacement
Returns the point at this corner, which is how a corner is handed to the parts of the API that place things byUI.Placement, such asImageConf.placement(Placement).- Returns:
- The matching corner of
UI.Placement, andUI.Placement.UNDEFINEDforEVERY, which names no single corner.
-