com.androidplot.util
Class Redrawer

java.lang.Object
  extended by com.androidplot.util.Redrawer
All Implemented Interfaces:
Runnable

public class Redrawer
extends Object
implements Runnable

Utility class for invoking Plot.redraw() on a backgorund thread at a set frequency.


Constructor Summary
Redrawer(List<Plot> plots, float maxRefreshRate, boolean startImmediately)
           
Redrawer(Plot plot, float maxRefreshRate, boolean startImmediately)
           
 
Method Summary
 void finish()
          Internally, this causes the refresh thread to exit.
 void pause()
          Temporarily stop redrawing the plot.
 void run()
           
 void setMaxRefreshRate(float refreshRate)
          Set the maximum refresh rate that Redrawer should use.
 void start()
          Start/resume redrawing the plot.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Redrawer

public Redrawer(List<Plot> plots,
                float maxRefreshRate,
                boolean startImmediately)
Parameters:
plots - List of Plot instances to be redrawn
maxRefreshRate - Desired frequency at which to redraw plots.
startImmediately - If true, invokes run() immediately after construction.

Redrawer

public Redrawer(Plot plot,
                float maxRefreshRate,
                boolean startImmediately)
Method Detail

pause

public void pause()
Temporarily stop redrawing the plot.


start

public void start()
Start/resume redrawing the plot.


finish

public void finish()
Internally, this causes the refresh thread to exit. Should always be called before exiting the application.


run

public void run()
Specified by:
run in interface Runnable

setMaxRefreshRate

public void setMaxRefreshRate(float refreshRate)
Set the maximum refresh rate that Redrawer should use. Actual refresh rate could be slower.

Parameters:
refreshRate - Refresh rate in Hz.


Copyright © 2010-2013 androidplot.com. All Rights Reserved.