|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.androidplot.ui.widget.Widget
public abstract class Widget
A Widget is a graphical sub-element of a Plot that can be positioned relative to the bounds of the Plot.
Constructor Summary | |
---|---|
Widget(LayoutManager layoutManager,
SizeMetrics sizeMetrics)
|
|
Widget(LayoutManager layoutManager,
SizeMetric heightMetric,
SizeMetric widthMetric)
|
Method Summary | |
---|---|
boolean |
containsPoint(android.graphics.PointF point)
Determines whether or not point lies within this Widget. |
void |
draw(android.graphics.Canvas canvas,
android.graphics.RectF widgetRect)
|
AnchorPosition |
getAnchor()
|
static android.graphics.PointF |
getAnchorCoordinates(float x,
float y,
float width,
float height,
AnchorPosition anchorPosition)
|
static android.graphics.PointF |
getAnchorCoordinates(android.graphics.RectF widgetRect,
AnchorPosition anchorPosition)
|
static android.graphics.PointF |
getAnchorOffset(float width,
float height,
AnchorPosition anchorPosition)
|
android.graphics.Paint |
getBackgroundPaint()
|
android.graphics.Paint |
getBorderPaint()
|
android.graphics.PointF |
getElementCoordinates(float height,
float width,
android.graphics.RectF viewRect,
PositionMetrics metrics)
|
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()
|
PositionMetrics |
getPositionMetrics()
|
DisplayDimensions |
getWidgetDimensions()
|
SizeMetric |
getWidthMetric()
|
float |
getWidthPix(float size)
|
boolean |
isClippingEnabled()
|
boolean |
isVisible()
|
void |
layout(DisplayDimensions plotDimensions)
Called when a change to the class' dimensions is made. |
void |
onPostInit()
Can be overridden by subclasses to handle any final resizing etc. |
void |
position(float x,
XLayoutStyle xLayoutStyle,
float y,
YLayoutStyle yLayoutStyle)
Same as position(float, com.androidplot.ui.XLayoutStyle, float, com.androidplot.ui.YLayoutStyle, com.androidplot.ui.AnchorPosition)
but with the anchor parameter defaulted to the upper left corner. |
void |
position(float x,
XLayoutStyle xLayoutStyle,
float y,
YLayoutStyle yLayoutStyle,
AnchorPosition anchor)
|
void |
refreshLayout()
Causes the pixel dimensions used for rendering this Widget to be recalculated. |
void |
setAnchor(AnchorPosition anchor)
|
void |
setBackgroundPaint(android.graphics.Paint backgroundPaint)
|
void |
setBorderPaint(android.graphics.Paint borderPaint)
|
void |
setClippingEnabled(boolean clippingEnabled)
|
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 |
setPositionMetrics(PositionMetrics positionMetrics)
|
void |
setSize(SizeMetrics sizeMetrics)
|
void |
setVisible(boolean visible)
|
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 |
---|
public Widget(LayoutManager layoutManager, SizeMetric heightMetric, SizeMetric widthMetric)
public Widget(LayoutManager layoutManager, SizeMetrics sizeMetrics)
Method Detail |
---|
public DisplayDimensions getWidgetDimensions()
public AnchorPosition getAnchor()
public void setAnchor(AnchorPosition anchor)
public void position(float x, XLayoutStyle xLayoutStyle, float y, YLayoutStyle yLayoutStyle)
position(float, com.androidplot.ui.XLayoutStyle, float, com.androidplot.ui.YLayoutStyle, com.androidplot.ui.AnchorPosition)
but with the anchor parameter defaulted to the upper left corner.
x
- xLayoutStyle
- y
- yLayoutStyle
- public void position(float x, XLayoutStyle xLayoutStyle, float y, YLayoutStyle yLayoutStyle, AnchorPosition anchor)
x
- X-Coordinate of the top left corner of element. When using RELATIVE, must be a value between 0 and 1.xLayoutStyle
- LayoutType to use when orienting this element's X-Coordinate.y
- Y_VALS_ONLY-Coordinate of the top-left corner of element. When using RELATIVE, must be a value between 0 and 1.yLayoutStyle
- LayoutType to use when orienting this element's Y_VALS_ONLY-Coordinate.anchor
- The point of reference used by this positioning call.public void onPostInit()
public boolean containsPoint(android.graphics.PointF point)
point
-
public void setSize(SizeMetrics sizeMetrics)
public void setWidth(float width)
public void setWidth(float width, SizeLayoutType layoutType)
public void setHeight(float height)
public void setHeight(float height, SizeLayoutType layoutType)
public SizeMetric getWidthMetric()
public SizeMetric getHeightMetric()
public float getWidthPix(float size)
public float getHeightPix(float size)
public android.graphics.RectF getMarginatedRect(android.graphics.RectF widgetRect)
BoxModelable
getMarginatedRect
in interface BoxModelable
public android.graphics.RectF getPaddedRect(android.graphics.RectF widgetMarginRect)
BoxModelable
getPaddedRect
in interface BoxModelable
public void setMarginRight(float marginRight)
setMarginRight
in interface BoxModelable
public void setMargins(float left, float top, float right, float bottom)
setMargins
in interface BoxModelable
public void setPadding(float left, float top, float right, float bottom)
setPadding
in interface BoxModelable
public float getMarginTop()
getMarginTop
in interface BoxModelable
public void setMarginTop(float marginTop)
setMarginTop
in interface BoxModelable
public float getMarginBottom()
getMarginBottom
in interface BoxModelable
public float getPaddingLeft()
getPaddingLeft
in interface BoxModelable
public void setPaddingLeft(float paddingLeft)
setPaddingLeft
in interface BoxModelable
public float getPaddingTop()
getPaddingTop
in interface BoxModelable
public void setPaddingTop(float paddingTop)
setPaddingTop
in interface BoxModelable
public float getPaddingRight()
getPaddingRight
in interface BoxModelable
public void setPaddingRight(float paddingRight)
setPaddingRight
in interface BoxModelable
public float getPaddingBottom()
getPaddingBottom
in interface BoxModelable
public void setPaddingBottom(float paddingBottom)
setPaddingBottom
in interface BoxModelable
public void setMarginBottom(float marginBottom)
public float getMarginLeft()
getMarginLeft
in interface BoxModelable
public void setMarginLeft(float marginLeft)
setMarginLeft
in interface BoxModelable
public float getMarginRight()
getMarginRight
in interface BoxModelable
public void refreshLayout()
public void layout(DisplayDimensions plotDimensions)
Resizable
layout
in interface Resizable
public android.graphics.PointF getElementCoordinates(float height, float width, android.graphics.RectF viewRect, PositionMetrics metrics)
public static android.graphics.PointF getAnchorOffset(float width, float height, AnchorPosition anchorPosition)
public static android.graphics.PointF getAnchorCoordinates(android.graphics.RectF widgetRect, AnchorPosition anchorPosition)
public static android.graphics.PointF getAnchorCoordinates(float x, float y, float width, float height, AnchorPosition anchorPosition)
public void draw(android.graphics.Canvas canvas, android.graphics.RectF widgetRect) throws PlotRenderException
PlotRenderException
public android.graphics.Paint getBorderPaint()
public void setBorderPaint(android.graphics.Paint borderPaint)
public android.graphics.Paint getBackgroundPaint()
public void setBackgroundPaint(android.graphics.Paint backgroundPaint)
public boolean isClippingEnabled()
public void setClippingEnabled(boolean clippingEnabled)
public boolean isVisible()
public void setVisible(boolean visible)
public PositionMetrics getPositionMetrics()
public void setPositionMetrics(PositionMetrics positionMetrics)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |