Merge pull request #4 from PAMGuard/main

Merge in chanes from main
This commit is contained in:
Douglas Gillespie 2022-06-24 12:27:15 +01:00 committed by GitHub
commit db68a8c2e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 3 deletions

View File

@ -257,15 +257,22 @@ abstract public class PamDialog extends JDialog {
// check we're not going too far off the screen.
Dimension sz = getPreferredSize();
Dimension screen = null;
int w, h;
if (getOwner() != null) {
Window owner = getOwner();
Rectangle bounds = owner.getBounds();
w = bounds.x+bounds.width;
h = bounds.y+bounds.height;
screen = getOwner().getSize();
}
else {
screen = Toolkit.getDefaultToolkit().getScreenSize();
w = screen.width;
h = screen.height;
}
point.y = Math.min(point.y, screen.height-sz.height-10);
point.y = Math.min(point.y, h-sz.height-10);
point.y = Math.max(point.y, 0);
point.x = Math.min(point.x, screen.width-sz.width-10);
point.x = Math.min(point.x, w-sz.width-10);
point.x = Math.max(point.x, 0);
setLocation(point);

View File

@ -48,6 +48,9 @@ public class OverlayCheckboxMenuSelect implements ActionListener {
return;
}
DataSelectDialog dataSelectDialog = new DataSelectDialog(javaFrame, dataBlock, dataSelector, symbolChooser);
if (javaFrame == null) {
dataSelectDialog.moveToMouseLocation();
}
boolean ok = dataSelectDialog.showDialog();
if (ok) {
menuItem.setSelected(true);

View File

@ -293,7 +293,7 @@ public class CTDataSelectPanel implements PamDialogPanel {
int used = 0;
for (int i=0; i<classifierCheckBoxes.length; i++) {
if (classifierCheckBoxes[i].isSelected()) {
currentParams.classifier[used++] = classifiers.get(i).getSpeciesID();
currentParams.classifier[used++] = classifiers.get(i).getSpeciesID();
}
}