ch.sahits.game.graphic.display
Interface ISahitsComponent

All Known Subinterfaces:
ISahitsLabel
All Known Implementing Classes:
AbstractEditableSahitsComponent, AbstractMultiselectableComponent, AbstractSahitsComponent, AbstractSelectableComponent, Button, Label, RadioButton, Slider, Spinner, TextInput

public interface ISahitsComponent

The ISahitsComponent is a renderable form element whithin a ISahitsContainer. It is the equivalent to a JComponent in swing.

Author:
Andi Hotz, (c) Sahits GmbH, 2011 Created on Jun 5, 2011

Method Summary
 Rectangle getBounds()
          Retrieve the bounds of the component
 Font getFont()
          Retrieve the font
 Dimension getPreferredSize()
          Retrieve the preferred size of the component.
 void paint(Graphics g)
          Draw the component with the appropriate graphic context.
 void setBounds(int x, int y, int width, int height)
          Define the measurements of the component
 void setFont(Font f)
          Set the font
 void setInsets(int top, int right, int bottom, int left)
          Define the insets of the component
 

Method Detail

paint

void paint(Graphics g)
Draw the component with the appropriate graphic context. Before calling this method make sure it is appropriately initialized.

Parameters:
g -

setBounds

void setBounds(int x,
               int y,
               int width,
               int height)
Define the measurements of the component

Parameters:
x - position along the x axis
y - position along the y axis
width - of the component
height - of the component

getPreferredSize

Dimension getPreferredSize()
Retrieve the preferred size of the component.

Returns:

setInsets

void setInsets(int top,
               int right,
               int bottom,
               int left)
Define the insets of the component

Parameters:
top -
right -
bottom -
left -

getFont

Font getFont()
Retrieve the font

Returns:

setFont

void setFont(Font f)
Set the font

Parameters:
f -

getBounds

Rectangle getBounds()
Retrieve the bounds of the component

Returns:


Copyright © 2011 Sahits GmbH. All Rights Reserved.