mirror of
https://github.com/PAMGuard/PAMGuard.git
synced 2024-11-22 07:02:29 +00:00
commit
db68a8c2e7
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user