Package com.diffplug.common.swt
Enum Class Corner
- All Implemented Interfaces:
Serializable,Comparable<Corner>,Constable
Positions within a rectangle (the corners, the center of the lines, and the center).
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptiongetPosition(com.diffplug.common.swt.ControlWrapper wrapper) Returns this corner's position on the given control in display coordinates.getPosition(Rectangle rectangle) Returns this corner's position within the given rectangle.getPosition(Control control) Returns this corner's position on the given control in display coordinates.getPosition(ToolItem item) Returns this corner's position on the given ToolItem in display coordinates.topLeftRequiredFor(Rectangle rectangle, Point position) If you move the topLeft of `rectangle` to the returned point, then this corner will be at `position`.static CornerReturns the enum constant of this class with the specified name.static Corner[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
TOP_LEFT
-
TOP_RIGHT
-
BOTTOM_LEFT
-
BOTTOM_RIGHT
-
TOP
-
LEFT
-
BOTTOM
-
RIGHT
-
CENTER
-
-
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
-
getPosition
Returns this corner's position within the given rectangle. -
getPosition
Returns this corner's position on the given control in display coordinates. -
getPosition
Returns this corner's position on the given control in display coordinates. -
getPosition
Returns this corner's position on the given ToolItem in display coordinates. -
topLeftRequiredFor
If you move the topLeft of `rectangle` to the returned point, then this corner will be at `position`.
-