-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathITheme.java
More file actions
68 lines (50 loc) · 1.55 KB
/
ITheme.java
File metadata and controls
68 lines (50 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package com.cleanroommc.modularui.api;
import com.cleanroommc.modularui.screen.Tooltip;
import com.cleanroommc.modularui.theme.WidgetSlotTheme;
import com.cleanroommc.modularui.theme.WidgetTextFieldTheme;
import com.cleanroommc.modularui.theme.WidgetTheme;
import com.cleanroommc.modularui.theme.WidgetThemeSelectable;
/**
* A theme is parsed from json and contains style information like color or background texture.
*/
public interface ITheme {
/**
* @return the master default theme.
*/
static ITheme getDefault() {
return IThemeApi.get().getDefaultTheme();
}
/**
* @param id theme id
* @return theme with given id
*/
static ITheme get(String id) {
return IThemeApi.get().getTheme(id);
}
/**
* @return theme id
*/
String getId();
/**
* @return parent theme
*/
ITheme getParentTheme();
WidgetTheme getFallback();
WidgetTheme getPanelTheme();
WidgetTheme getButtonTheme();
WidgetSlotTheme getItemSlotTheme();
WidgetSlotTheme getFluidSlotTheme();
WidgetTextFieldTheme getTextFieldTheme();
WidgetThemeSelectable getToggleButtonTheme();
WidgetTheme getWidgetTheme(String id);
default <T extends WidgetTheme> T getWidgetTheme(Class<T> clazz, String id) {
WidgetTheme theme = getWidgetTheme(id);
if (clazz.isInstance(theme)) {
return (T) theme;
}
return null;
}
int getOpenCloseAnimationOverride();
boolean getSmoothProgressBarOverride();
Tooltip.Pos getTooltipPosOverride();
}