sdljavax.gui
Class ListBox

java.lang.Object
  extended by sdljavax.gui.Widget
      extended by sdljavax.gui.ListBox
All Implemented Interfaces:
java.util.EventListener, SDLEventListener

public class ListBox
extends Widget

Describe class ListBox here.

Version:
$Id: ListBox.java,v 1.1 2005/02/10 04:20:18 ivan_ganza Exp $
Author:
Ivan Z. Ganza

Field Summary
(package private)  int firstVisibleRow
           
(package private)  java.util.List items
           
(package private)  float lineHeight
           
(package private)  int selectedRow
           
 
Fields inherited from class sdljavax.gui.Widget
backgroundTexture, border, container, defaultFont, drawBorder, height, name, visible, width, xPos, yPos
 
Constructor Summary
ListBox(GL gl, java.lang.String name, SDLRect dimensions, java.lang.String backgroundTexture)
          Construct a new ListBox.
 
Method Summary
 void add(java.lang.String i)
          Add an item to the list box
 void draw(GL gl, int x, int y)
          Draw myself at the given co-ordinates
 java.util.List getItems()
           
 void handleEvent(SDLEvent event)
          Describe handleEvent method here.
 void handleMouseMotionEvent(SDLMouseMotionEvent motionEvent)
           
 int whichRow(int y)
           
 
Methods inherited from class sdljavax.gui.Widget
contains, contains, draw, getBackgroundTexture, getHeight, getName, getWidth, getX, getY, hide, isVisible, mouseEntered, mouseExit, setBackgroundTexture, setHeight, setName, setWidth, setX, setY, show
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

items

java.util.List items

selectedRow

int selectedRow

firstVisibleRow

int firstVisibleRow

lineHeight

float lineHeight
Constructor Detail

ListBox

public ListBox(GL gl,
               java.lang.String name,
               SDLRect dimensions,
               java.lang.String backgroundTexture)
        throws java.io.IOException
Construct a new ListBox. Uses the defaultFont to display items.

Parameters:
font - a FTFont value
Throws:
java.io.IOException
Method Detail

add

public void add(java.lang.String i)
Add an item to the list box

Parameters:
i - a String value

getItems

public java.util.List getItems()

draw

public void draw(GL gl,
                 int x,
                 int y)
Description copied from class: Widget
Draw myself at the given co-ordinates

Overrides:
draw in class Widget
Parameters:
gl - a GL value
x - an int value
y - an int value

handleEvent

public void handleEvent(SDLEvent event)
Description copied from class: Widget
Describe handleEvent method here.

Specified by:
handleEvent in interface SDLEventListener
Overrides:
handleEvent in class Widget
Parameters:
event - a SDLEvent value

handleMouseMotionEvent

public void handleMouseMotionEvent(SDLMouseMotionEvent motionEvent)

whichRow

public int whichRow(int y)