public class TableControl extends Container implements ScrollClient
Modifier and Type | Field and Description |
---|---|
boolean |
allowClipboardOperations |
boolean |
allowDragSelection
Set this to false so that only one cell/cell group can be selected
at a time.
|
boolean |
autoScrollToVisible |
boolean |
canDragItems
Set this to true to allow the dragging of table items.
|
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 boolean |
dontUpdate |
protected Vector |
extendedSelection |
boolean |
ignoreDoubleClick
Set this true to ignore double clicks.
|
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.
|
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.
|
closedFocus, cycleFocus, dontAutoScroll, dontFocusOnChildren, FIND_FOR_MOUSE_PRESS, takeNextFocus
backGround, beforeRemoved, borderColor, borderStyle, borderWidth, children, columns, constraints, curFont, debugModify, debugRepaintNow, disabledBackground, dragging, dragResolution, dragTime, exitKeys, fieldTransfer, font, fontChange, fontFrom, foreGround, height, holdDownPause, holdTick, hotKey, image, lastSelected, listeners, lockPaint, maxHeight, maxWidth, menuState, minHeight, minWidth, modifiers, name, next, parent, penStatus, preferredHeight, preferredWidth, prev, prompt, promptControl, rows, ss, startDragResolution, tags, tail, text, toolTip, width, x, y
clipItems, clipObject, clipOwner, debugControl, debugFlag, doubleBuffer, doubleClickTime, doubleSizedFontHeight, firstPress, globalEditable, globalEnabled, PEN_STATUS_DID_HOLD_DOWN, PEN_STATUS_GOT_PEN_DOWN, PEN_STATUS_PEN_IS_ON, pressPoint, TAG_BOOLEAN_KEEP_BELOW_SIP, TAG_HOVER_TIME_INT, TAG_LAST_USER_DATA, TAG_USER_DATA, TAKE_FIRST_PRESS, unnamed
GoHigher, GoLower, Horizontal, OPTION_INDICATOR_ONLY, PageHigher, PageLower, ScrollHigher, ScrollLower, TrackTo, Vertical
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
KEEP_VISIBLE
Constructor and Description |
---|
TableControl() |
Modifier and Type | Method and Description |
---|---|
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)
This method should return whether the ScrollClient can actually scroll in a particular
direction, given a starting position in units.
|
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 - if it returns true you
should do a repaint of the Table.
|
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 gr,
Rect area)
This is the main method to override when doing custom Control painting.
|
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)
This is called by the ScrolledServer to indicate that the user has requested
a scroll.
|
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) |
Closes |
freezeUpdate(boolean updateOnClose) |
int |
getActual(int which)
Get the full number of units either vertically or horizontally that the ScrollClient
contains.
|
int |
getCurrent(int which)
This should return which unit is currently being displayed.
|
Dimension |
getCursorSize() |
Rect |
getDataArea(Rect dest)
Find the area on the table which contains the data, not the headers.
|
protected Control |
getFirstFocus() |
int |
getHeight() |
int |
getLastColToShow() |
int |
getLastColToShow(int forWidth) |
int |
getLastRowToShow() |
int |
getLastRowToShow(int forHeight) |
Range |
getLinesOnScreen(Range dest) |
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 |
getOrigin(Point destination) |
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.
|
int |
getSelectedLine()
If at least one cell is selected, return the row of the selection -
otherwise return -1;
|
RangeList |
getSelectedRows(RangeList dest)
Return a RangeList containing the all rows which have at least one cell
selected in them.
|
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)
Given a display size, this method should return the number of units that can be fully
displayed within the display size for the specified dimension.
|
int |
getWidth() |
boolean |
hasActiveControls() |
Object |
hideCursor()
This hides the cursor and returns an Object that can be used
to restore it.
|
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.
|
void |
mouseMoveChangeCursor(int newCursor)
This should be called by the TableModel during a mouse move event to tell the Table to change the cursor.
|
protected void |
mouseMoving(boolean isOnValidCell,
PenEvent pe,
int cellRow,
int cellCol) |
boolean |
multipleSelected()
In listMode this returns true if more than one cell is selected.
|
boolean |
needScrollBar(int which,
int forSize)
This method should return whether a ScrollBar (or some other form of scrolling
user control) is necessary for the specified dimension.
|
boolean |
noSelection()
This clears the selection but does NOT repaint the screen.
|
void |
onEvent(Event ev) |
void |
onKeyEvent(KeyEvent ev) |
void |
onPenEvent(PenEvent pe) |
protected Point |
overColMove(int x,
int y) |
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)
Do a standard painting of the Background.
|
void |
paintCells(Rect cellsToPaint) |
void |
paintCells(Vector rectsToPaint) |
void |
paintSelectedCells() |
void |
paintSelection()
This repaints the most recently selected cell rectangle.
|
void |
penClicked(Point where)
Called if the Pen or Mouse button is quickly pressed and released.
|
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 |
removeControls() |
void |
repaintCell(int row,
int col)
Repaint a Cell, but not the column or row headers.
|
void |
repaintNow(Graphics g,
Rect area) |
void |
resizeTo(int width,
int height)
This is called to change the width and height values.
|
void |
restoreCursor(Object fromHideCursor)
This restores the cursor from the value returned by hideCursor.
|
void |
restoreOrResetCursor(Object fromHideCursor)
If fromHideCursor is null, this will set the cursor to the default
"starting" position by calling setCursorToStart().
|
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) |
void |
selectLine(int line,
boolean exclusive,
boolean fireEvent)
Select a line and make it visible.
|
boolean |
setClickMode(boolean mode)
This sets ClickMode on or off.
|
void |
setCursorToStart() |
void |
setTableModel(TableModel m) |
protected boolean |
showHoldDownIndicator(int x,
int y)
If this returns true then the Pen Hold Down indicator will be
displayed before a Popup menu is shown.
|
void |
startDragging(DragContext dc)
This is called to indicate the start of a pen/mouse drag operation.
|
void |
startDropMenu(Point p) |
protected boolean |
startItemDragging(DragContext dc,
Point draggedItem)
Override this to setup an item being dragged.
|
boolean |
startNewSelectionBlock() |
void |
stopDragging(DragContext dc)
Called when the pen was released during a drag operation.
|
protected boolean |
tryStartMenu(Menu m,
Point where) |
void |
update(boolean repaint)
Update the table to reflect any changes.
|
void |
updateControls(boolean startUpdate)
Prepare Controls for a change in the Table structure.
|
void |
updateInWindowThread(boolean repaint) |
add, addDirectly, completeAddPopupControl, containerHasFocus, dismantle, dismantle, findChild, findChild, focusFirst, focusFirst, focusOnContainer, focusOnData, getChildren, getNextKeyFocus, gotFocus, grayOut, hide, lostFocus, relayout, remove, removeAll, removePopupControl, repaintDataNow, reShow, scrollToVisible, setHidden, startAddPopupControl, takeFocus, takePromptControl, unhide
acceptsData, activate, addListener, amOnTopFrame, applyFontChange, baseOnPenEvent, bufferGraphics, bufferGraphics, bufferGraphics, bufferGraphics, bufferGraphics, cache, calculatedSizes, calculateTextSize, calculateTextSize, calculateTextSize, cancelHoldDown, cancelPenPress, canEdit, change, changeDimension, changeTag, checkClipboardOperations, checkExitKey, checkMenu, checkMenuKey, checkModifiers, checkParentInterceptsUIEvent, checkPenTransparent, childrenPainted, clearTag, clipboardToString, clipboardTransfer, closeMenu, contains, contains, createNewMenu, dataAccepted, dataBeingRemoved, dataDraggedOff, dataDraggedOver, dataDraggedOver, dataDroppedOn, dataTransferCancelled, deactivate, defaultTo, deferInWindowThread, doAction, doActionKey, doBackground, doBorder, dontAcceptDrop, doPaintData, doPaintData, doShowMenu, draw, draw, draw, exitEntry, fillBackground, fillBackgroundNotInFrame, findTagInParents, fontChanged, formClosing, free, fromClipboard, fromField, fromField, getAllDescendants, getAllSubControls, getAncestor, getAncestor, getAncestorProperty, getBackground, getCached, getCachedChildren, getCachedDim, getCachedDim, getCachedRect, getCachedRect, getCachedSubControls, getChildAnchor, getChildren, getChildrenBackwards, getClipboardMenu, getClipObject, getContentsInsets, getContentsInsets, getContentsRect, getDataToCopy, getDataToDragAndDrop, getDim, getDisplayText, getDragAndDropContext, getFieldTransfer, getFont, getFontMetrics, getFontMetrics, getFontMetricsForSizeCalculations, getForeground, getFrame, getFrameOrContainer, getGraphics, getGraphics, getHideParent, getImage, getLastSelected, getLocation, getLock, getMaximumSize, getMenu, getMinimumSize, getModifiedBorderFlags, getModifiers, getNext, getPaintParameters, getParent, getParent, getParent, getParentOrListener, getPasswordCharacter, getPosInFrame, getPosInFrame, getPosInParent, getPosInParent, getPreferredSize, getPreferredSizeByParent, getPreferredTextSize, getPrompt, getPromptText, getRect, getRect, getServer, getSize, getSizes, getSubControls, getSubControls, getTag, getText, getWindow, getWindowGraphics, hasModifier, hasPopupFormAttached, hasTag, hide, inheritModifiers, insetToContents, interceptChildUIEvent, isChildOf, isDirectChildOfWindow, isHidden, isModal, isOnMe, isOnMe, isOnMe, isSomeonesHotKey, makeFrameTopMost, makeHot, makeHot, makeInvisible, makeVisible, markAsTemporaryError, menuIsActive, menuStateChanged, modify, modifyAll, modifyAll, modifyFlags, mouseHover, newEventThread, notifyAction, notifyDataChange, notifyDataChange, notifyMenuItemSelected, notifyStructureChanged, onControlEvent, onLabelPenEvent, paintWithControlPainter, pauseEventThread, penHeld, penRightReleased, popupBeep, popupMenuClosed, popupMenuEvent, postEvent, postInWindowThread, postUIEvent, putInside, queueKeyEvent, queuePenEvent, readLock, recalculatePreferredSize, redisplay, refresh, releaseBufferedGraphics, removed, removeListener, repaint, repaint, repaintInWindowThread, repaintInWindowThread, repaintNow, repaintNow, repaintNow, requestPaint, requestResizeTo, resetAllCachedProperties, resetCachedProperties, resetRect, restore, restoreBorderModifiers, restoreFlags, resumeEventThread, scrollAndRepaint, sendToListeners, set, setAllFonts, setBackgroundImage, setBorder, setBorderModifiers, setCell, setChildAnchor, setClipObject, setControl, setCursor, setFieldTransfer, setFixedSize, setFont, setFontChange, setFreeDragging, setHidden, setHiddenParent, setHotKey, setHotKey, setLocation, setMaximumSize, setMenu, setMinimumSize, setPreferredSize, setPreferredTextSize, setPreferredTextSize, setPromptControl, setRect, setRect, setScaledBackgroundImage, setServer, setShadow, setSwiping, setTag, setTags, setText, setTextSize, setTiledBackgroundImage, setToolTip, shown, simulateClickOn, simulateKeyPresses, simulateKeyType, standardOnKeyEvent, startDragAndDrop, startDragAndDrop, takeData, takeFromClipboard, testInWindowThread, ticked, tipIsDisplayed, toClipboard, toField, toField, toIDString, toString, toTextData, transferPenPress, transferPenPress, tryDragAndDrop, tryGetGraphics, tryNext, tryStartMenu, unhide, unlock, updateData, updateDCDuringDD, updateFrom, updateTo, verifyWantDrag, verifyWantHoldDown, waitEventThread, willAcceptDrop, willShowFrame, windowHasFloatingControls, writeLock
doubleSizeIt, getGuiTextHeight, isDoubleSized, isDoubleSizedFont, loadImage, tryLoadImage
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getServer, setServer
protected TableModel model
public boolean allowDragSelection
public boolean canDragItems
public boolean multiSelect
public boolean penSelectMode
public int listMode
public Point cursor
public boolean allowClipboardOperations
public boolean autoScrollToVisible
public boolean ignoreDoubleClick
public boolean clickClearsItself
protected Rect selection
protected Rect oldSelection
protected Vector extendedSelection
protected boolean clickMode
protected int clickedFlags
protected boolean dontUpdate
public Dimension getCursorSize()
public TableModel getTableModel()
public void setTableModel(TableModel m)
public TableCellAttributes overrideAttributes(TableCellAttributes ta)
protected boolean inRect(int row, int col, Rect selection)
public boolean isSelected(int row, int col)
public Rect getSelection(Rect dest)
public Point getSelectedCell(Point dest)
public RangeList getSelectedRows(RangeList dest)
dest
- a destination RangeList or null.public Vector getSelectedCells(Vector dest)
public boolean isIn(int col, int row, Rect where)
public boolean isASelection()
public void clearSelectedBlock(Rect block)
public void clearSelection(int row, int col, Rect getOldSelection)
public void clearSelection(Rect getOldSelection)
public void clearSelectedCells(Vector getOldSelection)
public void paintSelection()
public void paintSelectedCells()
public void addToSelection(int row, int col)
public void addToSelection(Rect r, boolean repaint)
public boolean startNewSelectionBlock()
public void addToSelection(Rect r, boolean extend, boolean repaint)
public int getSelectedLine()
public void selectLine(int line, boolean exclusive, boolean fireEvent)
line
- the line to select.exclusive
- true to clear previous selection first.fireEvent
- true to fire a selection event.public Point cellAtPoint(int x, int y, Point dest)
public Point cellAtPoint(int x, int y, Point dest, boolean dataOnly)
public void repaintCell(int row, int col)
public void penPressed(Point p)
Control
Within this method you can use the Control.Gui.currentPenPress() 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.
penPressed
in class Control
p
- The point on the Control where the pen was pressed.public void selectAndUpdate(int row, int col, boolean clearOld, boolean startNewBlock)
public void selectAndUpdate(int row, int col)
public void penReleased(Point p, boolean isDouble)
protected boolean showHoldDownIndicator(int x, int y)
Control
showHoldDownIndicator
in class Control
x
- the x position on the Control.y
- the y position on the Control.public boolean doMenu(Point where)
Control
public boolean canSelect(int row, int col)
public boolean setClickMode(boolean mode)
public void clicked(int row, int col)
public void doubleClicked(int row, int col)
public void fireClickedEvent(int row, int col, boolean isDouble)
public void fireSelectionEvent(int flags)
public void fireSelectionEvent()
public void penReleased(Point p)
Control
Within this method you can use the Control.Gui.currentPenPress() 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.
penReleased
in class Control
p
- The point on the Control where the pen was released.public boolean multipleSelected()
public int[] getSelectedIndexes()
public void selectAllIndexes(boolean selectOn)
public void invertSelectedIndexes()
public Rect getScreenRect(int row, int col, Rect dest)
public void startDropMenu(Point p)
protected boolean startItemDragging(DragContext dc, Point draggedItem)
dc
- draggedItem
- public void startDragging(DragContext dc)
Control
startDragging
in class Control
dc
- A DragContext indicating information about the dragging.public void stopDragging(DragContext dc)
Control
stopDragging
in class Control
dc
- The DragContext for the dragging operation.public void dragged(DragContext dc)
Control
public Rect getDataArea(Rect dest)
public boolean isVisible(int row, int col, boolean completely)
public boolean scrollToVisible(int row, int col)
public boolean changeOrigin(int fr, int fc)
public void removeControls()
public void updateControls(boolean startUpdate)
public Closes freezeUpdate(boolean updateOnClose)
public void update(boolean repaint)
public void updateInWindowThread(boolean repaint)
public void paintBackground(Graphics g)
Control
paintBackground
in class Control
g
- the non-null Graphics to paint to.public void repaintNow(Graphics g, Rect area)
repaintNow
in class Control
public void doPaint(Graphics gr, Rect area)
Control
public void paintCells(Vector rectsToPaint)
public void paintCells(Rect cellsToPaint)
public int getLastColToShow()
public int getLastColToShow(int forWidth)
public int getLastRowToShow()
public int getLastRowToShow(int forHeight)
public Rect getOnScreen(Rect dest)
public Rect getOnScreen(int firstCol, int firstRow, Rect dest)
public int getActual(int which)
ScrollClient
getActual
in interface ScrollClient
which
- either Horizontal or Vertical.public int getVisible(int which, int forSize)
ScrollClient
getVisible
in interface ScrollClient
which
- either Horizontal or Vertical.forSize
- the size (usually in pixels) allowed to be displayed on screen.public int getCurrent(int which)
ScrollClient
getCurrent
in interface ScrollClient
which
- either Horizontal or Vertical.public boolean needScrollBar(int which, int forSize)
ScrollClient
However a ScrollClient can return true always if it always wishes a ScrollBar to be present, or false always if it never wishes a ScrollBar to be present.
needScrollBar
in interface ScrollClient
which
- either Horizontal or Vertical.forSize
- the size (usually in pixels) allowed to be displayed on screen.public boolean canGo(int orientation, int direction, int position)
ScrollClient
canGo
in interface ScrollClient
orientation
- either Horizontal or Vertical.direction
- either GoHigher or GoLower.position
- a starting position in units.public void doScroll(int which, int action, int value)
ScrollClient
doScroll
in interface ScrollClient
which
- either Horizontal or Verticalaction
- one of PageHigher, PageLower, ScrollHigher, ScrollLower, TrackTovalue
- this is used for the TrackTo action and indicates the position to
track to.public void make(boolean reMake)
Container
public void resizeTo(int width, int height)
Control
public void doPaintChildren(Graphics g, int x, int y, int w, int h)
doPaintChildren
in class Control
protected void calculateSizes()
Control
calculateSizes
in class Control
public Object getToolTip(int x, int y)
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.
getToolTip
in class Control
x
- The x co-ordinate in pixels of the mouse.y
- The y co-ordinate in pixels of the mouse.public Object hideCursor()
public boolean noSelection()
public void restoreCursor(Object fromHideCursor)
public void restoreOrResetCursor(Object fromHideCursor)
fromHideCursor
- a value from restoreCursor or null.public void clearCursor()
public void cursorTo(int row, int col, boolean selectNew)
public void setCursorToStart()
protected boolean checkFirstKey()
protected boolean doHotKey(Control parent, KeyEvent key)
Control
protected Control getFirstFocus()
getFirstFocus
in class Container
public void onKeyEvent(KeyEvent ev)
onKeyEvent
in class Control
public void popupMenuEvent(MenuEvent ev)
Control
popupMenuEvent
in class Control
ev
- The event.protected Point overColMove(int x, int y)
protected Point overColStretch(int x, int y)
protected Point overRowStretch(int x, int y)
protected void mouseMoving(boolean isOnValidCell, PenEvent pe, int cellRow, int cellCol)
public void mouseMoveChangeCursor(int newCursor)
newCursor
- the new cursor to change to.public void onPenEvent(PenEvent pe)
onPenEvent
in class Control
public void penDoubleClicked(Point p)
Control
Within this method you can use the Control.Gui.currentPenPress() 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.
penDoubleClicked
in class Control
p
- The point on the Control where the pen was double-clicked.public void penClicked(Point where)
Control
Within this method you can use the Control.Gui.currentPenPress() 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 penReleased() method.
penClicked
in class Control
where
- The point on the Control where the pen was clicked.public boolean hasActiveControls()
public int getWidth()