|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectewe.ui.ControlBase
ewe.ui.Control
ewe.ui.Container
ewe.ui.TableControl
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode |
| Methods inherited from interface ewe.ui.ScrollClient |
getServer, setServer |
| Field Detail |
protected TableModel model
public boolean allowDragSelection
public boolean multiSelect
public boolean penSelectMode
public int listMode
public Point cursor
public boolean allowClipboardOperations
public boolean autoScrollToVisible
public boolean clickClearsItself
protected Rect selection
protected Rect oldSelection
protected Vector extendedSelection
public static Vector oldExtendedSelection
protected boolean clickMode
protected int clickedFlags
| Constructor Detail |
public TableControl()
| Method Detail |
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 Vector getSelectedCells(Vector dest)
public boolean isIn(int col,
int row,
Rect where)
public Rect findSelectedBlock(int row,
int col,
Rect dest)
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 Point cellAtPoint(int x,
int y,
Point dest)
public Point firstCellToPaint(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)
ControlWithin 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.
penPressed in class Controlp - 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)
public boolean doMenu(Point where)
Control
doMenu in class Controlwhere - The point where the pen was pressed or held.
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)
ControlWithin 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.
penReleased in class Controlp - The point on the Control where the pen was released.public void penDoubleClicked(Point p)
ControlWithin 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.
penDoubleClicked in class Controlp - The point on the Control where the pen was double-clicked.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)
public void startDragging(DragContext dc)
Control
startDragging in class Controldc - A DragContext indicating information about the dragging.public void stopDragging(DragContext dc)
Control
stopDragging in class Controldc - The DragContext for the dragging operation.public void dragged(DragContext dc)
Control
dragged in class Controldc - The DragContext for the dragging operation.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 updateControls()
public void update(boolean repaint)
public void paintBackground(Graphics g)
paintBackground in class Control
public void repaintNow(Graphics g,
Rect area)
Control
repaintNow in class Controlg - 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.
public void doPaint(Graphics g,
Rect area)
doPaint in class Control
public void paintCells(Graphics gr,
Vector rectsToPaint)
public void paintCells(Graphics gr,
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 Point getPageUp(Point dest)
public int getActual(int which)
getActual in interface ScrollClient
public int getVisible(int which,
int forSize)
getVisible in interface ScrollClientpublic int getCurrent(int which)
getCurrent in interface ScrollClient
public boolean needScrollBar(int which,
int forSize)
needScrollBar in interface ScrollClient
public boolean canGo(int orientation,
int direction,
int position)
canGo in interface ScrollClient
public void doScroll(int which,
int action,
int value)
doScroll in interface ScrollClientpublic void make(boolean reMake)
Control
make in class ControlreMake - if this is true then you should do a full re-make.
public void resizeTo(int width,
int height)
Control
resizeTo in class Control
public void doPaintChildren(Graphics g,
int x,
int y,
int w,
int h)
doPaintChildren in class Controlprotected 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 Controlx - The x co-ordinate in pixels of the mouse.y - The y co-ordinate in pixels of the mouse.
public void clearCursor()
public void cursorTo(int row,
int col,
boolean selectNew)
protected boolean checkFirstKey()
protected boolean doHotKey(Control parent,
KeyEvent key)
Control
doHotKey in class Containerprotected Control getFirstFocus()
getFirstFocus in class Containerpublic void onKeyEvent(KeyEvent ev)
onKeyEvent in class Controlpublic void popupMenuEvent(MenuEvent ev)
Control
popupMenuEvent in class Controlev - The event.
protected Point overColStretch(int x,
int y)
protected Point overRowStretch(int x,
int y)
public void onPenEvent(PenEvent pe)
Control
onPenEvent in class Controlpe - The incoming PenEvent.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||