uk.ac.starlink.ttools.example
Class SinePlot

java.lang.Object
  extended by uk.ac.starlink.ttools.example.SinePlot

public class SinePlot
extends Object

Example programmatic use of stilts plot2 classes. This program plots a number of points near a sinusoidal curve. Optionally, the data can change and be replotted at time intervals. Either way, the plot is "live"; you can pan and zoom round it using the mouse.

Two alternative ways of setting up the plot are provided by way of example, but they have the same effect.

To use this class invoke the main() method from the command line. Use the -h flag for options.

Since:
12 Jun 2014
Author:
Mark Taylor

Nested Class Summary
static interface SinePlot.PlanePlotter
          Abstracts the way that the table is turned into a 2d plot component.
 
Constructor Summary
SinePlot(SinePlot.PlanePlotter planePlotter, int count)
          Constructor.
 
Method Summary
static void main(String[] args)
          Main method.
 void run(int updateMillis)
          Constructs a plot and posts it to the screen.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SinePlot

public SinePlot(SinePlot.PlanePlotter planePlotter,
                int count)
         throws Exception
Constructor.

Parameters:
planePlotter - object that does the plot
count - number of points to plot
Throws:
Exception
Method Detail

run

public void run(int updateMillis)
         throws Exception
Constructs a plot and posts it to the screen.

Parameters:
updateMillis - if positive, gives an interval in millisecnds at which the plot should be refreshed; if non-positive, the data is considered static
Throws:
Exception

main

public static void main(String[] args)
                 throws Exception
Main method. Use with -help.

Throws:
Exception


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.