Package jexer.ttree
Class TTreeViewWindow
- java.lang.Object
-
- jexer.TWidget
-
- jexer.TWindow
-
- jexer.TScrollableWindow
-
- jexer.ttree.TTreeViewWindow
-
- All Implemented Interfaces:
java.lang.Comparable<TWidget>,Scrollable
public class TTreeViewWindow extends TScrollableWindow
TTreeViewWindow wraps a tree view with horizontal and vertical scrollbars in a standalone window.
-
-
Field Summary
-
Fields inherited from class jexer.TScrollableWindow
hScroller, vScroller
-
Fields inherited from class jexer.TWindow
ABSOLUTEXY, borderStyleActive, borderStyleActiveModal, borderStyleInactive, borderStyleMoving, CENTERED, helpTopic, HIDEONCLOSE, inKeyboardResize, inWindowMove, inWindowResize, MODAL, mouse, NOCLOSEBOX, NOZOOMBOX, overlay, OVERRIDEMENU, RESIZABLE, statusBar, underlay
-
-
Constructor Summary
Constructors Constructor Description TTreeViewWindow(TApplication parent, java.lang.String title, int x, int y, int width, int height, int flags)Public constructor.TTreeViewWindow(TApplication parent, java.lang.String title, int x, int y, int width, int height, int flags, TAction action)Public constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispatch()Perform user selection action.TTreeItemgetSelected()Get the tree view item that was selected.TTreeItemgetTreeRoot()Get the root of the tree.TTreeViewgetTreeView()Get the underlying TTreeView.voidonKeypress(TKeypressEvent keypress)Handle keystrokes.voidonMouseDown(TMouseEvent mouse)Handle mouse press events.voidonMouseMotion(TMouseEvent mouse)Handle mouse motion events.voidonMouseUp(TMouseEvent mouse)Handle mouse release events.voidonResize(TResizeEvent resize)Handle window/screen resize events.voidreflowData()Resize text and scrollbars for a new width/height.voidsetSelected(TTreeItem item, boolean centerWindow)Set the new selected tree view item.voidsetTreeRoot(TTreeItem treeRoot)Set the root of the tree.voidsetTreeRoot(TTreeItem treeRoot, boolean centerWindow)Set treeRoot.-
Methods inherited from class jexer.TScrollableWindow
bigHorizontalDecrement, bigHorizontalIncrement, bigVerticalDecrement, bigVerticalIncrement, getBottomValue, getHorizontalBigChange, getHorizontalScroller, getHorizontalSmallChange, getHorizontalValue, getLeftValue, getRightValue, getTopValue, getVerticalBigChange, getVerticalScroller, getVerticalSmallChange, getVerticalValue, horizontalDecrement, horizontalIncrement, maximize, mouseOnHorizontalScroller, mouseOnVerticalScroller, placeScrollbars, restore, setBottomValue, setHorizontalBigChange, setHorizontalSmallChange, setHorizontalValue, setLeftValue, setRightValue, setTopValue, setVerticalBigChange, setVerticalSmallChange, setVerticalValue, toBottom, toEnd, toHome, toLeft, toRight, toTop, verticalDecrement, verticalIncrement
-
Methods inherited from class jexer.TWindow
activate, addOverlay, addShortcutKeypress, addUnderlay, center, clearShortcutKeypresses, close, disableCloseEffect, disableOpenEffect, draw, ensureOnScreen, getAlpha, getApplication, getBackground, getBorder, getBorderControls, getBorderStyle, getBorderStyleForeground, getBorderStyleInactive, getBorderStyleModal, getBorderStyleMoving, getHelpTopic, getMaximumWindowHeight, getMaximumWindowWidth, getMinimumWindowHeight, getMinimumWindowWidth, getMouseStyle, getScreen, getStatusBar, getTitle, getWindowTheme, getZ, hasCloseBox, hasHiddenMouse, hasOverriddenMenu, hasZoomBox, hide, inMovements, isHidden, isModal, isResizable, isShortcutKeypress, isShown, mouseOnClose, mouseOnMaximize, mouseOnResize, newStatusBar, onClose, onCommand, onFocus, onHide, onMenu, onPostDraw, onPreClose, onShow, onUnfocus, removeShortcutKeypress, setAlpha, setBorderStyleForeground, setBorderStyleInactive, setBorderStyleModal, setBorderStyleMoving, setCloseBox, setHiddenMouse, setMaximumWindowHeight, setMaximumWindowWidth, setMinimumWindowHeight, setMinimumWindowWidth, setResizable, setTackboardsDirty, setTitle, setWindowTheme, setZ, setZoomBox, show, stopMovements, toString
-
Methods inherited from class jexer.TWidget
activate, activate, activateAll, addButton, addCalendar, addCheckBox, addCheckBox, addComboBox, addDirectoryList, addDirectoryList, addDirectoryList, addDirectoryList, addEditor, addField, addField, addField, addField, addImage, addImage, addImage, addImage, addLabel, addLabel, addLabel, addLabel, addLabel, addLabel, addList, addList, addList, addList, addPanel, addPasswordField, addPasswordField, addPasswordField, addProgressBar, addRadioGroup, addRadioGroup, addSpinner, addSplitPane, addTable, addTable, addText, addText, addTreeViewWidget, addTreeViewWidget, compareTo, doRepaint, drawBox, drawBox, drawBoxShadow, drawChildren, fileOpenBox, fileOpenBox, fileOpenBox, fileOpenBox, fileSaveBox, getAbsoluteX, getAbsoluteY, getActiveChild, getAttrXY, getChildren, getClipboard, getCursorAbsoluteX, getCursorAbsoluteY, getCursorX, getCursorY, getCustomMousePointer, getHeight, getLayoutManager, getLocale, getParent, getTheme, getWidgetUnderMouse, getWidth, getWindow, getX, getY, handleEvent, hasChild, hLineXY, hLineXY, inputBox, inputBox, inputBox, isAbsoluteActive, isActive, isCursorVisible, isDrawable, isEchoKeystrokes, isEnabled, isPixelMouse, isVisible, messageBox, messageBox, mouseWouldHit, onIdle, onMouseDoubleClick, putAll, putAttrXY, putAttrXY, putCharXY, putCharXY, putCharXY, putStringXY, putStringXY, remove, remove, remove, remove, removeAll, resetTabOrder, setActive, setCursorVisible, setCursorX, setCursorY, setCustomMousePointer, setDimensions, setEchoKeystrokes, setEchoKeystrokes, setEnabled, setHeight, setLayoutManager, setLocale, setMouseStyle, setParent, setupForTWindow, setVisible, setWidth, setWindow, setX, setY, splitHorizontal, splitVertical, switchWidget, toPrettyString, toPrettyString, vLineXY, vLineXY
-
-
-
-
Constructor Detail
-
TTreeViewWindow
public TTreeViewWindow(TApplication parent, java.lang.String title, int x, int y, int width, int height, int flags)
Public constructor.- Parameters:
parent- the main applicationtitle- the window titlex- column relative to parenty- row relative to parentwidth- width of tree viewflags- bitmask of RESIZABLE, CENTERED, or MODALheight- height of tree view
-
TTreeViewWindow
public TTreeViewWindow(TApplication parent, java.lang.String title, int x, int y, int width, int height, int flags, TAction action)
Public constructor.- Parameters:
parent- the main applicationtitle- the window titlex- column relative to parenty- row relative to parentwidth- width of tree viewheight- height of tree viewflags- bitmask of RESIZABLE, CENTERED, or MODALaction- action to perform when an item is selected
-
-
Method Detail
-
onMouseDown
public void onMouseDown(TMouseEvent mouse)
Handle mouse press events.- Overrides:
onMouseDownin classTWindow- Parameters:
mouse- mouse button press event
-
onMouseUp
public void onMouseUp(TMouseEvent mouse)
Handle mouse release events.
-
onMouseMotion
public void onMouseMotion(TMouseEvent mouse)
Handle mouse motion events.- Overrides:
onMouseMotionin classTWindow- Parameters:
mouse- mouse motion event
-
onKeypress
public void onKeypress(TKeypressEvent keypress)
Handle keystrokes.- Overrides:
onKeypressin classTWindow- Parameters:
keypress- keystroke event
-
onResize
public void onResize(TResizeEvent resize)
Handle window/screen resize events.- Overrides:
onResizein classTScrollableWindow- Parameters:
resize- resize event
-
reflowData
public void reflowData()
Resize text and scrollbars for a new width/height.- Overrides:
reflowDatain classTScrollableWindow
-
getTreeView
public TTreeView getTreeView()
Get the underlying TTreeView.- Returns:
- the TTreeView
-
getTreeRoot
public final TTreeItem getTreeRoot()
Get the root of the tree.- Returns:
- the root of the tree
-
setTreeRoot
public final void setTreeRoot(TTreeItem treeRoot)
Set the root of the tree.- Parameters:
treeRoot- the new root of the tree
-
setTreeRoot
public void setTreeRoot(TTreeItem treeRoot, boolean centerWindow)
Set treeRoot.- Parameters:
treeRoot- ultimate root of treecenterWindow- if true, move the window to put the root in view
-
getSelected
public final TTreeItem getSelected()
Get the tree view item that was selected.- Returns:
- the selected item, or null if no item is selected
-
setSelected
public void setSelected(TTreeItem item, boolean centerWindow)
Set the new selected tree view item.- Parameters:
item- new item that became selectedcenterWindow- if true, move the window to put the selected into view
-
dispatch
public void dispatch()
Perform user selection action.
-
-