/**
* Main class, so you can have an example. You can put your own attribute names in parameter
*/
public static void main(final String[] args) {
final IFrame frame = new 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/spjz_01.01";
tmpAttributeName = "double_image_ro";*/
tmpDeviceName = "test/gs/1";
tmpAttributeName = "int_image_rw";
//tmpDeviceName = "ica/salsa/scan.1";
// tmpDeviceName = "test/scanserver/titan";
//tmpAttributeName = "data_01";
}
final NumberImageViewerCometeV2 f = new NumberImageViewerCometeV2();
f.setDeviceName(tmpDeviceName);
f.setEntityName(tmpAttributeName);
f.setUserEnabled(false);
f.setShowRoiInformationTable(true);
String[] transfList = new String[3];
transfList[0] = Transformation.HORIZONTAL_SYMMETRY.toString();
transfList[1] = Transformation.POSITIVE_ROTATION.toString();
transfList[2] = Transformation.VERTICAL_SYMMETRY.toString();
f.setOrderedTransformation(transfList);
f.setShowImageTransformationActions(true);
f.initDAO();
f.clearDAO();
f.initDAO();
String[] trans = f.getOrderedTransformation();
// f.setRefreshingPeriod(500);
// f.setAxisRangeX(50, 200);
// f.setAxisRangeY(100, 200);
final ImageViewer viewer = ((RotaryImageViewer) f.widget).getImageViewer();
viewer.addViewerListener(new IIJViewerListener() {
int index = 1;
@Override
public void valueChanged(IJViewerEvent event) {
// nothing to do
}
@Override
public void pixelSizeChanged(IJViewerEvent event) {
// nothing to do
}
@Override
public void mouseClicked(IJViewerEvent event) {
if (viewer != null) {
Point2D.Double point = viewer.getAxisPosition();
IJCanvas canvas = viewer.getImageCanvas();
if ((point != null) && (canvas != null)) {
// XXX strange IJ hack that should be done in ImageViewer
int x = (canvas.screenXD(point.x));
int y = (canvas.screenYD(point.y));
f.addRoi("MyRoi" + ++index + ",point,1," + x + "," + y + "," + 5 + "," + 5 + ",GREEN");
}
}
}
@Override
public void mouseChanged(IJViewerEvent event) {
// TODO Auto-generated method stub
}
});
frame.setContentPane(f);
frame.setSize(640, 480);
frame.setTitle(f.getClass().getName());
frame.setDefaultCloseOperation(IFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
// new Thread() {
// @Override
// public void run() {
// try {