public class TreeControl extends TableControl implements Selectable
| Modifier and Type | Class and Description |
|---|---|
static class |
TreeControl.ControlTreeNode |
| Modifier and Type | Field and Description |
|---|---|
boolean |
doSelections |
boolean |
noDragAndDrop |
allowClipboardOperations, allowDragSelection, autoScrollToVisible, canDragItems, clickClearsItself, clickedFlags, clickMode, cursor, dontUpdate, extendedSelection, ignoreDoubleClick, listMode, model, multiSelect, oldSelection, penSelectMode, selectionclosedFocus, cycleFocus, dontAutoScroll, dontFocusOnChildren, FIND_FOR_MOUSE_PRESS, takeNextFocusbackGround, 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, yclipItems, 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, unnamedGoHigher, GoLower, Horizontal, OPTION_INDICATOR_ONLY, PageHigher, PageLower, ScrollHigher, ScrollLower, TrackTo, VerticalBDR_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, WantHoldDownKEEP_VISIBLE| Constructor and Description |
|---|
TreeControl() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
acceptsData(Object data,
DragContext how)
This should indicate whether this control will accept the data either via
a drag and drop or via a paste operation.
|
void |
cursorTo(int row,
boolean selectNew) |
void |
cursorTo(int row,
int col,
boolean selectNew) |
protected void |
dataAccepted(Control byWho,
Object data,
String action)
This is called either when data that was cut from this control was
pasted into another control, OR when data that was dragged from this
control is dropped into another control.
|
protected void |
dataBeingRemoved(Object data,
DragContext dc)
This tells the control that data is being removed from it either via
a cut operation or by a drag operation that is not explicitly a copy operation.
|
protected void |
dataTransferCancelled(Object data)
This gets called either when that was cut from this control was not
placed into another control (either it was rejected by a paste or a
subsequent copy/cut into the clipboard occured before the data was pasted)
or a drag and drop was initiated but not completed.
|
void |
deleteAndUpdate(MutableTreeNode child,
MutableTreeNode parent) |
boolean |
deleteSelection() |
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 |
dragged(DragContext dc)
This is called during the drag operation.
|
boolean |
getDataToDragAndDrop(DragContext dc)
A quick way to provide DragAndDrop data.
|
Point |
getSelectedCell(Point dest)
This returns a single selected cell.
|
int |
getSelectedLine()
If at least one cell is selected, return the row of the selection -
otherwise return -1;
|
Object |
getSelection() |
TreeTableModel |
getTreeTableModel() |
boolean |
hasSelection() |
int |
indexOfPoint(int x,
int y) |
boolean |
noSelection()
This clears the selection but does NOT repaint the screen.
|
void |
onKeyEvent(KeyEvent ev) |
void |
onPenEvent(PenEvent pe) |
protected int |
overAColumn(int x,
int y) |
void |
paintBackground(Graphics g)
Do a standard painting of the Background.
|
void |
paintLine(int index) |
void |
penClicked(Point p)
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.
|
boolean |
replaceSelection(Object with) |
void |
resizeTo(int width,
int height)
This is called to change the width and height values.
|
void |
scrollAndRepaint(int sx,
int sy,
int sw,
int sh,
int destX,
int destY)
This is called to update a Control on-screen after it has been scrolled.
|
boolean |
scrollToVisible(int index)
Ensure that the specified index is visible but do not do a repaint or update.
|
void |
selectLine(int line,
boolean exclusive,
boolean fireEvent)
Select a line and make it visible.
|
void |
setData(Object data) |
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 |
stopDragging(DragContext dc)
Called when the pen was released during a drag operation.
|
void |
updateInsertion(TreeNode insertedChild) |
addToSelection, addToSelection, addToSelection, calculateSizes, canGo, canSelect, cellAtPoint, cellAtPoint, changeOrigin, checkFirstKey, clearCursor, clearSelectedBlock, clearSelectedCells, clearSelection, clearSelection, clicked, doHotKey, doPaint, doPaintChildren, doScroll, doubleClicked, findSelectedBlock, fireClickedEvent, fireSelectionEvent, fireSelectionEvent, firstCellToPaint, freezeUpdate, getActual, getCurrent, getCursorSize, getDataArea, getFirstFocus, getHeight, getLastColToShow, getLastColToShow, getLastRowToShow, getLastRowToShow, getLinesOnScreen, getOnScreen, getOnScreen, getOrigin, getPageUp, getScreenRect, getSelectedCells, getSelectedIndexes, getSelectedRows, getSelection, getTableModel, getToolTip, getVisible, getWidth, hasActiveControls, hideCursor, inRect, invertSelectedIndexes, isASelection, isIn, isSelected, isVisible, make, mouseMoveChangeCursor, mouseMoving, multipleSelected, needScrollBar, onEvent, overColMove, overColStretch, overrideAttributes, overRowStretch, paintCells, paintCells, paintSelectedCells, paintSelection, penReleased, popupMenuEvent, removeControls, repaintCell, repaintNow, restoreCursor, restoreOrResetCursor, scrollToVisible, selectAllIndexes, selectAndUpdate, selectAndUpdate, setClickMode, setCursorToStart, setTableModel, startDropMenu, startItemDragging, startNewSelectionBlock, tryStartMenu, update, updateControls, updateInWindowThreadadd, 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, unhideactivate, 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, dataDraggedOff, dataDraggedOver, dataDraggedOver, dataDroppedOn, 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, 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, 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, writeLockdoubleSizeIt, getGuiTextHeight, isDoubleSized, isDoubleSizedFont, loadImage, tryLoadImageclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetServer, setServerpublic void resizeTo(int width,
int height)
resizeTo in class TableControlpublic TreeTableModel getTreeTableModel()
public Point getSelectedCell(Point dest)
TableControlgetSelectedCell in class TableControlpublic void setData(Object data)
public boolean scrollToVisible(int index)
index - the index of the line to make visible.public void scrollAndRepaint(int sx,
int sy,
int sw,
int sh,
int destX,
int destY)
ControlIf data can be moved directly on screen, then this will be done and only the newly exposed portion will be updated via a repaintNow() operation. If no moving is possible at all - or if the SIP may be covering the control then no scrolling will be done.
scrollAndRepaint in class Controlsx - The source x co-ordinate.sy - The source y co-ordinate.sw - The source width.sh - The source height.destX - The destination x co-ordinate.destY - The destination y co-ordinate.public void penPressed(Point p)
ControlWithin 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 TableControlp - The point on the Control where the pen was pressed.public boolean getDataToDragAndDrop(DragContext dc)
ControlTo setup the DragContext you should set the dataToDrag, isMultiple and isCopy and (optionally) the dragCursor value.
getDataToDragAndDrop in class Controldc - the DragContext to setup for the drag and drop operation.public void penDoubleClicked(Point p)
ControlWithin 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 TableControlp - The point on the Control where the pen was double-clicked.public void penClicked(Point p)
ControlWithin 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 TableControlp - The point on the Control where the pen was clicked.public void penReleased(Point p)
ControlWithin 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 TableControlp - The point on the Control where the pen was released.public int indexOfPoint(int x,
int y)
public void paintLine(int index)
protected boolean showHoldDownIndicator(int x,
int y)
ControlshowHoldDownIndicator in class TableControlx - the x position on the Control.y - the y position on the Control.public boolean doMenu(Point where)
ControldoMenu in class TableControlwhere - The point where the pen was pressed or held.public void cursorTo(int row,
int col,
boolean selectNew)
cursorTo in class TableControlpublic int getSelectedLine()
TableControlgetSelectedLine in class TableControlpublic void selectLine(int line,
boolean exclusive,
boolean fireEvent)
selectLine in class TableControlline - the line to select.exclusive - true to clear previous selection first.fireEvent - true to fire a selection event.public void cursorTo(int row,
boolean selectNew)
public void onKeyEvent(KeyEvent ev)
onKeyEvent in class TableControlpublic boolean noSelection()
TableControlnoSelection in interface SelectablenoSelection in class TableControlpublic boolean replaceSelection(Object with)
replaceSelection in interface Selectablepublic boolean deleteSelection()
deleteSelection in interface Selectablepublic Object getSelection()
getSelection in interface Selectablepublic boolean hasSelection()
hasSelection in interface Selectableprotected void dataBeingRemoved(Object data, DragContext dc)
ControldataBeingRemoved in class Controlprotected void dataTransferCancelled(Object data)
ControldataTransferCancelled in class Controldata - The data that was being transferred. If it is null it indicates
that this Control was a destination for a Drag and Drop operation, but the
operation was cancelled by the user.protected void dataAccepted(Control byWho, Object data, String action)
ControldataAccepted in class ControlbyWho - The Control that accepted the data.data - The data being transferred.action - This is either "copy" or "move" indicating if the data
is meant to be copied to the other control or moved to the other Control.public void deleteAndUpdate(MutableTreeNode child, MutableTreeNode parent)
public void updateInsertion(TreeNode insertedChild)
public void paintBackground(Graphics g)
ControlpaintBackground in class TableControlg - the non-null Graphics to paint to.protected int overAColumn(int x,
int y)
public void onPenEvent(PenEvent pe)
onPenEvent in class TableControlpublic void startDragging(DragContext dc)
ControlstartDragging in class TableControldc - A DragContext indicating information about the dragging.public void dragged(DragContext dc)
Controldragged in class TableControldc - The DragContext for the dragging operation.public void stopDragging(DragContext dc)
ControlstopDragging in class TableControldc - The DragContext for the dragging operation.public boolean acceptsData(Object data, DragContext how)
ControlacceptsData in class Controldata - The data to be transferred.how - if the transfer is via DragAndDrop this will be a DragContext object,
otherwise it will be null to indicate a clipboard operation.