Skip to content

Commit

Permalink
Merge pull request #300 from bls337/main
Browse files Browse the repository at this point in the history
add dialog to compute grid button
  • Loading branch information
bls337 authored Sep 4, 2024
2 parents 4fcc429 + e6fb88e commit 2fa0f69
Showing 1 changed file with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
package org.micromanager.lightsheetmanager.gui.frames;

import net.miginfocom.swing.MigLayout;
import org.micromanager.PositionList;
import org.micromanager.lightsheetmanager.gui.data.Icons;
import org.micromanager.lightsheetmanager.gui.components.Button;
import org.micromanager.lightsheetmanager.gui.components.CheckBox;
import org.micromanager.lightsheetmanager.gui.components.Panel;
import org.micromanager.lightsheetmanager.gui.components.Spinner;
import org.micromanager.internal.utils.WindowPositioning;
import org.micromanager.lightsheetmanager.LightSheetManager;
import org.micromanager.lightsheetmanager.gui.utils.DialogUtils;
import org.micromanager.lightsheetmanager.model.XYZGrid;

import javax.swing.JFrame;
Expand Down Expand Up @@ -241,11 +243,21 @@ private void createEventHandlers() {
spnOverlapYZ_.registerListener(e ->
grid.setOverlapYZ(spnOverlapYZ_.getInt()));

// Buttons
// compute XYZ grid
btnComputeGrid_.registerListener(e -> {
grid.computeGrid(model_);
loadFromSettings();
final PositionList positionList = model_.studio().positions().getPositionList();
if (positionList.getNumberOfPositions() != 0) {
final int result = DialogUtils.showYesNoDialog(this, "Warning",
"Do you want to overwrite the existing position list?");
if (result == 1) {
return; // early exit => do not overwrite
}
}
// no positions in list
grid.computeGrid(model_);
loadFromSettings();
});

btnEditPositionList_.registerListener(e ->
model_.studio().app().showPositionList());
btnRunOverviewAcq_.registerListener(e ->
Expand Down

0 comments on commit 2fa0f69

Please sign in to comment.