Package com.inductiveautomation.snap.ui
Class SpringLayout<T>
- java.lang.Object
- 
- com.inductiveautomation.snap.ui.SpringLayout<T>
 
- 
- All Implemented Interfaces:
- java.lang.Cloneable
 
 public abstract class SpringLayout<T> extends java.lang.Object implements java.lang.CloneableA class to layout children using springs/struts settings. Settings are described with strings using '~' (spring) and '-' (struts), eg.: "-~-,-~-" (horizontal,vertical).
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description classSpringLayout.SPLayoutInfoLayoutInfo for SpringLayout.
 - 
Constructor SummaryConstructors Constructor Description SpringLayout(T aParent)Creates a new SpringLayout for adapter.
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddChild(T aChild, java.lang.Object aLayoutInfo)Override to force LayoutInfoX to get set.SpringLayoutclone()Standard clone implementation.java.lang.StringgetAutosizing(T aChild)Returns the autosizing string for child.doublegetBestHeight(T aChild, double aValue)Returns child best height.abstract TgetChild(T aParent, int anIndex)Returns the individual child in this line.abstract intgetChildCount(T aParent)Returns the child count of given parent.abstract doublegetHeight(T aChild)Returns child height.abstract SPInsetsgetInsets(T aParent)Returns the insets of the parent.abstract java.lang.ObjectgetLayoutInfo(T aChild)Returns layout info (descriptor) for child.SpringLayout.SPLayoutInfogetLayoutInfoSP(T aChild)Return LayoutInfo for child.abstract java.lang.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.TgetParent()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 doublegetWidth(T aChild)Returns child width.abstract doublegetX(T aChild)Returns child x.abstract doublegetY(T aChild)Returns child y.voidlayoutChildren(T aParent)Performs layout.voidremoveChild(T aChild)Override to clear LayoutInfoX.voidreset()Update LayoutInfo for all children.abstract voidsetBounds(T aChild, double anX, double aY, double aWidth, double aHeight)Set child bounds.abstract voidsetLayoutInfo(T aChild, java.lang.Object aLI)Sets layout info (descriptor) for child.abstract voidsetLayoutInfoX(T aChild, java.lang.Object aLIX)Sets the internal layout info for a child.voidsetParent(T aParent)Sets the parent.voidupdateChild(T aChild)Updates a child if its layout info has changed.
 
- 
- 
- 
Constructor Detail- 
SpringLayoutpublic SpringLayout(T aParent) Creates a new SpringLayout for adapter.
 
- 
 - 
Method Detail- 
getParentpublic T getParent() Returns the parent.
 - 
setParentpublic void setParent(T aParent) Sets the parent.
 - 
getLayoutInfoSPpublic SpringLayout.SPLayoutInfo getLayoutInfoSP(T aChild) Return LayoutInfo for child.
 - 
getAutosizingpublic java.lang.String getAutosizing(T aChild) Returns the autosizing string for child.
 - 
addChildpublic void addChild(T aChild, java.lang.Object aLayoutInfo) Override to force LayoutInfoX to get set.
 - 
removeChildpublic void removeChild(T aChild) Override to clear LayoutInfoX.
 - 
updateChildpublic void updateChild(T aChild) Updates a child if its layout info has changed.
 - 
layoutChildrenpublic void layoutChildren(T aParent) Performs layout.
 - 
resetpublic void reset() Update LayoutInfo for all children.
 - 
getMinWidthpublic double getMinWidth(double aHeight) The min width for layout.
 - 
getMinHeightpublic double getMinHeight(double aWidth) The min height for layout.
 - 
getPrefWidthpublic double getPrefWidth(double aHeight) The preferred width for layout.
 - 
getPrefHeightpublic double getPrefHeight(double aWidth) The preferred height for layout.
 - 
getLayoutInfoXpublic abstract java.lang.Object getLayoutInfoX(T aChild) Returns the internal layout info for a child.
 - 
setLayoutInfoXpublic abstract void setLayoutInfoX(T aChild, java.lang.Object aLIX) Sets the internal layout info for a child.
 - 
getParentWidthpublic abstract double getParentWidth(T aParent) Returns parent width.
 - 
getParentHeightpublic abstract double getParentHeight(T aParent) Returns parent height.
 - 
getChildCountpublic abstract int getChildCount(T aParent) Returns the child count of given parent.
 - 
getChildpublic abstract T getChild(T aParent, int anIndex) Returns the individual child in this line.
 - 
getLayoutInfopublic abstract java.lang.Object getLayoutInfo(T aChild) Returns layout info (descriptor) for child.
 - 
setLayoutInfopublic abstract void setLayoutInfo(T aChild, java.lang.Object aLI) Sets layout info (descriptor) for child.
 - 
getXpublic abstract double getX(T aChild) Returns child x.
 - 
getYpublic abstract double getY(T aChild) Returns child y.
 - 
getWidthpublic abstract double getWidth(T aChild) Returns child width.
 - 
getHeightpublic abstract double getHeight(T aChild) Returns child height.
 - 
setBoundspublic abstract void setBounds(T aChild, double anX, double aY, double aWidth, double aHeight) Set child bounds.
 - 
getMinWidthpublic abstract double getMinWidth(T aChild, double aValue) Returns child min width.
 - 
getMinHeightpublic abstract double getMinHeight(T aChild, double aValue) Returns child max height.
 - 
getPrefWidthpublic abstract double getPrefWidth(T aChild, double aValue) Returns child preferred width.
 - 
getPrefHeightpublic abstract double getPrefHeight(T aChild, double aValue) Returns child preferred height.
 - 
getBestHeightpublic double getBestHeight(T aChild, double aValue) Returns child best height.
 - 
clonepublic SpringLayout clone() Standard clone implementation.- Overrides:
- clonein class- java.lang.Object
 
 
- 
 
-