ConfigPanel.java
2.11 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
package com.mumfrey.liteloader.modconfig;
/**
* Interface for mod config panels to implement
*
* @author Adam Mummery-Smith
*/
public interface ConfigPanel
{
/**
* Panels should return the text to display at the top of the config panel window
*/
public abstract String getPanelTitle();
/**
* Get the height of the content area for scrolling purposes, return -1 to disable scrolling
*/
public abstract int getContentHeight();
/**
* Called when the panel is displayed, initialise the panel (read settings, etc)
*
* @param host panel host
*/
public abstract void onPanelShown(ConfigPanelHost host);
/**
* Called when the window is resized whilst the panel is active
*
* @param host panel host
*/
public abstract void onPanelResize(ConfigPanelHost host);
/**
* Called when the panel is closed, panel should save settings
*/
public abstract void onPanelHidden();
/**
* Called every tick
*/
public abstract void onTick(ConfigPanelHost host);
/**
* Draw the configuration panel
*
* @param host
* @param mouseX
* @param mouseY
* @param partialTicks
*/
public abstract void drawPanel(ConfigPanelHost host, int mouseX, int mouseY, float partialTicks);
/**
* Called when a mouse button is pressed
*
* @param host
* @param mouseX
* @param mouseY
* @param mouseButton
*/
public abstract void mousePressed(ConfigPanelHost host, int mouseX, int mouseY, int mouseButton);
/**
* Called when a mouse button is released
*
* @param host
* @param mouseX
* @param mouseY
* @param mouseButton
*/
public abstract void mouseReleased(ConfigPanelHost host, int mouseX, int mouseY, int mouseButton);
/**
* Called when the mouse is moved
*
* @param host
* @param mouseX
* @param mouseY
*/
public abstract void mouseMoved(ConfigPanelHost host, int mouseX, int mouseY);
/**
* Called when a key is pressed
*
* @param host
* @param keyChar
* @param keyCode
*/
public abstract void keyPressed(ConfigPanelHost host, char keyChar, int keyCode);
}