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 it's width.

Behaviour
Displays a separator, currently always a horizontal line.


Field Summary
 
Fields inherited from class net.rim.device.api.ui.Field
EDITABLE, EDITABLE_MASK, FIELD_BOTTOM, FIELD_HALIGN_MASK, FIELD_HCENTER, FIELD_LEFT, FIELD_RIGHT, FIELD_TOP, FIELD_VALIGN_MASK, FIELD_VCENTER, FOCUSABLE, FOCUSABLE_MASK, HIGHLIGHT_FOCUS, HIGHLIGHT_SELECT, NON_FOCUSABLE, READONLY, USE_ALL_HEIGHT, USE_ALL_WIDTH
 
Constructor Summary
SeparatorField()
          Creates a new SeparatorField object.
 
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.
 
Methods inherited from class net.rim.device.api.ui.Field
drawFocus, drawHighlightRegion, fieldChangeNotify, focusAdd, focusRemove, getChangeListener, getContextMenu, getCookie, getExtent, getFieldStyle, getFocusListener, getFocusRect, getFont, getHeight, getIndex, getLeafFieldWithFocus, getLeft, getManager, getOriginal, getPreferredWidth, getScreen, getStyle, getTop, getWidth, invalidate, invalidate, isDirty, isEditable, isFocusable, isMuddy, isPasteable, isSelectable, isSelecting, isSelectionCopyable, isSelectionCutable, isSelectionDeleteable, isVisible, keyChar, keyControl, keyDown, keyRepeat, keyStatus, keyUp, makeContextMenu, moveFocus, moveFocus, onFocus, onUnfocus, onVisibilityChange, paste, select, selectionCopy, selectionCut, selectionDelete, setChangeListener, setCookie, setDirty, setEditable, setExtent, setFocus, setFocusListener, setFont, setMuddy, setPosition, trackwheelClick, trackwheelUnclick, updateLayout
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail
Constructor Detail

SeparatorField

public SeparatorField()
Creates a new SeparatorField object.

Method Detail

getPreferredHeight

public int getPreferredHeight()
Retrieves this field's preferred height.

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.
Overrides:
layout in class Field
Parameters:
width - Horizontal space available.
height - Vertical space available.
Since:
JDE 3.6

getLinePosition

protected int getLinePosition()
Retrieves the vertical position of the separator line.

If this field was built with the CHECK_FONT style, then this value depends on the current font.

Returns:
Distance in pixles from the top edge of this field's client area.

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.

Overrides:
paint in class Field
Parameters:
graphics - Graphics context for repainting this field.
Since:
JDE 3.6


Copyright 1999-2002 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.