com.sybase.uep.bobclient.controls
Class RowCoordinatorCalculator

java.lang.Object
  extended by com.sybase.uep.bobclient.controls.RowCoordinatorCalculator

public class RowCoordinatorCalculator
extends java.lang.Object

Class to calculate coordinates of controls in a grid layout

Author:
congchen

Constructor Summary
RowCoordinatorCalculator(int columns)
          Row Layout constructor
RowCoordinatorCalculator(int columns, int marginWidth, int marginHeight, int spacingHorizontal, int spacingVertical)
           
 
Method Summary
 void addControl(Control control)
          Add widget to the row
 boolean addControl(Control control, int colspan)
          Add widget to this row
 boolean addControl(Control control, int colspan, int rowspan, int controlFontHeight)
          Add widget to this row
 void fillExisting()
          Fill existing unused columns in this row
 Control getControl(int controlIndex)
          Get a control by the control's index
 int getControlHeight(Control control)
          Gets a control's height
 java.util.Vector getControls()
          Get all fields on this row layout manager
 int getControlWidth(Control control)
          Gets columns' width that a control occupies
 int getControlXCoordinator(Control control)
          Gets a control's X coordinator in the row
 int getControlYCoordinator(Control control)
          Gets a control's Y coordinator in the row
 int getControlYLocation(int controlXLocation, int controlYLocation, com.sybase.uep.bobclient.controls.RowCoordinatorCalculator.CellProperty cellProp, com.sybase.uep.bobclient.controls.RowCoordinatorCalculator.CellProperty[][] tmpCellProperties)
          Get the control Y location position
 int getPreferredHeight()
          Retrieves this row's preferred height.
 int getPreferredWidth()
          Retrieves this row's preferred width.
 boolean isFull()
          Check is the row is full
 void layout()
          lay out controlled fields appropriately.
 void refresh()
          Refreshing all the controls
 void setBasicRowHeight(int rowHeight)
          Set the row height
 void setColumnWidths(int[] columnWidths)
          Set column widths of a row
 void setRowIndex(int rowIndex)
          Set the index of a row
 int size()
          Get the current number of widgets in this row
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RowCoordinatorCalculator

public RowCoordinatorCalculator(int columns)
Row Layout constructor

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

RowCoordinatorCalculator

public RowCoordinatorCalculator(int columns,
                                int marginWidth,
                                int marginHeight,
                                int spacingHorizontal,
                                int spacingVertical)
Method Detail

setBasicRowHeight

public void setBasicRowHeight(int rowHeight)
Set the row height


setColumnWidths

public void setColumnWidths(int[] columnWidths)
Set column widths of a row

Parameters:
columnWidths -

setRowIndex

public void setRowIndex(int rowIndex)
Set the index of a row

Parameters:
rowIndex -

getControl

public Control getControl(int controlIndex)
Get a control by the control's index

Parameters:
controlIndex -
Returns:
Control

layout

public void layout()
lay out controlled fields appropriately.


getPreferredWidth

public int getPreferredWidth()
Retrieves this row's preferred width.

Returns:
Preferred width for this field in pixels

getPreferredHeight

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

Returns:
Preferred height for this field in pixels

getControlYLocation

public int getControlYLocation(int controlXLocation,
                               int controlYLocation,
                               com.sybase.uep.bobclient.controls.RowCoordinatorCalculator.CellProperty cellProp,
                               com.sybase.uep.bobclient.controls.RowCoordinatorCalculator.CellProperty[][] tmpCellProperties)
Get the control Y location position

Parameters:
controlXLocation - - control x grid location
controlYLocation - - control y grid location
cellProp - - cell property information
tmpCellProperties - - list of cell propoerties to be layed out
Returns:
y axis location

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


getControls

public java.util.Vector getControls()
Get all fields on this row layout manager

Parameters:
result - - vector to store the fields

refresh

public void refresh()
Refreshing all the controls


addControl

public void addControl(Control control)
Add widget to the row

Parameters:
control - - the widget to be added

addControl

public boolean addControl(Control control,
                          int colspan)
Add widget to this row

Parameters:
control - - 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.

addControl

public boolean addControl(Control control,
                          int colspan,
                          int rowspan,
                          int controlFontHeight)
Add widget to this row

Parameters:
control - - 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

getControlXCoordinator

public int getControlXCoordinator(Control control)
Gets a control's X coordinator in the row

Parameters:
control -
Returns:
X coordinator

getControlYCoordinator

public int getControlYCoordinator(Control control)
Gets a control's Y coordinator in the row

Parameters:
control -
Returns:
Y coordinator

getControlWidth

public int getControlWidth(Control control)
Gets columns' width that a control occupies

Parameters:
control -
Returns:
columns' width

getControlHeight

public int getControlHeight(Control control)
Gets a control's height

Parameters:
control -
Returns:
control's height