android.TICO.Views
Class RectangleView

java.lang.Object
  extended by View
      extended by android.TICO.Views.RectangleView

public class RectangleView
extends View

Implementation of a RectangleView view.

Version:
1.0 May, 2012
Author:
Eduardo Ferrer

Constructor Summary
RectangleView(int startX, int startY, int stopX, int stopY, Context context)
          Creates a new RectangleView for the specified params.
 
Method Summary
 void onDraw(Canvas canvas)
           
 void setBackgroundColor(int color)
          Set the RectangleView color of the rectangle interior.
 void setBackgroundDrawable(GradientDrawable colorIn)
          Set the background frame gradient color for the RectangleView
 void setBorderWidth(int border)
          Set the width for stroking.
 void setColor(int color)
          Set the RectangleView color of the line.
 void setRect(int startX, int startY, int stopX, int stopY)
          Changes the RectangleView position and size
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RectangleView

public RectangleView(int startX,
                     int startY,
                     int stopX,
                     int stopY,
                     Context context)
Creates a new RectangleView for the specified params.

Parameters:
startX - The starting coordinate in X of the rectangle
startY - The starting coordinate in Y of the rectangle
stopX - The ending coordinate in X of the rectangle
stopY - The ending coordinate in Y of the rectangle
context - The Context the view is running in, through which it can access the current theme, resources, etc.
Method Detail

onDraw

public void onDraw(Canvas canvas)

setColor

public void setColor(int color)
Set the RectangleView color of the line. Note that the color is an int containing alpha as well as r,g,b. This 32bit value is not premultiplied, meaning that its alpha can be any value, regardless of the values of r,g,b. See the Color class for more details.

Parameters:
color - The new color (including alpha) to set as color of the rectangle line.

setBorderWidth

public void setBorderWidth(int border)
Set the width for stroking. Pass 0 to stroke in hairline mode. Hairlines always draws a single pixel independent of the canva's matrix.

Parameters:
border - set the RectangleView's stroke width of the line.

setBackgroundColor

public void setBackgroundColor(int color)
Set the RectangleView color of the rectangle interior. Note that the color is an int containing alpha as well as r,g,b. This 32bit value is not premultiplied, meaning that its alpha can be any value, regardless of the values of r,g,b. See the Color class for more details.

Parameters:
color - The new color (including alpha) to set as color of the rectangle interior.

setBackgroundDrawable

public void setBackgroundDrawable(GradientDrawable colorIn)
Set the background frame gradient color for the RectangleView

Parameters:
colorIn - The gradient color of the RectangleView background

setRect

public void setRect(int startX,
                    int startY,
                    int stopX,
                    int stopY)
Changes the RectangleView position and size

Parameters:
startX - The new starting coordinate in X of the rectangle
startY - The new starting coordinate in Y of the rectangle
stopX - The new ending coordinate in X of the rectangle
stopY - The new ending coordinate in Y of the rectangle