Class DrawableShapesFactory


  • public class DrawableShapesFactory
    extends java.lang.Object
    Factory which creates Drawable shape object.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static android.graphics.drawable.Drawable createCircleDrawable​(Point topLeft, Point bottomRight, boolean isFilled, boolean isPicked, Color color, int width)
      Creates circle drawable object.
      static android.graphics.drawable.Drawable createShapeDrawable​(java.util.List<Point> points, boolean isFilled, boolean isPicked, Color color, int width)
      Creates shape drawable object.
      static android.graphics.drawable.Drawable createTextDrawable​(java.lang.String content, Point position, float fontSize, boolean isPicked, boolean drawWithRect, Color color)
      Creates text shape drawable object.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • HALF_OF_ALPHA_CHANNEL_VALUE

        public static final int HALF_OF_ALPHA_CHANNEL_VALUE
        See Also:
        Constant Field Values
    • Constructor Detail

      • DrawableShapesFactory

        public DrawableShapesFactory()
    • Method Detail

      • createShapeDrawable

        public static android.graphics.drawable.Drawable createShapeDrawable​(java.util.List<Point> points,
                                                                             boolean isFilled,
                                                                             boolean isPicked,
                                                                             Color color,
                                                                             int width)
        Creates shape drawable object.
        Parameters:
        points - shape points.
        isFilled - is shape filled by provided color.
        isPicked - is shape picked by user, if true shapes alpha channes value will be 50%.
        color - shapes color.
        width - stroke width in px.
        Returns:
        shape drawable object.
      • createTextDrawable

        public static android.graphics.drawable.Drawable createTextDrawable​(java.lang.String content,
                                                                            Point position,
                                                                            float fontSize,
                                                                            boolean isPicked,
                                                                            boolean drawWithRect,
                                                                            Color color)
        Creates text shape drawable object.
        Parameters:
        content - text.
        position - coordinates on canvas.
        fontSize - in px.
        isPicked - is shape picked by user, if true shapes alpha channes value will be 50%.
        drawWithRect - if true text will be drawn with outside black rectangle.
        color - shapes color.
        Returns:
        text shape drawable.
      • createCircleDrawable

        public static android.graphics.drawable.Drawable createCircleDrawable​(Point topLeft,
                                                                              Point bottomRight,
                                                                              boolean isFilled,
                                                                              boolean isPicked,
                                                                              Color color,
                                                                              int width)
        Creates circle drawable object.
        Parameters:
        topLeft - top left coordinates of shape.
        bottomRight - bottom right coordinates of shape.
        isFilled - is shape filled by provided color.
        isPicked - is shape picked by user, if true shapes alpha channes value will be 50%.
        color - shapes color.
        width - stroke width in px.
        Returns:
        circle drawable object.