mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 20:31:51 +09:00
Former-commit-id: 1647fa32ef6894bd7db44f741f07c2f4dcdf9054 Former-commit-id: 0e5810dcfbe1fd59b13e7cabe9f1e93c5542da2d
84 lines
1.7 KiB
Java
84 lines
1.7 KiB
Java
package org.newdawn.slick.gui;
|
|
|
|
import org.newdawn.slick.Graphics;
|
|
import org.newdawn.slick.SlickException;
|
|
|
|
/**
|
|
* Renamed to provide backwards compatibility
|
|
*
|
|
* @author kevin
|
|
* @deprecated
|
|
*/
|
|
public abstract class BasicComponent extends AbstractComponent {
|
|
/** The x position of the component */
|
|
protected int x;
|
|
/** The y position of the component */
|
|
protected int y;
|
|
/** The width of the component */
|
|
protected int width;
|
|
/** The height of the component */
|
|
protected int height;
|
|
|
|
/**
|
|
* Create a new component
|
|
*
|
|
* @param container
|
|
* The container displaying this component
|
|
*/
|
|
public BasicComponent(GUIContext container) {
|
|
super(container);
|
|
}
|
|
|
|
/**
|
|
* @see org.newdawn.slick.gui.AbstractComponent#getHeight()
|
|
*/
|
|
public int getHeight() {
|
|
return height;
|
|
}
|
|
|
|
/**
|
|
* @see org.newdawn.slick.gui.AbstractComponent#getWidth()
|
|
*/
|
|
public int getWidth() {
|
|
return width;
|
|
}
|
|
|
|
/**
|
|
* @see org.newdawn.slick.gui.AbstractComponent#getX()
|
|
*/
|
|
public int getX() {
|
|
return x;
|
|
}
|
|
|
|
/**
|
|
* @see org.newdawn.slick.gui.AbstractComponent#getY()
|
|
*/
|
|
public int getY() {
|
|
return y;
|
|
}
|
|
|
|
/**
|
|
* Allow the sub-component to render
|
|
*
|
|
* @param container The container holding the GUI
|
|
* @param g The graphics context into which we should render
|
|
*/
|
|
public abstract void renderImpl(GUIContext container, Graphics g);
|
|
|
|
/**
|
|
* @see org.newdawn.slick.gui.AbstractComponent#render(org.newdawn.slick.gui.GUIContext, org.newdawn.slick.Graphics)
|
|
*/
|
|
public void render(GUIContext container, Graphics g) throws SlickException {
|
|
renderImpl(container,g);
|
|
}
|
|
|
|
/**
|
|
* @see org.newdawn.slick.gui.AbstractComponent#setLocation(int, int)
|
|
*/
|
|
public void setLocation(int x, int y) {
|
|
this.x = x;
|
|
this.y = y;
|
|
}
|
|
|
|
}
|