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, selection
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 |
---|
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, updateInWindowThread
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
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, 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, writeLock
doubleSizeIt, getGuiTextHeight, isDoubleSized, isDoubleSizedFont, loadImage, tryLoadImage
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getServer, setServer
public void resizeTo(int width, int height)
resizeTo
in class TableControl
public TreeTableModel getTreeTableModel()
public Point getSelectedCell(Point dest)
TableControl
getSelectedCell
in class TableControl
public 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)
Control
If 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 Control
sx
- 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)
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 TableControl
p
- The point on the Control where the pen was pressed.public boolean getDataToDragAndDrop(DragContext dc)
Control
To setup the DragContext you should set the dataToDrag, isMultiple and isCopy and (optionally) the dragCursor value.
getDataToDragAndDrop
in class Control
dc
- the DragContext to setup for the drag and drop operation.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 TableControl
p
- The point on the Control where the pen was double-clicked.public void penClicked(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 penReleased() method.
penClicked
in class TableControl
p
- The point on the Control where the pen was clicked.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 TableControl
p
- 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)
Control
showHoldDownIndicator
in class TableControl
x
- the x position on the Control.y
- the y position on the Control.public boolean doMenu(Point where)
Control
doMenu
in class TableControl
where
- The point where the pen was pressed or held.public void cursorTo(int row, int col, boolean selectNew)
cursorTo
in class TableControl
public int getSelectedLine()
TableControl
getSelectedLine
in class TableControl
public void selectLine(int line, boolean exclusive, boolean fireEvent)
selectLine
in class TableControl
line
- 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 TableControl
public boolean noSelection()
TableControl
noSelection
in interface Selectable
noSelection
in class TableControl
public boolean replaceSelection(Object with)
replaceSelection
in interface Selectable
public boolean deleteSelection()
deleteSelection
in interface Selectable
public Object getSelection()
getSelection
in interface Selectable
public boolean hasSelection()
hasSelection
in interface Selectable
protected void dataBeingRemoved(Object data, DragContext dc)
Control
dataBeingRemoved
in class Control
protected void dataTransferCancelled(Object data)
Control
dataTransferCancelled
in class Control
data
- 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)
Control
dataAccepted
in class Control
byWho
- 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)
Control
paintBackground
in class TableControl
g
- the non-null Graphics to paint to.protected int overAColumn(int x, int y)
public void onPenEvent(PenEvent pe)
onPenEvent
in class TableControl
public void startDragging(DragContext dc)
Control
startDragging
in class TableControl
dc
- A DragContext indicating information about the dragging.public void dragged(DragContext dc)
Control
dragged
in class TableControl
dc
- The DragContext for the dragging operation.public void stopDragging(DragContext dc)
Control
stopDragging
in class TableControl
dc
- The DragContext for the dragging operation.public boolean acceptsData(Object data, DragContext how)
Control
acceptsData
in class Control
data
- 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.