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 void
center()
Recenter the split to the middle of this split pane.void
draw()
Draw me on screen.TWidget
getBottom()
Get the widget on the bottom side.boolean
getFocusFollowsMouse()
Get focusFollowsMouse flag.TWidget
getLeft()
Get the widget on the left side.TWidget
getRight()
Get the widget on the right side.int
getSplit()
Get the split location.TWidget
getTop()
Get the widget on the top side.boolean
isHorizontal()
Get whether or not this is a horizontal split.boolean
isVertical()
Get whether or not this is a vertical split.void
onMouseDown(TMouseEvent mouse)
Handle mouse button presses.void
onMouseMotion(TMouseEvent mouse)
Handle mouse movements.void
onMouseUp(TMouseEvent mouse)
Handle mouse button releases.void
onResize(TResizeEvent event)
Handle window/screen resize events.TWidget
removeSplit(TWidget widgetToRemove, boolean doClose)
Remove this split, removing the widget specified.void
removeWidget(TWidget widget)
Remove a widget, regardless of what pane it is on.void
replaceWidget(TWidget oldWidget, TWidget newWidget)
Replace a widget, regardless of what pane it is on, with another widget.protected void
resetTabOrder()
Reset the tab order of children to match their position in the list.void
setBottom(TWidget bottom)
Set the widget on the bottom side.void
setFocusFollowsMouse(boolean focusFollowsMouse)
Set focusFollowsMouse flag.void
setFocusFollowsMouse(boolean focusFollowsMouse, boolean recursive)
Set focusFollowsMouse flag.void
setLeft(TWidget left)
Set the widget on the left side.void
setRight(TWidget right)
Set the widget on the right side.void
setSplit(int split)
Set the split location.void
setTop(TWidget top)
Set the widget on the top side.java.lang.String
toString()
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, 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, getHeight, getLayoutManager, getParent, getScreen, getTheme, getWidth, getWindow, getX, getY, handleEvent, hasChild, hLineXY, inputBox, inputBox, inputBox, isAbsoluteActive, isActive, isCursorVisible, isDrawable, isEchoKeystrokes, isEnabled, 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, setDimensions, setEchoKeystrokes, setEchoKeystrokes, setEnabled, setHeight, setLayoutManager, setParent, setupForTWindow, setVisible, setWidth, setWindow, setX, setY, splitHorizontal, splitVertical, switchWidget, toPrettyString, toPrettyString, 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:
onMouseDown
in 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:
onMouseMotion
in 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:
resetTabOrder
in 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
-
-