Package de.marcely.bedwars.tools.gui
Enum CenterFormat
- All Implemented Interfaces:
Serializable
,Comparable<CenterFormat>
,java.lang.constant.Constable
Helper for easily aligning items in a GUI
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionItem: X, Air: O
Example with 3 items:
O X O X O X O X OItem: X, Air: O
Example with 3 items: O O O X X X O O O
Example with 2 items: O O O X X O O O OItem: X, Air: O
Example with 3 items: O O O X X X O O O
Example with 2 items: O O O X O X O O O -
Method Summary
Modifier and TypeMethodDescriptionint
calculate
(int index, int amount, int min, int max) static CenterFormat
Returns the enum constant of this type with the specified name.static CenterFormat[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
CENTRALIZED
Item: X, Air: O
Example with 3 items: O O O X X X O O O
Example with 2 items: O O O X X O O O O -
CENTRALIZED_EVEN
Item: X, Air: O
Example with 3 items: O O O X X X O O O
Example with 2 items: O O O X O X O O O -
ALIGNED
Item: X, Air: O
Example with 3 items:
O X O X O X O X O
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException
- if the argument is null
-
calculate
public int calculate(int index, int amount, int min, int max)
-