sdljavax.gui

Class Widget

public class Widget extends Object implements SDLEventListener

An entity which can be drawn to a screen and may interact with the user.

Version: $Id: Widget.java,v 1.2 2005/01/30 22:02:07 ivan_ganza Exp $

Author: Ivan Z. Ganza

Field Summary
protected TexturebackgroundTexture
protected intborder
protected Containercontainer
protected static FTFontdefaultFont
protected booleandrawBorder
protected intheight
protected Stringname
protected booleanvisible
protected intwidth
protected intxPos
protected intyPos
Constructor Summary
Widget(GL gl, String name, SDLRect dimensions, String backgroundTexturePath)
Method Summary
booleancontains(SDLRect rect)
Describe contains method here.
booleancontains(int x, int y)
x and y absolute
voiddraw(GL gl)
Describe draw method here.
voiddraw(GL gl, int x, int y)
Draw myself at the given co-ordinates
TexturegetBackgroundTexture()
Gets the value of backgroundTexture
intgetHeight()
Gets the value of height
StringgetName()
Gets the value of name
intgetWidth()
Gets the value of width
intgetX()
Gets the value of x
intgetY()
Gets the value of y
voidhandleEvent(SDLEvent event)
Describe handleEvent method here.
voidhide()
Describe hide method here.
booleanisVisible()
Describe isVisible method here.
voidmouseEntered()
voidmouseExit()
voidsetBackgroundTexture(Texture argBackgroundTexture)
Sets the value of backgroundTexture
voidsetHeight(int argHeight)
Sets the value of height
voidsetName(String argName)
Sets the value of name
voidsetWidth(int argWidth)
Sets the value of width
voidsetX(int argX)
Sets the value of x
voidsetY(int argY)
Sets the value of y
voidshow()
Describe show method here.

Field Detail

backgroundTexture

protected Texture backgroundTexture

border

protected int border

container

protected Container container

defaultFont

protected static FTFont defaultFont

drawBorder

protected boolean drawBorder

height

protected int height

name

protected String name

visible

protected boolean visible

width

protected int width

xPos

protected int xPos

yPos

protected int yPos

Constructor Detail

Widget

public Widget(GL gl, String name, SDLRect dimensions, String backgroundTexturePath)

Method Detail

contains

public boolean contains(SDLRect rect)
Describe contains method here.

Parameters: rect a SDLRect value

Returns: a boolean value

contains

public boolean contains(int x, int y)
x and y absolute

draw

public void draw(GL gl)
Describe draw method here.

Parameters: gl a GL value

draw

public void draw(GL gl, int x, int y)
Draw myself at the given co-ordinates

Parameters: gl a GL value x an int value y an int value

getBackgroundTexture

public Texture getBackgroundTexture()
Gets the value of backgroundTexture

Returns: the value of backgroundTexture

getHeight

public int getHeight()
Gets the value of height

Returns: the value of height

getName

public String getName()
Gets the value of name

Returns: the value of name

getWidth

public int getWidth()
Gets the value of width

Returns: the value of width

getX

public int getX()
Gets the value of x

Returns: the value of x

getY

public int getY()
Gets the value of y

Returns: the value of y

handleEvent

public void handleEvent(SDLEvent event)
Describe handleEvent method here.

Parameters: event a SDLEvent value

hide

public void hide()
Describe hide method here.

isVisible

public boolean isVisible()
Describe isVisible method here.

Returns: a boolean value

mouseEntered

public void mouseEntered()

mouseExit

public void mouseExit()

setBackgroundTexture

public void setBackgroundTexture(Texture argBackgroundTexture)
Sets the value of backgroundTexture

Parameters: argBackgroundTexture Value to assign to this.backgroundTexture

setHeight

public void setHeight(int argHeight)
Sets the value of height

Parameters: argHeight Value to assign to this.height

setName

public void setName(String argName)
Sets the value of name

Parameters: argName Value to assign to this.name

setWidth

public void setWidth(int argWidth)
Sets the value of width

Parameters: argWidth Value to assign to this.width

setX

public void setX(int argX)
Sets the value of x

Parameters: argX Value to assign to this.x

setY

public void setY(int argY)
Sets the value of y

Parameters: argY Value to assign to this.y

show

public void show()
Describe show method here.