20 import java.util.Queue;
22 import java.awt.FlowLayout;
23 import javax.swing.ImageIcon;
24 import javax.swing.JFrame;
25 import javax.swing.JLabel;
26 import javax.swing.JPanel;
28 import ca.uqac.lif.cep.Processor;
29 import ca.uqac.lif.cep.ProcessorException;
30 import ca.uqac.lif.cep.tmf.Sink;
44 protected transient JFrame m_frame;
46 protected transient JLabel m_label;
51 m_frame =
new JFrame(
"My plot");
52 JPanel panel =
new JPanel(
new FlowLayout(FlowLayout.CENTER));
54 m_frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
55 m_label =
new JLabel();
62 m_frame.setSize(800, 600);
63 m_frame.setVisible(
true);
67 protected boolean compute(Object[] inputs, Queue<Object[]> outputs)
throws ProcessorException
69 byte[] bytes = (byte[]) inputs[0];
70 m_label.setIcon(
new ImageIcon(bytes));
84 public Processor duplicate(
boolean with_state)
JFrame getFrame()
Gets the frame associated to the object.
Receives a byte array as an input, and shows it in a Swing window as a picture.