public abstract class ComponentBase extends java.lang.Object implements IComponent
| Modifier and Type | Field and Description |
|---|---|
protected ILabeled |
label
The label of the component.
|
| Constructor and Description |
|---|
ComponentBase(ILabeled label)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
enter()
Should be called by the parent when the component is shown.
|
void |
exit()
Should be called by the parent when the component is hidden.
|
protected abstract int |
getHeight()
Return height of component.
|
void |
getHeight(Context context)
Get the current height via
Context.setHeight(int). |
java.lang.String |
getTitle()
Get the caption of the component.
|
void |
handleButton(Context context,
int button)
Should be called by the parent when a mouse button state changes.
|
void |
handleChar(Context context,
char character)
Should be called by the parent when a key is typed.
|
void |
handleKey(Context context,
int scancode)
Should be called by the parent when a key is typed.
|
void |
handleScroll(Context context,
int diff)
Should be called by the parent when the mouse wheel is scrolled.
|
boolean |
isVisible()
Check if component should be visible.
|
void |
render(Context context)
Redraw component on screen.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitreleaseFocusprotected final ILabeled label
public ComponentBase(ILabeled label)
label - the label for the componentpublic java.lang.String getTitle()
IComponentgetTitle in interface IComponentpublic void render(Context context)
IComponentContext.setHeight(int).render in interface IComponentcontext - the Context for the componentpublic void handleButton(Context context, int button)
IComponentContext.setHeight(int).handleButton in interface IComponentcontext - the Context for the componentbutton - the button that changed its stateIInterface.LBUTTON,
IInterface.RBUTTONpublic void handleKey(Context context, int scancode)
IComponentContext.setHeight(int).handleKey in interface IComponentcontext - the Context for the componentscancode - the scancode for the key that was typedpublic void handleChar(Context context, char character)
IComponentContext.setHeight(int).handleChar in interface IComponentcontext - the Context for the componentcharacter - the character that was typedpublic void handleScroll(Context context, int diff)
IComponentContext.setHeight(int).handleScroll in interface IComponentcontext - the Context for the componentdiff - the amount by which the wheel was movedpublic void getHeight(Context context)
IComponentContext.setHeight(int).getHeight in interface IComponentcontext - the Context for the componentpublic void enter()
IComponententer in interface IComponentpublic void exit()
IComponentexit in interface IComponentpublic boolean isVisible()
IComponentisVisible in interface IComponentprotected abstract int getHeight()