Package pi.resources
Enum Class ImageFormat
- All Implemented Interfaces:
Serializable,Comparable<ImageFormat>,Constable
Contains all known image file-formats supported by the engine.
- Author:
- Steffen Wilke, Matthias Wilke
- See Also:
-
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 TypeMethodDescriptionstatic ImageFormatGets theImageFormatof the specified format string.static String[]static booleanisSupported(File file) Determines whether the extension of the specified file is supported by the engine.static booleanisSupported(String fileName) Determines whether the extension of the specified file is supported by the engine.Converts this format instance to a file format string that can be used as an extension (e.g. .png).
It adds a leading '.' to the lower-case string representation of this instance.toString()static ImageFormatReturns the enum constant of this class with the specified name.static ImageFormat[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
UNSUPPORTED
-
PNG
-
GIF
-
BMP
-
JPG
-
-
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
-
get
Gets theImageFormatof the specified format string.- Parameters:
imageFormat- The format string from which to extract the format.- Returns:
- The format of the specified string or
UNDEFINEDif not supported.
-
isSupported
Determines whether the extension of the specified file is supported by the engine.- Parameters:
file- The file to check for.- Returns:
- True if the extension is part of this enum; otherwise false.
-
isSupported
Determines whether the extension of the specified file is supported by the engine.- Parameters:
fileName- The name of the file to check for.- Returns:
- True if the extension is part of this enum; otherwise false.
-
getAllExtensions
-
toFileExtension
Converts this format instance to a file format string that can be used as an extension (e.g. .png).
It adds a leading '.' to the lower-case string representation of this instance.- Returns:
- The file extension string for this instance.
-
toString
- Overrides:
toStringin classEnum<ImageFormat>
-