int y = Double.valueOf(point[1]).intValue();
actuatorsInput.setActuatorIndex(x, y);
Object source = event.getSource();
if (source != null && source instanceof ImageViewer
&& resultListener != null && resultListener.isSelectionActivated()) {
ImageViewer imageViewer = (ImageViewer) source;
if (startRoi == null) {
// Remove endRoi
endRoi = new CometeRoi("To", RoiShape.NONE, 0, 0, 0, 0, 0,
CometeColor.WHITE);
imageViewer.addRoi(endRoi);
startRoi = new CometeRoi("From", RoiShape.CROSS, 0, x, y, 2, 2,
CometeColor.CYAN);
imageViewer.addRoi(startRoi, true);
endRoi = null;
if (resultListener != null) {
resultListener.startPointSelectedChanged(x, y);
}
}
else if (endRoi == null && startRoi != null) {
endRoi = new CometeRoi("To", RoiShape.CROSS, 0, x, y, 2, 2,
CometeColor.GREEN);
imageViewer.addRoi(endRoi, true);
startRoi = null;
if (resultListener != null) {
resultListener.endPointSelectedChanged(x, y);
}
}