ewe.ui
Class TableControl

java.lang.Object
  extended byewe.ui.ControlBase
      extended byewe.ui.Control
          extended byewe.ui.Container
              extended byewe.ui.TableControl
All Implemented Interfaces:
CellConstants, ControlConstants, EventListener, ImageRefresher, IScroll, ScrollClient, TimerProc, UIConstants
Direct Known Subclasses:
TreeControl

public class TableControl
extends Container
implements ScrollClient

This is a fairly powerful Table implementation. It uses this TableControl as the actual Control to be displayed on the screen and to respond to user inputs. It also uses a TableModel to specify the particulars of the table cells and table data.


Field Summary
 boolean allowClipboardOperations
           
 boolean allowDragSelection
          Set this to false so that only one cell/cell group can be selected at a time.
 boolean autoScrollToVisible
           
 boolean clickClearsItself
           
protected  int clickedFlags
          You can check this in the clicked(int row, int col) method to how the click was generated.
protected  boolean clickMode
          Indicates whether click mode is selected or not.
 Point cursor
          This is the cursor position.
protected  Vector extendedSelection
           
 int listMode
          This is if the table is to be considered a wrapping list (such as in a FileChooser).
protected  TableModel model
           
 boolean multiSelect
          Allow disconnected blocks to be selected.
static Vector oldExtendedSelection
           
protected  Rect oldSelection
          The selection rectangle.
 boolean penSelectMode
          If this is true then pen presses act as if CONTROL is always pressed.
protected  Rect selection
          The selection rectangle.
 
Fields inherited from class ewe.ui.Container
closedFocus, cycleFocus, dontAutoScroll, dontFocusOnChildren
 
Fields inherited from class ewe.ui.Control
_debug, backGround, beforeRemoved, borderColor, borderStyle, borderWidth, children, columns, constraints, DoPaintMethod, dragging, dragResolution, dragTime, exitKeys, fieldTransfer, font, foreGround, haveNativePaint, height, holdDownPause, holdTick, hotKey, image, lastSelected, listeners, maxHeight, maxWidth, menuState, minHeight, minWidth, modifiers, MyClass, name, next, np, parent, penStatus, popupSound, popupSoundClip, preferredHeight, preferredWidth, prev, prompt, promptControl, rows, ss, standardBorder, standardEdge, startDragResolution, tags, tail, text, toolTip, width, x, y
 
Fields inherited from class ewe.ui.ControlBase
clipItems, clipObject, clipOwner, curPoint, currentPenEvent, debugControl, debugFlag, DidHoldDown, doubleBuffer, doubleClickTime, firstPress, globalDrawFlat, globalEditable, globalEnabled, globalPalmStyle, globalSmallControls, GotPenDown, PenIsOn, pressPoint, TAG_LAST_USER_DATA, TAG_USER_DATA, TAKE_FIRST_PRESS, unnamed, useNativeTextInput
 
Fields inherited from interface ewe.ui.IScroll
Higher, Horizontal, Lower, OPTION_INDICATOR_ONLY, PageHigher, PageLower, ScrollHigher, ScrollLower, TrackTo, Vertical
 
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
 
Fields inherited from interface ewe.fx.ImageRefresher
KEEP_VISIBLE
 
Constructor Summary
TableControl()
           
 
Method Summary
 void addToSelection(int row, int col)
          This adds to the selection.
 void addToSelection(Rect r, boolean repaint)
          This adds a section to the selection, extending the current selection to include all cells in between.
 void addToSelection(Rect r, boolean extend, boolean repaint)
          This adds a section to the selection and will either extend the selection or add it as an individual selection.
protected  void calculateSizes()
          Override this to calculate the preferred, minimum and maximum size of your control.
 boolean canGo(int orientation, int direction, int position)
           
 boolean canSelect(int row, int col)
          Returns whether a row and column can be selected.
 Point cellAtPoint(int x, int y, Point dest)
          Find out which cell is at the point (x,y).
 Point cellAtPoint(int x, int y, Point dest, boolean dataOnly)
          Find out which cell is at the point (x,y).
 boolean changeOrigin(int fr, int fc)
          Set the top-left cell being displayed.
protected  boolean checkFirstKey()
           
 void clearCursor()
           
 void clearSelectedBlock(Rect block)
           
 void clearSelectedCells(Vector getOldSelection)
          This clears the selection.
 void clearSelection(int row, int col, Rect getOldSelection)
           
 void clearSelection(Rect getOldSelection)
          This clears the selection.
 void clicked(int row, int col)
          This gets called when a cell is clicked (Pressed and Released quickly).
 void cursorTo(int row, int col, boolean selectNew)
           
protected  boolean doHotKey(Control parent, KeyEvent key)
          This method checks to see if a KeyEvent should be considered the Control's hot-key.
 boolean doMenu(Point where)
          This is a request to display a menu based on the pen being held or the mouse being right clicked on the Control.
 void doPaint(Graphics g, Rect area)
           
 void doPaintChildren(Graphics g, int x, int y, int w, int h)
          This overrides doPaintChildren() to do nothing.
 void doScroll(int which, int action, int value)
           
 void doubleClicked(int row, int col)
           
 void dragged(DragContext dc)
          This is called during the drag operation.
 Rect findSelectedBlock(int row, int col, Rect dest)
           
 void fireClickedEvent(int row, int col, boolean isDouble)
          This fires the click event.
 void fireSelectionEvent()
          This fires the selection event.
 void fireSelectionEvent(int flags)
          This fires the selection event.
 Point firstCellToPaint(int x, int y, Point dest)
           
 int getActual(int which)
           
 int getCurrent(int which)
           
 Dimension getCursorSize()
           
 Rect getDataArea(Rect dest)
          Find the area on the table which contains the data, not the headers.
protected  Control getFirstFocus()
           
 int getLastColToShow()
           
 int getLastColToShow(int forWidth)
           
 int getLastRowToShow()
           
 int getLastRowToShow(int forHeight)
           
 Rect getOnScreen(int firstCol, int firstRow, Rect dest)
          This returns which rows and columns are on the screen, given the specified firstCol and firstRow.
 Rect getOnScreen(Rect dest)
          This returns which rows and columns are on the screen.
 Point getPageUp(Point dest)
          Find out the cell coordinates if a page up is done.
 Rect getScreenRect(int row, int col, Rect dest)
          Get the on screen rectangle for the cell.
 Point getSelectedCell(Point dest)
          This returns a single selected cell.
 Vector getSelectedCells(Vector dest)
          This returns all selected cells as a Vector of Rect objects.
 int[] getSelectedIndexes()
          This is only relevant with listMode being true.
 Rect getSelection(Rect dest)
          This return the selected rectangle of cells.
 TableModel getTableModel()
           
 Object getToolTip(int x, int y)
          Return a Tool Tip for the x,y position (in pixels) on the table.
 int getVisible(int which, int forSize)
           
protected  boolean inRect(int row, int col, Rect selection)
           
 void invertSelectedIndexes()
          This is only relevant with listMode being true.
 boolean isASelection()
          Reports whether at least one cell is selected.
 boolean isIn(int col, int row, Rect where)
           
 boolean isSelected(int row, int col)
          Returns if the cell in row and col are selected.
 boolean isVisible(int row, int col, boolean completely)
          Find out if the cell at row and col is completely visible (completely == true) or at least partially visible (completely == false).
 void make(boolean reMake)
          This is used to "make" the control before being displayed.
 boolean multipleSelected()
          In listMode this returns true if more than one cell is selected.
 boolean needScrollBar(int which, int forSize)
           
 void onKeyEvent(KeyEvent ev)
           
 void onPenEvent(PenEvent pe)
          Called to handle an incoming PenEvent.
protected  Point overColStretch(int x, int y)
           
 TableCellAttributes overrideAttributes(TableCellAttributes ta)
          This is called after the TableModel calls its own getTableCellAttributes().
protected  Point overRowStretch(int x, int y)
           
 void paintBackground(Graphics g)
           
 void paintCells(Graphics gr, Rect cellsToPaint)
           
 void paintCells(Graphics gr, Vector rectsToPaint)
           
 void paintSelectedCells()
           
 void paintSelection()
          This repaints the most recently selected cell rectangle.
 void penDoubleClicked(Point p)
          Called if the Pen or Mouse button is double clicked on the Control.
 void penPressed(Point p)
          Called when the Pen or Mouse button is pressed on the control.
 void penReleased(Point p)
          Called when the Pen or Mouse button is released on the control.
 void penReleased(Point p, boolean isDouble)
           
 void popupMenuEvent(MenuEvent ev)
          This is called when the popup menu associated with the control generates an event.
 void repaintCell(int row, int col)
          Repaint a Cell.
 void repaintNow(Graphics g, Rect area)
          Repaint a section of the Control now.
 void resizeTo(int width, int height)
          This will change the width and height values.
 boolean scrollToVisible(int row, int col)
          Scrolls the data so that the cell at row and col is completely visible.
 void selectAllIndexes(boolean selectOn)
          This is only relevant with listMode being true.
 void selectAndUpdate(int row, int col)
           
 void selectAndUpdate(int row, int col, boolean clearOld, boolean startNewBlock)
           
 boolean setClickMode(boolean mode)
          This sets ClickMode on or off.
 void setTableModel(TableModel m)
           
 void startDragging(DragContext dc)
          This is called to indicate the start of a pen/mouse drag operation.
 void startDropMenu(Point p)
           
 boolean startNewSelectionBlock()
           
 void stopDragging(DragContext dc)
          Called when the pen was released during a drag operation.
 void update(boolean repaint)
          Update the table to reflect any changes.
 void updateControls()
          This removes all controls within the table.
 
Methods inherited from class ewe.ui.Container
_paintChildren, add, addDirectly, containerHasFocus, dismantle, dismantle, findChild, focusFirst, focusFirst, focusOnContainer, focusOnData, getChildren, getChildrenBackwards, getNextKeyFocus, gotFocus, lostFocus, remove, removeAll, repaintDataNow, scrollToVisible, takeFocus, takePromptControl
 
Methods inherited from class ewe.ui.Control
acceptsData, activate, addListener, addTimer, amOnTopFrame, calculateTextSize, cancelCut, cancelHoldDown, canEdit, chainDataChange, change, checkClipboardOperations, checkExitKey, checkMenu, checkMenuKey, checkModifiers, checkPenTransparent, clearTag, clipboardToString, clipboardTransfer, closeMenu, contains, contains, createGraphics, dataAccepted, dataBeingRemoved, dataDraggedOff, dataDraggedOver, dataDraggedOver, dataDroppedOn, dataTransferCancelled, deactivate, defaultTo, doAction, doActionKey, doBackground, doBorder, dontAcceptDrop, doPaintChildren, doPaintChildren, doPaintData, doPaintData, doShowMenu, exitEntry, fillBackground, formClosing, fromClipboard, fromField, fromField, getAllDescendants, getAllSubControls, getBackground, getClipboardMenu, getClipObject, getControlBuffer, getControlBuffer, getDataRect, getDataToCopy, getDataToDragAndDrop, getDim, getDisplayText, getDragAndDropContext, getFont, getFontMetrics, getFontMetrics, getForeground, getFrame, getFrameOrContainer, getGraphics, getImage, getLastSelected, getLocation, getMaximumSize, getMenu, getMinimumSize, getModifiers, getNext, getParent, getPasswordCharacter, getPosInFrame, getPosInParent, getPreferredSize, getPrompt, getPromptText, getRect, getRect, getServer, getSize, getSizes, getSubControls, getTag, getText, getWindow, hasModifier, hasPopupFormAttached, hasTag, inheritModifiers, isChildOf, isModal, isOnMe, isSomeonesHotKey, makeFrameTopMost, makeHot, menuIsActive, modify, modifyAll, modifyAll, notifyAction, notifyDataChange, notifyDataChange, notNative_doPaintChildren, oldButWorksDoPaintChildren, oldPaintChildren, oldPostEvent, onControlEvent, onEvent, onLabelPenEvent, onPaint, paintChildren, penClicked, penHeld, penRightReleased, popupBeep, popupMenuClosed, popupMenuEvent, postEvent, recalculatePreferredSize, redisplay, refresh, removeListener, removeTimer, repaint, repaintNow, repaintNow, requestPaint, requestResizeTo, resetRect, restore, scrollAndRepaint, sendToListeners, set, setBorder, setCell, setClipObject, setControl, setCursor, setFixedSize, setFont, setHotKey, setHotKey, setLocation, setMaximumSize, setMenu, setMinimumSize, setPreferredSize, setPromptControl, setRect, setRect, setServer, setTag, setTags, setText, setTextSize, setToolTip, show, shown, standardOnKeyEvent, startDragAndDrop, startDragAndDrop, takeData, takeFromClipboard, testDim, ticked, toClipboard, toField, toField, toString, toTextData, transferPenPress, transferPenPress, tryDragAndDrop, tryNext, tryStartMenu, updateData, willAcceptDrop, willShowFrame
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode
 
Methods inherited from interface ewe.ui.ScrollClient
getServer, setServer
 

Field Detail

model

protected TableModel model

allowDragSelection

public boolean allowDragSelection
Set this to false so that only one cell/cell group can be selected at a time.


multiSelect

public boolean multiSelect
Allow disconnected blocks to be selected.


penSelectMode

public boolean penSelectMode
If this is true then pen presses act as if CONTROL is always pressed.


listMode

public int listMode
This is if the table is to be considered a wrapping list (such as in a FileChooser). A value greater than zero indicates this mode. The value itself states how many columns are considered as being a single item.


cursor

public Point cursor
This is the cursor position. This will generally follow the selection.


allowClipboardOperations

public boolean allowClipboardOperations

autoScrollToVisible

public boolean autoScrollToVisible

clickClearsItself

public boolean clickClearsItself

selection

protected Rect selection
The selection rectangle.


oldSelection

protected Rect oldSelection
The selection rectangle.


extendedSelection

protected Vector extendedSelection

oldExtendedSelection

public static Vector oldExtendedSelection

clickMode

protected boolean clickMode
Indicates whether click mode is selected or not.


clickedFlags

protected int clickedFlags
You can check this in the clicked(int row, int col) method to how the click was generated. If TableEvent.FLAG_SELECTED_BY_ARROWKEY is true, then the user navigated to that cell via the keyboard and not be a pen/mouse press.

Constructor Detail

TableControl

public TableControl()
Method Detail

getCursorSize

public Dimension getCursorSize()

getTableModel

public TableModel getTableModel()

setTableModel

public void setTableModel(TableModel m)

overrideAttributes

public TableCellAttributes overrideAttributes(TableCellAttributes ta)
This is called after the TableModel calls its own getTableCellAttributes(). This gives the opportunity to modify the attributes or return a completely new attribute.


inRect

protected boolean inRect(int row,
                         int col,
                         Rect selection)

isSelected

public boolean isSelected(int row,
                          int col)
Returns if the cell in row and col are selected.


getSelection

public Rect getSelection(Rect dest)
This return the selected rectangle of cells. If either width or height is zero - no cells are selected.


getSelectedCell

public Point getSelectedCell(Point dest)
This returns a single selected cell. It will work for TreeControls as well as TableControls. It will return null if no cell is selected.


getSelectedCells

public Vector getSelectedCells(Vector dest)
This returns all selected cells as a Vector of Rect objects.


isIn

public boolean isIn(int col,
                    int row,
                    Rect where)

findSelectedBlock

public Rect findSelectedBlock(int row,
                              int col,
                              Rect dest)

isASelection

public boolean isASelection()
Reports whether at least one cell is selected.


clearSelectedBlock

public void clearSelectedBlock(Rect block)

clearSelection

public void clearSelection(int row,
                           int col,
                           Rect getOldSelection)

clearSelection

public void clearSelection(Rect getOldSelection)
This clears the selection. It will NOT repaint the table. This only returns the most recently selected rectangle in a set of selected rectangles.


clearSelectedCells

public void clearSelectedCells(Vector getOldSelection)
This clears the selection. It will NOT repaint the table. This only returns the most recently selected rectangle in a set of selected rectangles.


paintSelection

public void paintSelection()
This repaints the most recently selected cell rectangle.


paintSelectedCells

public void paintSelectedCells()

addToSelection

public void addToSelection(int row,
                           int col)
This adds to the selection. It will NOT repaint the table.


addToSelection

public void addToSelection(Rect r,
                           boolean repaint)
This adds a section to the selection, extending the current selection to include all cells in between.


startNewSelectionBlock

public boolean startNewSelectionBlock()

addToSelection

public void addToSelection(Rect r,
                           boolean extend,
                           boolean repaint)
This adds a section to the selection and will either extend the selection or add it as an individual selection.


cellAtPoint

public Point cellAtPoint(int x,
                         int y,
                         Point dest)
Find out which cell is at the point (x,y). If no cell is at that point it will return null. Calls the cellAtPoint() method with dataOnly false.


firstCellToPaint

public Point firstCellToPaint(int x,
                              int y,
                              Point dest)

cellAtPoint

public Point cellAtPoint(int x,
                         int y,
                         Point dest,
                         boolean dataOnly)
Find out which cell is at the point (x,y). If no cell is at that point it will return null. If dataOnly is true, then the headers will not be included.


repaintCell

public void repaintCell(int row,
                        int col)
Repaint a Cell.


penPressed

public void penPressed(Point p)
Description copied from class: Control
Called when the Pen or Mouse button is pressed on the control. This is called by the onPenEvent(PenEvent ev) method.

Within this method you can use the Control.currentPenEvent value to find out more about the PenEvent that caused this - including any modifiers (e.g. SHIFT keys) or determine if the left or right mouse button was pressed.

Overrides:
penPressed in class Control
Parameters:
p - The point on the Control where the pen was pressed.

selectAndUpdate

public void selectAndUpdate(int row,
                            int col,
                            boolean clearOld,
                            boolean startNewBlock)

selectAndUpdate

public void selectAndUpdate(int row,
                            int col)

penReleased

public void penReleased(Point p,
                        boolean isDouble)

doMenu

public boolean doMenu(Point where)
Description copied from class: Control
This is a request to display a menu based on the pen being held or the mouse being right clicked on the Control. By default this method calls tryStartMenu(p);

Overrides:
doMenu in class Control
Parameters:
where - The point where the pen was pressed or held.
Returns:
true if a menu was displayed.

canSelect

public boolean canSelect(int row,
                         int col)
Returns whether a row and column can be selected.


setClickMode

public boolean setClickMode(boolean mode)
This sets ClickMode on or off. ClickMode is where pen presses can only "click" a cell. The cell is selected when the pen is held on it and then released when the pen is released - firing a TableEvent. This is useful when using the table as a keypad of some sort. Only single cells can be clicked.


clicked

public void clicked(int row,
                    int col)
This gets called when a cell is clicked (Pressed and Released quickly).


doubleClicked

public void doubleClicked(int row,
                          int col)

fireClickedEvent

public void fireClickedEvent(int row,
                             int col,
                             boolean isDouble)
This fires the click event.


fireSelectionEvent

public void fireSelectionEvent(int flags)
This fires the selection event.


fireSelectionEvent

public void fireSelectionEvent()
This fires the selection event.


penReleased

public void penReleased(Point p)
Description copied from class: Control
Called when the Pen or Mouse button is released on the control. This is called by the onPenEvent(PenEvent ev) method.

Within this method you can use the Control.currentPenEvent value to find out more about the PenEvent that caused this - including any modifiers (e.g. SHIFT keys) or determine if the left or right mouse button was pressed.

Overrides:
penReleased in class Control
Parameters:
p - The point on the Control where the pen was released.

penDoubleClicked

public void penDoubleClicked(Point p)
Description copied from class: Control
Called if the Pen or Mouse button is double clicked on the Control. This is called by the onPenEvent(PenEvent ev) method.

Within this method you can use the Control.currentPenEvent value to find out more about the PenEvent that caused this - including any modifiers (e.g. SHIFT keys) or determine if the left or right mouse button was pressed.

By default this method simply calls the penClicked() method.

Overrides:
penDoubleClicked in class Control
Parameters:
p - The point on the Control where the pen was double-clicked.

multipleSelected

public boolean multipleSelected()
In listMode this returns true if more than one cell is selected. Otherwise it returns true if more than one block is selected.


getSelectedIndexes

public int[] getSelectedIndexes()
This is only relevant with listMode being true. It returns a list of all selected indexes, in no particular order.


selectAllIndexes

public void selectAllIndexes(boolean selectOn)
This is only relevant with listMode being true. It selects all items in the list or deselects all items in the list. It does not do a repaint.


invertSelectedIndexes

public void invertSelectedIndexes()
This is only relevant with listMode being true. It inverts the selection. It does not do a repaint.


getScreenRect

public Rect getScreenRect(int row,
                          int col,
                          Rect dest)
Get the on screen rectangle for the cell.


startDropMenu

public void startDropMenu(Point p)

startDragging

public void startDragging(DragContext dc)
Description copied from class: Control
This is called to indicate the start of a pen/mouse drag operation. This will only get called if the WantDrag modifier has been set for this control. Within this method you can call startDragAndDrop() or tryDragAndDrop() to begin a data DragAndDrop operation.

Overrides:
startDragging in class Control
Parameters:
dc - A DragContext indicating information about the dragging.

stopDragging

public void stopDragging(DragContext dc)
Description copied from class: Control
Called when the pen was released during a drag operation. This will only be called if a data DragAndDrop was not initiated and if the cancelled member of the DragContext was not set true during the operation.

Overrides:
stopDragging in class Control
Parameters:
dc - The DragContext for the dragging operation.

dragged

public void dragged(DragContext dc)
Description copied from class: Control
This is called during the drag operation. It is also called by default by the startDragging() method if you do not override it.

Overrides:
dragged in class Control
Parameters:
dc - The DragContext for the dragging operation.

getDataArea

public Rect getDataArea(Rect dest)
Find the area on the table which contains the data, not the headers. This is the scrollable area on the screen.


isVisible

public boolean isVisible(int row,
                         int col,
                         boolean completely)
Find out if the cell at row and col is completely visible (completely == true) or at least partially visible (completely == false).


scrollToVisible

public boolean scrollToVisible(int row,
                               int col)
Scrolls the data so that the cell at row and col is completely visible. Returns true if a scroll was actually done. It does NOT repaint.


changeOrigin

public boolean changeOrigin(int fr,
                            int fc)
Set the top-left cell being displayed.


updateControls

public void updateControls()
This removes all controls within the table.


update

public void update(boolean repaint)
Update the table to reflect any changes. If you call with repaint false then any scroll bars will be updated but no repaint will be called.


paintBackground

public void paintBackground(Graphics g)
Overrides:
paintBackground in class Control

repaintNow

public void repaintNow(Graphics g,
                       Rect area)
Description copied from class: Control
Repaint a section of the Control now.

Overrides:
repaintNow in class Control
Parameters:
g - The Graphics to paint to. If this is null a new Graphics will be created.
area - The rectangle within the Control to paint. If this is null the entire Control will be painted.

doPaint

public void doPaint(Graphics g,
                    Rect area)
Overrides:
doPaint in class Control

paintCells

public void paintCells(Graphics gr,
                       Vector rectsToPaint)

paintCells

public void paintCells(Graphics gr,
                       Rect cellsToPaint)

getLastColToShow

public int getLastColToShow()

getLastColToShow

public int getLastColToShow(int forWidth)

getLastRowToShow

public int getLastRowToShow()

getLastRowToShow

public int getLastRowToShow(int forHeight)

getOnScreen

public Rect getOnScreen(Rect dest)
This returns which rows and columns are on the screen. x = first column on screen. y = first row on screen. width = number of columns fully visible. height = number of rows fully visible.


getOnScreen

public Rect getOnScreen(int firstCol,
                        int firstRow,
                        Rect dest)
This returns which rows and columns are on the screen, given the specified firstCol and firstRow. x = first column on screen. y = first row on screen. width = number of columns fully visible. height = number of rows fully visible.


getPageUp

public Point getPageUp(Point dest)
Find out the cell coordinates if a page up is done.


getActual

public int getActual(int which)
Specified by:
getActual in interface ScrollClient

getVisible

public int getVisible(int which,
                      int forSize)
Specified by:
getVisible in interface ScrollClient

getCurrent

public int getCurrent(int which)
Specified by:
getCurrent in interface ScrollClient

needScrollBar

public boolean needScrollBar(int which,
                             int forSize)
Specified by:
needScrollBar in interface ScrollClient

canGo

public boolean canGo(int orientation,
                     int direction,
                     int position)
Specified by:
canGo in interface ScrollClient

doScroll

public void doScroll(int which,
                     int action,
                     int value)
Specified by:
doScroll in interface ScrollClient

make

public void make(boolean reMake)
Description copied from class: Control
This is used to "make" the control before being displayed. This is usually only overridden by containers.

Overrides:
make in class Control
Parameters:
reMake - if this is true then you should do a full re-make.

resizeTo

public void resizeTo(int width,
                     int height)
Description copied from class: Control
This will change the width and height values.

Overrides:
resizeTo in class Control

doPaintChildren

public void doPaintChildren(Graphics g,
                            int x,
                            int y,
                            int w,
                            int h)
This overrides doPaintChildren() to do nothing. Child controls of a Table must be handled differently. This is done correctly in GridTableModel.

Overrides:
doPaintChildren in class Control

calculateSizes

protected void calculateSizes()
Description copied from class: Control
Override this to calculate the preferred, minimum and maximum size of your control. This is only called once unless the modifier flag AlwaysRecalculateSizes is true. During the calculation you will set the variables preferredWidth, preferredHeight, etc. directly.

Overrides:
calculateSizes in class Control

getToolTip

public Object getToolTip(int x,
                         int y)
Return a Tool Tip for the x,y position (in pixels) on the table. In this method you can do:
        Point cell = cellAtPoint(x,y);
        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.
        

Overrides:
getToolTip in class Control
Parameters:
x - The x co-ordinate in pixels of the mouse.
y - The y co-ordinate in pixels of the mouse.
Returns:
An acceptable ToolTip object.

clearCursor

public void clearCursor()

cursorTo

public void cursorTo(int row,
                     int col,
                     boolean selectNew)

checkFirstKey

protected boolean checkFirstKey()

doHotKey

protected boolean doHotKey(Control parent,
                           KeyEvent key)
Description copied from class: Control
This method checks to see if a KeyEvent should be considered the Control's hot-key. If it is it calls doAction(ByKeyboard).

Overrides:
doHotKey in class Container

getFirstFocus

protected Control getFirstFocus()
Overrides:
getFirstFocus in class Container

onKeyEvent

public void onKeyEvent(KeyEvent ev)
Overrides:
onKeyEvent in class Control

popupMenuEvent

public void popupMenuEvent(MenuEvent ev)
Description copied from class: Control
This is called when the popup menu associated with the control generates an event. By default it calls popupMenuEvent(Object selectedItem) if the selectedItem is not null.

Overrides:
popupMenuEvent in class Control
Parameters:
ev - The event.

overColStretch

protected Point overColStretch(int x,
                               int y)

overRowStretch

protected Point overRowStretch(int x,
                               int y)

onPenEvent

public void onPenEvent(PenEvent pe)
Description copied from class: Control
Called to handle an incoming PenEvent. By default this dispatches the event to the various pen handling methods like penPressed()

Overrides:
onPenEvent in class Control
Parameters:
pe - The incoming PenEvent.