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, verticalScrollUnit
BDR_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_SUNKEN
ALWAYS_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, WEST
All, 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, updateControls
public 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)
TableModel
calculateColWidth
in class TableModel
public int calculateRowHeight(int row)
TableModel
calculateRowHeight
in class TableModel
protected void calculateRC()
public void resized(int width, int height)
TableModel
resized
in class TableModel
public 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 TableModel
x
- 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 TableModel
public void made()
made
in class TableModel
public 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