|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--waba.ui.Control | +--waba.ui.Container | +--superwaba.ext.xplat.ui.Grid
A light variant of the standard Grid.
Demands a table model (GridModel) to work
Supports editing (of course), selection by row, column or single cell and toggle of borders
Note: this grid does not support scrollbars. If you add support for
them, please share your enhancements with the community: send the sources to classes@superwaba.org
Ver 1.0.2 With a quicker update when selecting/editing
Ver 1.0.3. Lots of bugfixes,including the keyboard error
GridModel
Field Summary | |
static int |
SELECT_BY_CELL
Constant used to specify selection by cell |
static int |
SELECT_BY_COLUMN
Constant used to specify selection by column |
static int |
SELECT_BY_ROW
Constant used to specify selection by row |
Fields inherited from class waba.ui.Container |
BORDER_LOWERED,
BORDER_NONE,
BORDER_RAISED,
BORDER_SIMPLE,
children,
lastH,
lastW,
lastX,
lastY,
parentWindow,
tail |
Fields inherited from class waba.ui.Control |
AFTER,
appId,
asContainer,
asWindow,
backColor,
backDis,
BEFORE,
BOTTOM,
CENTER,
enabled,
FILL,
FIT,
fm,
fmH,
focusLess,
font,
foreColor,
foreDis,
height,
LEFT,
parent,
PREFERRED,
RANGE,
RIGHT,
SAME,
TOP,
visible,
width,
x,
x2,
y,
y2 |
Constructor Summary | |
Grid(GridModel dm)
Constructs a Grid that is initialized with dm as the data model. |
Method Summary | |
boolean |
getBordered()
Returns if the table is bordered or not |
boolean |
getOneClickEditMode()
Indicates if a user is allowed to start editing a cell without selecting it first. |
Object |
getSelected()
Returns the currently selected item in the table |
int |
getSelectedColumn()
Returns the currently selected row |
int |
getSelectedRow()
Returns the currently selected row |
int |
getSelectMode()
Returns the mode of selection. |
GridModel |
getTableModel()
Returns the table model |
void |
onEvent(Event event)
Handels events passed to the table |
void |
onPaint(Graphics g)
Called by the system to draw the table, will lay out the rows and columns. |
void |
setBordered(boolean bordered)
Sets if the table should be bordered or not. |
void |
setOneClickEditMode(boolean oneClickEditMode)
Sets if a user is allowed to start editing a cell without selecting it first. When the user clicks a cell, it is selected for her. Default is false. |
void |
setSelectMode(int selMode)
Sets the table's selection mode to allow for selection by single cell, row or column. |
void |
setSpace(int space)
Sets the spacing between texts. |
void |
setTableModel(GridModel newModel)
Set the table model |
Methods inherited from class waba.ui.Container |
add,
add,
add,
broadcastEvent,
findChild,
getChildren,
getClientRect,
onColorsChanged,
onStart,
paintChildren,
remove,
setBorderStyle,
setEnabled |
Methods inherited from class waba.ui.Control |
addTimer,
contains,
createGraphics,
getAbsoluteRect,
getBackColor,
getFont,
getFontMetrics,
getForeColor,
getNext,
getParent,
getParentWindow,
getPos,
getPreferredHeight,
getPreferredWidth,
getRect,
getSize,
isDisplayed,
isEnabled,
isVisible,
onBoundsChanged,
onFontChanged,
onWindowPaintFinished,
postEvent,
removeTimer,
repaint,
repaintNow,
requestFocus,
setBackColor,
setBackForeColors,
setFocusLess,
setFont,
setForeColor,
setRect,
setRect,
setRect,
setVisible |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
toString,
wait,
wait |
Field Detail |
public static final int SELECT_BY_ROW
public static final int SELECT_BY_COLUMN
public static final int SELECT_BY_CELL
Constructor Detail |
public Grid(GridModel dm)
dm
- The tablemodelMethod Detail |
public boolean getBordered()
public boolean getOneClickEditMode()
public Object getSelected()
public int getSelectedColumn()
public int getSelectedRow()
public int getSelectMode()
SELECT_BY_CELL
,
SELECT_BY_ROW
,
SELECT_BY_COLUMN
public GridModel getTableModel()
public void onEvent(Event event)
event
- the eventpublic void onPaint(Graphics g)
g
- The Graphic object to paint onpublic void setBordered(boolean bordered)
bordered
- If true, the table is drawn with lines between cellspublic void setOneClickEditMode(boolean oneClickEditMode)
oneClickEditMode
- if true, one click editing is allowedpublic void setSelectMode(int selMode)
selMode
- One of 3 legal values: SELECT_BY_CELL, SELECT_BY_ROW, SELECT_BY_COLUMNSELECT_BY_CELL
,
SELECT_BY_ROW
,
SELECT_BY_COLUMN
public void setSpace(int space)
space
- The space in pixels beween the text and the cell borderpublic void setTableModel(GridModel newModel)
newModel
- GridModel
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |