com.androidplot.ui
Class LayoutManager
java.lang.Object
com.androidplot.util.ZHash <Widget ,PositionMetrics >
com.androidplot.ui.LayoutManager
All Implemented Interfaces: android.view.View.OnTouchListener, Resizable , ZIndexable <Widget >
public class LayoutManager extends ZHash <Widget ,PositionMetrics >implements android.view.View.OnTouchListener, Resizable
Method Summary
void
draw (android.graphics.Canvas canvas)
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)
AnchorPosition
getElementAnchor (Widget element)
android.graphics.PointF
getElementCoordinates (float height,
float width,
android.graphics.RectF viewRect,
PositionMetrics metrics)
android.graphics.Paint
getMarginPaint ()
android.graphics.Paint
getOutlinePaint ()
android.graphics.Paint
getOutlineShadowPaint ()
android.graphics.Paint
getPaddingPaint ()
boolean
isDrawAnchorsEnabled ()
boolean
isDrawMarginsEnabled ()
boolean
isDrawOutlinesEnabled ()
boolean
isDrawOutlineShadowsEnabled ()
boolean
isDrawPaddingEnabled ()
void
layout (DisplayDimensions dims)
Called when a change to the class' dimensions is made.
boolean
onTouch (android.view.View v,
android.view.MotionEvent event)
void
position (Widget element,
float x,
XLayoutStyle xLayoutStyle,
float y,
YLayoutStyle yLayoutStyle)
void
position (Widget element,
float x,
XLayoutStyle xLayoutStyle,
float y,
YLayoutStyle yLayoutStyle,
AnchorPosition anchor)
void
setDrawAnchorsEnabled (boolean drawAnchorsEnabled)
void
setDrawMarginsEnabled (boolean drawMarginsEnabled)
void
setDrawOutlinesEnabled (boolean drawOutlinesEnabled)
void
setDrawOutlineShadowsEnabled (boolean drawOutlineShadowsEnabled)
void
setDrawPaddingEnabled (boolean drawPaddingEnabled)
boolean
setElementAnchor (Widget element,
AnchorPosition anchor)
void
setMarginPaint (android.graphics.Paint marginPaint)
void
setMarkupEnabled (boolean enabled)
void
setOutlinePaint (android.graphics.Paint outlinePaint)
void
setOutlineShadowPaint (android.graphics.Paint outlineShadowPaint)
void
setPaddingPaint (android.graphics.Paint paddingPaint)
Methods inherited from class com.androidplot.util.ZHash
addToBottom , addToTop , elements , get , getKeysAsList , keys , moveAbove , moveBeneath , moveDown , moveToBottom , moveToTop , moveUp , remove , size
LayoutManager
public LayoutManager ()
setMarkupEnabled
public void setMarkupEnabled (boolean enabled)
getElementAnchor
public AnchorPosition getElementAnchor (Widget element)
setElementAnchor
public boolean setElementAnchor (Widget element,
AnchorPosition anchor)
getAnchorCoordinates
public static android.graphics.PointF getAnchorCoordinates (android.graphics.RectF widgetRect,
AnchorPosition anchorPosition)
getAnchorCoordinates
public static android.graphics.PointF getAnchorCoordinates (float x,
float y,
float width,
float height,
AnchorPosition anchorPosition)
getAnchorOffset
public static android.graphics.PointF getAnchorOffset (float width,
float height,
AnchorPosition anchorPosition)
getElementCoordinates
public android.graphics.PointF getElementCoordinates (float height,
float width,
android.graphics.RectF viewRect,
PositionMetrics metrics)
draw
public void draw (android.graphics.Canvas canvas)
throws PlotRenderException
Throws:
PlotRenderException
position
public void position (Widget element,
float x,
XLayoutStyle xLayoutStyle,
float y,
YLayoutStyle yLayoutStyle)
Parameters: element - The Widget to position. Used for positioning both new and existing widgets.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.
position
public void position (Widget element,
float x,
XLayoutStyle xLayoutStyle,
float y,
YLayoutStyle yLayoutStyle,
AnchorPosition anchor)
isDrawOutlinesEnabled
public boolean isDrawOutlinesEnabled ()
setDrawOutlinesEnabled
public void setDrawOutlinesEnabled (boolean drawOutlinesEnabled)
getOutlinePaint
public android.graphics.Paint getOutlinePaint ()
setOutlinePaint
public void setOutlinePaint (android.graphics.Paint outlinePaint)
isDrawAnchorsEnabled
public boolean isDrawAnchorsEnabled ()
setDrawAnchorsEnabled
public void setDrawAnchorsEnabled (boolean drawAnchorsEnabled)
isDrawMarginsEnabled
public boolean isDrawMarginsEnabled ()
setDrawMarginsEnabled
public void setDrawMarginsEnabled (boolean drawMarginsEnabled)
getMarginPaint
public android.graphics.Paint getMarginPaint ()
setMarginPaint
public void setMarginPaint (android.graphics.Paint marginPaint)
isDrawPaddingEnabled
public boolean isDrawPaddingEnabled ()
setDrawPaddingEnabled
public void setDrawPaddingEnabled (boolean drawPaddingEnabled)
getPaddingPaint
public android.graphics.Paint getPaddingPaint ()
setPaddingPaint
public void setPaddingPaint (android.graphics.Paint paddingPaint)
isDrawOutlineShadowsEnabled
public boolean isDrawOutlineShadowsEnabled ()
setDrawOutlineShadowsEnabled
public void setDrawOutlineShadowsEnabled (boolean drawOutlineShadowsEnabled)
getOutlineShadowPaint
public android.graphics.Paint getOutlineShadowPaint ()
setOutlineShadowPaint
public void setOutlineShadowPaint (android.graphics.Paint outlineShadowPaint)
onTouch
public boolean onTouch (android.view.View v,
android.view.MotionEvent event)
Specified by: onTouch in interface android.view.View.OnTouchListener
layout
public void layout (DisplayDimensions dims)
Description copied from interface: Resizable
Called when a change to the class' dimensions is made. This method is responsible
for cascading calls to update for any logical children of this class, for example
the Plot class is responsible for updating the LayoutManager. Note that while dims
is marked final in this interface, the compiler will not enforce it. Implementors of
this method should take care not to make changes to dims as this will affect parent
Resizables in likely undesired ways.
Specified by: layout in interface Resizable
Copyright © 2010-2013 androidplot.com . All Rights Reserved.