|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.microedition.lcdui.Displayable
javax.microedition.lcdui.Canvas
org.netbeans.microedition.lcdui.LoginScreen
public class LoginScreen
The LoginScreen
custom component provides usefully UI with standard
elements like Username Filed, Password Field and Login Button
Field Summary | |
---|---|
static javax.microedition.lcdui.Command |
LOGIN_COMMAND
|
Fields inherited from class javax.microedition.lcdui.Canvas |
---|
DOWN, FIRE, GAME_A, GAME_B, GAME_C, GAME_D, KEY_NUM0, KEY_NUM1, KEY_NUM2, KEY_NUM3, KEY_NUM4, KEY_NUM5, KEY_NUM6, KEY_NUM7, KEY_NUM8, KEY_NUM9, KEY_POUND, KEY_STAR, LEFT, RIGHT, UP |
Constructor Summary | |
---|---|
LoginScreen(javax.microedition.lcdui.Display display)
Creates a new instance of LoginScreen for given Display object. |
Method Summary | |
---|---|
void |
commandAction(javax.microedition.lcdui.Command c,
javax.microedition.lcdui.Displayable d)
Indicates that a command event has occurred on Displayable d. |
ColorSchema |
getColorSchema()
Returns component's color schema. |
javax.microedition.lcdui.CommandListener |
getCommandListener()
Returns command listener. |
javax.microedition.lcdui.Display |
getDisplay()
Returns dispaly object. |
java.lang.String |
getPassword()
Returns login password |
java.lang.String |
getUsername()
Returns login username |
protected void |
keyPressed(int keyCode)
Called when a key is pressed. |
protected void |
keyReleased(int keyCode)
Called when a key is released. |
protected void |
paint(javax.microedition.lcdui.Graphics graphics)
Paints this canvas. |
void |
setBackgroundImageAnchorPoint(int anchorPoint)
Sets backbround image anchor point. |
void |
setBGColor(int color)
Sets component's background color. |
void |
setCommandListener(javax.microedition.lcdui.CommandListener l)
Sets component's command listener. |
void |
setDefaulBorderStyles()
Sets default border styles. |
void |
setDefaultFonts()
Default border styles. |
void |
setFGColor(int color)
Sets component's foreground color. |
void |
setFonts(javax.microedition.lcdui.Font titleFont,
javax.microedition.lcdui.Font inputFont,
javax.microedition.lcdui.Font loginButtonFont)
Sets login screen fonts. |
void |
setLabelTexts(java.lang.String usernameLabel,
java.lang.String passwordLabel)
Sets username and password label. |
void |
setLoginTitle(java.lang.String loginTitleText)
Sets login title text. |
void |
setPassword(java.lang.String password)
Sets predefined login password. |
void |
setUseLoginButton(boolean useLoginButton)
Sets use of the login button. |
void |
setUsername(java.lang.String username)
Sets predefined login username. |
protected void |
showNotify()
The implementation calls showNotify() immediately prior to this Canvas
being made visible on the display. |
protected void |
sizeChanged(int w,
int h)
Called when the drawable area of the Canvas has been changed. |
Methods inherited from class javax.microedition.lcdui.Canvas |
---|
getGameAction, getKeyCode, getKeyName, hasPointerEvents, hasPointerMotionEvents, hasRepeatEvents, hideNotify, isDoubleBuffered, keyRepeated, pointerDragged, pointerPressed, pointerReleased, repaint, repaint, serviceRepaints, setFullScreenMode |
Methods inherited from class javax.microedition.lcdui.Displayable |
---|
addCommand, getHeight, getTicker, getTitle, getWidth, isShown, removeCommand, setTicker, setTitle |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static javax.microedition.lcdui.Command LOGIN_COMMAND
Constructor Detail |
---|
public LoginScreen(javax.microedition.lcdui.Display display)
LoginScreen
for given Display
object.
display
- a non-null Display
object.Method Detail |
---|
public void setUsername(java.lang.String username)
username
- predifined login usernamepublic java.lang.String getUsername()
String
valuepublic void setPassword(java.lang.String password)
password
- predefined login passwordpublic java.lang.String getPassword()
String
valuepublic void setLoginTitle(java.lang.String loginTitleText)
loginTitleText
- login title textpublic void setUseLoginButton(boolean useLoginButton)
useLoginButton
- Boolean.TRUE
login buton in used, Boolean.FALSE
login button is NOT usedpublic void setLabelTexts(java.lang.String usernameLabel, java.lang.String passwordLabel)
usernameLabel
- username labelpasswordLabel
- password labelpublic javax.microedition.lcdui.Display getDisplay()
public void setDefaulBorderStyles()
public void setDefaultFonts()
public void setFonts(javax.microedition.lcdui.Font titleFont, javax.microedition.lcdui.Font inputFont, javax.microedition.lcdui.Font loginButtonFont)
titleFont
- fonts used in titleinputFont
- font used in username and password text fieldsloginButtonFont
- fonts used in login buttonpublic void setBackgroundImageAnchorPoint(int anchorPoint)
anchorPoint
- image anchor paintprotected void showNotify()
Canvas
being made visible on the display. Canvas
subclasses may override this method
to perform tasks before being shown, such as setting up animations, starting
timers, etc.
showNotify
in class javax.microedition.lcdui.Canvas
protected void sizeChanged(int w, int h)
Canvas
has been changed. This method
has augmented semantics compared to Displayable.sizeChanged.
In addition to the causes listed in Displayable.sizeChanged, a size
change can occur on a Canvas
because of a change between normal and full-screen modes.
If the size of a Canvas
changes while it is actually visible on the display,
it may trigger an automatic repaint request. If this occurs, the call to size Changed will
occur prior to the call to paint. If the Canvas
has become smaller, the
implementation may choose not to trigger a repaint request if the remaining
contents of the Canvas
have been preserved. Similarly, if the Canvas
has become
larger, the implementation may choose to trigger a repaint only for the new region.
In both cases, the preserved contents must remain stationary with respect to the origin
of the Canvas
. If the size change is significant to the contents of the Canvas
,
the application must explicitly issue a repaint request for the changed areas.
Note that the application's repaint request should not cause multiple repaints,
since it can be coalesced with repaint requests that are already pending.
If the size of a Canvas
changes while it is not visible, the implementation
may choose to delay calls to sizeChanged until immediately prior to the call
to showNotify. In that case, there will be only one call to sizeChanged,
regardless of the number of size changes.
An application that is sensitive to size changes can update instance
variables in its implementation of sizeChanged. These updated values
will be available to the code in the showNotify, hideNotify, and paint methods.
sizeChanged
in class javax.microedition.lcdui.Canvas
w
- the new width in pixels of the drawable area of the Canvas
h
- the new height in pixels of the drawable area of the Canvas
public ColorSchema getColorSchema()
protected void paint(javax.microedition.lcdui.Graphics graphics)
paint
in class javax.microedition.lcdui.Canvas
graphics
- the Graphics
object to be used for rendering the Canvas
protected void keyReleased(int keyCode)
keyReleased
in class javax.microedition.lcdui.Canvas
keyCode
- the key code of the key that was releasedprotected void keyPressed(int keyCode)
keyPressed
in class javax.microedition.lcdui.Canvas
keyCode
- the key code of the key that was pressedpublic void setCommandListener(javax.microedition.lcdui.CommandListener l)
setCommandListener
in class javax.microedition.lcdui.Displayable
l
- CommandListenerpublic javax.microedition.lcdui.CommandListener getCommandListener()
public void setBGColor(int color)
color
- background colorpublic void setFGColor(int color)
color
- foreground colorpublic void commandAction(javax.microedition.lcdui.Command c, javax.microedition.lcdui.Displayable d)
commandAction
in interface javax.microedition.lcdui.CommandListener
c
- a Command
object identifying the command. This is either
one of the applications have been added to Displayable
with addCommand(Command)
or is the implicit SELECT_COMMAND
of List.d
- the Displayable
on which this event has occurred
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |