|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.enough.polish.ui.Item
de.enough.polish.ui.Spacer
public class Spacer
A blank, non-interactive item that has a settable minimum size.
The usage of the Spacer item is discouraged for applications which use J2ME Polish, since margins and paddings can be set for each item anyhow.
The
minimum width is useful for allocating flexible amounts of space between
Items within the same row of a
Form. The minimum height is useful for
enforcing a particular minimum height of a row. The application can set
the minimum width or height to any non-negative value. The implementation
may enforce implementation-defined maximum values for the minimum width and
height.
The unlocked preferred width of a Spacer is the same as its
current minimum width. Its unlocked preferred height is the same as its
current minimum height.
Since a Spacer's primary purpose is to position
other items, it is
restricted to be non-interactive, and the application is not allowed to add
Commands to a Spacer. Since the
presence of a label on an Item may affect
layout in device-specific ways, the label of a
Spacer is restricted to
always be null, and the application is not allowed
to change it.
| Field Summary |
|---|
| Constructor Summary | |
|---|---|
Spacer(int minWidth,
int minHeight)
Creates a new Spacer with the given minimum
size. |
|
| Method Summary | |
|---|---|
void |
addCommand(javax.microedition.lcdui.Command cmd)
Spacers are restricted from having
Commands, so this method will always
throw IllegalStateException whenever it is called. |
protected java.lang.String |
createCssSelector()
Retrieves the CSS selector for this item. |
protected void |
initContent(int firstLineWidth,
int lineWidth)
Initialises this item. |
void |
paintContent(int x,
int y,
int leftBorder,
int rightBorder,
javax.microedition.lcdui.Graphics g)
Paints the content of this item. |
void |
setDefaultCommand(javax.microedition.lcdui.Command cmd)
Spacers are restricted from having Commands,
so this method will always
throw IllegalStateException whenever it is called. |
void |
setLabel(java.lang.String label)
Spacers are restricted to having
null labels, so this method will
always throw
IllegalStateException whenever it is called. |
void |
setMinimumSize(int minWidth,
int minHeight)
Sets the minimum size for this spacer. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Spacer(int minWidth,
int minHeight)
Spacer with the given minimum
size. The Spacer's label
is null.
The minimum size must be zero or greater.
If minWidth is greater than the
implementation-defined maximum width, the maximum
width will be used instead.
If minHeight is greater than the
implementation-defined maximum height, the maximum
height will be used instead.
minWidth - - the minimum width in pixelsminHeight - - the minimum height in pixels
java.lang.IllegalArgumentException - - if either minWidth or minHeight is less than zero| Method Detail |
|---|
public void setMinimumSize(int minWidth,
int minHeight)
Form will not
be allowed to make the item smaller than this size.
The minimum size must be zero or greater.
If minWidth is greater than the
implementation-defined maximum width, the maximum
width will be used instead.
If minHeight is greater than the
implementation-defined maximum height, the maximum
height will be used instead.
minWidth - - the minimum width in pixelsminHeight - - the minimum height in pixels
java.lang.IllegalArgumentException - - if either minWidth or minHeight is less than zeropublic void addCommand(javax.microedition.lcdui.Command cmd)
Spacers are restricted from having
Commands, so this method will always
throw IllegalStateException whenever it is called.
addCommand in class Itemcmd - - the Command
java.lang.IllegalStateException - - alwaysin class Itempublic void setDefaultCommand(javax.microedition.lcdui.Command cmd)
Commands,
so this method will always
throw IllegalStateException whenever it is called.
setDefaultCommand in class Itemcmd - - the Command
java.lang.IllegalStateException - - alwaysin class Itempublic void setLabel(java.lang.String label)
Spacers are restricted to having
null labels, so this method will
always throw
IllegalStateException whenever it is called.
setLabel in class Itemlabel - - the label string
java.lang.IllegalStateException - - alwaysin class Item
public void paintContent(int x,
int y,
int leftBorder,
int rightBorder,
javax.microedition.lcdui.Graphics g)
Item
paintContent in class Itemx - the left start positiony - the upper start positionleftBorder - the left border, nothing must be painted left of this positionrightBorder - the right border, nothing must be painted right of this positiong - the Graphics on which this item should be painted.
protected void initContent(int firstLineWidth,
int lineWidth)
Item
initContent in class ItemfirstLineWidth - the maximum width of the first linelineWidth - the maximum width of any following linesItem.contentWidth,
Item.contentHeight,
Item.preferredWidth,
Item.preferredHeightprotected java.lang.String createCssSelector()
Item
createCssSelector in class Item
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||