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
|
package binnie.craftgui.controls.page;
import binnie.craftgui.controls.core.Control;
import binnie.craftgui.controls.core.IControlValue;
import binnie.craftgui.core.IWidget;
public class ControlPage<T>
extends Control
implements IControlValue<T>
{
T value;
public ControlPage(IWidget parent, T value)
{
this(parent, 0.0F, 0.0F, parent.w(), parent.h(), value);
}
public ControlPage(IWidget parent, float x, float y, float w, float h, T value)
{
super(parent, x, y, w, h);
setValue(value);
if (((parent instanceof IControlValue)) && (((IControlValue)parent).getValue() == null)) {
((IControlValue)parent).setValue(value);
}
}
public T getValue()
{
return this.value;
}
public void setValue(T value)
{
this.value = value;
}
}
|