diff --git a/pom.xml b/pom.xml index 83131973..4cdb1430 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 org.pamguard Pamguard - 2.02.06b + 2.02.06c Pamguard Java12+ Pamguard for Java 12+, using Maven to control dependcies www.pamguard.org diff --git a/src/PamController/PamguardVersionInfo.java b/src/PamController/PamguardVersionInfo.java index 530eee18..a58e1f70 100644 --- a/src/PamController/PamguardVersionInfo.java +++ b/src/PamController/PamguardVersionInfo.java @@ -31,12 +31,12 @@ public class PamguardVersionInfo { * Version number, major version.minorversion.sub-release. * Note: can't go higher than sub-release 'f' */ - static public final String version = "2.02.06b"; + static public final String version = "2.02.06c"; /** * Release date */ - static public final String date = "28 November 2022"; + static public final String date = "13 December 2022"; // /** // * Release type - Beta or Core diff --git a/src/PamView/GuiParameters.java b/src/PamView/GuiParameters.java index 257a1d35..8cb094ec 100644 --- a/src/PamView/GuiParameters.java +++ b/src/PamView/GuiParameters.java @@ -30,6 +30,12 @@ public class GuiParameters implements Serializable, Cloneable { private String currentSelectedTab; + /** + * Flag to hide all tool tips - which are + * very annoying when they cover controls you want to use! + */ + private boolean hideAllToolTips = false; + /* (non-Javadoc) * @see java.lang.Object#clone() @@ -60,5 +66,21 @@ public class GuiParameters implements Serializable, Cloneable { public void setCurrentSelectedTab(String currentSelectedTab) { this.currentSelectedTab = currentSelectedTab; } + + + /** + * @return the hideAllToolTips + */ + public boolean isHideAllToolTips() { + return hideAllToolTips; + } + + + /** + * @param hideAllToolTips the hideAllToolTips to set + */ + public void setHideAllToolTips(boolean hideAllToolTips) { + this.hideAllToolTips = hideAllToolTips; + } } diff --git a/src/PamView/PamGui.java b/src/PamView/PamGui.java index a502e0d8..4d103136 100644 --- a/src/PamView/PamGui.java +++ b/src/PamView/PamGui.java @@ -46,6 +46,7 @@ import java.net.URL; import java.util.List; import javax.swing.ImageIcon; +import javax.swing.JCheckBoxMenuItem; import javax.swing.JComponent; import javax.swing.JFrame; import javax.swing.JLabel; @@ -57,6 +58,7 @@ import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.SwingConstants; import javax.swing.SwingUtilities; +import javax.swing.ToolTipManager; import javax.swing.WindowConstants; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; @@ -250,6 +252,8 @@ public class PamGui extends PamView implements WindowListener, PamSettings { frame.setExtendedState(guiParameters.extendedState); frame.setVisible(true); + + hideToolTips(guiParameters.isHideAllToolTips()); somethingShowing = true; } @@ -819,6 +823,11 @@ public class PamGui extends PamView implements WindowListener, PamSettings { menuItem.setToolTipText("Warnings told \"Not to show again\" will be shown again"); menuItem.addActionListener(new ClearHiddenWarnings()); menu.add(menuItem); + + JCheckBoxMenuItem hideTips = new JCheckBoxMenuItem("Hide all tool tips", guiParameters.isHideAllToolTips()); + hideTips.setToolTipText("Hide annoying pop-up tool tips which keep getting in the way"); + hideTips.addActionListener(new HideToolTips(hideTips)); + menu.add(hideTips); /* * Add menu item to redirect output to file or console screen @@ -1173,6 +1182,32 @@ public class PamGui extends PamView implements WindowListener, PamSettings { } } + private class HideToolTips implements ActionListener { + + private JCheckBoxMenuItem hideTipsCheckbox; + + public HideToolTips(JCheckBoxMenuItem hideTips) { + this.hideTipsCheckbox = hideTips; + } + + @Override + public void actionPerformed(ActionEvent e) { + boolean shouldHide = !guiParameters.isHideAllToolTips(); + hideToolTips(shouldHide); + guiParameters.setHideAllToolTips(shouldHide); + hideTipsCheckbox.setSelected(shouldHide); + + } + } + + /** + * hide all tool tips + * @param hide + */ + private void hideToolTips(boolean hide) { + ToolTipManager.sharedInstance().setEnabled(!hide); + } + class ClearHiddenWarnings implements ActionListener { public void actionPerformed(ActionEvent ev){ WarnOnce.clearHiddenList(getGuiFrame()); @@ -1778,7 +1813,6 @@ public class PamGui extends PamView implements WindowListener, PamSettings { */ public boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings) { guiParameters = ((GuiParameters) pamControlledUnitSettings.getSettings()).clone(); - return true; } public PamTabbedPane getMainTab() {