|
||||||||||
| 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
de.enough.polish.ui.Screen
de.enough.polish.ui.Form
de.enough.polish.ui.FramedForm
public class FramedForm
Allows to split up a form into several frames.
The main frame is used for the normal content. Additional frames can be used for keeping GUI elements always in the same position, regardless whether the form is scrolled.
Copyright (c) Enough Software 2005 - 2008
history
14-Apr-2005 - rob creation
| Field Summary | |
|---|---|
protected Container |
bottomFrame
|
protected Container |
currentlyActiveContainer
|
protected Container |
leftFrame
|
protected Container |
rightFrame
|
protected Container |
topFrame
|
| 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 | |
|---|---|
FramedForm(java.lang.String title)
Creates a new FramedForm |
|
FramedForm(java.lang.String title,
Style style)
Creates a new FramedForm |
|
| Method Summary | |
|---|---|
void |
animate(long currentTime,
ClippingRegion repaintRegion)
Animates this screen. |
void |
append(int frameOrientation,
javax.microedition.lcdui.Item item)
|
void |
append(int frameOrientation,
Item item)
Adds the given item to the specifid frame. |
void |
append(int frameOrientation,
Item item,
Style itemStyle)
Adds the given item to the specifid frame. |
int |
append(javax.microedition.lcdui.Item item)
Adds an Item into the Form. |
protected void |
calculateContentArea(int x,
int y,
int width,
int height)
Calculates and sets the content area for this screen. |
protected boolean |
checkForRequestInit(Item source)
Checks if this screen's content area should be refreshed when the specified item has changed it's size. |
void |
delete(int frameOrientation,
int itemNum)
Removes the given item from the specifid frame. |
void |
deleteAll()
Deletes all the items from all frames of this FramedForm, leaving it with zero items. |
void |
deleteAll(int frameOrientation)
Removes all items from the specifid frame. |
boolean |
deleteFrame(int frameOrientation)
Deletes a complete frame. |
Item |
getCurrentItem()
Retrieves the currently focused item. |
protected Item[] |
getRootItems()
Retrieves all root-items of this screen. |
protected boolean |
handleCommand(javax.microedition.lcdui.Command cmd)
Tries to handle the specified command. |
protected boolean |
handleKeyPressed(int keyCode,
int gameAction)
Handles the key-pressed event. |
protected boolean |
handleKeyReleased(int keyCode,
int gameAction)
Handles the key-released event. |
protected boolean |
handleKeyRepeated(int keyCode,
int gameAction)
Handles the key-repeated event. |
protected boolean |
handlePointerPressed(int x,
int y)
Handles the pressing of a pointer. |
protected boolean |
handlePointerReleased(int x,
int y)
Handles the release of a pointer. |
protected void |
paintScreen(javax.microedition.lcdui.Graphics g)
Paints the screen. |
protected void |
requestInit()
Reinitializes this screen's content area. |
void |
set(int frameIndex,
int itemNumber,
javax.microedition.lcdui.Item item)
|
void |
set(int frameOrientation,
int itemNum,
Item item)
Updates an existing item in the specified frame |
void |
set(int itemNumber,
javax.microedition.lcdui.Item item)
|
void |
setActiveFrame(int frameOrientation)
Focuses the specified frame. |
void |
setItemStateListener(javax.microedition.lcdui.ItemStateListener listener)
Sets the ItemStateListener for the Screen,
replacing any previous ItemStateListener. |
void |
setStyle(Style style)
Sets the style of this screen. |
int |
size(int frameOrientation)
Retrieves the size of the specified frame. |
| Methods inherited from class de.enough.polish.ui.Form |
|---|
append, append, append, append, append, append, createCssSelector, delete, get, insert, insert, set, set, size |
| Methods inherited from class javax.microedition.lcdui.Canvas |
|---|
getKeyCode, getKeyName, hasPointerEvents, hasPointerMotionEvents, hasRepeatEvents, isDoubleBuffered, repaint, repaint, serviceRepaints |
| Methods inherited from class javax.microedition.lcdui.Displayable |
|---|
getHeight, getTicker, getWidth, setTicker |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Container leftFrame
protected Container rightFrame
protected Container topFrame
protected Container bottomFrame
protected Container currentlyActiveContainer
| Constructor Detail |
|---|
public FramedForm(java.lang.String title)
title - the title of this form
public FramedForm(java.lang.String title,
Style style)
title - the title of this formstyle - the style of this form, usually set with a #style directive| Method Detail |
|---|
public void deleteAll()
FramedForm, leaving it with zero items.
This method does nothing if the FramedForm is already empty.
deleteAll in class Formpublic void deleteAll(int frameOrientation)
frameOrientation - either Graphics.TOP, Graphics.BOTTOM, Graphics.LEFT or Graphics.RIGHT. Use -1 for the content frame.public int append(javax.microedition.lcdui.Item item)
FormItem into the Form.
The newly
added Item becomes the last Item in the
Form, and the size of the Form grows
by one.
This method is only provided for being able to add native items as well as custom items to a J2ME Polish form
within an IDE.
append in class Formitem - the Item to be added.
public void set(int frameIndex,
int itemNumber,
javax.microedition.lcdui.Item item)
public void set(int itemNumber,
javax.microedition.lcdui.Item item)
public void append(int frameOrientation,
javax.microedition.lcdui.Item item)
public void setItemStateListener(javax.microedition.lcdui.ItemStateListener listener)
ScreenItemStateListener for the Screen,
replacing any previous ItemStateListener.
If
iListener is null, simply
removes the previous ItemStateListener.
setItemStateListener in class Screenlistener - the new listener, or null to remove it
public void append(int frameOrientation,
Item item)
frameOrientation - either Graphics.TOP, Graphics.BOTTOM, Graphics.LEFT or Graphics.RIGHTitem - the item
public void set(int frameOrientation,
int itemNum,
Item item)
frameOrientation - either Graphics.TOP, Graphics.BOTTOM, Graphics.LEFT or Graphics.RIGHTitemNum - the index of the previous itemitem - the new item
public void delete(int frameOrientation,
int itemNum)
itemNum parameter must be
within the range [0..size()-1], inclusive.
frameOrientation - either Graphics.TOP, Graphics.BOTTOM, Graphics.LEFT or Graphics.RIGHTitemNum - the index of the itempublic int size(int frameOrientation)
frameOrientation - either Graphics.TOP, Graphics.BOTTOM, Graphics.LEFT or Graphics.RIGHT
public boolean deleteFrame(int frameOrientation)
frameOrientation - either Graphics.TOP, Graphics.BOTTOM, Graphics.LEFT or Graphics.RIGHT
public void append(int frameOrientation,
Item item,
Style itemStyle)
frameOrientation - either Graphics.TOP, Graphics.BOTTOM, Graphics.LEFT or Graphics.RIGHTitem - the itemitemStyle - the style for that item, is ignored when null
protected void calculateContentArea(int x,
int y,
int width,
int height)
Screen
calculateContentArea in class Screenx - left start of the content area, might later be adjusted by an external scrollindicatory - top start of the content area, is adjusted by the top margin, title height, subtitle height,
info height and maybe ticker height (when the ticker should be painted at the top).width - width of the content area, might later be adjusted by an external scrollindicatorheight - height of the content area, is adjusted by the title height, subtitle height,
info height and ticker height.protected boolean checkForRequestInit(Item source)
Screen
checkForRequestInit in class Screensource - the source of the event
protected void requestInit()
Screen
requestInit in class Screenprotected void paintScreen(javax.microedition.lcdui.Graphics g)
Screen
paintScreen in class Screeng - the graphics on which the screen should be paintedScreen.contentX,
Screen.contentY,
Screen.contentWidth,
Screen.contentHeight,
Screen.paintScrollIndicator,
Screen.paintScrollIndicatorUp,
Screen.paintScrollIndicatorDown
protected boolean handleKeyPressed(int keyCode,
int gameAction)
Screen
handleKeyPressed in class ScreenkeyCode - the code of the pressed key, e.g. Canvas.KEY_NUM2gameAction - the corresponding game-action, e.g. Canvas.UP
protected boolean handleKeyReleased(int keyCode,
int gameAction)
Screen
handleKeyReleased in class ScreenkeyCode - the code of the released key, e.g. Canvas.KEY_NUM2gameAction - the corresponding game-action, e.g. Canvas.UP
protected boolean handleKeyRepeated(int keyCode,
int gameAction)
Screen
handleKeyRepeated in class ScreenkeyCode - the code of the repeated key, e.g. Canvas.KEY_NUM2gameAction - the corresponding game-action, e.g. Canvas.UP
protected boolean handleCommand(javax.microedition.lcdui.Command cmd)
Screen
handleCommand in class Screencmd - the command
public Item getCurrentItem()
getCurrentItem in class Screenpublic void setActiveFrame(int frameOrientation)
frameOrientation - either Graphics.TOP, Graphics.BOTTOM, Graphics.LEFT, Graphics.RIGHT or -1 for the main/scrollable frame
protected boolean handlePointerPressed(int x,
int y)
Screen
handlePointerPressed in class Screenx - the absolute x position of the pointer pressingy - the absolute y position of the pointer pressing
protected boolean handlePointerReleased(int x,
int y)
Screen
handlePointerReleased in class Screenx - the absolute x position of the pointer pressingy - the absolute y position of the pointer pressing
public void animate(long currentTime,
ClippingRegion repaintRegion)
Screen
animate in class ScreencurrentTime - the current time in millisecondsrepaintRegion - the repaint area that needs to be updated when this item is animatedprotected Item[] getRootItems()
Screen
getRootItems in class Screenpublic void setStyle(Style style)
Screen
setStyle in class Screenstyle - the style
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||