com.androidplot.ui.widget
Class Widget

java.lang.Object
  extended by com.androidplot.ui.widget.Widget
All Implemented Interfaces:
BoxModelable
Direct Known Subclasses:
EmptyWidget, TextLabelWidget, XYGraphWidget, XYPlotLegendWidget

public abstract class Widget
extends Object
implements BoxModelable


Constructor Summary
Widget(SizeMetrics sizeMetrics)
           
Widget(SizeMetric heightMetric, SizeMetric widthMetric)
           
 
Method Summary
 void draw(android.graphics.Canvas canvas, android.graphics.RectF widgetRect)
           
 android.graphics.Paint getBackgroundPaint()
           
 android.graphics.Paint getBorderPaint()
           
 SizeMetric getHeightMetric()
           
 float getHeightPix(float size)
           
 android.graphics.RectF getMarginatedRect(android.graphics.RectF widgetRect)
          Returns a RectF instance describing the inner edge of the margin layer.
 float getMarginBottom()
           
 float getMarginLeft()
           
 float getMarginRight()
           
 float getMarginTop()
           
 android.graphics.RectF getPaddedRect(android.graphics.RectF widgetMarginRect)
          Returns a RectF instance describing the inner edge of the padding layer.
 float getPaddingBottom()
           
 float getPaddingLeft()
           
 float getPaddingRight()
           
 float getPaddingTop()
           
 SizeMetric getWidthMetric()
           
 float getWidthPix(float size)
           
 boolean isClippingEnabled()
           
 boolean isDrawBackgroundEnabled()
           
 boolean isDrawBorderEnabled()
           
 void setBackgroundPaint(android.graphics.Paint backgroundPaint)
           
 void setBorderPaint(android.graphics.Paint borderPaint)
           
 void setClippingEnabled(boolean clippingEnabled)
           
 void setDrawBackgroundEnabled(boolean drawBackgroundEnabled)
           
 void setDrawBorderEnabled(boolean drawBorderEnabled)
           
 void setHeight(float height)
           
 void setHeight(float height, SizeLayoutType layoutType)
           
 void setMarginBottom(float marginBottom)
           
 void setMarginLeft(float marginLeft)
           
 void setMarginRight(float marginRight)
           
 void setMargins(float left, float top, float right, float bottom)
           
 void setMarginTop(float marginTop)
           
 void setPadding(float left, float top, float right, float bottom)
           
 void setPaddingBottom(float paddingBottom)
           
 void setPaddingLeft(float paddingLeft)
           
 void setPaddingRight(float paddingRight)
           
 void setPaddingTop(float paddingTop)
           
 void setSize(SizeMetrics sizeMetrics)
           
 void setWidth(float width)
           
 void setWidth(float width, SizeLayoutType layoutType)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Widget

public Widget(SizeMetric heightMetric,
              SizeMetric widthMetric)

Widget

public Widget(SizeMetrics sizeMetrics)
Method Detail

setSize

public void setSize(SizeMetrics sizeMetrics)

setWidth

public void setWidth(float width)

setWidth

public void setWidth(float width,
                     SizeLayoutType layoutType)

setHeight

public void setHeight(float height)

setHeight

public void setHeight(float height,
                      SizeLayoutType layoutType)

getWidthMetric

public SizeMetric getWidthMetric()

getHeightMetric

public SizeMetric getHeightMetric()

getWidthPix

public float getWidthPix(float size)

getHeightPix

public float getHeightPix(float size)

getMarginatedRect

public android.graphics.RectF getMarginatedRect(android.graphics.RectF widgetRect)
Description copied from interface: BoxModelable
Returns a RectF instance describing the inner edge of the margin layer.

Specified by:
getMarginatedRect in interface BoxModelable
Returns:

getPaddedRect

public android.graphics.RectF getPaddedRect(android.graphics.RectF widgetMarginRect)
Description copied from interface: BoxModelable
Returns a RectF instance describing the inner edge of the padding layer.

Specified by:
getPaddedRect in interface BoxModelable
Returns:

setMarginRight

public void setMarginRight(float marginRight)
Specified by:
setMarginRight in interface BoxModelable

setMargins

public void setMargins(float left,
                       float top,
                       float right,
                       float bottom)
Specified by:
setMargins in interface BoxModelable

setPadding

public void setPadding(float left,
                       float top,
                       float right,
                       float bottom)
Specified by:
setPadding in interface BoxModelable

getMarginTop

public float getMarginTop()
Specified by:
getMarginTop in interface BoxModelable

setMarginTop

public void setMarginTop(float marginTop)
Specified by:
setMarginTop in interface BoxModelable

getMarginBottom

public float getMarginBottom()
Specified by:
getMarginBottom in interface BoxModelable

getPaddingLeft

public float getPaddingLeft()
Specified by:
getPaddingLeft in interface BoxModelable

setPaddingLeft

public void setPaddingLeft(float paddingLeft)
Specified by:
setPaddingLeft in interface BoxModelable

getPaddingTop

public float getPaddingTop()
Specified by:
getPaddingTop in interface BoxModelable

setPaddingTop

public void setPaddingTop(float paddingTop)
Specified by:
setPaddingTop in interface BoxModelable

getPaddingRight

public float getPaddingRight()
Specified by:
getPaddingRight in interface BoxModelable

setPaddingRight

public void setPaddingRight(float paddingRight)
Specified by:
setPaddingRight in interface BoxModelable

getPaddingBottom

public float getPaddingBottom()
Specified by:
getPaddingBottom in interface BoxModelable

setPaddingBottom

public void setPaddingBottom(float paddingBottom)
Specified by:
setPaddingBottom in interface BoxModelable

setMarginBottom

public void setMarginBottom(float marginBottom)

getMarginLeft

public float getMarginLeft()
Specified by:
getMarginLeft in interface BoxModelable

setMarginLeft

public void setMarginLeft(float marginLeft)
Specified by:
setMarginLeft in interface BoxModelable

getMarginRight

public float getMarginRight()
Specified by:
getMarginRight in interface BoxModelable

draw

public void draw(android.graphics.Canvas canvas,
                 android.graphics.RectF widgetRect)
          throws PlotRenderException
Throws:
PlotRenderException

getBorderPaint

public android.graphics.Paint getBorderPaint()

setBorderPaint

public void setBorderPaint(android.graphics.Paint borderPaint)

getBackgroundPaint

public android.graphics.Paint getBackgroundPaint()

setBackgroundPaint

public void setBackgroundPaint(android.graphics.Paint backgroundPaint)

isDrawBorderEnabled

public boolean isDrawBorderEnabled()

setDrawBorderEnabled

public void setDrawBorderEnabled(boolean drawBorderEnabled)

isDrawBackgroundEnabled

public boolean isDrawBackgroundEnabled()

setDrawBackgroundEnabled

public void setDrawBackgroundEnabled(boolean drawBackgroundEnabled)

isClippingEnabled

public boolean isClippingEnabled()

setClippingEnabled

public void setClippingEnabled(boolean clippingEnabled)


Copyright © 2011. All Rights Reserved.