Imaging ROI in scan roi selection panel.
This commit is contained in:
@@ -13,9 +13,11 @@ import ch.psi.utils.Serializer;
|
||||
import ch.psi.utils.State;
|
||||
import ch.psi.utils.Str;
|
||||
import ch.psi.utils.swing.SwingUtils;
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Point;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
import java.io.File;
|
||||
@@ -140,6 +142,12 @@ public class DataAcquisition extends Panel {
|
||||
modelRois = (DefaultTableModel) tableRoi.getModel();
|
||||
new File(ABSORTION_SPECTRUM_PATH).mkdirs();
|
||||
new File(ROIS_PATH).mkdirs();
|
||||
imagingRoiOverlay = new Rect(new Pen(Color.GREEN.darker(),0));
|
||||
imagingRoiOverlay.setSelectable(false);
|
||||
imagingRoiOverlay.setMovable(false);
|
||||
imagingRoiOverlay.setSolid(false);
|
||||
rendererRoi.addOverlay(imagingRoiOverlay);
|
||||
|
||||
}
|
||||
|
||||
//Overridable callbacks
|
||||
@@ -157,7 +165,8 @@ public class DataAcquisition extends Panel {
|
||||
textOutliersMask.setText(String.valueOf(getSetting("OUTLIERS_MASK_FILE")));
|
||||
} catch (IOException ex) {
|
||||
showException(ex);
|
||||
} }
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStateChange(State state, State former) {
|
||||
@@ -182,6 +191,20 @@ public class DataAcquisition extends Panel {
|
||||
textFOV.setText(label);
|
||||
});
|
||||
}).start();
|
||||
|
||||
Rectangle imagingRoi = getImagingRoi();
|
||||
if (imagingRoi==null){
|
||||
imagingRoiOverlay.setVisible(false);
|
||||
} else {
|
||||
imagingRoiOverlay.setPosition(imagingRoi.getLocation());
|
||||
imagingRoiOverlay.setSize(imagingRoi.getSize());
|
||||
imagingRoiOverlay.setVisible(true);
|
||||
}
|
||||
}
|
||||
Rect imagingRoiOverlay;
|
||||
|
||||
Rectangle getImagingRoi(){
|
||||
return (Rectangle) getGlobalVar("IMAGING_ROI");
|
||||
}
|
||||
|
||||
//Callback to perform update - in event thread
|
||||
|
||||
Reference in New Issue
Block a user