Package jexer
Class TSplitPane
- java.lang.Object
-
- jexer.TWidget
-
- jexer.TSplitPane
-
-
Constructor Summary
Constructors Constructor Description TSplitPane(TWidget parent, int x, int y, int width, int height, boolean vertical)Public constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcenter()Recenter the split to the middle of this split pane.voiddraw()Draw me on screen.TWidgetgetBottom()Get the widget on the bottom side.booleangetFocusFollowsMouse()Get focusFollowsMouse flag.TWidgetgetLeft()Get the widget on the left side.TWidgetgetRight()Get the widget on the right side.intgetSplit()Get the split location.TWidgetgetTop()Get the widget on the top side.booleanisHorizontal()Get whether or not this is a horizontal split.booleanisVertical()Get whether or not this is a vertical split.voidonMouseDown(TMouseEvent mouse)Handle mouse button presses.voidonMouseMotion(TMouseEvent mouse)Handle mouse movements.voidonMouseUp(TMouseEvent mouse)Handle mouse button releases.voidonResize(TResizeEvent event)Handle window/screen resize events.TWidgetremoveSplit(TWidget widgetToRemove, boolean doClose)Remove this split, removing the widget specified.voidremoveWidget(TWidget widget)Remove a widget, regardless of what pane it is on.voidreplaceWidget(TWidget oldWidget, TWidget newWidget)Replace a widget, regardless of what pane it is on, with another widget.protected voidresetTabOrder()Reset the tab order of children to match their position in the list.voidsetBottom(TWidget bottom)Set the widget on the bottom side.voidsetFocusFollowsMouse(boolean focusFollowsMouse)Set focusFollowsMouse flag.voidsetFocusFollowsMouse(boolean focusFollowsMouse, boolean recursive)Set focusFollowsMouse flag.voidsetLeft(TWidget left)Set the widget on the left side.voidsetRight(TWidget right)Set the widget on the right side.voidsetSplit(int split)Set the split location.voidsetTop(TWidget top)Set the widget on the top side.java.lang.StringtoString()Generate a human-readable string for this widget.-
Methods inherited from class jexer.TWidget
activate, 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, close, compareTo, doRepaint, drawBox, drawBox, drawBoxShadow, drawChildren, fileOpenBox, fileOpenBox, fileOpenBox, fileOpenBox, fileSaveBox, getAbsoluteX, getAbsoluteY, getActiveChild, getApplication, getAttrXY, getChildren, getClipboard, getCursorAbsoluteX, getCursorAbsoluteY, getCursorX, getCursorY, getCustomMousePointer, getHeight, getLayoutManager, getLocale, getMouseStyle, getParent, getScreen, getTheme, getWidgetUnderMouse, getWidth, getWindow, getX, getY, handleEvent, hasChild, hLineXY, hLineXY, inputBox, inputBox, inputBox, isAbsoluteActive, isActive, isCursorVisible, isDrawable, isEchoKeystrokes, isEnabled, isPixelMouse, isVisible, messageBox, messageBox, mouseWouldHit, onCommand, onIdle, onKeypress, onMenu, onMouseDoubleClick, putAll, putAttrXY, putAttrXY, putCharXY, putCharXY, putCharXY, putStringXY, putStringXY, remove, remove, remove, remove, removeAll, 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
-
TSplitPane
public TSplitPane(TWidget parent, int x, int y, int width, int height, boolean vertical)
Public constructor.- Parameters:
parent- parent widgetx- column relative to parenty- row relative to parentwidth- width of widgetheight- height of widgetvertical- if true, split vertically
-
-
Method Detail
-
onResize
public void onResize(TResizeEvent event)
Handle window/screen resize events.
-
onMouseDown
public void onMouseDown(TMouseEvent mouse)
Handle mouse button presses.- Overrides:
onMouseDownin classTWidget- Parameters:
mouse- mouse button event
-
onMouseUp
public void onMouseUp(TMouseEvent mouse)
Handle mouse button releases.
-
onMouseMotion
public void onMouseMotion(TMouseEvent mouse)
Handle mouse movements.- Overrides:
onMouseMotionin classTWidget- Parameters:
mouse- mouse motion event
-
toString
public java.lang.String toString()
Generate a human-readable string for this widget.
-
resetTabOrder
protected void resetTabOrder()
Reset the tab order of children to match their position in the list. Available so that subclasses can re-order their widgets if needed.- Overrides:
resetTabOrderin classTWidget
-
getFocusFollowsMouse
public boolean getFocusFollowsMouse()
Get focusFollowsMouse flag.- Returns:
- true if focus follows mouse: widgets automatically activate if the mouse passes over them
-
setFocusFollowsMouse
public void setFocusFollowsMouse(boolean focusFollowsMouse)
Set focusFollowsMouse flag.- Parameters:
focusFollowsMouse- if true, focus follows mouse: widgets are automatically activated if the mouse passes over them
-
setFocusFollowsMouse
public void setFocusFollowsMouse(boolean focusFollowsMouse, boolean recursive)Set focusFollowsMouse flag.- Parameters:
focusFollowsMouse- if true, focus follows mouse: widgets are automatically activated if the mouse passes over themrecursive- if true, set the focusFollowsMouse flag of all child TSplitPane's recursively
-
getLeft
public TWidget getLeft()
Get the widget on the left side.- Returns:
- the widget on the left, or null if not set
-
setLeft
public void setLeft(TWidget left)
Set the widget on the left side.- Parameters:
left- the widget to set, or null to remove
-
getRight
public TWidget getRight()
Get the widget on the right side.- Returns:
- the widget on the right, or null if not set
-
setRight
public void setRight(TWidget right)
Set the widget on the right side.- Parameters:
right- the widget to set, or null to remove
-
getTop
public TWidget getTop()
Get the widget on the top side.- Returns:
- the widget on the top, or null if not set
-
setTop
public void setTop(TWidget top)
Set the widget on the top side.- Parameters:
top- the widget to set, or null to remove
-
getBottom
public TWidget getBottom()
Get the widget on the bottom side.- Returns:
- the widget on the bottom, or null if not set
-
setBottom
public void setBottom(TWidget bottom)
Set the widget on the bottom side.- Parameters:
bottom- the widget to set, or null to remove
-
removeWidget
public void removeWidget(TWidget widget)
Remove a widget, regardless of what pane it is on.- Parameters:
widget- the widget to remove
-
replaceWidget
public void replaceWidget(TWidget oldWidget, TWidget newWidget)
Replace a widget, regardless of what pane it is on, with another widget.- Parameters:
oldWidget- the widget to removenewWidget- the widget to replace it with
-
isVertical
public boolean isVertical()
Get whether or not this is a vertical split.- Returns:
- if true, this is a vertical split
-
isHorizontal
public boolean isHorizontal()
Get whether or not this is a horizontal split.- Returns:
- if true, this is a horizontal split
-
getSplit
public int getSplit()
Get the split location.- Returns:
- the row of the divider for a horizontal, or the column for a vertical split
-
setSplit
public void setSplit(int split)
Set the split location.- Parameters:
split- the row of the divider for a horizontal, or the column for a vertical split
-
center
public void center()
Recenter the split to the middle of this split pane.
-
removeSplit
public TWidget removeSplit(TWidget widgetToRemove, boolean doClose)
Remove this split, removing the widget specified.- Parameters:
widgetToRemove- the widget to removedoClose- if true, call the close() method before removing the child- Returns:
- the pane that remains, or null if nothing is retained
-
-