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

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, Resizable
Direct Known Subclasses:
PieChart, XYPlot

public abstract class Plot<SeriesType extends Series,FormatterType extends Formatter,RendererType extends SeriesRenderer>
extends android.view.View
implements Resizable

Base class for all other Plot implementations..


Nested Class Summary
static class Plot.BorderStyle
           
static class Plot.RenderMode
          The RenderMode used by a Plot to draw it's self onto the screen.
 
Nested classes/interfaces inherited from class android.view.View
android.view.View.AccessibilityDelegate, android.view.View.BaseSavedState, android.view.View.DragShadowBuilder, android.view.View.MeasureSpec, android.view.View.OnAttachStateChangeListener, android.view.View.OnClickListener, android.view.View.OnCreateContextMenuListener, android.view.View.OnDragListener, android.view.View.OnFocusChangeListener, android.view.View.OnGenericMotionListener, android.view.View.OnHoverListener, android.view.View.OnKeyListener, android.view.View.OnLayoutChangeListener, android.view.View.OnLongClickListener, android.view.View.OnSystemUiVisibilityChangeListener, android.view.View.OnTouchListener
 
Field Summary
 
Fields inherited from class android.view.View
ALPHA, DRAWING_CACHE_QUALITY_AUTO, DRAWING_CACHE_QUALITY_HIGH, DRAWING_CACHE_QUALITY_LOW, FIND_VIEWS_WITH_CONTENT_DESCRIPTION, FIND_VIEWS_WITH_TEXT, FOCUS_BACKWARD, FOCUS_DOWN, FOCUS_FORWARD, FOCUS_LEFT, FOCUS_RIGHT, FOCUS_UP, FOCUSABLES_ALL, FOCUSABLES_TOUCH_MODE, GONE, HAPTIC_FEEDBACK_ENABLED, IMPORTANT_FOR_ACCESSIBILITY_AUTO, IMPORTANT_FOR_ACCESSIBILITY_NO, IMPORTANT_FOR_ACCESSIBILITY_YES, INVISIBLE, KEEP_SCREEN_ON, LAYER_TYPE_HARDWARE, LAYER_TYPE_NONE, LAYER_TYPE_SOFTWARE, MEASURED_HEIGHT_STATE_SHIFT, MEASURED_SIZE_MASK, MEASURED_STATE_MASK, MEASURED_STATE_TOO_SMALL, NO_ID, OVER_SCROLL_ALWAYS, OVER_SCROLL_IF_CONTENT_SCROLLS, OVER_SCROLL_NEVER, ROTATION, ROTATION_X, ROTATION_Y, SCALE_X, SCALE_Y, SCREEN_STATE_OFF, SCREEN_STATE_ON, SCROLLBAR_POSITION_DEFAULT, SCROLLBAR_POSITION_LEFT, SCROLLBAR_POSITION_RIGHT, SCROLLBARS_INSIDE_INSET, SCROLLBARS_INSIDE_OVERLAY, SCROLLBARS_OUTSIDE_INSET, SCROLLBARS_OUTSIDE_OVERLAY, SOUND_EFFECTS_ENABLED, STATUS_BAR_HIDDEN, STATUS_BAR_VISIBLE, SYSTEM_UI_FLAG_FULLSCREEN, SYSTEM_UI_FLAG_HIDE_NAVIGATION, SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN, SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION, SYSTEM_UI_FLAG_LAYOUT_STABLE, SYSTEM_UI_FLAG_LOW_PROFILE, SYSTEM_UI_FLAG_VISIBLE, SYSTEM_UI_LAYOUT_FLAGS, TEXT_ALIGNMENT_INHERIT, TEXT_ALIGNMENT_RESOLVED_DEFAULT, TRANSLATION_X, TRANSLATION_Y, VISIBLE, X, Y
 
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, String title)
          Convenience constructor - wraps Plot(android.content.Context, String, com.androidplot.Plot.RenderMode).
Plot(android.content.Context context, String title, Plot.RenderMode mode)
          Used for programmatic instantiation.
 
Method Summary
 boolean addListener(PlotListener listener)
           
 boolean addSeries(SeriesType series, FormatterType formatter)
           
 void clear()
          Remove all series from all renderers
 android.graphics.Paint getBackgroundPaint()
           
 android.graphics.Paint getBorderPaint()
           
 DisplayDimensions getDisplayDimensions()
           
 FormatterType getFormatter(SeriesType series, Class rendererClass)
           
 LayoutManager getLayoutManager()
           
 float getPlotMarginBottom()
           
 float getPlotMarginLeft()
           
 float getPlotMarginRight()
           
 float getPlotMarginTop()
           
 float getPlotPaddingBottom()
           
 float getPlotPaddingLeft()
           
 float getPlotPaddingRight()
           
 float getPlotPaddingTop()
           
 RendererType getRenderer(Class rendererClass)
           
 List<RendererType> getRendererList()
           
 Plot.RenderMode getRenderMode()
           
 SeriesAndFormatterList<SeriesType,FormatterType> getSeriesAndFormatterListForRenderer(Class rendererClass)
           
 List<SeriesType> getSeriesListForRenderer(Class rendererClass)
           
 Set<SeriesType> getSeriesSet()
          Returns a list of all series assigned to the various renderers within the Plot.
 String getTitle()
           
 TextLabelWidget getTitleWidget()
           
 boolean isEmpty()
           
 void layout(DisplayDimensions dims)
          Called when a change to the class' dimensions is made.
 void redraw()
          Causes the plot to be redrawn.
 boolean removeListener(PlotListener listener)
           
 void removeSeries(SeriesType series)
          Remove all occorrences of series from all renderers
 boolean removeSeries(SeriesType series, 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, Float radiusX, Float radiusY)
          Sets the visual style of the plot's border.
 void setLayoutManager(LayoutManager layoutManager)
           
 void setMarkupEnabled(boolean enabled)
           
 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 setRenderMode(Plot.RenderMode mode)
          Sets the render mode used by the Plot.
 void setTitle(String title)
           
 void setTitleWidget(TextLabelWidget titleWidget)
           
 
Methods inherited from class android.view.View
addChildrenForAccessibility, addFocusables, addFocusables, addOnAttachStateChangeListener, addOnLayoutChangeListener, addTouchables, animate, announceForAccessibility, bringToFront, buildDrawingCache, buildDrawingCache, buildLayer, callOnClick, cancelLongPress, canScrollHorizontally, canScrollVertically, checkInputConnectionProxy, clearAnimation, clearFocus, combineMeasuredStates, computeScroll, createAccessibilityNodeInfo, createContextMenu, destroyDrawingCache, dispatchConfigurationChanged, dispatchDisplayHint, dispatchDragEvent, dispatchGenericMotionEvent, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchPopulateAccessibilityEvent, dispatchSystemUiVisibilityChanged, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchWindowFocusChanged, dispatchWindowSystemUiVisiblityChanged, dispatchWindowVisibilityChanged, draw, findFocus, findViewById, findViewsWithText, findViewWithTag, focusSearch, forceLayout, getAccessibilityNodeProvider, getAlpha, getAnimation, getApplicationWindowToken, getBackground, getBaseline, getBottom, getCameraDistance, getContentDescription, getContext, getDefaultSize, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getFilterTouchesWhenObscured, getFitsSystemWindows, getFocusables, getFocusedRect, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHeight, getHitRect, getHorizontalFadingEdgeLength, getId, getImportantForAccessibility, getKeepScreenOn, getKeyDispatcherState, getLayerType, getLayoutParams, getLeft, getLocalVisibleRect, getLocationInWindow, getLocationOnScreen, getMatrix, getMeasuredHeight, getMeasuredHeightAndState, getMeasuredState, getMeasuredWidth, getMeasuredWidthAndState, getMinimumHeight, getMinimumWidth, getNextFocusDownId, getNextFocusForwardId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getOverScrollMode, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getParent, getParentForAccessibility, getPivotX, getPivotY, getResources, getRight, getRootView, getRotation, getRotationX, getRotationY, getScaleX, getScaleY, getScrollBarDefaultDelayBeforeFade, getScrollBarFadeDuration, getScrollBarSize, getScrollBarStyle, getScrollX, getScrollY, getSolidColor, getSystemUiVisibility, getTag, getTag, getTop, getTouchables, getTouchDelegate, getTranslationX, getTranslationY, getVerticalFadingEdgeLength, getVerticalScrollbarPosition, getVerticalScrollbarWidth, getViewTreeObserver, getVisibility, getWidth, getWindowSystemUiVisibility, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, getX, getY, hasFocus, hasFocusable, hasOnClickListeners, hasOverlappingRendering, hasTransientState, hasWindowFocus, inflate, invalidate, invalidate, invalidate, invalidateDrawable, isActivated, isClickable, isDirty, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isHapticFeedbackEnabled, isHardwareAccelerated, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isHovered, isInEditMode, isInTouchMode, isLayoutRequested, isLongClickable, isOpaque, isPressed, isSaveEnabled, isSaveFromParentEnabled, isScrollbarFadingEnabled, isScrollContainer, isSelected, isShown, isSoundEffectsEnabled, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, jumpDrawablesToCurrentState, layout, measure, offsetLeftAndRight, offsetTopAndBottom, onCheckIsTextEditor, onCreateInputConnection, onDragEvent, onFilterTouchEventForSecurity, onFinishTemporaryDetach, onGenericMotionEvent, onHoverChanged, onHoverEvent, onInitializeAccessibilityEvent, onInitializeAccessibilityNodeInfo, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onPopulateAccessibilityEvent, onScreenStateChanged, onStartTemporaryDetach, onTouchEvent, onTrackballEvent, onWindowFocusChanged, onWindowSystemUiVisibilityChanged, performAccessibilityAction, performClick, performHapticFeedback, performHapticFeedback, performLongClick, playSoundEffect, post, postDelayed, postInvalidate, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, postInvalidateOnAnimation, postInvalidateOnAnimation, postOnAnimation, postOnAnimationDelayed, refreshDrawableState, removeCallbacks, removeOnAttachStateChangeListener, removeOnLayoutChangeListener, requestFitSystemWindows, requestFocus, requestFocus, requestFocus, requestFocusFromTouch, requestLayout, requestRectangleOnScreen, requestRectangleOnScreen, resolveSize, resolveSizeAndState, restoreHierarchyState, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, sendAccessibilityEvent, sendAccessibilityEventUnchecked, setAccessibilityDelegate, setActivated, setAlpha, setAnimation, setBackground, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setBottom, setCameraDistance, setClickable, setContentDescription, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setEnabled, setFadingEdgeLength, setFilterTouchesWhenObscured, setFitsSystemWindows, setFocusable, setFocusableInTouchMode, setHapticFeedbackEnabled, setHasTransientState, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setHovered, setId, setImportantForAccessibility, setKeepScreenOn, setLayerType, setLayoutParams, setLeft, setLongClickable, setMinimumHeight, setMinimumWidth, setNextFocusDownId, setNextFocusForwardId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnClickListener, setOnCreateContextMenuListener, setOnDragListener, setOnFocusChangeListener, setOnGenericMotionListener, setOnHoverListener, setOnKeyListener, setOnLongClickListener, setOnSystemUiVisibilityChangeListener, setOnTouchListener, setOverScrollMode, setPadding, setPivotX, setPivotY, setPressed, setRight, setRotation, setRotationX, setRotationY, setSaveEnabled, setSaveFromParentEnabled, setScaleX, setScaleY, setScrollBarDefaultDelayBeforeFade, setScrollBarFadeDuration, setScrollbarFadingEnabled, setScrollBarSize, setScrollBarStyle, setScrollContainer, setScrollX, setScrollY, setSelected, setSoundEffectsEnabled, setSystemUiVisibility, setTag, setTag, setTop, setTouchDelegate, setTranslationX, setTranslationY, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVerticalScrollbarPosition, setVisibility, setWillNotCacheDrawing, setWillNotDraw, setX, setY, showContextMenu, startActionMode, startAnimation, startDrag, 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,
            String title)
Convenience constructor - wraps Plot(android.content.Context, String, com.androidplot.Plot.RenderMode). RenderMode is set to Plot.RenderMode.USE_BACKGROUND_THREAD.

Parameters:
context -
title - The display title of this Plot.

Plot

public Plot(android.content.Context context,
            String title,
            Plot.RenderMode mode)
Used for programmatic instantiation.

Parameters:
context -
title - The display title of this Plot.

Plot

public Plot(android.content.Context context,
            android.util.AttributeSet attrs)
Required by super-class. Extending class' implementations should add the following code immediately before exiting to ensure that loadAttrs is called only once by the derived class: if(getClass().equals(DerivedPlot.class) { loadAttrs(context, attrs); } See XYPlot.XYPlot(android.content.Context, android.util.AttributeSet) for an example.

Parameters:
context -
attrs -

Plot

public Plot(android.content.Context context,
            android.util.AttributeSet attrs,
            int defStyle)
Required by super-class. Extending class' implementations should add the following code immediately before exiting to ensure that loadAttrs is called only once by the derived class: if(getClass().equals(DerivedPlot.class) { loadAttrs(context, attrs); } See XYPlot.XYPlot(android.content.Context, android.util.AttributeSet, int) for an example.

Parameters:
context -
attrs -
defStyle -
Method Detail

getDisplayDimensions

public DisplayDimensions getDisplayDimensions()

setRenderMode

public void setRenderMode(Plot.RenderMode mode)
Sets the render mode used by the Plot. WARNING: This method is not currently designed for general use outside of Configurator. Attempting to reassign the render mode at runtime will result in unexpected behavior.

Parameters:
mode -

getRenderMode

public Plot.RenderMode getRenderMode()

addListener

public boolean addListener(PlotListener listener)

removeListener

public boolean removeListener(PlotListener listener)

addSeries

public boolean addSeries(SeriesType series,
                         FormatterType formatter)
Parameters:
series -

removeSeries

public boolean removeSeries(SeriesType series,
                            Class rendererClass)

removeSeries

public void removeSeries(SeriesType series)
Remove all occorrences of series from all renderers

Parameters:
series -

clear

public void clear()
Remove all series from all renderers


isEmpty

public boolean isEmpty()

getFormatter

public FormatterType getFormatter(SeriesType series,
                                  Class rendererClass)

getSeriesAndFormatterListForRenderer

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

getSeriesSet

public 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 List<SeriesType> getSeriesListForRenderer(Class rendererClass)

getRenderer

public RendererType getRenderer(Class rendererClass)

getRendererList

public List<RendererType> getRendererList()

setMarkupEnabled

public void setMarkupEnabled(boolean enabled)

redraw

public void redraw()
Causes the plot to be redrawn.

Since:
0.5.1

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

setBorderStyle

public void setBorderStyle(Plot.BorderStyle style,
                           Float radiusX,
                           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 String getTitle()
Returns:
The displayed title of this Plot.

setTitle

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

getLayoutManager

public LayoutManager getLayoutManager()

setLayoutManager

public void setLayoutManager(LayoutManager layoutManager)

getTitleWidget

public TextLabelWidget getTitleWidget()

setTitleWidget

public void setTitleWidget(TextLabelWidget 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 © 2010-2013 androidplot.com. All Rights Reserved.