aboutsummaryrefslogtreecommitdiff
path: root/src/Java/binnie/craftgui/controls/page/ControlPage.java
blob: 0e5c89492e7ac994bdfb08a1ea02c97947d52fc5 (plain)
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;
  }
}