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 voidadd(Element toAdd)Adds the given GUI element as a child of this grid, placing it as a panel in the next available space.protected voidaddPane(javafx.scene.Node toAdd)voidautoAdjustSize()voidclear()Removes all elements from this container.javafx.scene.NodegetBorderedNode()java.util.List<Element>getElements()Returns a list of all elements currently inside this container.intgetNumColumns()voidremove(Element toRemove)Removes the specified elements from this container.voidscrollTo(double percentage)voidscrollToEnd()voidscrollToTop()voidsetGrowth(boolean horizontal, boolean vertical)voidsetGrowth(Element element, boolean horizontal, boolean vertical)voidsetNumColumns(int columns)voidslideInElement(Element toAdd)voidslideOutElement(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:
autoAdjustSizein 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:
getBorderedNodein interfaceElement
-
addPane
protected void addPane(javafx.scene.Node toAdd)
-
remove
public void remove(Element toRemove)
Description copied from interface:ContainerRemoves 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:ContainerRemoves all elements from this container.
-
getElements
public java.util.List<Element> getElements()
Description copied from interface:ContainerReturns a list of all elements currently inside this container.- Specified by:
getElementsin 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)
-
-