Path: blob/master/SLICK_HOME/src/org/newdawn/slick/gui/BasicComponent.java
1457 views
package org.newdawn.slick.gui;12import org.newdawn.slick.Graphics;3import org.newdawn.slick.SlickException;45/**6* Renamed to provide backwards compatibility7*8* @author kevin9* @deprecated10*/11public abstract class BasicComponent extends AbstractComponent {12/** The x position of the component */13protected int x;14/** The y position of the component */15protected int y;16/** The width of the component */17protected int width;18/** The height of the component */19protected int height;2021/**22* Create a new component23*24* @param container25* The container displaying this component26*/27public BasicComponent(GUIContext container) {28super(container);29}3031/**32* @see org.newdawn.slick.gui.AbstractComponent#getHeight()33*/34public int getHeight() {35return height;36}3738/**39* @see org.newdawn.slick.gui.AbstractComponent#getWidth()40*/41public int getWidth() {42return width;43}4445/**46* @see org.newdawn.slick.gui.AbstractComponent#getX()47*/48public int getX() {49return x;50}5152/**53* @see org.newdawn.slick.gui.AbstractComponent#getY()54*/55public int getY() {56return y;57}5859/**60* Allow the sub-component to render61*62* @param container The container holding the GUI63* @param g The graphics context into which we should render64*/65public abstract void renderImpl(GUIContext container, Graphics g);6667/**68* @see org.newdawn.slick.gui.AbstractComponent#render(org.newdawn.slick.gui.GUIContext, org.newdawn.slick.Graphics)69*/70public void render(GUIContext container, Graphics g) throws SlickException {71renderImpl(container,g);72}7374/**75* @see org.newdawn.slick.gui.AbstractComponent#setLocation(int, int)76*/77public void setLocation(int x, int y) {78this.x = x;79this.y = y;80}8182}838485