| org.netbeans.microedition.lcdui.AbstractInfoScreen
All known Subclasses: org.netbeans.microedition.lcdui.WaitScreen, org.netbeans.microedition.lcdui.SplashScreen,
AbstractInfoScreen | abstract public class AbstractInfoScreen extends Canvas (Code) | | An abstract class serving as a parent for SplashScreen and WaitScreen. This class provides
the basic visualization of the screen.
When this screen is displayed, it can display either supplied text or image. The current implementation
shows both, text and image, centered in the middle of the display.
> Please note, in previous version this component automatically switched to displayables
specified by setNextDisplayable() method, but this approach has been deprecated in favor
of using static command and calling CommandListener's commandAction() method when an action
happens. This gives the developer much higher flexibility for processing the action - it
is no longer limited to switching to another displayable, but it can do whatever developer wants.
author: breh |
Constructor Summary | |
public | AbstractInfoScreen(Display display) Creates a new instance of AbstractInfoScreen
Parameters: display - display parameter. | public | AbstractInfoScreen(Display display, ColorSchema colorSchema) Creates a new instance of AbstractInfoScreen
Parameters: display - display parameter. |
Method Summary | |
public ColorSchema | getColorSchema() | final protected CommandListener | getCommandListener() | protected Display | getDisplay() | public Image | getImage() Gets the image to be painted on the screen. | protected Alert | getNextAlert() | protected Displayable | getNextDisplayable() | public String | getText() Gets the text to be painted on the screen. | public Font | getTextFont() Gets the current font used to paint the text. | protected void | paint(Graphics g) | public void | setColorSchema(ColorSchema colorSchema) | public void | setCommandListener(CommandListener commandListener) | public void | setImage(Image image) Sets image to be painted on the screen. | public void | setNextDisplayable(Displayable nextDisplayable) Sets the displayable to be used to switch when the screen is being dismissed. | public void | setNextDisplayable(Alert nextAlert, Displayable nextDisplayable) Requests that the specified Alert is going to be shown in the case of
screen dismiss, and nextDisplayable be made current after the Alert is dismissed.
The nextDisplayable parameter cannot be Alert and in the case
nextAlert is not null, it also cannot be null.
Parameters: nextAlert - alert to be shown, or null if the component should return back to the original screen Parameters: nextDisplayable - a displayable to be shown after the alert is being dismissed. | public void | setText(String text) Sets the text to be painted on the screen. | public void | setTextFont(Font font) Sets the font to be used to paint the specified text. | protected void | showNotify() sets value of previous displayable. | protected void | sizeChanged(int w, int h) repaints the screen whem a size has changed. | protected static void | switchToDisplayable(Display display, Alert alert, Displayable displayable) | protected void | switchToNextDisplayable() |
AbstractInfoScreen | public AbstractInfoScreen(Display display, ColorSchema colorSchema)(Code) | | Creates a new instance of AbstractInfoScreen
Parameters: display - display parameter. Cannot be null Parameters: colorSchema - color schema to be used for this component. If null, SystemColorSchema is used. throws: java.lang.IllegalArgumentException - if the display parameter is null |
getColorSchema | public ColorSchema getColorSchema()(Code) | | Gets ColorSchema currently in use
|
getCommandListener | final protected CommandListener getCommandListener()(Code) | | Gets command listener assigned to this displayable
command listener assigned to this component or null if there is no command listener assigned |
getDisplay | protected Display getDisplay()(Code) | | Gets the used display object
display object |
getImage | public Image getImage()(Code) | | Gets the image to be painted on the screen.
image |
getNextAlert | protected Alert getNextAlert()(Code) | | gets the next alert
next alert |
getNextDisplayable | protected Displayable getNextDisplayable()(Code) | | Gets the next displayable
next displayable |
getText | public String getText()(Code) | | Gets the text to be painted on the screen.
text |
getTextFont | public Font getTextFont()(Code) | | Gets the current font used to paint the text.
text font |
paint | protected void paint(Graphics g)(Code) | | implementation of abstract method
Parameters: g - |
setColorSchema | public void setColorSchema(ColorSchema colorSchema)(Code) | | Sets ColorSchema
|
setCommandListener | public void setCommandListener(CommandListener commandListener)(Code) | | Sets command listener to this component
Parameters: commandListener - - command listener to be used |
setImage | public void setImage(Image image)(Code) | | Sets image to be painted on the screen. If set to null, no image
will be painted
Parameters: image - image to be painted. Can be null. |
setNextDisplayable | public void setNextDisplayable(Displayable nextDisplayable)(Code) | | Sets the displayable to be used to switch when the screen is being dismissed.
Parameters: nextDisplayable - displayable, or null if the component should switch backto the screen from which was displayed prior showing this component. |
setNextDisplayable | public void setNextDisplayable(Alert nextAlert, Displayable nextDisplayable) throws IllegalArgumentException(Code) | | Requests that the specified Alert is going to be shown in the case of
screen dismiss, and nextDisplayable be made current after the Alert is dismissed.
The nextDisplayable parameter cannot be Alert and in the case
nextAlert is not null, it also cannot be null.
Parameters: nextAlert - alert to be shown, or null if the component should return back to the original screen Parameters: nextDisplayable - a displayable to be shown after the alert is being dismissed. This displayablecannot be null if the nextAlert is not null and it also cannot beAlert. throws: java.lang.IllegalArgumentException - If the nextAlert is not null and nextDisplayable is null at the same time, orif the nextDisplayable is instance of Alert |
setText | public void setText(String text)(Code) | | Sets the text to be painted on the screen.
Parameters: text - text to be painter, or null if no text should be shown |
setTextFont | public void setTextFont(Font font)(Code) | | Sets the font to be used to paint the specified text. If set
to null, the default font (Font.STATIC_TEXT_FONT) will be used.
Parameters: font - font to be used to paint the text. May be null. |
showNotify | protected void showNotify()(Code) | | sets value of previous displayable. Implementation should always
call this super implementation when overriding this method
|
sizeChanged | protected void sizeChanged(int w, int h)(Code) | | repaints the screen whem a size has changed.
|
switchToDisplayable | protected static void switchToDisplayable(Display display, Alert alert, Displayable displayable)(Code) | | Switch to the given displayable and alert
Parameters: display - Parameters: alert - Parameters: displayable - |
switchToNextDisplayable | protected void switchToNextDisplayable()(Code) | | switch to the next displayable (or alert)
|
|
|