| java.lang.Object com.sun.midp.chameleon.CWindow com.sun.midp.chameleon.MIDPWindow
MIDPWindow | public class MIDPWindow extends CWindow (Code) | | The MIDPWindow class is a concrete instance of a CWindow which
implements the MIDP specification and its graphical elements,
such as a title bar, soft buttons, ticker, etc.
|
Method Summary | |
public boolean | addLayer(CLayer layer) Add the given layer to this window. | public boolean | belongToCmdLayers(int x, int y) | public boolean | bodyContainsPoint(int x, int y) Utility method to determine if the given point lies within
the bounds of body layer. | public void | callPaint(Graphics g, CGraphicsQ refreshQ) MIDPWindow overrides the parent paint method in order to
do special effects such as paint a "wash" over the background
when a dialog is up. | protected void | clearPopups() Internal method to clear all current popups. | public int | getBodyAnchorX() Get the current x anchor coordinate for the body layer (the body
layer renders the contents of the current displayable). | public int | getBodyAnchorY() Get the current y anchor coordinate for the body layer (the body
layer renders the contents of the current displayable). | public int | getBodyHeight() Get the current height of the body layer (the body
layer renders the contents of the current displayable). | public int[] | getBodyLayerBounds() | public int | getBodyWidth() Get the current width of the body layer (the body
layer renders the contents of the current displayable). | public Command | getSoftOne() Returns the left soft button (one). | public Command[] | getSoftTwo() Returns the command array tied to the right soft button (two). | public PopupLayer | getTopMostPopup() Gets the "top" most Popup layer added to this body layer. | public void | hideDisplayable(Displayable displayable) Alert this MIDPWindow that the given displayable is no longer
current and should be removed from the screen. | public boolean | isInFullScreenMode() Determines if window is in full screen mode. | public void | paintWash(boolean onOff) Called to paint a wash over the background of this window. | public boolean | removeLayer(CLayer layer) Remove the given layer from this window. | public void | repaintDisplayable(int x, int y, int w, int h) Request a repaint of a region of the current displayable.
This method specifically marks a region of the body layer
(which renders the displayable's contents) as dirty and
results in a repaint request being scheduled. | public void | requestRepaint() Request a repaint. | public void | resize() Internal method to resize window and its content layers
according to a size changes in the loaded skins.
This is important to re-calculate whenever things such as
titles, tickers, fullscreen mode, etc. | public void | setFullScreen(boolean onOff) Set this MIDPWindow's displayable to "fullscreen" mode. | public boolean | setGraphicsForCanvas(Graphics g) This method is an optimization which allows Display to bypass
the Chameleon paint engine logic and directly paint an animating
canvas. | public void | setTicker(Ticker ticker) Set the ticker of this MIDPWindow. | public void | setTitle(String title) Set the title of this MIDPWindow. | public boolean | setVerticalScroll(int scrollPosition, int scrollProportion) Set the current vertical scroll position and proportion.
Parameters: scrollPosition - vertical scroll position. Parameters: scrollProportion - vertical scroll proportion. | public void | showDisplayable(Displayable displayable, int height) Alert this MIDPWindow that the given displayable is now current
and should be shown on the screen. | public boolean | systemMenuUp() Determines if the system menu is currently visible. | public void | updateCommandSet(Command[] itemCommands, int itemCmdCount, ItemCommandListener itemCmdListener, Command[] scrCommands, int scrCmdCount, CommandListener scrCmdListener) Update this MIDPWindow's current command set to match the
current displayable and possibly item selection. | public void | updateLayout() |
ALERT_LAYER | final public static int ALERT_LAYER(Code) | | Id of layer containing the alert displayable
|
ALERT_WASH_LAYER | final public static int ALERT_WASH_LAYER(Code) | | Id of layer containing the alert wash
|
BODY_LAYER | final public static int BODY_LAYER(Code) | | Id of layer containing the current displayable's contents
|
BTN_LAYER | final public static int BTN_LAYER(Code) | | Id of layer rendering the soft button controls
|
LAST_LAYER | final public static int LAST_LAYER(Code) | | Number of main layers
|
PTI_LAYER | final public static int PTI_LAYER(Code) | | Id of layer containing the pti contents
|
TICKER_LAYER | final public static int TICKER_LAYER(Code) | | Id of layer containing the ticker of the current displayable
|
TITLE_LAYER | final public static int TITLE_LAYER(Code) | | Id of layer containing the title of the current displayable
|
WASH_LAYER | final public static int WASH_LAYER(Code) | | Id of layer containing the mail
|
itemCmdCache | Command[] itemCmdCache(Code) | | Cache of selected item commands
|
itemCmdCount | int itemCmdCount(Code) | | Number of item commands in the cache
|
scrCmdCount | int scrCmdCount(Code) | | Number of screen commands in the cache
|
screenMode | int screenMode(Code) | | Current screen mode
|
sizeChangedOccured | boolean sizeChangedOccured(Code) | | Determines whether area of the window has been changed
|
MIDPWindow | public MIDPWindow(ChamDisplayTunnel tunnel)(Code) | | Construct a new MIDPWindow given the tunnel to the desired
MIDP Display instance
Parameters: tunnel - the "tunnel" to make calls from this java packageback into the Display object in another package |
addLayer | public boolean addLayer(CLayer layer)(Code) | | Add the given layer to this window. This method is
overridden from CWindow in order to special case
popup layers. Popup layers can have their own commands
which supercede those of the current displayable.
Parameters: layer - the CLayer to add to this window true if new layer was added, false otherwise |
belongToCmdLayers | public boolean belongToCmdLayers(int x, int y)(Code) | | Returns true if the point lies in the bounds of commnad layer
Parameters: x - the "x" coordinate of the point Parameters: y - the "y" coordinate of the point true if the point lies in the bounds of commnad layer |
bodyContainsPoint | public boolean bodyContainsPoint(int x, int y)(Code) | | Utility method to determine if the given point lies within
the bounds of body layer. The point should be in the coordinate
space of this layer's containing CWindow.
Parameters: x - the "x" coordinate of the point Parameters: y - the "y" coordinate of the point true if the coordinate lies in the bounds of this layer |
callPaint | public void callPaint(Graphics g, CGraphicsQ refreshQ)(Code) | | MIDPWindow overrides the parent paint method in order to
do special effects such as paint a "wash" over the background
when a dialog is up. Also in an effort to call
javax.microedition.lcdui.Displayable.sizeChanged method before painting. This implementation determine whether size
has been changed and calls sizeChanged() if it's so.
Anyway it invokes the base class's
CWindow.paint method.
Parameters: g - The graphics object to use to paint this MIDP window. Parameters: refreshQ - The chameleon graphics queue. |
clearPopups | protected void clearPopups()(Code) | | Internal method to clear all current popups. This occurs if a
change of displayable occurs, as all popups are treated as belonging
to the current displayable.
|
getBodyAnchorX | public int getBodyAnchorX()(Code) | | Get the current x anchor coordinate for the body layer (the body
layer renders the contents of the current displayable).
the x anchor coordinate of the body layer |
getBodyAnchorY | public int getBodyAnchorY()(Code) | | Get the current y anchor coordinate for the body layer (the body
layer renders the contents of the current displayable).
the y anchor coordinate of the body layer |
getBodyHeight | public int getBodyHeight()(Code) | | Get the current height of the body layer (the body
layer renders the contents of the current displayable).
the height of the body layer |
getBodyLayerBounds | public int[] getBodyLayerBounds()(Code) | | Return bounds of BodyLayer currently
array of bounds |
getBodyWidth | public int getBodyWidth()(Code) | | Get the current width of the body layer (the body
layer renders the contents of the current displayable).
the width of the body layer |
getSoftOne | public Command getSoftOne()(Code) | | Returns the left soft button (one).
the command that's tied to the left soft button |
getSoftTwo | public Command[] getSoftTwo()(Code) | | Returns the command array tied to the right soft button (two).
the command array that's tied to the right soft button |
getTopMostPopup | public PopupLayer getTopMostPopup()(Code) | | Gets the "top" most Popup layer added to this body layer.
If there are no popups, this method returns null.
the top most popup layer, or null if there are none. |
hideDisplayable | public void hideDisplayable(Displayable displayable)(Code) | | Alert this MIDPWindow that the given displayable is no longer
current and should be removed from the screen.
Special circumstances may occur if the displayable is an Alert,
such as removing the popup and re-instating the previous
displayable which was visible before the Alert popped up.
Parameters: displayable - the newly current displayable to show |
isInFullScreenMode | public boolean isInFullScreenMode()(Code) | | Determines if window is in full screen mode.
true if in full screen mode |
paintWash | public void paintWash(boolean onOff)(Code) | | Called to paint a wash over the background of this window.
Used by SoftButtonLayer when the system menu pops up, and
internally when an Alert is shown.
Parameters: onOff - A flag indicating if the wash should be on or off |
removeLayer | public boolean removeLayer(CLayer layer)(Code) | | Remove the given layer from this window. This method is
overridden from CWindow in order to special case popup
layers. Popup layers can have their own commands which
supercede those of the current displayable. In this case,
the popup is removed and the commands in the soft button
bar are restored to either the next top-most popup layer
or the current displayable itself.
Parameters: layer - the CLayer to remove from this window true if the layer was able to be removed |
repaintDisplayable | public void repaintDisplayable(int x, int y, int w, int h)(Code) | | Request a repaint of a region of the current displayable.
This method specifically marks a region of the body layer
(which renders the displayable's contents) as dirty and
results in a repaint request being scheduled. The coordinates
are in the space of the displayable itself - that is, 0,0
represents the top left corner of the body layer.
Parameters: x - the x coordinate of the dirty region Parameters: y - the y coordinate of the dirty region Parameters: w - the width of the dirty region Parameters: h - the height of the dirty region |
requestRepaint | public void requestRepaint()(Code) | | Request a repaint. This method does not require any bounds
information as it is contained in each of the Chameleon layers.
This method simply results in a repaint event being placed in
the event queue for a future callback.
|
resize | public void resize()(Code) | | Internal method to resize window and its content layers
according to a size changes in the loaded skins.
This is important to re-calculate whenever things such as
titles, tickers, fullscreen mode, etc. change state.
|
setFullScreen | public void setFullScreen(boolean onOff)(Code) | | Set this MIDPWindow's displayable to "fullscreen" mode. This
will expand the region occupied by the current displayable to
include the area previously occupied by the title and ticker
if present
Parameters: onOff - true if the displayable should be in fullscreen mode |
setGraphicsForCanvas | public boolean setGraphicsForCanvas(Graphics g)(Code) | | This method is an optimization which allows Display to bypass
the Chameleon paint engine logic and directly paint an animating
canvas. Display will call this method with the graphics context
and this method will either return false, indicating the Chameleon
paint engine should not be bypassed, or will return true and will
setup the graphics context for the canvas to be painted directly.
Parameters: g - the graphics context to setup true if Chameleon's paint logic can be bypassed and thecanvas can be rendered directly. |
setTicker | public void setTicker(Ticker ticker)(Code) | | Set the ticker of this MIDPWindow. This would typically
correspond to the ticker of the current displayable, and
may result in the ticker layer appearing or disappearing.
Parameters: ticker - the current Ticker object. null indicates thereis no ticker. |
setTitle | public void setTitle(String title)(Code) | | Set the title of this MIDPWindow. This would typically
correspond to the title of the current displayable, and
may result in the title layer appearing or disappearing.
Parameters: title - the value of the title. null indicates thereis no title. |
setVerticalScroll | public boolean setVerticalScroll(int scrollPosition, int scrollProportion)(Code) | | Set the current vertical scroll position and proportion.
Parameters: scrollPosition - vertical scroll position. Parameters: scrollProportion - vertical scroll proportion. true if set vertical scroll occues |
showDisplayable | public void showDisplayable(Displayable displayable, int height)(Code) | | Alert this MIDPWindow that the given displayable is now current
and should be shown on the screen.
This will establish the given displayable on the screen,
as well as reflect the displayable's title and ticker (if any).
Special circumstances may occur if the displayable is an Alert,
such as maintaining the current screen contents and showing the
Alert in a popup.
Parameters: displayable - the newly current displayable to show Parameters: height - the preferred height of the new displayable |
systemMenuUp | public boolean systemMenuUp()(Code) | | Determines if the system menu is currently visible. This can be useful
in determining the current isShown() status of the displayable.
true if the system menu is up |
updateCommandSet | public void updateCommandSet(Command[] itemCommands, int itemCmdCount, ItemCommandListener itemCmdListener, Command[] scrCommands, int scrCmdCount, CommandListener scrCmdListener)(Code) | | Update this MIDPWindow's current command set to match the
current displayable and possibly item selection.
Parameters: itemCommands - the set of item specific commands Parameters: itemCmdCount - the number of item commands Parameters: itemCmdListener - the notification listener for item commands Parameters: scrCommands - the set of screen specific commands Parameters: scrCmdCount - the number of screen commands Parameters: scrCmdListener - the notification listener for screen commands |
updateLayout | public void updateLayout()(Code) | | Update the current layout
|
|
|