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 TypeMethodDescriptionvoidOverride to force LayoutInfoX to get set.clone()Standard clone implementation.getAutosizing(T aChild) Returns the autosizing string for child.doublegetBestHeight(T aChild, double aValue) Returns child best height.abstract TReturns the individual child in this line.abstract intgetChildCount(T aParent) Returns the child count of given parent.abstract doubleReturns child height.abstract SPInsetsReturns the insets of the parent.abstract ObjectgetLayoutInfo(T aChild) Returns layout info (descriptor) for child.getLayoutInfoSP(T aChild) Return LayoutInfo for child.abstract ObjectgetLayoutInfoX(T aChild) Returns the internal layout info for a child.doublegetMinHeight(double aWidth) The min height for layout.abstract doublegetMinHeight(T aChild, double aValue) Returns child max height.doublegetMinWidth(double aHeight) The min width for layout.abstract doublegetMinWidth(T aChild, double aValue) Returns child min width.Returns the parent.abstract doublegetParentHeight(T aParent) Returns parent height.abstract doublegetParentWidth(T aParent) Returns parent width.doublegetPrefHeight(double aWidth) The preferred height for layout.abstract doublegetPrefHeight(T aChild, double aValue) Returns child preferred height.doublegetPrefWidth(double aHeight) The preferred width for layout.abstract doublegetPrefWidth(T aChild, double aValue) Returns child preferred width.abstract doubleReturns child width.abstract doubleReturns child x.abstract doubleReturns child y.voidlayoutChildren(T aParent) Performs layout.voidremoveChild(T aChild) Override to clear LayoutInfoX.voidreset()Update LayoutInfo for all children.abstract voidSet child bounds.abstract voidsetLayoutInfo(T aChild, Object aLI) Sets layout info (descriptor) for child.abstract voidsetLayoutInfoX(T aChild, Object aLIX) Sets the internal layout info for a child.voidSets the parent.voidupdateChild(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.
-