extra.ui
Class Title

java.lang.Object
  |
  +--waba.ui.Control
        |
        +--extra.ui.Title
All Implemented Interfaces:
PreferredSize

public class Title
extends Control
implements PreferredSize

A standard palm title bar. Doesn't do anything, just sits at the top of the screen and displays the title of the application. May link any presses on the bar to menus later.


Constructor Summary
Title()
          Construct a new title with the text "Untitled"
Title(String name)
          Construct a new title with the given text
 
Method Summary
 int getPreferredHeight(FontMetrics fm)
           
 int getPreferredWidth(FontMetrics fm)
           
 void onEvent(Event event)
          Called to process key, pen, control and other posted events.
 void onPaint(Graphics g)
          Called to draw the control.
 void setText(String title)
           
 
Methods inherited from class waba.ui.Control
addTimer, contains, createGraphics, getFontMetrics, getNext, getParent, getRect, postEvent, removeTimer, repaint, setRect
 
Methods inherited from class java.lang.Object
equals, hashCode, toString
 

Constructor Detail

Title

public Title()
Construct a new title with the text "Untitled"

Title

public Title(String name)
Construct a new title with the given text
Parameters:
name - the title
Method Detail

setText

public void setText(String title)

getPreferredWidth

public int getPreferredWidth(FontMetrics fm)
Specified by:
getPreferredWidth in interface PreferredSize

getPreferredHeight

public int getPreferredHeight(FontMetrics fm)
Specified by:
getPreferredHeight in interface PreferredSize

onPaint

public void onPaint(Graphics g)
Description copied from class: Control
Called to draw the control. When this method is called, the graphics object passed has been translated into the coordinate system of the control and the area behind the control has already been painted. The background is painted by the top-level window control.
Overrides:
onPaint in class Control
Following copied from class: waba.ui.Control
Parameters:
g - the graphics object for drawing
See Also:
Graphics

onEvent

public void onEvent(Event event)
Description copied from class: Control
Called to process key, pen, control and other posted events.
Overrides:
onEvent in class Control
Following copied from class: waba.ui.Control
Parameters:
event - the event to process
See Also:
Event, KeyEvent, PenEvent