org.j4me.ui.components
Class Whitespace
java.lang.Object
org.j4me.ui.components.Component
org.j4me.ui.components.Whitespace
public class Whitespace
- extends Component
The Whitespace
component adds whitespace to a form.
Constructor Summary |
Whitespace(int vertical)
Constructs a Whitespace component. |
Method Summary |
protected int[] |
getPreferredComponentSize(Theme theme,
int viewportWidth,
int viewportHeight)
Returns the dimensions of the whitespace. |
protected void |
paintComponent(javax.microedition.lcdui.Graphics g,
Theme theme,
int width,
int height,
boolean selected)
Paints the whitespace. |
void |
setSpacing(int vertical)
Sets the vertical amount of whitespace this component occupies. |
Methods inherited from class org.j4me.ui.components.Component |
acceptsInput, getHeight, getHorizontalAlignment, getPreferredSize, getScreen, getWidth, getX, getY, hideNotify, invalidate, isShown, keyPressed, keyReleased, keyRepeated, paint, paintRect, pointerDragged, pointerPressed, pointerReleased, repaint, setHorizontalAlignment, showNotify, visible |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Whitespace
public Whitespace(int vertical)
- Constructs a
Whitespace
component.
- Parameters:
vertical
- is the number of pixels to space. It must be
0 or greater.
setSpacing
public void setSpacing(int vertical)
- Sets the vertical amount of whitespace this component occupies.
This does not include the form's spacing above and below this
component.
- Parameters:
vertical
- is the number of pixels to space. It must be
0 or greater.- See Also:
Dialog.getSpacing()
paintComponent
protected void paintComponent(javax.microedition.lcdui.Graphics g,
Theme theme,
int width,
int height,
boolean selected)
- Paints the whitespace.
- Specified by:
paintComponent
in class Component
- Parameters:
g
- is the Graphics
object to be used for rendering the item.theme
- is the application's theme. Use it to get fonts and colors.width
- is the width, in pixels, to paint the component.height
- is the height, in pixels, to paint the component.selected
- is true
when this components is currently selected
and false
when it is not.- See Also:
Component.paintComponent(javax.microedition.lcdui.Graphics, org.j4me.ui.Theme, int, int, boolean)
getPreferredComponentSize
protected int[] getPreferredComponentSize(Theme theme,
int viewportWidth,
int viewportHeight)
- Returns the dimensions of the whitespace.
- Specified by:
getPreferredComponentSize
in class Component
- Parameters:
theme
- is the application's Theme
.viewportWidth
- is the width of the viewable area, in pixels,
the component can use.viewportHeight
- is the height of the viewable area, in pixels,
the component can use.
- Returns:
- A array with two elements where the first is the width of the
component in pixels and the second is the height.
- See Also:
Component.getPreferredComponentSize(org.j4me.ui.Theme, int, int)