Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
epoxy
GitHub Repository: epoxy/proj11
Path: blob/master/SLICK_HOME/src/org/newdawn/slick/gui/BasicComponent.java
1457 views
1
package org.newdawn.slick.gui;
2
3
import org.newdawn.slick.Graphics;
4
import org.newdawn.slick.SlickException;
5
6
/**
7
* Renamed to provide backwards compatibility
8
*
9
* @author kevin
10
* @deprecated
11
*/
12
public abstract class BasicComponent extends AbstractComponent {
13
/** The x position of the component */
14
protected int x;
15
/** The y position of the component */
16
protected int y;
17
/** The width of the component */
18
protected int width;
19
/** The height of the component */
20
protected int height;
21
22
/**
23
* Create a new component
24
*
25
* @param container
26
* The container displaying this component
27
*/
28
public BasicComponent(GUIContext container) {
29
super(container);
30
}
31
32
/**
33
* @see org.newdawn.slick.gui.AbstractComponent#getHeight()
34
*/
35
public int getHeight() {
36
return height;
37
}
38
39
/**
40
* @see org.newdawn.slick.gui.AbstractComponent#getWidth()
41
*/
42
public int getWidth() {
43
return width;
44
}
45
46
/**
47
* @see org.newdawn.slick.gui.AbstractComponent#getX()
48
*/
49
public int getX() {
50
return x;
51
}
52
53
/**
54
* @see org.newdawn.slick.gui.AbstractComponent#getY()
55
*/
56
public int getY() {
57
return y;
58
}
59
60
/**
61
* Allow the sub-component to render
62
*
63
* @param container The container holding the GUI
64
* @param g The graphics context into which we should render
65
*/
66
public abstract void renderImpl(GUIContext container, Graphics g);
67
68
/**
69
* @see org.newdawn.slick.gui.AbstractComponent#render(org.newdawn.slick.gui.GUIContext, org.newdawn.slick.Graphics)
70
*/
71
public void render(GUIContext container, Graphics g) throws SlickException {
72
renderImpl(container,g);
73
}
74
75
/**
76
* @see org.newdawn.slick.gui.AbstractComponent#setLocation(int, int)
77
*/
78
public void setLocation(int x, int y) {
79
this.x = x;
80
this.y = y;
81
}
82
83
}
84
85