Package com.inductiveautomation.snap.ui
Class FlowLayout<T>
- java.lang.Object
-
- com.inductiveautomation.snap.ui.FlowLayout<T>
-
- All Implemented Interfaces:
java.lang.Cloneable
public abstract class FlowLayout<T> extends java.lang.Object implements java.lang.Cloneable
A layout that puts children one after another, wrapping when needed.
-
-
Constructor Summary
Constructors Constructor Description FlowLayout()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addChild(T aChild, java.lang.Object aLayoutInfo)
Adds a layout child.FlowLayout
clone()
Standard clone implementation.abstract T
getChild(T aParent, int anIndex)
Returns the individual child in this line.abstract int
getChildCount(T aParent)
Returns the child count of given parent.abstract double
getHeight(T aChild)
Returns child height.abstract SPInsets
getInsets(T aParent)
Returns the insets of the parent.abstract java.lang.Object
getLayoutInfo(T aChild)
Returns layout info (descriptor) for child.double
getMinHeight(double aWidth)
The min height for layout.double
getMinWidth(double aHeight)
The min width for layout.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.double
getSpacingX()
Returns the spacing x.double
getSpacingY()
Returns the spacing y.abstract double
getWidth(T aChild)
Returns child width.boolean
getWraps()
Returns whether layout wraps.abstract double
getX(T aChild)
Returns child x.abstract double
getY(T aChild)
Returns child y.void
layoutChildren(T aParent)
Layout children.void
removeChild(T aChild)
Removes a child.abstract void
setBounds(T aChild, double anX, double aY, double aWidth, double aHeight)
Set child bounds.abstract void
setLayoutInfo(T aChild, java.lang.Object aLI)
Sets layout info (descriptor) for child.void
setSpacingX(double aValue)
Sets the spacing x.void
setSpacingY(double aValue)
Sets the spacing y.void
setWraps(boolean aValue)
Sets whether layout wraps.
-
-
-
Method Detail
-
getSpacingX
public double getSpacingX()
Returns the spacing x.
-
setSpacingX
public void setSpacingX(double aValue)
Sets the spacing x.
-
getSpacingY
public double getSpacingY()
Returns the spacing y.
-
setSpacingY
public void setSpacingY(double aValue)
Sets the spacing y.
-
getWraps
public boolean getWraps()
Returns whether layout wraps.
-
setWraps
public void setWraps(boolean aValue)
Sets whether layout wraps.
-
layoutChildren
public void layoutChildren(T aParent)
Layout children.
-
getPrefWidth
public double getPrefWidth(double aHeight)
The preferred width for layout.
-
getPrefHeight
public double getPrefHeight(double aWidth)
The preferred height for layout.
-
getMinWidth
public double getMinWidth(double aHeight)
The min width for layout.
-
getMinHeight
public double getMinHeight(double aWidth)
The min height for layout.
-
addChild
public void addChild(T aChild, java.lang.Object aLayoutInfo)
Adds a layout child.
-
removeChild
public void removeChild(T aChild)
Removes a child.
-
getParentWidth
public abstract double getParentWidth(T aParent)
Returns parent width.
-
getParentHeight
public abstract double getParentHeight(T aParent)
Returns parent height.
-
getChildCount
public abstract int getChildCount(T aParent)
Returns the child count of given parent.
-
getChild
public abstract T getChild(T aParent, int anIndex)
Returns the individual child in this line.
-
getLayoutInfo
public abstract java.lang.Object getLayoutInfo(T aChild)
Returns layout info (descriptor) for child.
-
setLayoutInfo
public abstract void setLayoutInfo(T aChild, java.lang.Object aLI)
Sets layout info (descriptor) for child.
-
getX
public abstract double getX(T aChild)
Returns child x.
-
getY
public abstract double getY(T aChild)
Returns child y.
-
getWidth
public abstract double getWidth(T aChild)
Returns child width.
-
getHeight
public abstract double getHeight(T aChild)
Returns child height.
-
setBounds
public abstract void setBounds(T aChild, double anX, double aY, double aWidth, double aHeight)
Set child bounds.
-
getPrefWidth
public abstract double getPrefWidth(T aChild, double aValue)
Returns child preferred width.
-
getPrefHeight
public abstract double getPrefHeight(T aChild, double aValue)
Returns child preferred height.
-
clone
public FlowLayout clone()
Standard clone implementation.- Overrides:
clone
in classjava.lang.Object
-
-