com.sybase.uep.bobclient.controls
Class RowLayout

java.lang.Object
  extended by net.rim.device.api.ui.Field
      extended by net.rim.device.api.ui.Manager
          extended by com.sybase.uep.bobclient.controls.RowLayout

public class RowLayout
extends net.rim.device.api.ui.Manager

This is the row layout control

Author:
tdang

Field Summary
 
Fields inherited from class net.rim.device.api.ui.Manager
BOTTOMMOST, DOWNWARD, HORIZONTAL_SCROLL, HORIZONTAL_SCROLL_MASK, HORIZONTAL_SCROLLBAR, HORIZONTAL_SCROLLBAR_MASK, LEAVE_BLANK_SPACE, LEFTMOST, LEFTWARD, NO_HORIZONTAL_SCROLL, NO_HORIZONTAL_SCROLLBAR, NO_SCROLL_RESET, NO_VERTICAL_SCROLL, NO_VERTICAL_SCROLLBAR, QUANTA_FONT, RIGHTMOST, RIGHTWARD, TOPMOST, UPWARD, VERTICAL_SCROLL, VERTICAL_SCROLL_MASK, VERTICAL_SCROLLBAR, VERTICAL_SCROLLBAR_MASK
 
Fields inherited from class net.rim.device.api.ui.Field
ACTION_INVOKE, 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
RowLayout(int columns, LayoutManager layoutManager)
          Row Layout constructor
RowLayout(int columns, LayoutManager layoutManager, int bgcolor)
          Row Layout constructor
 
Method Summary
 void addWidget(net.rim.device.api.ui.Field widget)
          Add widget to the row
 boolean addWidget(net.rim.device.api.ui.Field widget, int colspan)
          Add widget to this row
 boolean addWidget(net.rim.device.api.ui.Field widget, int colspan, int rowspan)
          Add widget to this row
 void fillExisting()
          Fill existing unused columns in this row
 void getAllFields(java.util.Vector result)
          Get all fields on this row layout manager
 int getControlXCoordinator(Control field)
           
 int getPreferredHeight()
          Retrieves this field's preferred height.
 int getPreferredWidth()
          Retrieves this field's preferred width.
 boolean isFull()
          Check is the row is full
protected  void onFocus(int direction)
           
 void paint(net.rim.device.api.ui.Graphics g)
          Paints this manager's visible region.
protected  void paintRowLayout(net.rim.device.api.ui.Graphics g, FontStyle fontStyle, int height, int width)
           
 void refresh()
          Refreshing all the controls
 void refreshColumnWidths()
           
 void setBgColor(int color)
          Set the background color
 void setLastFocusedField(net.rim.device.api.ui.Field lastFocusedField)
          Sets the last focused field in the rowLayout
 int size()
          Get the current number of widgets in this row
 void sublayout(int width, int height)
          Implements custom layout features for this manager.
 void updateRowLayout()
           
 
Methods inherited from class net.rim.device.api.ui.Manager
add, clearCustomScrollArrows, delete, deleteAll, deleteRange, getAccessibleContext, getField, getFieldAtLocation, getFieldCount, getFieldWithFocus, getFieldWithFocusIndex, getFocusRect, getHorizontalScroll, getLeafFieldWithFocus, getPreferredHeightOfChild, getPreferredWidthOfChild, getVerticalScroll, getVirtualHeight, getVirtualWidth, getVisibleHeight, getVisibleWidth, insert, invalidate, invalidate, invalidateFieldRange, invokeAction, isDataValid, isDirty, isDownArrowShown, isFocusable, isMuddy, isSelecting, isUpArrowShown, isValidLayout, keyChar, keyControl, keyDown, keyRepeat, keyStatus, keyUp, layout, layoutChild, makeMenu, moveFocus, moveFocus, moveFocus, navigationClick, navigationMovement, navigationUnclick, nextFocus, nextFocus, onUndisplay, onUnfocus, paintChild, replace, setDirty, setFocus, setHorizontalQuantization, setHorizontalScroll, setNonfocusableOverride, setPositionChild, setScrollListener, setVerticalQuantization, setVerticalScroll, setVirtualExtent, subpaint, touchEvent, trackwheelClick, trackwheelUnclick
 
Methods inherited from class net.rim.device.api.ui.Field
drawFocus, drawHighlightRegion, fieldChangeNotify, focusAdd, focusChangeNotify, focusRemove, getBackground, getBackground, getBorder, getBorder, getBorder, getChangeListener, getContentHeight, getContentLeft, getContentRect, getContentRect, getContentTop, getContentWidth, getContextMenu, getContextMenu, getCookie, getExtent, getExtent, getFieldStyle, getFocusListener, getFont, getHeight, getIndex, getLeft, getManager, getMargin, getMarginBottom, getMarginLeft, getMarginRight, getMarginTop, getOriginal, getPadding, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getScreen, getState, getStyle, getTop, getVisualState, getWidth, invalidateAll, isEditable, isFocus, isPasteable, isSelectable, isSelectionCopyable, isSelectionCutable, isSelectionDeleteable, isSpellCheckable, isStyle, isVisible, makeContextMenu, makeContextMenu, onDisplay, onExposed, onMenuDismissed, onMenuDismissed, onObscured, onVisibilityChange, paintBackground, paste, select, selectionCopy, selectionCut, selectionDelete, setBackground, setBackground, setBorder, setBorder, setBorder, setBorder, setBorder, setChangeListener, setCookie, setEditable, setExtent, setFocus, setFocusListener, setFont, setFont, setMargin, setMargin, setMuddy, setNonSpellCheckable, setPadding, setPadding, setPosition, setVisualState, updateLayout
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RowLayout

public RowLayout(int columns,
                 LayoutManager layoutManager)
Row Layout constructor

Parameters:
columns - - Maximum number of columns allowed for this row
layoutManager - - Layout Manager

RowLayout

public RowLayout(int columns,
                 LayoutManager layoutManager,
                 int bgcolor)
Row Layout constructor

Parameters:
columns - - Maximum number of columns allowed for this row
layoutManager - - Layout Manager
bgcolor - - background color for this row
Method Detail

sublayout

public void sublayout(int width,
                      int height)
Implements custom layout features for this manager. If implementing a manager with custom layout features, extend the Manager class and implement this method. Invoking the sublayout method prompts your manager subclass to lay out controlled fields appropriately. layout(int, int) invokes this method to perform custom layout handling.

Specified by:
sublayout in class net.rim.device.api.ui.Manager
Parameters:
width - - Width available for this manager.
height - - Height available for this manager.

getPreferredWidth

public int getPreferredWidth()
Retrieves this field's preferred width. Your implementation of getPreferredWidth() should return the width of your custom field if it has any amount of space available.

Overrides:
getPreferredWidth in class net.rim.device.api.ui.Field
Returns:
Preferred width for this field in pixels

getPreferredHeight

public int getPreferredHeight()
Retrieves this field's preferred height. Your implementation of getPreferredHeight() should return the height of your custom field if it has any amount of space available.

Overrides:
getPreferredHeight in class net.rim.device.api.ui.Field
Returns:
Preferred height for this field in pixels

setBgColor

public void setBgColor(int color)
Set the background color

Parameters:
color - - color value

size

public int size()
Get the current number of widgets in this row

Returns:
current size of the row

fillExisting

public void fillExisting()
Fill existing unused columns in this row


getAllFields

public void getAllFields(java.util.Vector result)
Get all fields on this row layout manager

Parameters:
result - - vector to store the fields

updateRowLayout

public void updateRowLayout()

refresh

public void refresh()
Refreshing all the controls


addWidget

public void addWidget(net.rim.device.api.ui.Field widget)
Add widget to the row

Parameters:
widget - - the widget to be added

addWidget

public boolean addWidget(net.rim.device.api.ui.Field widget,
                         int colspan)
Add widget to this row

Parameters:
widget - - the widget to be added
colspan - - the number of columns this widget will take up
Returns:
return true if the row is full else false.

addWidget

public boolean addWidget(net.rim.device.api.ui.Field widget,
                         int colspan,
                         int rowspan)
Add widget to this row

Parameters:
widget - - the widget to be added
colspan - - the number of columns this widget will take up
rowspan - - the number of rows this widget will take up
Returns:
return true if the row is full else false.

isFull

public boolean isFull()
Check is the row is full

Returns:
If true it's full

paint

public void paint(net.rim.device.api.ui.Graphics g)
Paints this manager's visible region.

Overrides:
paint in class net.rim.device.api.ui.Manager
Parameters:
g - - Graphics object used for painting.

paintRowLayout

protected void paintRowLayout(net.rim.device.api.ui.Graphics g,
                              FontStyle fontStyle,
                              int height,
                              int width)

refreshColumnWidths

public void refreshColumnWidths()

onFocus

protected void onFocus(int direction)
Overrides:
onFocus in class net.rim.device.api.ui.Manager

setLastFocusedField

public void setLastFocusedField(net.rim.device.api.ui.Field lastFocusedField)
Sets the last focused field in the rowLayout

Parameters:
lastFocusedField -

getControlXCoordinator

public int getControlXCoordinator(Control field)