Refactor enums to classes with static fields

This commit is contained in:
SpaiR committed 2019-12-29 23:59:39 +03:00
1 parent d4c59568d7
commit 8d241a60e6
35 files changed
+551 -769

No files matched your search

@@ -4,34 +4,18 @@ package imgui.enums;
* Enumeration for GetMouseCursor()
* User code may request binding to display given cursor by calling SetMouseCursor(), which is why we have some cursors that are marked unused here
*/
public enum ImGuiMouseCursor {
None(-1),
Arrow(0),
TextInput(1),
ResizeAll(2),
ResizeNS(3),
ResizeEW(4),
ResizeNESW(5),
ResizeNWSE(6),
Hand(7),
COUNT(8);
int value;
ImGuiMouseCursor(int code) {
value = code;
public final class ImGuiMouseCursor {
private ImGuiMouseCursor() {
}
public static ImGuiMouseCursor valueOf(int value) {
for (ImGuiMouseCursor cursor : values()) {
if (cursor.value == value) {
return cursor;
}
}
throw new IllegalArgumentException("Invalid cursor value: " + value);
}
public int getValue() {
return value;
}
public static final int None = -1;
public static final int Arrow = 0;
public static final int TextInput = 1; // When hovering over InputText, etc.
public static final int ResizeAll = 2; // (Unused by Dear ImGui functions)
public static final int ResizeNS = 3; // When hovering over an horizontal border
public static final int ResizeEW = 4; // When hovering over a vertical border or a column
public static final int ResizeNESW = 5; // When hovering over the bottom-left corner of a window
public static final int ResizeNWSE = 6; // When hovering over the bottom-right corner of a window
public static final int Hand = 7; // (Unused by Dear ImGui functions. Use for e.g. hyperlinks)
public static final int COUNT = 8;
}