20 import ca.uqac.lif.cep.Connector;
21 import ca.uqac.lif.cep.functions.ApplyFunction;
22 import ca.uqac.lif.cep.mtnp.DrawPlot;
23 import ca.uqac.lif.cep.mtnp.UpdateTableArray;
24 import ca.uqac.lif.cep.tmf.CountDecimate;
25 import ca.uqac.lif.cep.tmf.QueueSource;
26 import ca.uqac.lif.cep.tmf.Window;
27 import ca.uqac.lif.cep.util.Bags;
28 import ca.uqac.lif.mtnp.plot.gral.Scatterplot;
51 public static void main(String[] args)
throws InterruptedException
55 QueueSource one =
new QueueSource();
58 Connector.connect(one, random);
64 ApplyFunction array_convert =
new ApplyFunction(
new Bags.ToArray(Number.class, Number.class));
65 Connector.connect(random, array_convert);
69 UpdateTableArray update_table =
new UpdateTableArray(
"x",
"y");
72 Window window =
new Window(update_table, 100);
75 Connector.connect(array_convert, window);
80 CountDecimate decimate =
new CountDecimate(20);
81 Connector.connect(window, decimate);
85 Scatterplot plot =
new Scatterplot();
86 DrawPlot draw =
new DrawPlot(plot);
87 Connector.connect(decimate, draw);
89 Connector.connect(draw, frame);
91 System.out.println(
"Displaying plot. Press Ctrl+C or close the window to end.");
Update a windowed 2D scatterplot in realtime from two streams of numbers.
Generates a random stream of x-y pairs.
Receives a byte array as an input, and shows it in a Swing window as a picture.