net.rim.device.api.ui.component
Class SeparatorField
java.lang.Object
net.rim.device.api.ui.Field
net.rim.device.api.ui.component.SeparatorField
public class SeparatorField
- extends Field
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:
|
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. |
| Fields inherited from class net.rim.device.api.ui.Field |
ACTION_INVOKE, AXIS_HORIZONTAL, AXIS_SEQUENTIAL, AXIS_VERTICAL, EDITABLE, EDITABLE_MASK, FIELD_BOTTOM, FIELD_HALIGN_MASK, FIELD_HCENTER, FIELD_LEADING, FIELD_LEFT, FIELD_RIGHT, FIELD_TOP, FIELD_TRAILING, FIELD_VALIGN_MASK, FIELD_VCENTER, FOCUSABLE, FOCUSABLE_MASK, HIGHLIGHT_FOCUS, HIGHLIGHT_SELECT, NON_FOCUSABLE, NON_SPELLCHECKABLE, READONLY, SPELLCHECKABLE, SPELLCHECKABLE_MASK, STATUS_MOVE_FOCUS_HORIZONTALLY, STATUS_MOVE_FOCUS_VERTICALLY, USE_ALL_HEIGHT, USE_ALL_WIDTH, VISUAL_STATE_ACTIVE, VISUAL_STATE_DISABLED, VISUAL_STATE_DISABLED_FOCUS, VISUAL_STATE_FOCUS, VISUAL_STATE_NORMAL |
|
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 net.rim.device.api.ui.Field |
cursorClick, cursorUnclick, drawFocus, drawHighlightRegion, fieldChangeNotify, focusAdd, focusRemove, getAccessibleContext, getBackground, getBackground, getBorder, getBorder, getBorder, getChangeListener, getCommandItemProvider, getContentHeight, getContentLeft, getContentRect, getContentRect, getContentTop, getContentWidth, getContextMenu, getCookie, getExtent, getExtent, getFieldStyle, getFocusListener, getFocusRect, getFont, getHeight, getIndex, getLeafFieldWithFocus, getLeft, getManager, getMargin, getMarginBottom, getMarginLeft, getMarginRight, getMarginTop, getOriginal, getPadding, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getPreferredWidth, getScreen, getStyle, getTextFillColor, getTextStrokeColor, getTop, getVisualState, getWidth, invalidate, invalidate, invalidateAll, invokeAction, isDataValid, isDirty, isEditable, isEnabled, isFocus, isFocusable, isLeftToRight, isMuddy, isPasteable, isScrollCopyable, isSelectable, isSelecting, isSelectionCopyable, isSelectionCutable, isSelectionDeleteable, isSpellCheckable, isStyle, isVisible, keyChar, keyControl, keyDown, keyRepeat, keyStatus, keyUp, makeContextMenu, moveFocus, moveFocus, navigationClick, navigationMovement, navigationUnclick, onDisplay, onExposed, onFocus, onMenuDismissed, onMenuDismissed, onObscured, onUndisplay, onUnfocus, onVisibilityChange, paste, select, selectionCopy, selectionCut, selectionDelete, setBackground, setBackground, setBorder, setBorder, setBorder, setBorder, setChangeListener, setCommandItemProvider, setCookie, setDirty, setEditable, setEnabled, setExtent, setFocus, setFocusListener, setFont, setFont, setMargin, setMargin, setMuddy, setNonSpellCheckable, setPadding, setPadding, setPosition, setVisualState, touchEvent, trackwheelClick, trackwheelUnclick, updateLayout |
LINE_HORIZONTAL
public static final long LINE_HORIZONTAL
- Field should draw a horizontal line.
- See Also:
- Constant Field Values
- Since:
- BlackBerry API 4.0.0
LINE_VERTICAL
public static final long LINE_VERTICAL
- Field should draw a vertical line.
- See Also:
- Constant Field Values
- Since:
- BlackBerry API 4.0.0
LINE_MASK
public static final long LINE_MASK
- Mask for which way line should be drawn.
- See Also:
- Constant Field Values
- Since:
- BlackBerry API 4.0.0
SeparatorField
public SeparatorField()
- Creates a new SeparatorField object.
SeparatorField
public SeparatorField(long style)
- Creates a new SeparatorField object with a particular style.
- Parameters:
style - if style is SeparatorField.CHECK_FONT, the separator field
checks the current font size and resizes itself accordingly.- Since:
- BlackBerry API 5.0.0
getPreferredHeight
public int getPreferredHeight()
- Retrieves this field's preferred height.
See
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.
- Overrides:
getPreferredHeight in class Field
- Returns:
- Preferred height for this field.
layout
protected void layout(int width,
int height)
- Lays out this field's contents.
This field's manager invokes this method during the layout process to
instruct this field to arrange its contents, given an amount of available
space.
- Specified by:
layout in class Field
- Parameters:
width - Horizontal space available.height - Vertical space available.
getLinePosition
protected int getLinePosition()
- Retrieves the vertical position of the separator line.
- Returns:
- Distance in pixels from the top edge of this field's client area.
toString
public String toString()
- Represent a separator as a string of 20 dashes.
- Overrides:
toString in class Object
- Returns:
- a string representation of the object.
- Since:
- BlackBerry API 4.2.0
paint
protected void paint(Graphics graphics)
- Redraws this field.
This field's manager invokes this method during the repainting
process to instruct this field to repaint itself.
- Specified by:
paint in class Field
- Parameters:
graphics - Graphics context for repainting this field.
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal