|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.incrediblesoft.redjey.Component
public abstract class Component
Field Summary | |
---|---|
static int |
BOTTOM_LAYOUT
|
static int |
DISABLED
|
static int |
H_EXPAND
Set this flag to say layout manager that this component is willing to have max available width; |
static int |
HCENTER_LAYOUT
|
static int |
HIGHLIGHTED
|
static int |
LEFT_LAYOUT
Layout constants |
static int |
NORMAL
Predefined component states |
static int |
PRESSED
|
static int |
RIGHT_LAYOUT
|
static int |
TOP_LAYOUT
|
static int |
TOTAL_STATES
|
static int |
V_EXPAND
Set this flag to say layout manager that this component is willing to have max available height; Not implemented yet. |
static int |
VCENTER_LAYOUT
|
Constructor Summary | |
---|---|
Component()
Constructs component |
|
Component(java.lang.String styleClassName)
Constructs component with a given style class |
Method Summary | |
---|---|
void |
addActionListener(ActionListener listener)
Adds action listener to this component. |
void |
addMouseListener(MouseListener listener)
Adds mouse listener to this component. |
void |
dispatchEvent(AbstractEvent event)
Dispatches event to children |
void |
fireActionEvent()
Generates and dispatched ActionEvent to listeners |
Rectangle |
getAbsoluteRect()
|
int |
getAbsoluteX()
Returns X-coordinate in device's screen coordinate system |
int |
getAbsoluteY()
Returns Y-coordinate in device's screen coordinate system |
int |
getAlignment()
Returns component alignment hints |
Rectangle |
getBounds()
|
Dimension |
getClientSize()
Returns client's area dimension |
int |
getContentAlignment()
Returns content alignment hints |
Style |
getCurrentStyle()
Returns current active style |
int |
getHeight()
Returns the height of component |
abstract java.lang.String |
getName()
This method is used to retrieve the appropriate style set from a hashtable of styles |
Component |
getParent()
Returns component's parent |
Dimension |
getPreferredSize()
Returns preferred size. |
int |
getState()
Returns current state |
Style |
getStyle(int state)
Returns style associated with a given component's state |
Style[] |
getStyleClass()
Returns the current set of styles. |
int |
getWidth()
Returns the width of component |
int |
getX()
|
int |
getY()
|
void |
invalidate()
Reset validation flag. |
void |
invalidateTree()
Invalidates all component tree hierarchy |
boolean |
isFocused()
Returns the focus state of component |
boolean |
isHighlightable()
Returns true if this component can be highlighted |
boolean |
isVisible()
Returns weather component is visible or not |
boolean |
keyPressed(int keycode)
Is not realized yet |
boolean |
keyReleased(int keycode)
Is not realized yet |
void |
paint(javax.microedition.lcdui.Graphics g)
Paints component. |
void |
removeActonListener(ActionListener listener)
Removes action listener from this component. |
void |
removeMouseListener(MouseListener listener)
Removes mouse listener from this component. |
void |
repaint()
Causes application triggered repaint request |
void |
repaint(int x,
int y,
int width,
int height)
Dispatched repaint request |
Component |
setAlignment(int anchor)
Sets component alignment hints. |
void |
setBounds(int x,
int y,
int width,
int height)
|
void |
setContentAlignment(int anchor)
Sets content alignment hints. |
void |
setLocation(int x,
int y)
Sets component location relative to parent's coordinates. |
void |
setPreferredSize(Dimension dim)
Sets the predefined preferred dimensions. |
void |
setSize(Dimension size)
Sets the size of component |
void |
setSize(int width,
int height)
Sets the size of component |
void |
setState(int state)
Sets component state (NORMAL, FOCUSED, DISABLED or custom one). |
void |
setStyle(Style style)
|
void |
setStyle(Style style,
int state)
Sets the style that will represent some state of component |
void |
setStyleClass(java.lang.String className)
Sets the set of styles of the corresponding class. |
void |
setTag(java.lang.String tag)
Assigns text label to component, to retrieve later from toString() method. |
void |
setVisible(boolean visible)
Set this component visible or not |
void |
setX(int x)
|
void |
setY(int y)
|
void |
tick(int dt)
Called every tick. |
java.lang.String |
toString()
|
void |
validate()
Validate component |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int LEFT_LAYOUT
public static final int RIGHT_LAYOUT
public static final int TOP_LAYOUT
public static final int BOTTOM_LAYOUT
public static final int HCENTER_LAYOUT
public static final int VCENTER_LAYOUT
public static final int H_EXPAND
public static final int V_EXPAND
public static final int NORMAL
public static final int HIGHLIGHTED
public static final int PRESSED
public static final int DISABLED
public static final int TOTAL_STATES
Constructor Detail |
---|
public Component()
public Component(java.lang.String styleClassName)
styleClassName
- style classMethod Detail |
---|
public abstract java.lang.String getName()
public Component getParent()
public boolean isHighlightable()
public int getWidth()
public int getHeight()
public void setSize(Dimension size)
size
- new sizepublic void setSize(int width, int height)
width
- widthheight
- heightpublic void setLocation(int x, int y)
x
- xy
- ypublic void setBounds(int x, int y, int width, int height)
public void setX(int x)
public void setY(int y)
public int getX()
public int getY()
public int getAbsoluteX()
public int getAbsoluteY()
public Rectangle getBounds()
public Rectangle getAbsoluteRect()
public Dimension getClientSize()
public Dimension getPreferredSize()
public void setPreferredSize(Dimension dim)
dim
- Dimensionpublic Component setAlignment(int anchor)
anchor
- See *_LAYOUT constantspublic int getAlignment()
public void setContentAlignment(int anchor)
anchor
- See *_LAYOUT constantspublic int getContentAlignment()
public void setState(int state)
state
- Component state indexpublic int getState()
public Style[] getStyleClass()
public void setStyleClass(java.lang.String className)
className
- The name of style class.public void setStyle(Style style)
public void setStyle(Style style, int state)
style
- style to setstate
- state to representpublic Style getCurrentStyle()
public Style getStyle(int state)
state
- component state
public void setVisible(boolean visible)
visible
- true / falsepublic boolean isVisible()
public boolean keyPressed(int keycode)
keycode
-
public boolean keyReleased(int keycode)
keycode
-
public void dispatchEvent(AbstractEvent event)
event
- public void fireActionEvent()
public boolean isFocused()
public void invalidate()
public void invalidateTree()
public void validate()
public void addActionListener(ActionListener listener)
listener
- action listenerpublic void removeActonListener(ActionListener listener)
listener
- action listenerpublic void addMouseListener(MouseListener listener)
listener
- mouse listenerpublic void removeMouseListener(MouseListener listener)
listener
- mouse listenerpublic void tick(int dt)
dt
- time in millisecondspublic void paint(javax.microedition.lcdui.Graphics g)
g
- Graphics objectpublic void repaint()
public void repaint(int x, int y, int width, int height)
x
- area xy
- area ywidth
- area widthheight
- area heightpublic void setTag(java.lang.String tag)
tag
- String labelpublic java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |