gr.bluevibe.fire.components
Class Component

java.lang.Object
  extended bygr.bluevibe.fire.components.Component
Direct Known Subclasses:
DateTimeRow, FGauge, FTicker, ListBox, ListElement, Movie, Panel, Row

public class Component
extends java.lang.Object

Fire Components are pretty much the same as Components in j2se. Every component has a paint method and it is expected to draw its contents inside a rectangle of given width/height. A component can have commands associated with it.

Author:
padeler

Constructor Summary
Component()
           
 
Method Summary
 void addCommand(javax.microedition.lcdui.Command c)
          Add a command to the components.
 boolean clock()
          Animated components receive clock events in order to update their animation.
 boolean equals(java.lang.Object o)
           
protected  void fireValidateEvent()
           
protected  boolean generateEvent()
           
 int getHeight()
           
 int getMinHeight()
           
 int getMinWidth()
           
 int getWidth()
           
 boolean isAnimated()
          If a componets states that it is animated, it will receive periodically clock events in order to update its animation.
 boolean isSelected()
           
 boolean isTraversable()
          If a component is traversable it can have commands associated with it and receive key and tap events (and vice versa).
 boolean keyEvent(int key)
          Key events are propagated from FireScreen down to the components of the panel or the popup that contains them.
 void paint(javax.microedition.lcdui.Graphics g)
          Paint is called by the container of the component to allow it to draw itself on Graphics g The drawable area on g is (0,0,width,height).
 boolean pointerEvent(int x, int y)
           
 void setCommandListener(CommandListener listener)
           
protected  void setContainerCurrent()
           
protected  void setCurrent(javax.microedition.lcdui.Displayable d)
           
 void setHeight(int height)
           
 void setMinHeight(int minHeight)
           
 void setMinWidth(int minWidth)
           
 void setSelected(boolean v)
          Sets this component on/off selected mode.
 void setWidth(int width)
           
 void validate()
          A validate event requests from the component to recalculate its internal properties suck as width/height etc.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Component

public Component()
Method Detail

paint

public void paint(javax.microedition.lcdui.Graphics g)
Paint is called by the container of the component to allow it to draw itself on Graphics g The drawable area on g is (0,0,width,height).

Parameters:
g - the area on witch the component will draw it self.

isTraversable

public boolean isTraversable()
If a component is traversable it can have commands associated with it and receive key and tap events (and vice versa).

Returns:

isAnimated

public boolean isAnimated()
If a componets states that it is animated, it will receive periodically clock events in order to update its animation.

Returns:

clock

public boolean clock()
Animated components receive clock events in order to update their animation.

Returns:
true if repainting is needed after the clock event.

setSelected

public void setSelected(boolean v)
Sets this component on/off selected mode.

Parameters:
v -

isSelected

public boolean isSelected()

keyEvent

public boolean keyEvent(int key)
Key events are propagated from FireScreen down to the components of the panel or the popup that contains them. If a component if not traversable it will not recieve key events.

Parameters:
key -
Returns:

pointerEvent

public boolean pointerEvent(int x,
                            int y)

validate

public void validate()
A validate event requests from the component to recalculate its internal properties suck as width/height etc.


getHeight

public int getHeight()

setHeight

public void setHeight(int height)

getMinHeight

public int getMinHeight()

setMinHeight

public void setMinHeight(int minHeight)

getMinWidth

public int getMinWidth()

setMinWidth

public void setMinWidth(int minWidth)

getWidth

public int getWidth()

setWidth

public void setWidth(int width)

addCommand

public void addCommand(javax.microedition.lcdui.Command c)
Add a command to the components. If a components has a command assosiated with it, then it is considered traversable.

Parameters:
c -

setCommandListener

public void setCommandListener(CommandListener listener)

generateEvent

protected final boolean generateEvent()

equals

public boolean equals(java.lang.Object o)

fireValidateEvent

protected void fireValidateEvent()

setCurrent

protected void setCurrent(javax.microedition.lcdui.Displayable d)

setContainerCurrent

protected void setContainerCurrent()