Package uk.ac.starlink.ttools.example
Class ApiPlanePlotter
- java.lang.Object
-
- uk.ac.starlink.ttools.example.ApiPlanePlotter
-
- All Implemented Interfaces:
SinePlot.PlanePlotter
public class ApiPlanePlotter extends java.lang.Object implements SinePlot.PlanePlotter
PlanePlotter implementation that sets up a plot explicitly. There's a lot to do, it's quite complicated, even for a simple plot. If you don't like this approach, see the much more straightforwardEnvPlanePlotter
implementation instead. This approach however gives compile-time type-checking of the plot parameters.- Since:
- 12 Jun 2014
- Author:
- Mark Taylor
-
-
Constructor Summary
Constructors Constructor Description ApiPlanePlotter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PlotDisplay<?,?>
createPlotComponent(uk.ac.starlink.table.StarTable table, boolean dataMayChange)
Creates a JComponent holding a plot of the data in the first two columns of the supplied table.
-
-
-
Method Detail
-
createPlotComponent
public PlotDisplay<?,?> createPlotComponent(uk.ac.starlink.table.StarTable table, boolean dataMayChange) throws java.lang.InterruptedException, java.io.IOException
Description copied from interface:SinePlot.PlanePlotter
Creates a JComponent holding a plot of the data in the first two columns of the supplied table. This plot is live, and can be resized (as required by Swing) and panned and zoomed (by various mouse drag and wheel gestures).The
dataMayChange
parameter is used to determine whether the plot positions should be cached or not for repaints, either as required by Swing move/resize actions or as the result of the user navigating around the plot. It's always safe to set it true, but if the data is static, setting it false will give better performance.- Specified by:
createPlotComponent
in interfaceSinePlot.PlanePlotter
- Parameters:
table
- table to plotdataMayChange
- true if the table data may change during the lifetime of the plot- Throws:
java.lang.InterruptedException
java.io.IOException
-
-