com.androidplot
Class Plot<SeriesType extends Series,FormatterType,RendererType extends DataRenderer>

java.lang.Object
  extended by android.view.View
      extended by com.androidplot.Plot<SeriesType,FormatterType,RendererType>
All Implemented Interfaces:
android.graphics.drawable.Drawable.Callback, android.view.accessibility.AccessibilityEventSource, android.view.KeyEvent.Callback
Direct Known Subclasses:
XYPlot

public abstract class Plot<SeriesType extends Series,FormatterType,RendererType extends DataRenderer>
extends android.view.View

Base class for all other Plot implementations..


Nested Class Summary
static class Plot.BorderStyle
           
 
Nested classes/interfaces inherited from class android.view.View
android.view.View.BaseSavedState, android.view.View.MeasureSpec, android.view.View.OnClickListener, android.view.View.OnCreateContextMenuListener, android.view.View.OnFocusChangeListener, android.view.View.OnKeyListener, android.view.View.OnLongClickListener, android.view.View.OnTouchListener
 
Field Summary
 
Fields inherited from class android.view.View
DRAWING_CACHE_QUALITY_AUTO, DRAWING_CACHE_QUALITY_HIGH, DRAWING_CACHE_QUALITY_LOW, FOCUS_BACKWARD, FOCUS_DOWN, FOCUS_FORWARD, FOCUS_LEFT, FOCUS_RIGHT, FOCUS_UP, FOCUSABLES_ALL, FOCUSABLES_TOUCH_MODE, GONE, HAPTIC_FEEDBACK_ENABLED, INVISIBLE, KEEP_SCREEN_ON, NO_ID, SCROLLBARS_INSIDE_INSET, SCROLLBARS_INSIDE_OVERLAY, SCROLLBARS_OUTSIDE_INSET, SCROLLBARS_OUTSIDE_OVERLAY, SOUND_EFFECTS_ENABLED, VISIBLE
 
Constructor Summary
Plot(android.content.Context context, android.util.AttributeSet attrs)
          Required by super-class.
Plot(android.content.Context context, android.util.AttributeSet attrs, int defStyle)
          Required by super-class.
Plot(android.content.Context context, java.lang.String title)
          Required by super-class.
 
Method Summary
 boolean addListener(PlotListener listener)
           
 boolean addSeries(SeriesType series, java.lang.Class rendererClass, FormatterType formatter)
          Will *immediately* throw ClassCastException if rendererClass is not an instance of RendererType.
 void disableAllMarkup()
           
 android.graphics.Paint getBackgroundPaint()
           
 android.graphics.Paint getBorderPaint()
           
 FormatterType getFormatter(SeriesType series, java.lang.Class rendererClass)
           
 LayoutManager getLayoutManager()
           
 float getPlotMarginBottom()
           
 float getPlotMarginLeft()
           
 float getPlotMarginRight()
           
 float getPlotMarginTop()
           
 float getPlotPaddingBottom()
           
 float getPlotPaddingLeft()
           
 float getPlotPaddingRight()
           
 float getPlotPaddingTop()
           
 RendererType getRenderer(java.lang.Class rendererClass)
           
 java.util.List<RendererType> getRendererList()
           
 SeriesAndFormatterList<SeriesType,FormatterType> getSeriesAndFormatterListForRenderer(java.lang.Class rendererClass)
           
 java.util.List<SeriesType> getSeriesListForRenderer(java.lang.Class rendererClass)
           
 java.util.Set<SeriesType> getSeriesSet()
          Returns a list of all series assigned to the various renderers within the Plot.
 java.lang.String getTitle()
           
 TitleWidget getTitleWidget()
           
 boolean isDrawBorderEnabled()
          Deprecated.
 boolean isEmpty()
           
 void position(Widget element, float x, XLayoutStyle xLayoutStyle, float y, YLayoutStyle yLayoutStyle)
          Convenience method - wraps LayoutManager.position().
 void position(Widget element, float x, XLayoutStyle xLayoutStyle, float y, YLayoutStyle yLayoutStyle, AnchorPosition anchor)
          Convenience method - wraps LayoutManager.positon().
 void postRedraw()
          Invalidates the Plot's underlying View and blocks until it is redrawn.
 void postRedraw(boolean isBlocking)
           
 void redraw()
          Causes the plot to be redrawn.
 boolean removeListener(PlotListener listener)
           
 void removeSeries(SeriesType series)
           
 boolean removeSeries(SeriesType series, java.lang.Class rendererClass)
           
 void setBackgroundPaint(android.graphics.Paint backgroundPaint)
           
 void setBorderPaint(android.graphics.Paint borderPaint)
          Set's the paint used to draw the border.
 void setBorderStyle(Plot.BorderStyle style, java.lang.Float radiusX, java.lang.Float radiusY)
          Sets the visual style of the plot's border.
 void setDrawBorderEnabled(boolean drawBorderEnabled)
          Deprecated - Use setBorderPaint(null) instead.
 boolean setFormatter(SeriesType series, java.lang.Class rendererClass, FormatterType formatter)
           
 void setLayoutManager(LayoutManager layoutManager)
           
 void setPlotMarginBottom(float plotMarginBottom)
           
 void setPlotMarginLeft(float plotMarginLeft)
           
 void setPlotMarginRight(float plotMarginRight)
           
 void setPlotMargins(float left, float top, float right, float bottom)
          Convenience method - wraps the individual setMarginXXX methods into a single method.
 void setPlotMarginTop(float plotMarginTop)
           
 void setPlotPadding(float left, float top, float right, float bottom)
          Convenience method - wraps the individual setPaddingXXX methods into a single method.
 void setPlotPaddingBottom(float plotPaddingBottom)
           
 void setPlotPaddingLeft(float plotPaddingLeft)
           
 void setPlotPaddingRight(float plotPaddingRight)
           
 void setPlotPaddingTop(float plotPaddingTop)
           
 void setTitle(java.lang.String title)
           
 void setTitleWidget(TitleWidget titleWidget)
           
 
Methods inherited from class android.view.View
addFocusables, addFocusables, addTouchables, bringToFront, buildDrawingCache, buildDrawingCache, cancelLongPress, checkInputConnectionProxy, clearAnimation, clearFocus, computeScroll, createContextMenu, destroyDrawingCache, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchPopulateAccessibilityEvent, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchWindowFocusChanged, dispatchWindowVisibilityChanged, draw, findFocus, findViewById, findViewWithTag, focusSearch, forceLayout, getAnimation, getApplicationWindowToken, getBackground, getBaseline, getBottom, getContentDescription, getContext, getDefaultSize, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getFocusables, getFocusedRect, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHeight, getHitRect, getHorizontalFadingEdgeLength, getId, getKeepScreenOn, getKeyDispatcherState, getLayoutParams, getLeft, getLocalVisibleRect, getLocationInWindow, getLocationOnScreen, getMeasuredHeight, getMeasuredWidth, getNextFocusDownId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getParent, getResources, getRight, getRootView, getScrollBarStyle, getScrollX, getScrollY, getSolidColor, getTag, getTag, getTop, getTouchables, getTouchDelegate, getVerticalFadingEdgeLength, getVerticalScrollbarWidth, getViewTreeObserver, getVisibility, getWidth, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, hasFocus, hasFocusable, hasWindowFocus, inflate, invalidate, invalidate, invalidate, invalidateDrawable, isClickable, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isHapticFeedbackEnabled, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isInEditMode, isInTouchMode, isLayoutRequested, isLongClickable, isOpaque, isPressed, isSaveEnabled, isScrollbarFadingEnabled, isSelected, isShown, isSoundEffectsEnabled, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, layout, measure, offsetLeftAndRight, offsetTopAndBottom, onCheckIsTextEditor, onCreateInputConnection, onFinishTemporaryDetach, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onStartTemporaryDetach, onTouchEvent, onTrackballEvent, onWindowFocusChanged, performClick, performHapticFeedback, performHapticFeedback, performLongClick, playSoundEffect, post, postDelayed, postInvalidate, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, refreshDrawableState, removeCallbacks, requestFocus, requestFocus, requestFocus, requestFocusFromTouch, requestLayout, requestRectangleOnScreen, requestRectangleOnScreen, resolveSize, restoreHierarchyState, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, sendAccessibilityEvent, sendAccessibilityEventUnchecked, setAnimation, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setClickable, setContentDescription, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setEnabled, setFadingEdgeLength, setFocusable, setFocusableInTouchMode, setHapticFeedbackEnabled, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setId, setKeepScreenOn, setLayoutParams, setLongClickable, setMinimumHeight, setMinimumWidth, setNextFocusDownId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnClickListener, setOnCreateContextMenuListener, setOnFocusChangeListener, setOnKeyListener, setOnLongClickListener, setOnTouchListener, setPadding, setPressed, setSaveEnabled, setScrollbarFadingEnabled, setScrollBarStyle, setScrollContainer, setSelected, setSoundEffectsEnabled, setTag, setTag, setTouchDelegate, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVisibility, setWillNotCacheDrawing, setWillNotDraw, showContextMenu, startAnimation, unscheduleDrawable, unscheduleDrawable, willNotCacheDrawing, willNotDraw
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Plot

public Plot(android.content.Context context,
            java.lang.String title)
Required by super-class. See android.view.View.

Parameters:
context - Android Context used to doBeforeDraw this Plot.

Plot

public Plot(android.content.Context context,
            android.util.AttributeSet attrs)
Required by super-class. See android.view.View.

Parameters:
context -
attrs -

Plot

public Plot(android.content.Context context,
            android.util.AttributeSet attrs,
            int defStyle)
Required by super-class. See android.view.View.

Parameters:
context -
attrs -
defStyle -
Method Detail

addListener

public boolean addListener(PlotListener listener)

removeListener

public boolean removeListener(PlotListener listener)

position

public void position(Widget element,
                     float x,
                     XLayoutStyle xLayoutStyle,
                     float y,
                     YLayoutStyle yLayoutStyle)
Convenience method - wraps LayoutManager.position().

Parameters:
element -
x -
xLayoutStyle -
y -
yLayoutStyle -

position

public void position(Widget element,
                     float x,
                     XLayoutStyle xLayoutStyle,
                     float y,
                     YLayoutStyle yLayoutStyle,
                     AnchorPosition anchor)
Convenience method - wraps LayoutManager.positon().

Parameters:
element -
x -
xLayoutStyle -
y -
yLayoutStyle -
anchor -

addSeries

public boolean addSeries(SeriesType series,
                         java.lang.Class rendererClass,
                         FormatterType formatter)
Will *immediately* throw ClassCastException if rendererClass is not an instance of RendererType.

Parameters:
series -
rendererClass -

removeSeries

public boolean removeSeries(SeriesType series,
                            java.lang.Class rendererClass)

removeSeries

public void removeSeries(SeriesType series)

isEmpty

public boolean isEmpty()

getFormatter

public FormatterType getFormatter(SeriesType series,
                                  java.lang.Class rendererClass)

setFormatter

public boolean setFormatter(SeriesType series,
                            java.lang.Class rendererClass,
                            FormatterType formatter)

getSeriesAndFormatterListForRenderer

public SeriesAndFormatterList<SeriesType,FormatterType> getSeriesAndFormatterListForRenderer(java.lang.Class rendererClass)

getSeriesSet

public java.util.Set<SeriesType> getSeriesSet()
Returns a list of all series assigned to the various renderers within the Plot. The returned List will contain no duplicates.

Returns:

getSeriesListForRenderer

public java.util.List<SeriesType> getSeriesListForRenderer(java.lang.Class rendererClass)

getRenderer

public RendererType getRenderer(java.lang.Class rendererClass)

getRendererList

public java.util.List<RendererType> getRendererList()

disableAllMarkup

public void disableAllMarkup()

redraw

public void redraw()
Causes the plot to be redrawn. Should only be called by the main (UI) thead. Non-UI threads should call postRedraw().

Throws:
java.lang.InterruptedException

postRedraw

public void postRedraw()
                throws java.lang.InterruptedException
Invalidates the Plot's underlying View and blocks until it is redrawn. For a non-blocking version of this method use postRedraw(false). This method should only be called from threads that are not the primary (UI) thread. Use redraw() instead for calls made from the primary thread.

Throws:
java.lang.InterruptedException

postRedraw

public void postRedraw(boolean isBlocking)
                throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException

setBorderStyle

public void setBorderStyle(Plot.BorderStyle style,
                           java.lang.Float radiusX,
                           java.lang.Float radiusY)
Sets the visual style of the plot's border.

Parameters:
style -
radiusX - Sets the X radius for BorderStyle.ROUNDED. Use null for all other styles.
radiusY - Sets the Y radius for BorderStyle.ROUNDED. Use null for all other styles.

getTitle

public java.lang.String getTitle()
Returns:
The displayed title of this Plot.

setTitle

public void setTitle(java.lang.String title)
Parameters:
title - The title to display on this Plot.

getLayoutManager

public LayoutManager getLayoutManager()

setLayoutManager

public void setLayoutManager(LayoutManager layoutManager)

isDrawBorderEnabled

public boolean isDrawBorderEnabled()
Deprecated. Use getBorderPaint instead. If return is null then borders are disabled.

Returns:

setDrawBorderEnabled

public void setDrawBorderEnabled(boolean drawBorderEnabled)
Deprecated - Use setBorderPaint(null) instead.

Parameters:
drawBorderEnabled -

getTitleWidget

public TitleWidget getTitleWidget()

setTitleWidget

public void setTitleWidget(TitleWidget titleWidget)

getBackgroundPaint

public android.graphics.Paint getBackgroundPaint()

setBackgroundPaint

public void setBackgroundPaint(android.graphics.Paint backgroundPaint)

setPlotMargins

public void setPlotMargins(float left,
                           float top,
                           float right,
                           float bottom)
Convenience method - wraps the individual setMarginXXX methods into a single method.

Parameters:
left -
top -
right -
bottom -

setPlotPadding

public void setPlotPadding(float left,
                           float top,
                           float right,
                           float bottom)
Convenience method - wraps the individual setPaddingXXX methods into a single method.

Parameters:
left -
top -
right -
bottom -

getPlotMarginTop

public float getPlotMarginTop()

setPlotMarginTop

public void setPlotMarginTop(float plotMarginTop)

getPlotMarginBottom

public float getPlotMarginBottom()

setPlotMarginBottom

public void setPlotMarginBottom(float plotMarginBottom)

getPlotMarginLeft

public float getPlotMarginLeft()

setPlotMarginLeft

public void setPlotMarginLeft(float plotMarginLeft)

getPlotMarginRight

public float getPlotMarginRight()

setPlotMarginRight

public void setPlotMarginRight(float plotMarginRight)

getPlotPaddingTop

public float getPlotPaddingTop()

setPlotPaddingTop

public void setPlotPaddingTop(float plotPaddingTop)

getPlotPaddingBottom

public float getPlotPaddingBottom()

setPlotPaddingBottom

public void setPlotPaddingBottom(float plotPaddingBottom)

getPlotPaddingLeft

public float getPlotPaddingLeft()

setPlotPaddingLeft

public void setPlotPaddingLeft(float plotPaddingLeft)

getPlotPaddingRight

public float getPlotPaddingRight()

setPlotPaddingRight

public void setPlotPaddingRight(float plotPaddingRight)

getBorderPaint

public android.graphics.Paint getBorderPaint()

setBorderPaint

public void setBorderPaint(android.graphics.Paint borderPaint)
Set's the paint used to draw the border. Note that this method copies borderPaint and set's the copy's Paint.Style attribute to Paint.Style.STROKE.

Parameters:
borderPaint -


Copyright © 2011. All Rights Reserved.