Package jisa.gui
Class Grid
- java.lang.Object
-
- jisa.gui.JFXElement
-
- jisa.gui.Grid
-
- Direct Known Subclasses:
ConnectorGrid
,SwapGrid
public class Grid extends JFXElement implements Element, Container
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jisa.gui.Element
Element.ElementBorder
-
-
Constructor Summary
Constructors Constructor Description Grid(int numColumns, Element... children)
Grid(java.lang.String title)
Creates a Grid element with the given title and the default number (3) of columns.Grid(java.lang.String title, int numColumns)
Creates a Grid element with the given title and number of columns.Grid(java.lang.String title, int numCols, Element... children)
Creates a Grid element with the given title, number of columns and adds the given elements to it as children.Grid(java.lang.String title, Element... children)
Creates a Grid element with the given title, 3 columns and adds the given elements to it as children.Grid(Element... panels)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(Element toAdd)
Adds the given GUI element as a child of this grid, placing it as a panel in the next available space.protected void
addPane(javafx.scene.Node toAdd)
void
autoAdjustSize()
void
clear()
Removes all elements from this container.javafx.scene.Node
getBorderedNode()
java.util.List<Element>
getElements()
Returns a list of all elements currently inside this container.int
getNumColumns()
void
remove(Element toRemove)
Removes the specified elements from this container.void
scrollTo(double percentage)
void
scrollToEnd()
void
scrollToTop()
void
setGrowth(boolean horizontal, boolean vertical)
void
setGrowth(Element element, boolean horizontal, boolean vertical)
void
setNumColumns(int columns)
void
slideInElement(Element toAdd)
void
slideOutElement(Element toRemove)
-
Methods inherited from class jisa.gui.JFXElement
addDialogButton, addDialogMenuButton, addToolbarButton, addToolbarMenuButton, addToolbarSeparator, autoSizeWindow, clearDialogButtons, clearToolbar, close, getIcon, getMaxHeight, getMaxWidth, getMaxWindowHeight, getMaxWindowWidth, getMinHeight, getMinWidth, getNode, getStage, getTitle, getWindowHeight, getWindowWidth, hide, iconProperty, isDecorated, isExitOnClose, isMaximised, isShowing, setCentreNode, setDecorated, setExitOnClose, setIcon, setIcon, setMaxHeight, setMaximised, setMaxWidth, setMaxWindowHeight, setMaxWindowWidth, setMinHeight, setMinWidth, setOnClose, setTitle, setWindowHeight, setWindowSize, setWindowWidth, show, showAsAlert, showAsConfirmation, showAsDialog, titleProperty
-
-
-
-
Constructor Detail
-
Grid
public Grid(java.lang.String title, int numColumns)
Creates a Grid element with the given title and number of columns.- Parameters:
title
- TitlenumColumns
- Number of columns
-
Grid
public Grid(java.lang.String title)
Creates a Grid element with the given title and the default number (3) of columns.- Parameters:
title
- Title
-
Grid
public Grid(java.lang.String title, int numCols, Element... children)
Creates a Grid element with the given title, number of columns and adds the given elements to it as children.- Parameters:
title
- TitlenumCols
- Number of columnschildren
- Children to add
-
Grid
public Grid(java.lang.String title, Element... children)
Creates a Grid element with the given title, 3 columns and adds the given elements to it as children.- Parameters:
title
- Titlechildren
- Children to add
-
Grid
public Grid(int numColumns, Element... children)
-
Grid
public Grid(Element... panels)
-
-
Method Detail
-
autoAdjustSize
public void autoAdjustSize()
- Overrides:
autoAdjustSize
in classJFXElement
-
scrollToEnd
public void scrollToEnd()
-
scrollToTop
public void scrollToTop()
-
scrollTo
public void scrollTo(double percentage)
-
add
public void add(Element toAdd)
Adds the given GUI element as a child of this grid, placing it as a panel in the next available space.
-
getBorderedNode
public javafx.scene.Node getBorderedNode()
- Specified by:
getBorderedNode
in interfaceElement
-
addPane
protected void addPane(javafx.scene.Node toAdd)
-
remove
public void remove(Element toRemove)
Description copied from interface:Container
Removes the specified elements from this container.
-
slideOutElement
public void slideOutElement(Element toRemove)
-
slideInElement
public void slideInElement(Element toAdd)
-
clear
public void clear()
Description copied from interface:Container
Removes all elements from this container.
-
getElements
public java.util.List<Element> getElements()
Description copied from interface:Container
Returns a list of all elements currently inside this container.- Specified by:
getElements
in interfaceContainer
- Returns:
- List of elements.
-
getNumColumns
public int getNumColumns()
-
setNumColumns
public void setNumColumns(int columns)
-
setGrowth
public void setGrowth(boolean horizontal, boolean vertical)
-
setGrowth
public void setGrowth(Element element, boolean horizontal, boolean vertical)
-
-