Package com.github.tadukoo.view.shapes
Class ShapeInfo
java.lang.Object
com.github.tadukoo.view.shapes.ShapeInfo
- Direct Known Subclasses:
ShapeInfoUIResource
Shape Info contains a method for calculating the
Shape
and one for calculating the Insets
for that
Shape. Both methods take in the x, y, width, and height of the space the Shape will be drawn in to support
Shapes of different sizes more easily.- Version:
- Alpha v.0.2
- Author:
- Logan Ferree (Tadukoo)
-
Field Summary
Modifier and TypeFieldDescriptionprivate final ShapeDrawingFunction
AShapeDrawingFunction
for the bottom-right half of the shapestatic final ShapeDrawingFunction
null
to be used in checks for a missing drawing function (which is allowed in some cases)static final ShapeInsetsFunction
A simpleShapeInsetsFunction
to be used to return anInsets
object with 0 for all sides.private final ShapeFunction
TheShapeFunction
for constructing aShape
private final ShapeInsetsFunction
TheShapeInsetsFunction
for determiningInsets
for the shapeprivate final ShapeDrawingFunction
AShapeDrawingFunction
for the top-left half of the shape -
Constructor Summary
ConstructorDescriptionShapeInfo
(ShapeFunction shapeFunc, ShapeInsetsFunction shapeInsetsFunc, ShapeDrawingFunction topLeftDrawFunc, ShapeDrawingFunction bottomRightDrawFunc) Constructs a new ShapeInfo with the given functions -
Method Summary
Modifier and TypeMethodDescription
-
Field Details
-
noInsets
A simpleShapeInsetsFunction
to be used to return anInsets
object with 0 for all sides. -
noDrawFunc
null
to be used in checks for a missing drawing function (which is allowed in some cases) -
shapeFunc
TheShapeFunction
for constructing aShape
-
shapeInsetsFunc
TheShapeInsetsFunction
for determiningInsets
for the shape -
topLeftDrawFunc
AShapeDrawingFunction
for the top-left half of the shape -
bottomRightDrawFunc
AShapeDrawingFunction
for the bottom-right half of the shape
-
-
Constructor Details
-
ShapeInfo
public ShapeInfo(ShapeFunction shapeFunc, ShapeInsetsFunction shapeInsetsFunc, ShapeDrawingFunction topLeftDrawFunc, ShapeDrawingFunction bottomRightDrawFunc) Constructs a new ShapeInfo with the given functions- Parameters:
shapeFunc
- TheShapeFunction
for constructing aShape
shapeInsetsFunc
- TheShapeInsetsFunction
for determiningInsets
for the shapetopLeftDrawFunc
- AShapeDrawingFunction
for the top-left half of the shapebottomRightDrawFunc
- AShapeDrawingFunction
for the bottom-right half of the shape
-
-
Method Details
-
getShapeFunc
- Returns:
- The
ShapeFunction
for constructing aShape
-
getShapeInsetsFunc
- Returns:
- The
ShapeInsetsFunction
for determiningInsets
for the shape
-
getTopLeftDrawFunc
- Returns:
- A
ShapeDrawingFunction
for the top-left half of the shape
-
getBottomRightDrawFunc
- Returns:
- A
ShapeDrawingFunction
for the bottom-right half of the shape
-