|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfds.micro.ui.Component
fds.micro.ui.Hyperlink
This class implements a simple hyperlink without special visual effect when activated.
An object of this class is dedicated to be used within an object of fds.micro.ui.AbstractPanel sub-class (J2ME).
Warning: Use this class only if you want to have control on rendering. If possible, always prefer javax.microedition.lcdui.Item sub-classes.
You can read below a typical use within a class that inherit fds.micro.ui.RowPanel:
... this.append(new StringItem("Clic ")); final Hyperlink link = new Hyperlink("here"); link.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent evt) { // Link activated: Go to next screen Display.getDisplay(this.midlet).setCurrent(myNextScreen); } } ); this.append(link); this.append(new StringItem(" to continue.")); ...
Field Summary |
Fields inherited from class fds.micro.ui.Component |
INTERN_BOTTOM_VALIGN, INTERN_CENTER_HALIGN, INTERN_CENTER_VALIGN, INTERN_LEFT_HALIGN, INTERN_RIGHT_HALIGN, INTERN_TOP_VALIGN |
Constructor Summary | |
Hyperlink(java.lang.String text)
Build a button with a text inside. |
Method Summary | |
void |
activateLink()
Activate the hyperlink. |
void |
addActionListener(ActionListener listener)
Add a listener object that will receive action events produced by this component. |
java.lang.String |
getActionCommand()
Get the command associated with the hyperlink activation. |
java.lang.String |
getText()
Get the hyperlink text. |
javax.microedition.lcdui.Font |
getTextFont()
Get the font used to display the hyperlink text. |
void |
keyPressed(int keyCode,
int gameAction)
Called to notify the component that a key is pressed. |
void |
pointerPressed(int xpos,
int ypos)
Called to notify the component that pointer device was pressed. |
void |
removeActionListener(ActionListener listener)
Remove a listener. |
void |
setActionCommand(java.lang.String actionCommand)
Set a command string that will be associated with the hyperlink activation. |
void |
setMaximumSize(int width,
int height)
Set the maximum size for this component. |
void |
setText(java.lang.String text)
Change the hyperlink text. |
void |
setTextColor(int red,
int green,
int blue)
Set the button text color. |
void |
setTextColorOff(int red,
int green,
int blue)
Set the button text color used if the button is disabled. |
void |
setTextFont(javax.microedition.lcdui.Font textFont)
Change the font used to display the hyperlink text. |
void |
setUnderlineColor(int red,
int green,
int blue)
Set the underline color. |
Methods inherited from class fds.micro.ui.Component |
addFocusListener, addItemListener, equals, getHAlign, getHeight, getParent, getVAlign, getWidth, getX, getY, isDisabled, isHaveFocus, isHidden, isManageFocus, isOpaque, removeFocusListener, removeItemListener, setBackground, setDisabled, setFocusColor, setHAlign, setHidden, setLocation, setManageFocus, setOpaque, setVAlign |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Hyperlink(java.lang.String text)
text
- The text to display in the buttonMethod Detail |
public void activateLink()
public void addActionListener(ActionListener listener)
listener
- The listener to add.public java.lang.String getActionCommand()
public java.lang.String getText()
public javax.microedition.lcdui.Font getTextFont()
public void keyPressed(int keyCode, int gameAction)
keyPressed
in class Component
keyCode
- The key code.gameAction
- Game action corresponding to the key code.public void pointerPressed(int xpos, int ypos)
pointerPressed
in class Component
xpos
- The X position of pointer on parent Canvas.ypos
- The Y position of pointer on parent Canvas.public void removeActionListener(ActionListener listener)
listener
- The listener to remove.public void setActionCommand(java.lang.String actionCommand)
actionCommand
- The action command to set.public void setMaximumSize(int width, int height)
setMaximumSize
in class Component
width
- The maximum width.height
- The maximum height.public void setText(java.lang.String text)
text
- The new text to display.public void setTextColor(int red, int green, int blue)
red
- The red component of the color to set.green
- The green component of the color to set.blue
- The blue component of the color to set.public void setTextColorOff(int red, int green, int blue)
red
- The red component of the color to set.green
- The green component of the color to set.blue
- The blue component of the color to set.public void setTextFont(javax.microedition.lcdui.Font textFont)
textFont
- The hyperlink font.public void setUnderlineColor(int red, int green, int blue)
red
- The red component of the color to set.green
- The green component of the color to set.blue
- The blue component of the color to set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |