ch.sahits.game.graphic.layout
Class Spinner

java.lang.Object
  extended by ch.sahits.game.graphic.layout.AbstractSahitsComponent
      extended by ch.sahits.game.graphic.layout.AbstractMultiselectableComponent<String>
          extended by ch.sahits.game.graphic.layout.Spinner
All Implemented Interfaces:
ISahitsComponent, IUpdatableComponent

public class Spinner
extends AbstractMultiselectableComponent<String>


Field Summary
private  Rectangle downSpinner
           
private  FontMetrics metric
           
private  int TEXT_INSET
           
private  Rectangle upSpinner
           
 
Fields inherited from class ch.sahits.game.graphic.layout.AbstractMultiselectableComponent
selectables
 
Fields inherited from class ch.sahits.game.graphic.layout.AbstractSahitsComponent
painter
 
Constructor Summary
Spinner(FontMetrics fm)
           
 
Method Summary
 Dimension getPreferredSize()
          Retrieve the preferred size of the component.
 void paint(Graphics g)
          Draw the component with the appropriate graphic context.
 void testClick(MouseEvent e)
           
 void testClick(Point p)
          Test if there was a mouse click on the component
 
Methods inherited from class ch.sahits.game.graphic.layout.AbstractMultiselectableComponent
add, decSelection, gameRender, gameUpdate, getFont, getItem, getItemCount, getSelected, getSelectedIndex, incSelection, setFont, setSelected, testKeyPress
 
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
 

Field Detail

upSpinner

private Rectangle upSpinner

downSpinner

private Rectangle downSpinner

metric

private final FontMetrics metric

TEXT_INSET

private final int TEXT_INSET
See Also:
Constant Field Values
Constructor Detail

Spinner

public Spinner(FontMetrics fm)
Method Detail

paint

public void paint(Graphics g)
Description copied from interface: ISahitsComponent
Draw the component with the appropriate graphic context. Before calling this method make sure it is appropriately initialized.


getPreferredSize

public Dimension getPreferredSize()
Description copied from interface: ISahitsComponent
Retrieve the preferred size of the component.

Returns:

testClick

public void testClick(MouseEvent e)

testClick

public void testClick(Point p)
Description copied from interface: IUpdatableComponent
Test if there was a mouse click on the component



Copyright © 2011 Sahits GmbH. All Rights Reserved.