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
FieldsModifier and TypeFieldDescriptionprivate final ShapeDrawingFunctionAShapeDrawingFunctionfor the bottom-right half of the shapestatic final ShapeDrawingFunctionnullto be used in checks for a missing drawing function (which is allowed in some cases)static final ShapeInsetsFunctionA simpleShapeInsetsFunctionto be used to return anInsetsobject with 0 for all sides.private final ShapeFunctionTheShapeFunctionfor constructing aShapeprivate final ShapeInsetsFunctionTheShapeInsetsFunctionfor determiningInsetsfor the shapeprivate final ShapeDrawingFunctionAShapeDrawingFunctionfor the top-left half of the shape -
Constructor Summary
ConstructorsConstructorDescriptionShapeInfo(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 simpleShapeInsetsFunctionto be used to return anInsetsobject with 0 for all sides. -
noDrawFunc
nullto be used in checks for a missing drawing function (which is allowed in some cases) -
shapeFunc
TheShapeFunctionfor constructing aShape -
shapeInsetsFunc
TheShapeInsetsFunctionfor determiningInsetsfor the shape -
topLeftDrawFunc
AShapeDrawingFunctionfor the top-left half of the shape -
bottomRightDrawFunc
AShapeDrawingFunctionfor 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- TheShapeFunctionfor constructing aShapeshapeInsetsFunc- TheShapeInsetsFunctionfor determiningInsetsfor the shapetopLeftDrawFunc- AShapeDrawingFunctionfor the top-left half of the shapebottomRightDrawFunc- AShapeDrawingFunctionfor the bottom-right half of the shape
-
-
Method Details
-
getShapeFunc
- Returns:
- The
ShapeFunctionfor constructing aShape
-
getShapeInsetsFunc
- Returns:
- The
ShapeInsetsFunctionfor determiningInsetsfor the shape
-
getTopLeftDrawFunc
- Returns:
- A
ShapeDrawingFunctionfor the top-left half of the shape
-
getBottomRightDrawFunc
- Returns:
- A
ShapeDrawingFunctionfor the bottom-right half of the shape
-