|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectewe.ui.TableModel
ewe.ui.IconTableModel
This is a table model that displays an icon with associated text below it. The display is actually treated as a list that scrolls either vertically or horizontally. All you need to do is set the minHeight/minWidth values and then override getIconCount(), getIconText() and getIconImage().
| Nested Class Summary |
| Nested classes inherited from class ewe.ui.TableModel |
TableModel.CellControl, TableModel.ControlProxy |
| Field Summary | |
boolean |
dontAutoSelectScrollMode
This is false by default and tells the table model to not automatically select the scrolling mode (vertical or horizontal) appropriate for the size of the table. |
int |
minHeight
The minimum height for each cell. |
int |
minWidth
The minimum width for each cell. |
boolean |
vmode
If this is true then the table will scroll vertically only. |
| Fields inherited from interface ewe.ui.UIConstants |
BDR_DOTTED, BDR_INNER, BDR_NOBORDER, BDR_OUTER, BDR_OUTLINE, BDR_RAISEDINNER, BDR_RAISEDOUTER, BDR_SUNKENINNER, BDR_SUNKENOUTER, BF_BOTTOM, BF_BOTTOMLEFT, BF_BOTTOMRIGHT, BF_BUTTON, BF_DIAGONAL, BF_DIAGONAL_ENDBOTTOMLEFT, BF_DIAGONAL_ENDBOTTOMRIGHT, BF_DIAGONAL_ENDTOPLEFT, BF_DIAGONAL_ENDTOPRIGHT, BF_EXACT, BF_FLAT, BF_LEFT, BF_MIDDLE, BF_MONO, BF_PALM, BF_RECT, BF_RIGHT, BF_SOFT, BF_SQUARE, BF_TOP, BF_TOPLEFT, BF_TOPRIGHT, EDGE_BUMP, EDGE_ETCHED, EDGE_RAISED, EDGE_SUNKEN |
| Fields inherited from interface ewe.ui.CellConstants |
BORDER, BOTTOM, CELLFLAG, CELLMASK, CENTER, CONTROLMASK, DONTCHANGE, DONTFILL, DONTSTRETCH, EAST, FILL, FIXEDSIZE, GROW, HCENTER, HCONTRACT, HEXPAND, HFILL, HGROW, HSHRINK, HSTRETCH, INITIALLY_CLOSED, INITIALLY_MINIMIZED, INITIALLY_PREFERRED_SIZE, INSETS, LEFT, MAXIMUMSIZE, MINIMUMSIZE, NORTH, NORTHEAST, NORTHWEST, PREFERREDSIZE, RECT, RIGHT, SHRINK, SOUTH, SOUTHEAST, SOUTHWEST, SPAN, STRETCH, TEXTSIZE, TOP, VCENTER, VCONTRACT, VEXPAND, VFILL, VGROW, VSHRINK, VSTRETCH, WEST |
| Fields inherited from interface ewe.ui.ControlConstants |
All, AlwaysEnabled, AlwaysRecalculateSizes, ByDeferredMouse, ByDeferredPen, ByFrameChange, ByKeyboard, ByMouse, ByPen, ByRequest, CalculatedSizes, Disabled, DisablePopupMenu, DisplayOnly, Down, DrawFlat, Flag, ForceResize, HasData, Invisible, KeepImage, KeepSIP, Left, MakeMenuAtLeastAsWide, Maximize, Minimize, MouseSensitive, NoFocus, NotAnEditor, NotEditable, PaintDataOnly, PaintOutsideOnly, PenTransparent, PreferredSizeOnly, Right, SendUpKeyEvents, SendUpPenEvents, ShowSIP, ShrinkToNothing, SmallControl, SpecialBackground, TakeControlEvents, TakesKeyFocus, Transparent, Up, WantDrag, WantHoldDown |
| Constructor Summary | |
IconTableModel()
|
|
| Method Summary | |
int |
calculateColWidth(int col)
This returns the full width of the column. |
protected void |
calculateRC()
Calculate the rows and columns based on the size of the table. |
int |
calculateRowHeight(int row)
This returns the full height of the row. |
boolean |
canSelect(int row,
int col)
This should return whether or not a particular cell may be selected. |
TableCellAttributes |
getCellAttributes(int row,
int col,
boolean isSelected,
TableCellAttributes tca)
Get the attributes for a cell. |
int |
getIconCount()
This should return the number of icons. |
IImage |
getIconImage(int iconIndex)
Get the image for the specified icon. |
String |
getIconText(int iconIndex)
Get the text for the specified icon. |
Object |
getIconToolTip(int index)
Get the tooltip for the icon at the specified index. |
Object |
getToolTip(int x,
int y)
Return a Tool Tip for the x,y position (in pixels) on the table. |
void |
iconClicked(int index)
If an icon in the table returned by makeTable() is clicked, this method is called. |
void |
iconSelected(int index)
If an icon in the table returned by makeTable() is selected with the arrow keys, this method is called. |
void |
made()
This is called after the TableControl has been made. |
TableControl |
makeTable()
|
void |
onEvent(Event ev)
|
void |
resized(int width,
int height)
This is called after the TableControl has been resized. |
void |
setVMode(boolean vmode)
|
boolean |
toCell(int index,
Point where)
Get the row and column of the icon at the specified index. |
int |
toIconIndex(int row,
int col)
Get the index of the icon given the row and column. |
void |
updateDisplay()
Update the table display after any changes. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, toString |
| Field Detail |
public int minWidth
public int minHeight
public boolean vmode
public boolean dontAutoSelectScrollMode
| Constructor Detail |
public IconTableModel()
| Method Detail |
public int getIconCount()
public String getIconText(int iconIndex)
iconIndex - The index of the icon.
public IImage getIconImage(int iconIndex)
iconIndex - The index of the icon.
public void updateDisplay()
public int calculateColWidth(int col)
TableModel
calculateColWidth in class TableModelpublic int calculateRowHeight(int row)
TableModel
calculateRowHeight in class TableModelprotected void calculateRC()
public void resized(int width,
int height)
TableModel
resized in class TableModelpublic void setVMode(boolean vmode)
public Object getToolTip(int x,
int y)
TableModel
Point cell = table.cellAtPoint(x,y,null);
if (cell == null) return null; //Not on a cell.
// Now cell.x will have the column and cell.y will have the row
// of the cell the mouse is over and you can then display a tool tip for that cell.
getToolTip in class TableModelx - The x co-ordinate in pixels of the mouse.y - The y co-ordinate in pixels of the mouse.
public Object getIconToolTip(int index)
public int toIconIndex(int row,
int col)
public boolean toCell(int index,
Point where)
index - The index of the icon.where - A Point to store the x (column) and y (row) location of its cell.
This parameter may be null, in which case the return value will simply indicate if the
index is valid or not.
public TableCellAttributes getCellAttributes(int row,
int col,
boolean isSelected,
TableCellAttributes tca)
TableModel
getCellAttributes in class TableModel
public boolean canSelect(int row,
int col)
TableModel
canSelect in class TableModelpublic void made()
TableModel
made in class TableModelpublic TableControl makeTable()
public void iconClicked(int index)
index - The index of the icon that was clicked.public void iconSelected(int index)
index - The index of the icon that was clicked.public void onEvent(Event ev)
onEvent in interface EventListeneronEvent in class TableModel
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||