Package snap.view

Class ViewProxy<T extends View>

All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
ParentViewProxy

public class ViewProxy<T extends View> extends Rect
This class represents a view for the purpose of layout.
  • Constructor Details

    • ViewProxy

      public ViewProxy(View aView)
      Creates a new ViewProxy for given View.
  • Method Details

    • getView

      public T getView()
      Returns the view.
    • getWidth

      public double getWidth()
      Returns the width.
      Overrides:
      getWidth in class RectBase
    • getHeight

      public double getHeight()
      Returns the height.
      Overrides:
      getHeight in class RectBase
    • setBounds

      public void setBounds(Rect aRect)
      Sets the bounds.
    • setBounds

      public void setBounds(double aX, double aY, double aW, double aH)
      Sets the bounds.
    • getMaxX

      public double getMaxX()
      Returns the Max X.
      Overrides:
      getMaxX in class RectBase
    • getMaxY

      public double getMaxY()
      Returns the Max Y.
      Overrides:
      getMaxY in class RectBase
    • setBoundsInClient

      public void setBoundsInClient()
      Sets the bounds back in the client.
    • getContent

      public ViewProxy<?> getContent()
      Returns the content.
    • setContent

      public void setContent(ViewProxy<?> aViewProxy)
      Sets the content.
    • getChildCount

      public int getChildCount()
      Returns the number of children.
    • getChildren

      public ViewProxy<?>[] getChildren()
      Returns the children.
    • setChildren

      public void setChildren(ViewProxy<?>[] theProxies)
      Returns the children.
    • getChildForClass

      public <E extends View> ViewProxy<E> getChildForClass(Class<E> aClass)
      Returns the child for given component class.
    • getChildrenForClass

      public <E extends View> ViewProxy<E>[] getChildrenForClass(Class<E> aClass)
      Returns the children for given component class.
    • getBorder

      public Border getBorder()
      Returns the border.
    • setBorder

      public void setBorder(Border aBorder)
      Sets the border.
    • getBorderInsets

      public Insets getBorderInsets()
      Returns the border insets.
    • getMargin

      public Insets getMargin()
      Returns the margin.
    • setMargin

      public void setMargin(Insets theIns)
      Sets the margin.
    • getPadding

      public Insets getPadding()
      Returns the padding.
    • setPadding

      public void setPadding(Insets theIns)
      Sets the padding.
    • getInsetsAll

      public Insets getInsetsAll()
      Returns the insets.
    • isVisible

      public boolean isVisible()
      Returns whether proxy is visible.
    • getAlign

      public Pos getAlign()
      Returns the alignment.
    • setAlign

      public void setAlign(Pos aPos)
      Sets the alignment.
    • getLeanX

      public HPos getLeanX()
      Returns the LeanX.
    • getLeanY

      public VPos getLeanY()
      Returns the LeanY.
    • isGrowWidth

      public boolean isGrowWidth()
      Returns whether view grows width.
    • setGrowWidth

      public void setGrowWidth(boolean aValue)
      Sets whether view grows width.
    • isGrowHeight

      public boolean isGrowHeight()
      Returns whether view grows height.
    • setGrowHeight

      public void setGrowHeight(boolean aValue)
      Sets whether view grows height.
    • getSpacing

      public double getSpacing()
      Returns spacing.
    • setSpacing

      public void setSpacing(double aValue)
      Sets spacing.
    • isFillWidth

      public boolean isFillWidth()
      Returns whether view fills width.
    • setFillWidth

      public void setFillWidth(boolean aValue)
      Sets whether view fills width.
    • isFillHeight

      public boolean isFillHeight()
      Returns whether view fills height.
    • setFillHeight

      public void setFillHeight(boolean aValue)
      Sets whether view fills height.
    • getBestWidth

      public double getBestWidth(double aH)
      Returns the best width.
    • getBestHeight

      public double getBestHeight(double aW)
      Returns the best height.
    • getAlignXAsDouble

      public double getAlignXAsDouble()
      Returns the align x factor.
    • getAlignYAsDouble

      public double getAlignYAsDouble()
      Returns the align y factor.
    • getLeanXAsDouble

      public double getLeanXAsDouble()
      Returns the lean x factor.
    • getLeanYAsDouble

      public double getLeanYAsDouble()
      Returns the lean y factor.
    • toString

      public String toString()
      Description copied from class: RectBase
      Standard toString implementation.
      Overrides:
      toString in class RectBase
    • getProxy

      public static ViewProxy<?> getProxy(View aView)
      Returns a proxy for given view.
    • getProxies

      public static ViewProxy<?>[] getProxies(View... theViews)
      Returns an array of proxies for given array of views.