ch.sahits.game.graphic.layout
Class AbstractSahitsComponent

java.lang.Object
  extended by ch.sahits.game.graphic.layout.AbstractSahitsComponent
All Implemented Interfaces:
ISahitsComponent
Direct Known Subclasses:
AbstractEditableSahitsComponent, AbstractMultiselectableComponent, AbstractSelectableComponent, Button, Label

public abstract class AbstractSahitsComponent
extends Object
implements ISahitsComponent


Field Summary
private  Rectangle bounds
           
private  Insets insets
           
protected  ch.sahits.game.graphic.image.OpenPatricianSlabPainter painter
           
 
Constructor Summary
AbstractSahitsComponent()
           
 
Method Summary
protected  Rectangle2D createVisualBounds(String s)
          Create the visual bounds for the string using the set font
 Rectangle getBounds()
          Retrieve the bounds
protected  Insets getInsets()
          Retrieve the insets
 void setBounds(int x, int y, int width, int height)
          Define the measurements of the component
 void setInsets(int top, int right, int bottom, int left)
          Define the insets of the component
 
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.ISahitsComponent
getFont, getPreferredSize, paint, setFont
 

Field Detail

bounds

private Rectangle bounds

insets

private Insets insets

painter

protected final ch.sahits.game.graphic.image.OpenPatricianSlabPainter painter
Constructor Detail

AbstractSahitsComponent

public AbstractSahitsComponent()
Method Detail

getBounds

public Rectangle getBounds()
Retrieve the bounds

Specified by:
getBounds in interface ISahitsComponent
Returns:

setBounds

public void setBounds(int x,
                      int y,
                      int width,
                      int height)
Description copied from interface: ISahitsComponent
Define the measurements of the component

Specified by:
setBounds in interface ISahitsComponent
Parameters:
x - position along the x axis
y - position along the y axis
width - of the component
height - of the component

getInsets

protected Insets getInsets()
Retrieve the insets

Returns:

setInsets

public void setInsets(int top,
                      int right,
                      int bottom,
                      int left)
Description copied from interface: ISahitsComponent
Define the insets of the component

Specified by:
setInsets in interface ISahitsComponent

createVisualBounds

protected final Rectangle2D createVisualBounds(String s)
Create the visual bounds for the string using the set font

Parameters:
s - String to be used
Returns:
Rectangle representing the visual bounds of s


Copyright © 2011 Sahits GmbH. All Rights Reserved.