diff --git a/README.html b/README.html index 601738b5..f39f4964 100644 --- a/README.html +++ b/README.html @@ -388,7 +388,10 @@ PamguardBeta_ViewerMode.exe):
Time zone displays: Fixed some bugs +associated with options to have PAMGuard display times in local time, rather +than UTC. This was affecting times typed into the scroll bars of displays which +were reading local time, even when set to use UTC.
+ +Use of localization sensor and orientation
-data for static hydrophones had a bug whereby it would continually ‘forget’ angle
+ Use of localization sensor and orientation data
+for static hydrophones had a bug whereby it would continually ‘forget’ angle
offsets applied to static hydrophones in viewer mode. This is now fixed. Click tool bar: Correctly shows event
@@ -525,10 +538,10 @@ generates random chirps between around 200 and 800Hz, roughly the frequency
you’d expect sound from higher frequency baleen whales, such as humpbacks, to
vocalise at. Hiding tool tips. A menu item to permanently
-turn off all tool tips, or tap the ‘Esc’ key to turn them off for 6 seconds if
-they are getting in the way, particularly when trying to interact with displays
-using the mouse. Hiding tool tips. A menu item to
+permanently turn off all tool tips, or tap the ‘Esc’ key to turn them off for 6
+seconds if they are getting in the way, particularly when trying to interact
+with displays using the mouse. Version 2.02.06 November 2022
@@ -550,8 +563,8 @@ whistle classification module.
SoundTrap SUD file reading. If you’re using SoundTrap autonomous recorders from Ocean Instruments, you no longer need to decompress the SoundTrap files prior to processing. This will save time and a -lot of disk space. Extraction of clicks from the inbuilt SoundTrap Click -detector can also happen while processing SUD file data with other detectors, thereby +lot of disk space. Extraction of clicks from the inbuilt SoundTrap Click detector +can also happen while processing SUD file data with other detectors, thereby streamlining the whole processing chain. Read the online Help for details.
@@ -656,9 +669,9 @@ selections from drop down lists within any form.-
Note that updates have also been made to the Matlab -interface to PAMGuard binary files, which has now also been migrated to GitHub -at https://github.com/PAMGuard/PAMGuardMatlab. +
Note that updates have also been made to the Matlab interface +to PAMGuard binary files, which has now also been migrated to GitHub at https://github.com/PAMGuard/PAMGuardMatlab.
This version of PAMGuard has been bundled with Java 16 (OpenJDK -release), so you will not need to install a java runtime engine separately. -PSFX files generated in previous beta releases (2.xx.xx) should be compatible -with this version, and vice-versa. PSF files generated in core releases -(1.15.xx) can be loaded in this version, but will be converted to PSFX files -when PAMGuard exits.
+This version of PAMGuard has been bundled with Java 16 +(OpenJDK release), so you will not need to install a java runtime engine +separately. PSFX files generated in previous beta releases (2.xx.xx) should be +compatible with this version, and vice-versa. PSF files generated in core +releases (1.15.xx) can be loaded in this version, but will be converted to PSFX +files when PAMGuard exits.
@@ -739,8 +752,8 @@ params
3. Bug - 492. Data Model does not update button//tooltip text when underlying data -changes
+ 492. Data Model does not update button//tooltip text when underlying +data changes4. Bug @@ -835,17 +848,17 @@ Noise Level Outputs - as an aid to performance diagnosis, some detectors (currently the GPL, Click Detector and Whistle and Moan Detector) are outputting additional noise metrics to their binary output files. These can be read with the PAMGuard -Matlab library and used to diagnose system performance in varying noise -conditions. Improved displays within PAMGuard for these noise metrics will be -included in a future release.
+Matlab library and used to diagnose system performance in varying noise conditions. +Improved displays within PAMGuard for these noise metrics will be included in a +future release.17. An implementation of the Generalized Power Law Detector, -developed by Tyler Helble ([Helble et al., ‘A generalized power-law -detection algorithm for humpback whale vocalizations’, The Journal of the -Acoustical Society of America, vol. 131, no. 4, pp. 2682–2699, 2012) is now -available. For details, see the online help
+developed by Tyler Helble ([Helble et al., ‘A generalized power-law detection +algorithm for humpback whale vocalizations’, The Journal of the Acoustical +Society of America, vol. 131, no. 4, pp. 2682–2699, 2012) is now available. +For details, see the online help18. @@ -866,11 +879,11 @@ understand the notes listed for Beta Version 2.00.10 before proceeding with installation and use of this version.
-This version of PAMGuard has been bundled with Java 13 (release -13.0.1). PSFX files generated in previous beta releases (2.xx.xx) should be -compatible with this version, and vice-versa. PSF files generated in core -releases (1.15.xx) can be loaded in this version, but will be converted to PSFX -files when PAMGuard exits.
+This version of PAMGuard has been bundled with Java 13 +(release 13.0.1). PSFX files generated in previous beta releases (2.xx.xx) +should be compatible with this version, and vice-versa. PSF files generated in +core releases (1.15.xx) can be loaded in this version, but will be converted to +PSFX files when PAMGuard exits.
Bug Fixes
@@ -958,8 +971,9 @@ lang=EN-US> Better auto-scaling in Ishmael Detector graphics window.7. Change to Windows temporary folder location, to get around Windows -Security settings that were preventing some modules from working properly.
+lang=EN-US> Change to Windows temporary folder location, to get around +Windows Security settings that were preventing some modules from working +properly. @@ -1015,8 +1029,8 @@ lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'> &nb8. Bug - 460. Click Detector BT Display vertical axis shows all zeroes when zooming -out
+ 460. Click Detector BT Display vertical axis shows all zeroes when +zooming out9. Bug @@ -1299,8 +1313,8 @@ Added a few new options to the Click Detector Sweep Classifier.
10. Add option to the Map module's Plot Overlay Options dialog, to -show events occuring in the future (look +lang=EN-US> Add option to the Map module's Plot Overlay Options dialog, +to show events occuring in the future (look ahead) instead of the default display of events which have already occurred. Can make it easier to match up the map with clicks seen in the Click Detector display.
@@ -1465,8 +1479,8 @@ Upgrades to the Group Localiser, including better error estimation.2. Click Train Detector upgrades, including ability to import -time chunks from csv file for batch processing.
+lang=EN-US> Click Train Detector upgrades, including ability to import time +chunks from csv file for batch processing.3.
3.
-Bugs 398 and 399. Click Detector, FFT Engine and Filter modules were losing
-source during startup, if the source selected was not the first raw data source
-in the list.
4. @@ -1738,9 +1752,9 @@ see new options in main menu.
2. Added Matched Template Click Classifier. Classifies clicks based -on an ideal template to match and a template to reject. An example of this is -to classify beaked whale clicks in an environment with dolphin clicks.
+lang=EN-US> Added Matched Template Click Classifier. Classifies clicks +based on an ideal template to match and a template to reject. An example of +this is to classify beaked whale clicks in an environment with dolphin clicks.3. @@ -1856,11 +1870,11 @@ to work with whistles.
3. -Added option to export all settings and parameters as an XML-formatted file. -Note that this required changes to the structure of the Array Manager, and as -such any settings (psf) files created with this version of Pamguard cannot be -used in older versions. Older psf files can be loaded with this version, but -will be converted.
+Added option to export all settings and parameters as an XML-formatted file. Note +that this required changes to the structure of the Array Manager, and as such +any settings (psf) files created with this version of Pamguard cannot be used +in older versions. Older psf files can be loaded with this version, but will be +converted.4.
PAMGuard Version 2 contains major updates. You
-should read and understand these notes before proceeding with installation and
-use of this version. These changes have been funded under contract to NOAA
+ PAMGuard Version 2 contains major updates.
+You should read and understand these notes before proceeding with installation
+and use of this version. These changes have been funded under contract to NOAA
Fisheries, contract no. WE-133F-16-SE-1126. The most significant change in the binary
-file format is the addition of a Unique Data Identifier (UID) to each unit of
-data. This is intended to aid in offline analysis by making it easier for the
-user to link what they are seeing on different PAMGuard displays and also to
-link with any data post processed in Matlab or other custom analysis software.
-UID’s are also added to PAMGuard database tables. Beta Version
2.00.10 June 2017
-Binary File Structural Changes
@@ -2112,11 +2126,11 @@ the PAMGuard Viewer the older data will be converted to the new format (see
below for details).
3. -Rocca Module: added StartHr, ProportionWhists and ProportionClicks -parameters to Event classifier
+Rocca Module: added StartHr, ProportionWhists and ProportionClicks parameters +to Event classifier4. @@ -2236,14 +2250,14 @@ switches/parameters to be included in *.ini files.
1. -Bug 308. Map Overlay Control. Storage of data saying -what get's plotted on each map and for how long became corrupted and the list -grew to a ridiculous size. Code has been put in place to a) stop it happening -again and b) to repair any configuration files which are corrupted. Corrupted -files will be slow to load, slow to save and will be > several megabytes in -size. It may be necessary to delete the PamguardSettings table in any databases -since these too may have become oversized which will slow down viewer mode -PAMGuard start-up.
+Bug 308. Map Overlay Control. Storage of data +saying what get's plotted on each map and for how long became corrupted and the +list grew to a ridiculous size. Code has been put in place to a) stop it +happening again and b) to repair any configuration files which are corrupted. +Corrupted files will be slow to load, slow to save and will be > several +megabytes in size. It may be necessary to delete the PamguardSettings table in +any databases since these too may have become oversized which will slow down +viewer mode PAMGuard start-up.2. @@ -2374,10 +2388,10 @@ high sample rate.
2. -Bug 305. Date and Time not being correctly -extracted from wav files created using SoundTrap recorders. Fixed by correctly -finding and unpacking information in the accompanying xml log files that come -with SoundTrap files.
+Bug 305. Date and Time not being correctly extracted +from wav files created using SoundTrap recorders. Fixed by correctly finding +and unpacking information in the accompanying xml log files that come with +SoundTrap files.Logger Form Design
-A GUI driven system for designing Logger forms has been released. -Currently, this feature has no online help, but is reasonably intuitive -compared to the old method of typing directly into the database.
+A GUI driven system for designing Logger forms has been +released. Currently, this feature has no online help, but is reasonably +intuitive compared to the old method of typing directly into the database.
Improved Number handling
@@ -2841,10 +2855,10 @@ displaying in the viewer. This is now fixed.3. -Bug 248. Crash in hydrophone array manager. Bug in array -manager would crash PAMGuard when the click detector was configured with more -channels than the sound acquisition system (almost impossible to achieve, but -someone managed it).
+Bug 248. Crash in hydrophone array manager. Bug in +array manager would crash PAMGuard when the click detector was configured with +more channels than the sound acquisition system (almost impossible to achieve, +but someone managed it).4. @@ -2913,8 +2927,8 @@ writing results files. Fixed.
7. -Bug 237. Logger forms not saving data to database after sound acquisition -starts. Fixed.
+Bug 237. Logger forms not saving data to database after sound +acquisition starts. Fixed.8. @@ -2957,15 +2971,15 @@ which is useful when using PAMGuard for demonstration purposes.
lang=EN-US>4. The sound File and Folder audio input systems now have an optional time zone setting. Note that PAMGuard analysis should still all be taking place in -UTC and that this option is intended to allow the conversion of file times which -were not recorded as UTC into UTC and not the other way around. Use the option -with caution ! +UTC and that this option is intended to allow the conversion of file times +which were not recorded as UTC into UTC and not the other way around. Use the +option with caution !5. -The Open Office Database system has been removed from the list of available -options since it is not reliable. If you require a free database solution we -recommend you use the MySql Community Server The Open Office Database system has been removed from the list of +available options since it is not reliable. If you require a free database +solution we recommend you use the MySql Community Server http://dev.mysql.com/downloads/mysql/
Menu Layout The PAMGuard menus have been rearranged into a more intuitive
-grouping which we believe will help users find functionality more easily. The PAMGuard menus have been rearranged into a more
+intuitive grouping which we believe will help users find functionality more
+easily. 'Detection' menu has been renamed to 'Settings' since many
menu items within this menu were not directly to do with 'Detection'.
This module, funded by NOAA for the South West Fisheries Science Centre (SWFSC), measures pitch and roll from analogue accelerometer sensors in a hydrophone. Data are fed real time into the updated hydrophone -array manager in order that bearings from a tetrahedral tracking array are -correctly calculated in real world coordinates.
+array manager in order that bearings from a tetrahedral tracking array are correctly +calculated in real world coordinates.Wild ArcGIS Interface (Maps and Mapping group)
@@ -3193,12 +3208,12 @@ marine mammal survey package. See online help for details.Alarms (Utilities Group)
-This is a general system of visual and audio alarms -developed by Doug Gillespie for use on a variety of projects. The alarms can be -coupled to any module or detector in PAMGuard. Where appropriate, modules can -control which of their data will cause an alarm action (e.g. in the Click -detector you can set which types of classified click will fire the alarm). See -online help for details.
+This is a general system of visual and audio alarms developed +by Doug Gillespie for use on a variety of projects. The alarms can be coupled +to any module or detector in PAMGuard. Where appropriate, modules can control +which of their data will cause an alarm action (e.g. in the Click detector you +can set which types of classified click will fire the alarm). See online help +for details.
Noise Band Monitor (Sound Processing Group)
@@ -3246,9 +3261,9 @@ different. Details are available in the online help.Can now read raw audio data direct from FLAC files. FLAC is a lossless compression -algorithm for audio data. Files, or folders of files are accessed in the same -way as WAV and AIFF files in the Sound Acquisition module. In a future release -we also hope to provide support for writing FLAC files from the sound recorder +algorithm for audio data. Files, or folders of files are accessed in the same way +as WAV and AIFF files in the Sound Acquisition module. In a future release we +also hope to provide support for writing FLAC files from the sound recorder module.
Sound Recorder Module
@@ -3292,9 +3307,8 @@ shaped Finite Impulse Response filters (see online help for details).Radar Display
-Can now show bearings relative to true North OR the vessel -heading. Also has the option of only showing certain types of click and -whistle.
+Can now show bearings relative to true North OR the vessel heading. +Also has the option of only showing certain types of click and whistle.
Bug Fixes
@@ -3373,8 +3387,8 @@ survey software package.Core Functionality
-New storage options have been -implemented which give the user greater control of where data are stored.
+New storage options have been implemented +which give the user greater control of where data are stored.
Modules have been arranged into different groups in the configuration menus and tool tip texts have been added @@ -3396,9 +3410,9 @@ other data sources for the PAMGuard viewer.
Database
-Can now copy data from binary storage -to the database offline for any module having both binary and database storage. -
+Can now copy data from binary +storage to the database offline for any module having both binary and database +storage.
Can create a blank MS Access database (2007 and later *.accdb formats only).
@@ -3461,8 +3475,8 @@ inter-detection interval. margin-left:36.0pt'>Target Motion Analysis: Updated target motion analysis -module so that it works in three (as opposed to two) dimensions.
+margin-left:36.0pt'>Target Motion Analysis: Updated target motion analysis module +so that it works in three (as opposed to two) dimensions.@@ -3549,8 +3563,8 @@ start-up.
' Bug in Noise Monitor. Version 1.11.01 would crash if only a subset of -channels were selected, e.g. if you only measured noise on channel 0 of a two channel -configuration. This bug is now fixed
+channels were selected, e.g. if you only measured noise on channel 0 of a two +channel configuration. This bug is now fixed' Whistle classifier has some new features in the classifier training -panel. It is also now possible to export training data files directly from -binary data files.
+panel. It is also now possible to export training data files directly from binary +data files.' @@ -3825,8 +3839,8 @@ of channel numbering was only implemented several years into the PAMGUARD project, it was never fully implemented or well supported by the different modules which resulted in a number of bugs which could cause confusion as to which hydrophones were being used during localisation or during calibrated -measurement. The situation tended to only arise with a small number of ASIO sound -cards such as the RME Fireface 400 on which the most useful inputs, the +measurement. The situation tended to only arise with a small number of ASIO +sound cards such as the RME Fireface 400 on which the most useful inputs, the balanced line inputs, are hardware channels 4,5,6 and 7 on the back of the instrument. (On the Fireface 800, the balanced line inputs are channels 0 to 7). When using the National Instruments system, data were always sent into the @@ -3849,13 +3863,14 @@ out a better system for handling channel numbering in PAMGUARD and have decided that the only practical thing to do is to force all software channel numbering back to a zero indexed system. i.e. even if you read out hardware channels 3,4,5 and 6, within PAMGUARD, everywhere apart from the Sound acquisition -dialog, you will see them listed as channels 0,1,2 and 3. The consequences -of doing this are mainly very good. Most users will not notice any changes. For -those who need for some reason to read channel numbers not starting at zero -things will be more stable. However, when you go to a new version with this new -feature, it will be necessary to reconfigure all the modules in any existing -configurations. To do this, open the configuration dialog for each module in -turn and select the correct, zero indexed, channel number.
+dialog, you will see them listed as channels 0,1,2 and 3. The +consequences of doing this are mainly very good. Most users will not notice any +changes. For those who need for some reason to read channel numbers not +starting at zero things will be more stable. However, when you go to a new +version with this new feature, it will be necessary to reconfigure all the +modules in any existing configurations. To do this, open the configuration +dialog for each module in turn and select the correct, zero indexed, channel +number.Other Changes / new features
@@ -3912,8 +3927,8 @@ existing configurations.Sound acquisition
-Changes made for a previous Mac build now incorporated into main -Beta branch. This should allow for basic 2 channel sound acquisition using +
Changes made for a previous Mac build now incorporated into +main Beta branch. This should allow for basic 2 channel sound acquisition using Macs.
Bug Fixes
@@ -3950,12 +3965,12 @@ port is closed. Might prevent a few problems when using a GPS.Bug Fixes
Crashes caused in real time or Mixed Mode if the number of -software channels exceeds the number of hydrophones configured in the array -manager. It is of course illogical to have software channels which are not -assigned to a hydrophone, so rather than entirely prevent PAMGUARD from -crashing I have inserted additional checks into the hydrophone array dialog -which will prevent the user from closing that dialog unless all software -channels are assigned to a hydrophone.
+software channels exceeds the number of hydrophones configured in the array manager. +It is of course illogical to have software channels which are not assigned to a +hydrophone, so rather than entirely prevent PAMGUARD from crashing I have +inserted additional checks into the hydrophone array dialog which will prevent +the user from closing that dialog unless all software channels are assigned to +a hydrophone.@@ -4057,8 +4072,8 @@ arrays to give two polar angle coordinates. this can be used to resolve left right ambiguity and is implemented for both the click and the whistle/moan detectors. As a result, the click detector bearing time display can now be set to go from -180 to 180 degrees rather than 0 - 180 degrees. In this case, -clicks in the upper half of the bearing display will be to port and clicks in -the right half will be to starboard. As you pass a whale which is to port, the +clicks in the upper half of the bearing display will be to port and clicks in the +right half will be to starboard. As you pass a whale which is to port, the clicks will move UP the display. In the long term, I hope to turn this display around so that time is up the screen rather than across. @@ -4106,8 +4121,9 @@ methods used in PAMGUARD
New Modules
-Two new modules are packaged. These are still in the final stages -of development. Feedback is most welcome. See online help for further details.
+Two new modules are packaged. These are still in the final +stages of development. Feedback is most welcome. See online help for further +details.
Whistle and Moan Detector
@@ -4715,7 +4731,8 @@ Symbol'>''1.0Beta 22 Jan 2008 - Pamguard -starts two releases, core and beta release, +class=Heading2Char>1.0Beta 22 Jan 2008 - +Pamguard starts two releases, core and beta release,this is the beta release
@@ -4831,12 +4848,12 @@ and Ishmael-type detectors and localisers.Information from above modules can be displayed on configurable user displays which support real time scrolling spectrograms and radar displays. Detection and localisation information can be optionally -displayed on the map display.Map enhancements include improved scrolling -whereby the user can click and drag to pan the area. PamGuard can now interface -with MySQL database servers and users can easily select which information is -logged. (This replaces the previous 'flat-file' logging feature). A simulation -module allows virtual vocalising animals to be placed on the map to assist in -training and development. Extensive online user help has been added to PamGuard +displayed on the map display.Map enhancements include improved scrolling whereby +the user can click and drag to pan the area. PamGuard can now interface with +MySQL database servers and users can easily select which information is logged. +(This replaces the previous 'flat-file' logging feature). A simulation module +allows virtual vocalising animals to be placed on the map to assist in training +and development. Extensive online user help has been added to PamGuard Application
use UTC, the selection " + - "you make here \nwill only affect what is displayed on the screen"); + ta.setText("Note that all processing and data storage will continue to use UTC.
The selection " + + "you make here will only affect what is displayed on the screen."); tzPanel.add(ta, c); ButtonGroup bg = new ButtonGroup(); @@ -66,7 +66,7 @@ public class TimeZoneDisplayDialog extends PamDialog { bg.add(usePC); bg.add(useOther); - thisTimeZone = Calendar.getInstance().getTimeZone(); + TimeZone pcTimeZone = TimeZone.getDefault(); timeZoneIds = TimeZone.getAvailableIDs(); Arrays.sort(timeZoneIds, new TimeZoneComparator()); TimeZone tz; @@ -76,7 +76,7 @@ public class TimeZoneDisplayDialog extends PamDialog { if (timeZoneIds[i].equals(PamCalendar.defaultTimeZone.getID())) { utcTZIndex = i; } - if (timeZoneIds[i].equals(thisTimeZone.getID())) { + if (timeZoneIds[i].equals(pcTimeZone.getID())) { pcTZIndex = i; } if (tz.getRawOffset() < 0) { @@ -118,7 +118,8 @@ public class TimeZoneDisplayDialog extends PamDialog { useUTC.setSelected(timeDisplayParameters.zoneType == TimeDisplayParameters.TIME_ZONE_UTC); usePC.setSelected(timeDisplayParameters.zoneType == TimeDisplayParameters.TIME_ZONE_PC); useOther.setSelected(timeDisplayParameters.zoneType == TimeDisplayParameters.TIME_ZONE_OTHER); - pcTimeZone.setText(String.format("(%s / %s)", thisTimeZone.getID(), thisTimeZone.getDisplayName())); + TimeZone defaultTimeZone = TimeZone.getDefault(); + pcTimeZone.setText(String.format("(%s / %s)", defaultTimeZone.getID(), defaultTimeZone.getDisplayName())); enableControls(); showSelection(); } @@ -165,7 +166,7 @@ public class TimeZoneDisplayDialog extends PamDialog { } else if (usePC.isSelected()) { timeDisplayParameters.zoneType = TimeDisplayParameters.TIME_ZONE_PC; - timeDisplayParameters.timeZone = thisTimeZone; + timeDisplayParameters.timeZone = TimeZone.getDefault(); } else if (useOther.isSelected()) { timeDisplayParameters.zoneType = TimeDisplayParameters.TIME_ZONE_OTHER; diff --git a/src/PamView/GuiFrameManager.java b/src/PamView/GuiFrameManager.java index 030628c0..b49da8d7 100644 --- a/src/PamView/GuiFrameManager.java +++ b/src/PamView/GuiFrameManager.java @@ -633,5 +633,26 @@ public class GuiFrameManager implements PamSettings, PAMControllerGUI { return frameIcon; } + /** + * Function that can move GUI frames back onto the main window. + * Can be used to recover a GUI if it's on a monitor that is not present. + */ + public void findGUI() { + if (pamViewList == null) { + return; + } + int loc = 10; + for (PamViewInterface view : pamViewList) { + JFrame frame = view.getGuiFrame(); + if (frame == null) { + continue; + } + frame.setLocation(loc, loc); + frame.setState(JFrame.NORMAL); + frame.setVisible(true); + loc += 20; + } + } + } diff --git a/src/PamView/PamGui.java b/src/PamView/PamGui.java index 34f9b000..98ef13e4 100644 --- a/src/PamView/PamGui.java +++ b/src/PamView/PamGui.java @@ -223,32 +223,24 @@ public class PamGui extends PamView implements WindowListener, PamSettings { PamSettingManager.getInstance().registerSettings(this); if (guiParameters.bounds != null) { - /* - * now need to check that the frame is visible on the - * current screen - a pain when psf files are sent between - * users, or when I work on two screens at work and then one - * at home ! - */ - // Rectangle screenRect = ScreenSize.getScreenBounds(20000); - Rectangle screenRect = ScreenSize.getScreenBounds(); - // Rectangle intercept = screenRect.intersection(frame.getBounds()); - if (screenRect == null) { - System.out.println("Unable to get screen dimensions from system"); +// /* +// * now need to check that the frame is visible on the +// * current screen - a pain when psf files are sent between +// * users, or when I work on two screens at work and then one +// * at home ! +// */ + + Point topCorner = guiParameters.bounds.getLocation(); + boolean posOK = true; + try { + posOK = ScreenSize.isPointOnScreen(topCorner); + } catch (Exception e) { } - else { - while (guiParameters.bounds.x + guiParameters.bounds.width < screenRect.x + 200) { - guiParameters.bounds.x += screenRect.width; - } - while (guiParameters.bounds.x > screenRect.x+screenRect.width) { - guiParameters.bounds.x -= screenRect.width; - } - while (guiParameters.bounds.y + guiParameters.bounds.height < screenRect.y + 200) { - guiParameters.bounds.y += screenRect.height; - } - while (guiParameters.bounds.y > screenRect.y+screenRect.height) { - guiParameters.bounds.y -= screenRect.height; - } + if (!posOK) { + // put it in the top corner of the main screen. + guiParameters.bounds.x = guiParameters.bounds.y = 10; } + frame.setBounds(guiParameters.bounds); diff --git a/src/PamView/ScreenSize.java b/src/PamView/ScreenSize.java index a51863a2..4b4d905b 100644 --- a/src/PamView/ScreenSize.java +++ b/src/PamView/ScreenSize.java @@ -3,6 +3,7 @@ package PamView; import java.awt.GraphicsConfiguration; import java.awt.GraphicsDevice; import java.awt.GraphicsEnvironment; +import java.awt.Point; import java.awt.Rectangle; import java.util.List; @@ -15,7 +16,7 @@ import javafx.scene.layout.Pane; /** * Class to launch a thread which will get the screen size - * (inlcuding the bounds of multiple monitors) + * (including the bounds of multiple monitors) *
* The process of getting the dimensions is launched in a * different thread and can be going on while other PAMGAURD @@ -32,40 +33,6 @@ public class ScreenSize { private static Rectangle[] screenDimensions; -// private volatile static boolean hasRun = false; -// -// private ScreenSize() { -// //Problems with startup on Mac that -// //seem to have been caused by the -// //GetBounds not being invoked from within -// //the Event Display Thread -// //CJB 2009-06-15 -//// SwingUtilities.invokeLater(new GetBounds()); -// //old version -// //Thread thread = new Thread(new GetBounds()); -// //thread.start(); -// long m1 = System.currentTimeMillis(); -// findScreenBounds(); -// long m2 = System.currentTimeMillis(); -// System.out.println("screen bounds took ms: " + (m2-m1)); -// } -// -// /** -// * Only needs to be called once to -// * start the background process which gets -// * the virtual screen size. -// *
-// * Is called from PAMGUARD Main to get it
-// * going asap.
-// */
-// public static void startScreenSizeProcess() {
-// if (hasRun == false) {
-// hasRun = true;
-// new ScreenSize();
-// }
-//
-// }
-//
/**
* Gets the screen bounds, sum / union of all screens.
* @return Virtual screen size, or null.
@@ -103,40 +70,6 @@ public class ScreenSize {
return screenDimensions[iScreen];
}
-// /**
-// * Gets the virtual screen size. Will wait for them to be
-// * extracted from the background thread up to some set timeout
-// * @param maxWaitMillis Max time to wait.
-// * @return virtual screen dimension, or null if unavailable
-// * after the set wait period.
-// */
-// public static Rectangle getScreenBounds(int maxWaitMillis) {
-//
-// startScreenSizeProcess();
-//
-// long endTime = System.currentTimeMillis() + maxWaitMillis;
-// while (System.currentTimeMillis() <= endTime) {
-// if (screenDimension != null) {
-// return screenDimension;
-// }
-// try {
-// Thread.sleep(100);
-// }
-// catch (InterruptedException e) {
-// return screenDimension;
-// }
-// }
-// return screenDimension;
-// }
-//
-// /**
-// *
-// * @return true if screen bounds are available.
-// */
-// public boolean haveScreenBounds() {
-// return (screenDimension != null);
-// }
-
private static Rectangle findScreenBounds() {
Rectangle virtualBounds = new Rectangle();
if (PamGUIManager.getGUIType() == PamGUIManager.NOGUI) {
@@ -160,40 +93,50 @@ public class ScreenSize {
//let PAMGUARD start up a little quicker
//CJB 2009-06-15
GraphicsConfiguration dgc = gd.getDefaultConfiguration();
- // System.out.printf("", dgc.getBufferCapabilities().)
- // System.out.println(dgc);
screenDimensions[j] = dgc.getBounds();
virtualBounds = virtualBounds.union(dgc.getBounds());
}
}
- // new Pane();
- // List