- java.lang.Object
-
- java.lang.Enum<ScreenPart>
-
- be.yildizgames.module.window.ScreenPart
-
- All Implemented Interfaces:
Serializable
,Comparable<ScreenPart>
public enum ScreenPart extends Enum<ScreenPart>
Different virtual part of the screen.- Author:
- Grégory Van den Borre
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BOTTOM
From bottom part to bottom part - border size.CENTER
If in none of the other screen parts.LEFT
From left part of screen to left part + border size.LEFT_BOTTOM
From bottom and left part.LEFT_UP
From top and left part.RIGHT
From right part of screen to right part - border size.RIGHT_BOTTOM
From bottom and right part.RIGHT_UP
From top and right part.UP
From top part to top part + border size.
-
Method Summary
Modifier and Type Method Description static ScreenPart
getFromPosition(ScreenSize res, MousePosition position)
Retrieve the screen part containing the given position.static ScreenPart
valueOf(String name)
Returns the enum constant of this type with the specified name.static ScreenPart[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
LEFT
public static final ScreenPart LEFT
From left part of screen to left part + border size.
-
RIGHT
public static final ScreenPart RIGHT
From right part of screen to right part - border size.
-
UP
public static final ScreenPart UP
From top part to top part + border size.
-
BOTTOM
public static final ScreenPart BOTTOM
From bottom part to bottom part - border size.
-
LEFT_UP
public static final ScreenPart LEFT_UP
From top and left part.
-
RIGHT_UP
public static final ScreenPart RIGHT_UP
From top and right part.
-
LEFT_BOTTOM
public static final ScreenPart LEFT_BOTTOM
From bottom and left part.
-
RIGHT_BOTTOM
public static final ScreenPart RIGHT_BOTTOM
From bottom and right part.
-
CENTER
public static final ScreenPart CENTER
If in none of the other screen parts.
-
-
Method Detail
-
values
public static ScreenPart[] 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
public static ScreenPart valueOf(String name)
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
-
getFromPosition
public static ScreenPart getFromPosition(ScreenSize res, MousePosition position)
Retrieve the screen part containing the given position.- Parameters:
res
- Rectangle with the screen size.position
- Position to check.- Returns:
- The screen part where the given position is.
-
-