Package com.inductiveautomation.snap.ui
Class SpringLayout<T>
java.lang.Object
com.inductiveautomation.snap.ui.SpringLayout<T>
- All Implemented Interfaces:
Cloneable
A class to layout children using springs/struts settings.
Settings are described with strings using '~' (spring) and '-' (struts), eg.: "-~-,-~-" (horizontal,vertical).
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Override to force LayoutInfoX to get set.clone()
Standard clone implementation.getAutosizing
(T aChild) Returns the autosizing string for child.double
getBestHeight
(T aChild, double aValue) Returns child best height.abstract T
Returns the individual child in this line.abstract int
getChildCount
(T aParent) Returns the child count of given parent.abstract double
Returns child height.abstract SPInsets
Returns the insets of the parent.abstract Object
getLayoutInfo
(T aChild) Returns layout info (descriptor) for child.getLayoutInfoSP
(T aChild) Return LayoutInfo for child.abstract Object
getLayoutInfoX
(T aChild) Returns the internal layout info for a child.double
getMinHeight
(double aWidth) The min height for layout.abstract double
getMinHeight
(T aChild, double aValue) Returns child max height.double
getMinWidth
(double aHeight) The min width for layout.abstract double
getMinWidth
(T aChild, double aValue) Returns child min width.Returns the parent.abstract double
getParentHeight
(T aParent) Returns parent height.abstract double
getParentWidth
(T aParent) Returns parent width.double
getPrefHeight
(double aWidth) The preferred height for layout.abstract double
getPrefHeight
(T aChild, double aValue) Returns child preferred height.double
getPrefWidth
(double aHeight) The preferred width for layout.abstract double
getPrefWidth
(T aChild, double aValue) Returns child preferred width.abstract double
Returns child width.abstract double
Returns child x.abstract double
Returns child y.void
layoutChildren
(T aParent) Performs layout.void
removeChild
(T aChild) Override to clear LayoutInfoX.void
reset()
Update LayoutInfo for all children.abstract void
Set child bounds.abstract void
setLayoutInfo
(T aChild, Object aLI) Sets layout info (descriptor) for child.abstract void
setLayoutInfoX
(T aChild, Object aLIX) Sets the internal layout info for a child.void
Sets the parent.void
updateChild
(T aChild) Updates a child if its layout info has changed.
-
Constructor Details
-
SpringLayout
Creates a new SpringLayout for adapter.
-
-
Method Details
-
getParent
Returns the parent. -
setParent
Sets the parent. -
getLayoutInfoSP
Return LayoutInfo for child. -
getAutosizing
Returns the autosizing string for child. -
addChild
Override to force LayoutInfoX to get set. -
removeChild
Override to clear LayoutInfoX. -
updateChild
Updates a child if its layout info has changed. -
layoutChildren
Performs layout. -
reset
public void reset()Update LayoutInfo for all children. -
getMinWidth
public double getMinWidth(double aHeight) The min width for layout. -
getMinHeight
public double getMinHeight(double aWidth) The min height for layout. -
getPrefWidth
public double getPrefWidth(double aHeight) The preferred width for layout. -
getPrefHeight
public double getPrefHeight(double aWidth) The preferred height for layout. -
getLayoutInfoX
Returns the internal layout info for a child. -
setLayoutInfoX
Sets the internal layout info for a child. -
getParentWidth
Returns parent width. -
getParentHeight
Returns parent height. -
getChildCount
Returns the child count of given parent. -
getChild
Returns the individual child in this line. -
getInsets
Returns the insets of the parent. -
getLayoutInfo
Returns layout info (descriptor) for child. -
setLayoutInfo
Sets layout info (descriptor) for child. -
getX
Returns child x. -
getY
Returns child y. -
getWidth
Returns child width. -
getHeight
Returns child height. -
setBounds
Set child bounds. -
getMinWidth
Returns child min width. -
getMinHeight
Returns child max height. -
getPrefWidth
Returns child preferred width. -
getPrefHeight
Returns child preferred height. -
getBestHeight
Returns child best height. -
clone
Standard clone implementation.
-