Code Examples
A repository of 155 code examples for BeepBeep
widgets.AverageSlider Class Reference

Display a real-time plot of the values of a slider in a Swing frame. More...

Static Public Member Functions

static void main (String[] args) throws ProcessorException
 

Detailed Description

Display a real-time plot of the values of a slider in a Swing frame.

In this example, a JFrame containing a simple slider widget is polled for its value twice per second. This value is then processed to display a 2D scatterplot with two data series:

  • The value of the slider at each time point
  • The average value of the slider for the last 4 time points

Here is a screenshot of the two JFrames used in this example. At the left is the slider the user can move, and at the right, the generated plot that updates once per second. Notice how the use of an average (green line) smoothes the jittery motion of the raw values (blue line).

Graphically, the processor chain for this example can be represented as follows:

Processor graph

As one can see, this example is notable for its mix of various processors:

Author
Sylvain Hallé Medium

Definition at line 88 of file AverageSlider.java.


The documentation for this class was generated from the following file: