Package com.xinapse.image
Enum Class RotationAngle
- All Implemented Interfaces:
Serializable
,Comparable<RotationAngle>
,Constable
The rotation angles that can be used to rotate an image in steps of 90 degrees.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A JPanel for selecting an image rotation angle in steps of 90 degrees.Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionTheRotationAngle
corresponding to an anticlockwise rotation of 90 degrees.TheRotationAngle
corresponding to a rotation of 180 degrees.TheRotationAngle
corresponding to a clockwise rotation of 90 degrees. -
Method Summary
Modifier and TypeMethodDescriptionstatic RotationAngle
Returns aRotationAngle
corresponding to a string.static RotationAngle
Gets the preferred rotation angle from the Preferences.static void
savePreferredRotationAngle
(Preferences prefs, RotationAngle rotationAngle) Saves the supplied rotation angle to the Preferences as the preferred RotationAngle.toString()
Returns a java.lang.String describing thisRotationAngle
.static RotationAngle
Returns the enum constant of this class with the specified name.static RotationAngle[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
PLUS_90
TheRotationAngle
corresponding to a clockwise rotation of 90 degrees. -
PLUS_180
TheRotationAngle
corresponding to a rotation of 180 degrees. -
MINUS_90
TheRotationAngle
corresponding to an anticlockwise rotation of 90 degrees.
-
-
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
-
getInstance
Returns aRotationAngle
corresponding to a string.- Parameters:
s
- aString
from which the most-like plane will be interpreted. Can be:- "+90",
- "180", or
- "-90".
- Returns:
- a
RotationAngle
corresponding to a String. - Throws:
InvalidArgumentException
- if the String is invalid.
-
getPreferredRotationAngle
Gets the preferred rotation angle from the Preferences.- Parameters:
prefs
- the Preferences from which to get the rotation angle.- Returns:
- the preferred RotationAngle.
-
savePreferredRotationAngle
Saves the supplied rotation angle to the Preferences as the preferred RotationAngle.- Parameters:
prefs
- the Preferences in which to save the rotation angle.rotationAngle
- the RotationAngle to save as the preferred one.
-
toString
Returns a java.lang.String describing thisRotationAngle
.- Overrides:
toString
in classEnum<RotationAngle>
- Returns:
- a java.lang.String describing this
RotationAngle
.
-