Package snap.view
Class ScaleBoxProxy
java.lang.Object
- All Implemented Interfaces:
Cloneable
A ViewProxy that can layout content in the manner of ScaleBox for any View.
-
Field Summary
Fields inherited from class snap.view.ParentViewProxy
_growHeightCount, _growWidthCount
Fields inherited from class snap.geom.Shape
_bounds, WIND_EVEN_ODD, WIND_NON_ZERO
-
Constructor Summary
ConstructorDescriptionScaleBoxProxy
(View aParent) Constructor for given parent view.ScaleBoxProxy
(View aParent, View aChild, boolean isFillWidth, boolean isFillHeight) Creates a new ScaleBox for content with FillWidth, FillHeight params. -
Method Summary
Modifier and TypeMethodDescriptiondouble
Returns the aspect of the content.double
getPrefHeight
(double aW) Returns preferred height of layout.double
getPrefWidth
(double aH) Returns preferred width of layout.boolean
Returns whether to preserve natural aspect of content when scaling.void
Performs Box layout for given parent, child and fill width/height.void
setKeepAspect
(boolean aValue) Sets whether to preserve natural aspect of content when scaling.Methods inherited from class snap.view.BoxViewProxy
getPrefHeightImpl, getPrefWidthImpl
Methods inherited from class snap.view.ParentViewProxy
getBestHeight, getBestWidth, getChildrenMaxXAllWithInsets, getChildrenMaxXLastWithInsets, getChildrenMaxYAllWithInsets, getChildrenMaxYLastWithInsets, getGrowHeightCount, getGrowWidthCount, layoutView
Methods inherited from class snap.view.ViewProxy
getAlign, getAlignXAsDouble, getAlignYAsDouble, getBorder, getBorderInsets, getChildCount, getChildForClass, getChildren, getChildrenForClass, getContent, getHeight, getInsetsAll, getLeanX, getLeanXAsDouble, getLeanY, getLeanYAsDouble, getMargin, getMaxX, getMaxY, getPadding, getProxies, getProxy, getSpacing, getView, getWidth, isFillHeight, isFillWidth, isGrowHeight, isGrowWidth, isVisible, setAlign, setBorder, setBounds, setBounds, setBoundsInClient, setChildren, setContent, setFillHeight, setFillWidth, setGrowHeight, setGrowWidth, setMargin, setPadding, setSpacing, toString
Methods inherited from class snap.geom.Rect
add, add, addX, addY, clone, contains, contains, contains, contains, containsRect, equals, get, get, getAddRect, getBoundsImpl, getInsetRect, getInsetRect, getInsetRect, getIntersectRect, getOffsetRect, getPathIter, getPerimeterPointForRadial, getPoint, getPointForPosition, getPointForPositionAndSize, getPointForPositionAndSize, getPoints, getRectCenteredInside, getRectForPoints, getRectForString, getScaledRect, getUnionRect, hashCode, intersect, intersectsRect, intersectsRectAndNotEmpty, intersectsShape, intersectsShape, scale, snap, union, union, unionEvenIfEmpty
Methods inherited from class snap.geom.RectBase
copyFor, copyFor, equals, getMidX, getMidY, getMinX, getMinY, getSize, getSvgString, getX, getXY, getY, inset, inset, inset, isEmpty, offset, setCenteredXY, setHeight, setRect, setRect, setSize, setWidth, setX, setXY, setY
Methods inherited from class snap.geom.Shape
addShapes, contains, containsSeg, copyForBounds, crossesSeg, getArcLength, getBounds, getCrossings, getDistance, getFlattenedShape, getFlattenedShape, getNotSelfIntersectingShape, intersectShapes, intersectsSeg, intersectsXY, isClosed, isFlat, isMultiCycle, isSelfIntersecting, isSingleCycle, shapeChanged, subtractShapes
-
Constructor Details
-
ScaleBoxProxy
Constructor for given parent view. -
ScaleBoxProxy
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 classParentViewProxy<View>
-
getPrefHeight
public double getPrefHeight(double aW) Returns preferred height of layout.- Overrides:
getPrefHeight
in classParentViewProxy<View>
-
layoutProxy
public void layoutProxy()Performs Box layout for given parent, child and fill width/height.- Overrides:
layoutProxy
in classBoxViewProxy<View>
-