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
Nested ClassesModifier and TypeClassDescriptionstatic classA 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 ConstantsEnum ConstantDescriptionTheRotationAnglecorresponding to an anticlockwise rotation of 90 degrees.TheRotationAnglecorresponding to a rotation of 180 degrees.TheRotationAnglecorresponding to a clockwise rotation of 90 degrees. -
Method Summary
Modifier and TypeMethodDescriptionstatic RotationAngleReturns aRotationAnglecorresponding to a string.static RotationAngleGets the preferred rotation angle from the Preferences.static voidsavePreferredRotationAngle(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 RotationAngleReturns 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
TheRotationAnglecorresponding to a clockwise rotation of 90 degrees. -
PLUS_180
TheRotationAnglecorresponding to a rotation of 180 degrees. -
MINUS_90
TheRotationAnglecorresponding 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 aRotationAnglecorresponding to a string.- Parameters:
s- aStringfrom which the most-like plane will be interpreted. Can be:- "+90",
- "180", or
- "-90".
- Returns:
- a
RotationAnglecorresponding 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:
toStringin classEnum<RotationAngle>- Returns:
- a java.lang.String describing this
RotationAngle.
-