|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.device.api.ui.Field
net.rim.device.api.ui.component.SeparatorField
public class SeparatorField
A field which draws a horizontal line across its width.
Behaviour
Displays a separator, currently always a horizontal line.
A SeparatorField
object can be added to a menu in the following
ways:
Menu.add(ContextMenu, boolean)
method and set the
addSeparator
argument to true.
Menu.addSeparator()
method to add a separator.
Field Summary | ||
---|---|---|
static long |
LINE_HORIZONTAL
Field should draw a horizontal line. |
|
static long |
LINE_MASK
Mask for which way line should be drawn. |
|
static long |
LINE_VERTICAL
Field should draw a vertical line. |
Constructor Summary | ||
---|---|---|
SeparatorField()
Creates a new SeparatorField object. |
||
SeparatorField(long style)
Creates a new SeparatorField object with a particular style. |
Method Summary | ||
---|---|---|
protected int |
getLinePosition()
Retrieves the vertical position of the separator line. |
|
int |
getPreferredHeight()
Retrieves this field's preferred height. |
|
protected void |
layout(int width,
int height)
Lays out this field's contents. |
|
protected void |
paint(Graphics graphics)
Redraws this field. |
|
String |
toString()
Represent a separator as a string of 20 dashes. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final long LINE_HORIZONTAL
public static final long LINE_VERTICAL
public static final long LINE_MASK
Constructor Detail |
---|
public SeparatorField()
public SeparatorField(long style)
style
- if style is SeparatorField.CHECK_FONT
, the separator field
checks the current font size and resizes itself accordingly.Method Detail |
---|
public int getPreferredHeight()
Field.getPreferredHeight()
for more information.
This field's manager invokes this method during the layout process to determine this field's desired height.
If the current font is a small font (8 pixel), then separators like to be one pixel high; otherwise, they prefer to be three pixels high.
getPreferredHeight
in class Field
protected void layout(int width, int height)
layout
in class Field
width
- Horizontal space available.height
- Vertical space available.protected int getLinePosition()
public String toString()
toString
in class Object
protected void paint(Graphics graphics)
This field's manager invokes this method during the repainting process to instruct this field to repaint itself.
paint
in class Field
graphics
- Graphics context for repainting this field.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.