Package snap.view

Class ScaleBoxProxy

All Implemented Interfaces:
Cloneable

public class ScaleBoxProxy extends BoxViewProxy<View>
A ViewProxy that can layout content in the manner of ScaleBox for any View.
  • Constructor Details

    • ScaleBoxProxy

      public ScaleBoxProxy(View aParent)
      Constructor for given parent view.
    • ScaleBoxProxy

      public ScaleBoxProxy(View aParent, View aChild, boolean isFillWidth, boolean isFillHeight)
      Creates a new ScaleBox for content with FillWidth, FillHeight params.
  • Method Details

    • isKeepAspect

      public boolean isKeepAspect()
      Returns whether to preserve natural aspect of content when scaling.
    • setKeepAspect

      public void setKeepAspect(boolean aValue)
      Sets whether to preserve natural aspect of content when scaling.
    • getAspect

      public double getAspect()
      Returns the aspect of the content.
    • getPrefWidth

      public double getPrefWidth(double aH)
      Returns preferred width of layout.
      Overrides:
      getPrefWidth in class ParentViewProxy<View>
    • getPrefHeight

      public double getPrefHeight(double aW)
      Returns preferred height of layout.
      Overrides:
      getPrefHeight in class ParentViewProxy<View>
    • layoutProxy

      public void layoutProxy()
      Performs Box layout for given parent, child and fill width/height.
      Overrides:
      layoutProxy in class BoxViewProxy<View>