Package snap.view

Class ParentViewProxy<T extends View>

All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
BoxViewProxy, ColViewProxy, RowViewProxy

public abstract class ParentViewProxy<T extends View> extends ViewProxy<T>
A ViewProxy that can layout content in the manner of BoxView for any View.
  • Field Details

    • _growWidthCount

      protected int _growWidthCount
    • _growHeightCount

      protected int _growHeightCount
  • Constructor Details

    • ParentViewProxy

      public ParentViewProxy(View aParent)
      Constructor for given parent view.
  • Method Details

    • getGrowWidthCount

      public int getGrowWidthCount()
      Returns the number of children that grow width.
    • getGrowHeightCount

      public int getGrowHeightCount()
      Returns the number of children that grow height.
    • getChildrenMaxXLastWithInsets

      public double getChildrenMaxXLastWithInsets()
      Returns the MaxX of last child with insets.
    • getChildrenMaxXAllWithInsets

      public double getChildrenMaxXAllWithInsets()
      Returns the MaxX of children with insets.
    • getChildrenMaxYLastWithInsets

      public double getChildrenMaxYLastWithInsets()
      Returns the MaxY of last child with insets.
    • getChildrenMaxYAllWithInsets

      public double getChildrenMaxYAllWithInsets()
      Returns the MaxY of children with insets.
    • getBestWidth

      public double getBestWidth(double aH)
      Returns the best width for view - accounting for pref/min/max.
      Overrides:
      getBestWidth in class ViewProxy<T extends View>
    • getBestHeight

      public double getBestHeight(double aW)
      Returns the best height for view - accounting for pref/min/max.
      Overrides:
      getBestHeight in class ViewProxy<T extends View>
    • getPrefWidth

      public double getPrefWidth(double aH)
      Returns preferred width of layout.
    • getPrefHeight

      public double getPrefHeight(double aW)
      Returns preferred height of layout.
    • layoutView

      public void layoutView()
      Performs BoxView layout.
    • getPrefWidthImpl

      protected abstract double getPrefWidthImpl(double aH)
      Returns preferred width of layout.
    • getPrefHeightImpl

      protected abstract double getPrefHeightImpl(double aW)
      Returns preferred height of layout.
    • layoutProxy

      public abstract void layoutProxy()
      Performs Box layout for given parent, child and fill width/height.