ch.sahits.game.graphic.layout
Class AbstractMultiselectableComponent<T>
java.lang.Object
ch.sahits.game.graphic.layout.AbstractSahitsComponent
ch.sahits.game.graphic.layout.AbstractMultiselectableComponent<T>
- All Implemented Interfaces:
- ISahitsComponent, IUpdatableComponent
- Direct Known Subclasses:
- Slider, Spinner
public abstract class AbstractMultiselectableComponent<T>
- extends AbstractSahitsComponent
- implements IUpdatableComponent
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
font
private Font font
selectables
protected ArrayList<T> selectables
selectedIndex
private int selectedIndex
update
private boolean update
AbstractMultiselectableComponent
public AbstractMultiselectableComponent()
add
public void add(T item)
getSelected
public T getSelected()
incSelection
public void incSelection()
decSelection
public void decSelection()
getSelectedIndex
public final int getSelectedIndex()
getItemCount
public final int getItemCount()
getItem
public T getItem(int index)
setSelected
public void setSelected(int index)
getFont
public Font getFont()
- Description copied from interface:
ISahitsComponent
- Retrieve the font
- Specified by:
getFont in interface ISahitsComponent
- Returns:
setFont
public void setFont(Font f)
- Description copied from interface:
ISahitsComponent
- Set the font
- Specified by:
setFont in interface ISahitsComponent
gameRender
public void gameRender(Graphics gScr)
- Description copied from interface:
IUpdatableComponent
- Force the panel to render itself.
- Specified by:
gameRender in interface IUpdatableComponent
- Parameters:
gScr - Graphics used for the rendering
gameUpdate
public void gameUpdate()
- Description copied from interface:
IUpdatableComponent
- Force the panel to update its state.
- Specified by:
gameUpdate in interface IUpdatableComponent
testKeyPress
public void testKeyPress(KeyEvent e)
- Description copied from interface:
IUpdatableComponent
- Check the updatable components if the key press was in one of them
- Specified by:
testKeyPress in interface IUpdatableComponent
Copyright © 2011 Sahits GmbH. All Rights Reserved.