public abstract class ShapeDrawer extends Object
+---------+---------+ | | | | | | | | | +---------+---------+ | | | | | | | | | +---------+---------+Depending on shape, the parts can be designed or not.
Constructor and Description |
---|
ShapeDrawer() |
Modifier and Type | Method and Description |
---|---|
protected void |
applyFillProperties(Context2d context,
String shapeColor)
Applies the common configuration to context for fill designing.
|
protected void |
applyStrokeProperties(Context2d context,
String shapeColor,
int size)
Applies the common configuration to context for stroke designing.
|
protected void |
applyStrokeProperties(Context2d context,
String shapeColor,
int size,
Context2d.LineCap lineCap,
Context2d.LineJoin lineJoin)
Applies the common configuration to context for stroke designing.
|
protected abstract void |
drawTile(Context2d context,
String backgroundColor,
String shapeColor,
int size)
Draws the tile applying the requested shape.
|
protected CanvasElement |
initCanvas(CanvasElement outerCanvas,
int size)
Initialized the internal canvas to use for drawing.
|
protected final CanvasElement initCanvas(CanvasElement outerCanvas, int size)
outerCanvas
- canvas instance of tile factorysize
- dimension of internal canvasprotected abstract void drawTile(Context2d context, String backgroundColor, String shapeColor, int size)
context
- context of canvas to design the shapebackgroundColor
- background of tileshapeColor
- color of shapesize
- the size of tile, which is a squareprotected final void applyStrokeProperties(Context2d context, String shapeColor, int size)
context
- context of canvas to design the shapeshapeColor
- color of shapesize
- the size of tile, which is a squareprotected final void applyStrokeProperties(Context2d context, String shapeColor, int size, Context2d.LineCap lineCap, Context2d.LineJoin lineJoin)
context
- context of canvas to design the shapeshapeColor
- color of shapesize
- the size of tile, which is a squarelineCap
- determines the shape used to draw the end points of lineslineJoin
- determines the shape used to join two line segments where they meet