ch.sahits.game.graphic.layout
Class AbstractSelectableComponent

java.lang.Object
  extended by ch.sahits.game.graphic.layout.AbstractSahitsComponent
      extended by ch.sahits.game.graphic.layout.AbstractSelectableComponent
All Implemented Interfaces:
ISahitsComponent, IUpdatableComponent
Direct Known Subclasses:
RadioButton

public abstract class AbstractSelectableComponent
extends AbstractSahitsComponent
implements IUpdatableComponent


Field Summary
private  Font font
           
private  FontMetrics metrics
           
private  boolean selected
           
 
Fields inherited from class ch.sahits.game.graphic.layout.AbstractSahitsComponent
painter
 
Constructor Summary
AbstractSelectableComponent(FontMetrics metrics)
           
 
Method Summary
 void gameRender(Graphics gScr)
          Force the panel to render itself.
 void gameUpdate()
          Force the panel to update its state.
 Font getFont()
          Retrieve the font
protected  FontMetrics getFontMetrics()
           
 boolean isSelected()
           
 void setFont(Font f)
          Set the font
 void setSelected(boolean selected)
           
 void testKeyPress(KeyEvent e)
          Key events are not handled
 
Methods inherited from class ch.sahits.game.graphic.layout.AbstractSahitsComponent
createVisualBounds, getBounds, getInsets, setBounds, setInsets
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ch.sahits.game.graphic.display.IUpdatableComponent
testClick
 
Methods inherited from interface ch.sahits.game.graphic.display.ISahitsComponent
getPreferredSize, paint
 

Field Detail

font

private Font font

selected

private boolean selected

metrics

private final FontMetrics metrics
Constructor Detail

AbstractSelectableComponent

public AbstractSelectableComponent(FontMetrics metrics)
Method Detail

getFontMetrics

protected FontMetrics getFontMetrics()

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

isSelected

public boolean isSelected()

setSelected

public void setSelected(boolean selected)

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)
Key events are not handled

Specified by:
testKeyPress in interface IUpdatableComponent


Copyright © 2011 Sahits GmbH. All Rights Reserved.