/**
* Main class, so you can have an example. You can put your own attribute names in parameter
*/
public static void main(String[] args) {
IFrame frame = CometeWidgetFactory.createFrame();
String tmpDeviceName = null;
String tmpAttributeName = null;
if (args != null && args.length > 1) {
tmpDeviceName = args[0];
tmpAttributeName = args[1];
}
else {
tmpDeviceName = "tango/tangotest/titan";
tmpAttributeName = "double_image_ro";
}
NumberImageViewer f = new NumberImageViewer();
IImageViewerListener listener = new IImageViewerListener() {
@Override
public void selectedPointChanged(Point point) {
System.out.println("selectedPointChanged=" + point);
}
@Override
public void selectedValueChanged(Number y) {
System.out.println("selectedValueChanged=" + y);
}
@Override
public void selectedXChanged(Number x) {
System.out.println("selectedXChanged=" + x);
}
@Override
public void selectedYChanged(Number y) {
System.out.println("selectedYChanged=" + y);
}
@Override
public void valueChanged(NumberMatrix value) {
System.out.println("valueChanged=" + value);
}
};
f.addImageViewerListener(listener);
f.setDeviceName(tmpDeviceName);
f.setEntityName(tmpAttributeName);
f.initDAO();
f.addRoi(new CometeRoi("MyRoi1", IRoi.RECTANGLE, 10, 90, 90, 80, 50, CometeColor.BLUE));
f.addRoi(new CometeRoi("MyRoi2", IRoi.RECTANGLE, 10, 100, 100, 90, 60, CometeColor.GREEN));
f.setShowRoiInformationTable(true);
frame.setContentPane(f);
frame.setSize(640, 480);
frame.setTitle(f.getClass().getName());
frame.setDefaultCloseOperation(IFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}