From 63e93122d1722a69e997a9ac64502ef74c4a7a17 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Fri, 10 Jul 2015 06:15:32 +0100 Subject: [PATCH] JAL-1807 explicit imports (jalview.jbgui) --- src/jalview/jbgui/GAlignFrame.java | 33 +++++++++++++++++------------- src/jalview/jbgui/GDasSourceBrowser.java | 32 +++++++++++++++++++++++------ src/jalview/jbgui/GDesktop.java | 13 ++++++------ src/jalview/jbgui/GFinder.java | 6 ++++-- src/jalview/jbgui/GSequenceLink.java | 24 ++++++++++++++++------ src/jalview/jbgui/GWsPreferences.java | 3 ++- 6 files changed, 75 insertions(+), 36 deletions(-) diff --git a/src/jalview/jbgui/GAlignFrame.java b/src/jalview/jbgui/GAlignFrame.java index c6a042b..614c383 100755 --- a/src/jalview/jbgui/GAlignFrame.java +++ b/src/jalview/jbgui/GAlignFrame.java @@ -23,10 +23,14 @@ package jalview.jbgui; import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder; import jalview.api.SplitContainerI; import jalview.bin.Cache; +import jalview.gui.Desktop; import jalview.gui.JvSwingUtils; import jalview.gui.Preferences; +import jalview.gui.UserDefinedColours; +import jalview.io.FormatAdapter; import jalview.schemes.ColourSchemeProperty; import jalview.util.MessageManager; +import jalview.util.Platform; import java.awt.BorderLayout; import java.awt.Color; @@ -39,6 +43,7 @@ import java.awt.event.FocusEvent; import java.awt.event.KeyEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; +import java.util.Enumeration; import java.util.HashMap; import java.util.Map; @@ -241,10 +246,10 @@ public class GAlignFrame extends JInternalFrame setJMenuBar(alignFrameMenuBar); // dynamically fill save as menu with available formats - for (int i = 0; i < jalview.io.FormatAdapter.WRITEABLE_FORMATS.length; i++) + for (int i = 0; i < FormatAdapter.WRITEABLE_FORMATS.length; i++) { JMenuItem item = new JMenuItem( - jalview.io.FormatAdapter.WRITEABLE_FORMATS[i]); + FormatAdapter.WRITEABLE_FORMATS[i]); item.addActionListener(new ActionListener() { @@ -262,7 +267,7 @@ public class GAlignFrame extends JInternalFrame System.err.println(e.toString()); } - if (!jalview.util.Platform.isAMac()) + if (!Platform.isAMac()) { closeMenuItem.setMnemonic('C'); outputTextboxMenu.setMnemonic('T'); @@ -274,10 +279,10 @@ public class GAlignFrame extends JInternalFrame reload.setMnemonic('R'); } - if (jalview.gui.UserDefinedColours.getUserColourSchemes() != null) + if (UserDefinedColours.getUserColourSchemes() != null) { - java.util.Enumeration userColours = jalview.gui.UserDefinedColours - .getUserColourSchemes().keys(); + Enumeration userColours = UserDefinedColours.getUserColourSchemes() + .keys(); while (userColours.hasMoreElements()) { @@ -295,7 +300,7 @@ public class GAlignFrame extends JInternalFrame radioItem.removeActionListener(radioItem.getActionListeners()[0]); int option = JOptionPane.showInternalConfirmDialog( - jalview.gui.Desktop.desktop, + Desktop.desktop, MessageManager .getString("label.remove_from_default_list"), MessageManager @@ -303,8 +308,8 @@ public class GAlignFrame extends JInternalFrame JOptionPane.YES_NO_OPTION); if (option == JOptionPane.YES_OPTION) { - jalview.gui.UserDefinedColours - .removeColourFromDefaults(radioItem.getText()); + UserDefinedColours.removeColourFromDefaults(radioItem + .getText()); colourMenu.remove(radioItem); } else @@ -350,7 +355,7 @@ public class GAlignFrame extends JInternalFrame // colours.add(covariationColour); colours.add(tcoffeeColour); colours.add(RNAInteractionColour); - setColourSelected(jalview.bin.Cache.getDefault( + setColourSelected(Cache.getDefault( Preferences.DEFAULT_COLOUR, "None")); } @@ -1484,7 +1489,7 @@ public class GAlignFrame extends JInternalFrame }); seqLimits.setText(MessageManager .getString("label.show_sequence_limits")); - seqLimits.setState(jalview.bin.Cache.getDefault("SHOW_JVSUFFIX", true)); + seqLimits.setState(Cache.getDefault("SHOW_JVSUFFIX", true)); seqLimits.addActionListener(new ActionListener() { @Override @@ -1654,7 +1659,7 @@ public class GAlignFrame extends JInternalFrame .setText(MessageManager.getString("action.calculate_tree")); padGapsMenuitem.setText(MessageManager.getString("label.pad_gaps")); - padGapsMenuitem.setState(jalview.bin.Cache + padGapsMenuitem.setState(Cache .getDefault("PAD_GAPS", false)); padGapsMenuitem.addActionListener(new ActionListener() { @@ -1768,7 +1773,7 @@ public class GAlignFrame extends JInternalFrame }); autoCalculate.setText(MessageManager .getString("label.autocalculate_consensus")); - autoCalculate.setState(jalview.bin.Cache.getDefault( + autoCalculate.setState(Cache.getDefault( "AUTO_CALC_CONSENSUS", true)); autoCalculate.addActionListener(new ActionListener() { @@ -1785,7 +1790,7 @@ public class GAlignFrame extends JInternalFrame + MessageManager .getString("label.enable_automatically_sort_alignment_when_open_new_tree")); sortByTree - .setState(jalview.bin.Cache.getDefault("SORT_BY_TREE", false)); + .setState(Cache.getDefault("SORT_BY_TREE", false)); sortByTree.addActionListener(new ActionListener() { @Override diff --git a/src/jalview/jbgui/GDasSourceBrowser.java b/src/jalview/jbgui/GDasSourceBrowser.java index d74900a..7443de1 100755 --- a/src/jalview/jbgui/GDasSourceBrowser.java +++ b/src/jalview/jbgui/GDasSourceBrowser.java @@ -20,13 +20,33 @@ */ package jalview.jbgui; +import jalview.util.BrowserLauncher; import jalview.util.MessageManager; -import java.awt.*; -import java.awt.event.*; -import javax.swing.*; -import javax.swing.border.*; -import javax.swing.event.*; +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.awt.Insets; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +import javax.swing.BorderFactory; +import javax.swing.JButton; +import javax.swing.JEditorPane; +import javax.swing.JLabel; +import javax.swing.JList; +import javax.swing.JPanel; +import javax.swing.JProgressBar; +import javax.swing.JScrollPane; +import javax.swing.JTable; +import javax.swing.JTextField; +import javax.swing.SwingConstants; +import javax.swing.border.TitledBorder; +import javax.swing.event.HyperlinkEvent; +import javax.swing.event.HyperlinkListener; public class GDasSourceBrowser extends JPanel { @@ -210,7 +230,7 @@ public class GDasSourceBrowser extends JPanel if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { - jalview.util.BrowserLauncher.openURL(e.getURL().toString()); + BrowserLauncher.openURL(e.getURL().toString()); } } catch (Exception ex) { diff --git a/src/jalview/jbgui/GDesktop.java b/src/jalview/jbgui/GDesktop.java index 7bb688c..301c29b 100755 --- a/src/jalview/jbgui/GDesktop.java +++ b/src/jalview/jbgui/GDesktop.java @@ -20,7 +20,9 @@ */ package jalview.jbgui; +import jalview.gui.AlignViewport; import jalview.util.MessageManager; +import jalview.util.Platform; import java.awt.FlowLayout; import java.awt.Toolkit; @@ -116,7 +118,7 @@ public class GDesktop extends JFrame e.printStackTrace(); } - if (!new jalview.util.Platform().isAMac()) + if (!Platform.isAMac()) { FileMenu.setMnemonic('F'); inputLocalFileMenuItem.setMnemonic('L'); @@ -435,8 +437,7 @@ public class GDesktop extends JFrame * @param e * DOCUMENT ME! */ - protected void inputLocalFileMenuItem_actionPerformed( - jalview.gui.AlignViewport av) + protected void inputLocalFileMenuItem_actionPerformed(AlignViewport av) { } @@ -446,8 +447,7 @@ public class GDesktop extends JFrame * @param e * DOCUMENT ME! */ - protected void inputURLMenuItem_actionPerformed( - jalview.gui.AlignViewport av) + protected void inputURLMenuItem_actionPerformed(AlignViewport av) { } @@ -457,8 +457,7 @@ public class GDesktop extends JFrame * @param e * DOCUMENT ME! */ - protected void inputTextboxMenuItem_actionPerformed( - jalview.gui.AlignViewport av) + protected void inputTextboxMenuItem_actionPerformed(AlignViewport av) { } diff --git a/src/jalview/jbgui/GFinder.java b/src/jalview/jbgui/GFinder.java index 0b2e6be..1e748ce 100755 --- a/src/jalview/jbgui/GFinder.java +++ b/src/jalview/jbgui/GFinder.java @@ -20,8 +20,10 @@ */ package jalview.jbgui; +import jalview.analysis.AlignSeq; import jalview.datamodel.AlignmentI; import jalview.io.FormatAdapter; +import jalview.util.Comparison; import jalview.util.MessageManager; import java.awt.BorderLayout; @@ -220,8 +222,8 @@ public class GFinder extends JPanel } if (al != null && al.getHeight() > 0) { - str = jalview.analysis.AlignSeq.extractGaps( - jalview.util.Comparison.GapChars, al.getSequenceAt(0) + str = AlignSeq.extractGaps( + Comparison.GapChars, al.getSequenceAt(0) .getSequenceAsString()); textfield.setText(str); diff --git a/src/jalview/jbgui/GSequenceLink.java b/src/jalview/jbgui/GSequenceLink.java index ed74f02..9e32766 100755 --- a/src/jalview/jbgui/GSequenceLink.java +++ b/src/jalview/jbgui/GSequenceLink.java @@ -20,13 +20,26 @@ */ package jalview.jbgui; +import jalview.gui.Desktop; import jalview.gui.JvSwingUtils; import jalview.util.MessageManager; import jalview.util.UrlLink; -import java.awt.*; -import java.awt.event.*; -import javax.swing.*; +import java.awt.Font; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.awt.Insets; +import java.awt.Panel; +import java.awt.Rectangle; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; + +import javax.swing.BorderFactory; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JTextField; +import javax.swing.SwingConstants; public class GSequenceLink extends Panel { @@ -119,9 +132,8 @@ public class GSequenceLink extends Panel } JOptionPane - .showInternalMessageDialog( - jalview.gui.Desktop.desktop, - MessageManager.getString("warn.url_must_contain"), +.showInternalMessageDialog(Desktop.desktop, + MessageManager.getString("warn.url_must_contain"), MessageManager.getString("label.invalid_url"), JOptionPane.WARNING_MESSAGE); return false; } diff --git a/src/jalview/jbgui/GWsPreferences.java b/src/jalview/jbgui/GWsPreferences.java index 1eae7fc..7f073cc 100644 --- a/src/jalview/jbgui/GWsPreferences.java +++ b/src/jalview/jbgui/GWsPreferences.java @@ -20,6 +20,7 @@ */ package jalview.jbgui; +import jalview.bin.Cache; import jalview.util.MessageManager; import java.awt.BorderLayout; @@ -409,7 +410,7 @@ public class GWsPreferences extends JPanel wsMenuRefreshButs.add(resetWs, null); wsMenuRefreshButs.add(progressBar, null); myBorderlayout.setHgap(3); - if (jalview.bin.Cache.getDefault("ENABLE_RSBS_EDITOR", false)) + if (Cache.getDefault("ENABLE_RSBS_EDITOR", false)) { JTabbedPane listPanels = new JTabbedPane(); listPanels.addTab("JABAWS Servers", wsListPanel); -- 1.7.10.2