|
jMobileCore toolkit | |||||||
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
com.jmobilecore.ui.core.PlatformCanvas
com.jmobilecore.ui.core.ScreenCanvas
public class ScreenCanvas
A screen that contains Component
s.
Field Summary | |
---|---|
protected boolean |
adjustFocus
Indicated if focus ajjustment is required |
protected int |
bodyOffset
y-coordinate offset within the body of the first component to display. |
protected static int |
CANVAS_SCROLL_STEP
Scrolling step |
protected java.util.Vector |
components
Vector of GUI components |
protected int |
focusedIndex
Currently focused component. |
protected javax.microedition.lcdui.Image |
offScreen
Off the screen image for double buffer painting |
protected int |
paintAreaHeight
Height of the scrollable area (of current screen) in pixels |
protected Label |
screenTitle
Screen title |
static int |
SCROLL_DOWN
Scrolling direction. |
static int |
SCROLL_UP
Scrolling direction. |
protected SoftKeyBar |
softKeyBar
SoftKeyBar for current screen this component is not in components vector |
protected int |
softKeyBarHeight
Height of the scrollbar in pixels |
protected int |
titleHeight
Height of the title in pixels |
Fields inherited from class com.jmobilecore.ui.core.PlatformCanvas |
---|
DOUBLE_BUFFER, HEIGHT, KEY_CLEAR, KEY_DOWN, KEY_ENTER, KEY_FIRE, KEY_LEFT, KEY_PHONE_OFF, KEY_PHONE_ON, KEY_RIGHT, KEY_SOFT_LEFT, KEY_SOFT_RIGHT, KEY_UNDEFINED, KEY_UP, KEY_VOLUME_DOWN, KEY_VOLUME_UP, PLATFORM, PLATFORM_BARTEO, PLATFORM_LG, PLATFORM_MOTOROLA, PLATFORM_MOTOROLA_V, PLATFORM_NOKIA, PLATFORM_NOKIA_30, PLATFORM_SAMSUNG, PLATFORM_SIEMENS, PLATFORM_SONYERICSSON, PLATFORM_SUN_WTK, WIDTH |
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 | |
---|---|
ScreenCanvas()
Creates a new ScreenCanvas instance. |
|
ScreenCanvas(Label title)
Creates a new ScreenCanvas instance. |
|
ScreenCanvas(Label title,
SoftKeyBar softKeyBar)
Creates a new ScreenCanvas instance. |
Method Summary | |
---|---|
void |
add(Component component)
Adds the component to the screen. |
void |
add(Component component,
int index)
Adds the component to the screen at the given position. |
void |
changeFocus(int newIndex)
Moves the focus to the specified component. |
void |
destructor()
Class destructor. |
static void |
drawTriangle(javax.microedition.lcdui.Graphics g,
int tipX,
int tipY,
int maxHeight,
int direction,
int color)
Support method for painting scroller |
protected int |
getComponentsHeight()
Get height of all components |
protected int |
getFirstFocusable()
Gets first focusable component |
protected int |
getLastFocusable()
Gets the last focusable component |
protected int |
getNextFocusable()
Gets next focusable component |
protected int |
getPreviousFocusable()
Gets previous focusable component |
protected int |
getScrollDirections()
Returns the directions the body can be scrolled in. |
protected void |
keyPressed(int keyCode)
Processes a press of a key. |
void |
paint(javax.microedition.lcdui.Graphics g)
Paints the screen's body, which is all of the components that have been added to the screen. |
void |
paintBody(javax.microedition.lcdui.Graphics g)
Paints the screen's body, which is all of the components that have been added to the screen. |
protected void |
paintBodyBackground(javax.microedition.lcdui.Graphics g)
Paints the screen's body background |
protected void |
paintScroller(javax.microedition.lcdui.Graphics g)
Paint scrolling indicator(s) at the bottom of the screen to indicate that the display can scroll vertically. |
protected void |
recalcAdjustment()
|
void |
refocus()
Adjust the screen to make focused component visible |
void |
remove(Component component)
Removes the specified component from this container. |
void |
remove(int index)
Removes the component, specified by index from the screen |
void |
removeAll()
Removes all the components from this container. |
protected boolean |
scrollDown()
Scrolls CANVAS_SCROLL_STEP pixels down |
protected void |
scrollTop()
Scrolls to the top of the screen and sets first focusable component to focused state |
protected boolean |
scrollUp()
Scrolls CANVAS_SCROLL_STEP pixels up |
Methods inherited from class javax.microedition.lcdui.Canvas |
---|
getGameAction, getHeight, getKeyCode, getKeyName, getWidth, hasPointerEvents, hasPointerMotionEvents, hasRepeatEvents, hideNotify, isDoubleBuffered, keyReleased, keyRepeated, pointerDragged, pointerPressed, pointerReleased, repaint, repaint, serviceRepaints, showNotify |
Methods inherited from class javax.microedition.lcdui.Displayable |
---|
addCommand, isShown, removeCommand, setCommandListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean adjustFocus
recalcAdjustment()
,
refocus()
protected int bodyOffset
protected static final int CANVAS_SCROLL_STEP
protected java.util.Vector components
protected int focusedIndex
protected javax.microedition.lcdui.Image offScreen
protected int paintAreaHeight
protected Label screenTitle
public static final int SCROLL_DOWN
drawTriangle
public static final int SCROLL_UP
drawTriangle
protected SoftKeyBar softKeyBar
protected int softKeyBarHeight
protected int titleHeight
Constructor Detail |
---|
public ScreenCanvas()
ScreenCanvas
instance.
public ScreenCanvas(Label title)
ScreenCanvas
instance.
title
- The screen title, one line textpublic ScreenCanvas(Label title, SoftKeyBar softKeyBar)
ScreenCanvas
instance.
title
- Title for current screensoftKeyBar
- Container for soft keys for current screenMethod Detail |
---|
public void add(Component component)
components
one component per line
component
- the component to be addedpublic void add(Component component, int index)
components
one component per line
component
- the component to be addedindex
- the position at which to insert the component,
or -1
to append the component to the endpublic void changeFocus(int newIndex)
newIndex
- The index of component gaining focuspublic void destructor()
public static void drawTriangle(javax.microedition.lcdui.Graphics g, int tipX, int tipY, int maxHeight, int direction, int color)
paintScroller(javax.microedition.lcdui.Graphics)
protected int getComponentsHeight()
components
for current screenprotected int getFirstFocusable()
protected int getLastFocusable()
protected int getNextFocusable()
protected int getPreviousFocusable()
protected int getScrollDirections()
SCROLL_UP
and/or SCROLL_DOWN
protected void keyPressed(int keyCode)
keyPressed
in class javax.microedition.lcdui.Canvas
public void paint(javax.microedition.lcdui.Graphics g)
paint
in class javax.microedition.lcdui.Canvas
g
- Graphics contextpublic void paintBody(javax.microedition.lcdui.Graphics g)
g
- The graphics object to draw to.protected void paintBodyBackground(javax.microedition.lcdui.Graphics g)
g
- Graphics contextprotected void paintScroller(javax.microedition.lcdui.Graphics g)
g
- Graphics contextprotected void recalcAdjustment()
public void refocus()
public void remove(Component component)
component
- the component to be removedpublic void remove(int index)
index
from the screen
index
- the index of the component to be removed.public void removeAll()
protected boolean scrollDown()
CANVAS_SCROLL_STEP
pixels down
protected void scrollTop()
protected boolean scrollUp()
CANVAS_SCROLL_STEP
pixels up
|
jMobileCore toolkit | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |