public class IconTableModel extends TableModel
TableModel.CellControl, TableModel.ControlProxy| Modifier and Type | Field and Description |
|---|---|
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.
|
activeCellControl, allColumnsSameSize, allRowsSameSize, canHScroll, canMoveColumnHeaders, canVScroll, cellInsets, charHeight, charWidth, clipData, colAdjustments, controlProxy, cursorSize, fillToEqualHeights, fillToEqualWidths, gap, hasColumnHeaders, hasPreferredSize, hasRowHeaders, hasSpanningColumns, hasSpanningRows, horizontalScrollUnit, keepSIP, mouseIsOverCell, numCols, numRows, preferredCols, preferredRows, selectRowWhenEditing, shadeAlternateRows, shadeColor, table, verticalScrollUnitBDR_DOTTED, BDR_INNER, BDR_NOBORDER, BDR_OUTER, BDR_OUTLINE, BDR_RAISEDINNER, BDR_RAISEDOUTER, BDR_SUNKENINNER, BDR_SUNKENOUTER, BF_ABUT_ANY, BF_ABUT_BOTTOM, BF_ABUT_LEFT, BF_ABUT_RIGHT, BF_ABUT_TOP, 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_SUNKENALWAYS_STRETCHABLE, BOTTOM, CELLFLAG, CELLMASK, CENTER, CONTROLMASK, DONTCHANGE, DONTFILL, DONTSTRETCH, EAST, FILL, GROW, HCENTER, HCONTRACT, HEXPAND, HFILL, HGROW, HSHRINK, HSTRETCH, INITIALLY_CLOSED, INITIALLY_HIDDEN, INITIALLY_MINIMIZED, INITIALLY_PREFERRED_SIZE, INSETS, LEFT, MAXIMUMSIZE, MINIMUMSIZE, NORTH, NORTHEAST, NORTHWEST, PREFERREDSIZE, RECT, RIGHT, SHRINK, SOUTH, SOUTHEAST, SOUTHWEST, SPAN, STRETCH, TAG_BACKGROUND_IMAGE, TAG_BUSY_DISPLAY, TAG_COLORS, TAG_CONTROL_PAINTER, TAG_EXPOSE_GROUP, TAG_FIXEDSIZE, TAG_GRAY_BACKGROUND, TAG_HIDE_CONTROL_OBJECT, TAG_HIDE_PARENT, TAG_INNER_TEXT_INSETS, TAG_INPUT_STACK_PARENT, TAG_INSETS, TAG_MAKE_VISIBLE, TAG_MAXIMUMSIZE, TAG_MINIMUMSIZE, TAG_PAINT_CONTROL_LIST, TAG_PREFERRED_TEXT_SIZE, TAG_PREFERRED_TEXT_SIZE_HEIGHT, TAG_PREFERRED_TEXT_SIZE_WIDTH, TAG_PREFERREDSIZE, TAG_RECT, TAG_SHADOW_INSETS, TAG_SPAN, TAG_SWIPER, TAG_TEMPORARY_ERROR, TAG_TEXT_INSETS, TAG_TEXTSIZE, TEXTSIZE, TOP, VCENTER, VCONTRACT, VEXPAND, VFILL, VGROW, VSHRINK, VSTRETCH, WESTAll, AlwaysEnabled, AlwaysRecalculateSizes, ByDeferredMouse, ByDeferredPen, ByFrameChange, ByKeyboard, ByMouse, ByPen, ByRequest, CalculatedSizes, ContainerDontPaintChildren, Disabled, DisablePopupMenu, DisplayOnly, DontBuffer, Down, DrawFlat, Flag, ForceResize, HasData, Invisible, KeepImage, KeepSIP, Left, MakeMenuAtLeastAsWide, Maximize, Minimize, ModifiersInheritedFromWindow, MouseSensitive, NoFocus, NotAnEditor, NotEditable, PaintDataOnly, PaintOutsideOnly, PenTransparent, PreferredSizeOnly, Right, SendUpUIEvents, ShowSIP, ShrinkToNothing, SmallControl, TakeChildUIEvents, TakeControlEvents, TakesKeyFocus, Transparent, Up, WantDrag, WantHoldDown| Constructor and Description |
|---|
IconTableModel() |
| Modifier and Type | Method and Description |
|---|---|
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() |
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.
|
acceptColumnMoved, calculatePreferredColWidth, calculatePreferredRowHeight, calculatePreferredSize, calculateSizes, calculateTextCharsInColumn, calculateTextLinesInRow, canScreenScroll, checkControlFor, clearCellAdjustments, clearColumnWidthAdjustments, clearSelectionOnClick, closeActiveControl, columnMoved, deferPaintTableCell, doHotKey, editNow, editNow, endEditing, findCellsInArea, fixBorder, freezeUpdate, getCellControlFor, getCellData, getCellInsets, getCellPreferredSize, getCellRect, getCellText, getCellText, getColWidth, getColXPointInTable, getControlFor, getLock, getMaxColWidth, getMaxRowHeight, getMenuFor, getMenuOutsideCells, getMinColWidth, getMinRowHeight, getPreferredSize, getRowHeight, getRowYPointInTable, getTable, handleEvent, hasActiveControls, hasCellControlFor, inset, isActiveCellControl, makeActiveControlVisible, mouseMoving, mouseOverChanged, notifyDataChange, onKeyEvent, paintTableCell, paintTableCell, paintTableCellData, paintTableCellText, penClicked, penPressed, popupMenuEvent, positionCellControl, remapColumns, restoreColumnWidthAdjustments, saveColumnWidthAdjustments, scrolled, scrollTo, select, setColAdjust, setColWidth, show, showingMenuFor, sizeColumnToFitData, startedEditing, updateControlspublic int minWidth
public int minHeight
public boolean vmode
public boolean dontAutoSelectScrollMode
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)
TableModelcalculateColWidth in class TableModelpublic int calculateRowHeight(int row)
TableModelcalculateRowHeight in class TableModelprotected void calculateRC()
public void resized(int width,
int height)
TableModelresized 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)
TableModelgetCellAttributes in class TableModelpublic boolean canSelect(int row,
int col)
TableModelcanSelect in class TableModelpublic void made()
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 class TableModel