|
85 | 85 | import java.awt.BorderLayout;
|
86 | 86 | import java.awt.Color;
|
87 | 87 | import java.awt.Component;
|
88 |
| -import java.awt.Container; |
89 |
| -import java.awt.Dimension; |
90 | 88 | import java.awt.FlowLayout;
|
91 | 89 | import java.awt.Font;
|
92 | 90 | import java.awt.event.ActionEvent;
|
@@ -152,10 +150,7 @@ public class TabConfig extends JPanelWithEnablement {
|
152 | 150 | private UiText uiTextBinPython;
|
153 | 151 | private HtmlStyledJEditorPane epPythonVer;
|
154 | 152 | private HtmlStyledJEditorPane epDbsplitText;
|
155 |
| - private HtmlStyledJEditorPane epDbsplitErr; |
156 |
| - private Container epDbsplitErrParent; |
157 | 153 | private HtmlStyledJEditorPane epEasyPQPText;
|
158 |
| - private Container epSpeclibgenParent; |
159 | 154 | private JButton btnAbout;
|
160 | 155 |
|
161 | 156 | public static final String TIP_MSFRAGGER_BIN = "tip.msfragger.bin";
|
@@ -219,8 +214,6 @@ private void init() {
|
219 | 214 | add(createPanelTools(), new CC().growX().wrap());
|
220 | 215 | add(createPanelDiann(), new CC().growX().wrap());
|
221 | 216 | add(createPanelPython(), new CC().growX().wrap());
|
222 |
| - add(createPanelDbsplit(), new CC().growX().wrap()); |
223 |
| - add(createPanelSpeclibgen(), new CC().growX().wrap()); |
224 | 217 | add(createPanelBottomInfo(), new CC().growX().wrap());
|
225 | 218 | add(createPanelBottomLink(), new CC().growX().wrap());
|
226 | 219 | }
|
@@ -896,65 +889,42 @@ private String textDbsplitEnabled(boolean isEnabled) {
|
896 | 889 | @Subscribe(sticky = true, threadMode = ThreadMode.MAIN_ORDERED)
|
897 | 890 | public void on(NoteConfigDbsplit m) {
|
898 | 891 | if (m.ex != null) {
|
899 |
| - log.debug("Got NoteDbsplitConfig with exception set"); |
900 |
| - if (epDbsplitErrParent != null && !epDbsplitErrParent.isAncestorOf(epDbsplitErr)) { |
901 |
| - epDbsplitErrParent.add(epDbsplitErr, new CC().wrap()); |
902 |
| - epDbsplitErr.setVisible(true); |
903 |
| - } |
904 | 892 | epDbsplitText.setText(textDbsplitEnabled(false));
|
905 |
| - if (m.ex instanceof ValidationException) { |
906 |
| - epDbsplitErr.setText(m.ex.getMessage()); |
907 |
| - } else { |
908 |
| - showConfigError(m.ex, TIP_DBSPLIT, epDbsplitText, false); |
909 |
| - } |
910 | 893 | this.revalidate();
|
911 | 894 | return;
|
912 | 895 | }
|
913 | 896 | if (m.instance == null) {
|
914 | 897 | throw new IllegalStateException("If no exception is reported from DBSplit init, instance should not be null");
|
915 | 898 | }
|
916 |
| - log.debug("Got NoteDbsplitConfig without exceptions"); |
917 |
| - |
918 |
| - epDbsplitErrParent = epDbsplitErr.getParent(); |
919 |
| - if (epDbsplitErrParent != null) { |
920 |
| - epDbsplitErrParent.remove(epDbsplitErr); |
921 |
| - } |
922 | 899 | epDbsplitText.setText(textDbsplitEnabled(true));
|
923 | 900 | this.revalidate();
|
924 | 901 | }
|
925 | 902 |
|
926 |
| - private String textEasyPQP(String easypqpLocalVersion, String easypqpLatestVersion, String pandasLocalVersion, String numpyLocalVersion, boolean enableEasypqp, String errMsg) { |
| 903 | + private String textEasyPQP(String easypqpLocalVersion, String easypqpLatestVersion, boolean enableEasypqp, String errMsg) { |
927 | 904 | StringBuilder sb = new StringBuilder();
|
928 | 905 | if (enableEasypqp && !easypqpLocalVersion.contentEquals("N/A")) {
|
929 | 906 | if (!easypqpLatestVersion.contentEquals("N/A") && VersionComparator.cmp(easypqpLocalVersion, easypqpLatestVersion) < 0) {
|
930 |
| - sb.append("EasyPQP: <b>Available</b>. Version: " + easypqpLocalVersion + "<br>" |
931 |
| - + "<p style=\"color:red\">There is a new version (" + easypqpLatestVersion + "). Please upgrade it by clicking the button below and waiting.<br>"); |
932 |
| - sb.append("Pandas: <b>Available</b>. Version: ").append(pandasLocalVersion).append("<br>"); |
933 |
| - sb.append("Numpy: <b>Available</b>. Version: ").append(numpyLocalVersion).append("<br>"); |
| 907 | + sb.append("EasyPQP: <b>Available</b>. Version: " + easypqpLocalVersion + ". Used for spectral library building.<br><br>" |
| 908 | + + "<p style=\"color:red\">There is a new version (" + easypqpLatestVersion + "). Please upgrade it by clicking the button below and waiting.<br><br>"); |
934 | 909 | } else {
|
935 |
| - sb.append("EasyPQP: <b>Available</b>. Version: " + easypqpLocalVersion + "<br>"); |
936 |
| - sb.append("Pandas: <b>Available</b>. Version: ").append(pandasLocalVersion).append("<br>"); |
937 |
| - sb.append("Numpy: <b>Available</b>. Version: ").append(numpyLocalVersion).append("<br>"); |
| 910 | + sb.append("EasyPQP: <b>Available</b>. Version: " + easypqpLocalVersion + ". Used for spectral library building.<br><br>"); |
938 | 911 | }
|
939 | 912 | } else {
|
940 | 913 | if (errMsg.isEmpty()) {
|
941 |
| - sb.append("EasyPQP: <b>Not available</b><br>" |
942 |
| - + "Please make sure that Python is installed, and then click the button below and wait.<br>"); |
| 914 | + sb.append("EasyPQP: <b>Not available</b>. Used for spectral library building.<br><br>"); |
943 | 915 | } else {
|
944 |
| - sb.append("EasyPQP: <b>Not available</b><br>" |
945 |
| - + "Please make sure that Python is installed, and then click the button below and wait.<br>").append(errMsg); |
| 916 | + sb.append("EasyPQP: <b>Not available</b>. Used for spectral library building.<br><br>").append(errMsg); |
946 | 917 | }
|
947 | 918 | }
|
948 | 919 | return sb.toString();
|
949 | 920 | }
|
950 | 921 |
|
951 | 922 | @Subscribe(sticky = true, threadMode = ThreadMode.MAIN_ORDERED)
|
952 | 923 | public void on(NoteConfigSpeclibgen m) {
|
953 |
| - epSpeclibgenParent = epEasyPQPText.getParent(); |
954 | 924 | epEasyPQPText.setVisible(true);
|
955 | 925 | if (m.ex != null) {
|
956 | 926 | log.debug("Got NoteConfigSpeclibgen with exception set");
|
957 |
| - epEasyPQPText.setText(textEasyPQP("N/A", "N/A", "N/A", "N/A", false, m.ex.getMessage())); |
| 927 | + epEasyPQPText.setText(textEasyPQP("N/A", "N/A", false, m.ex.getMessage())); |
958 | 928 | showConfigError(m.ex, TIP_SPECLIBGEN, epEasyPQPText, false);
|
959 | 929 | this.revalidate();
|
960 | 930 | return;
|
@@ -1021,7 +991,7 @@ public void on(NoteConfigSpeclibgen m) {
|
1021 | 991 | easypqpLatestVersion = "N/A";
|
1022 | 992 | }
|
1023 | 993 |
|
1024 |
| - epEasyPQPText.setText(textEasyPQP(m.easypqpLocalVersion, easypqpLatestVersion, m.pandasLocalVersion, m.numpyLocalVersion, true, "")); |
| 994 | + epEasyPQPText.setText(textEasyPQP(m.easypqpLocalVersion, easypqpLatestVersion, true, "")); |
1025 | 995 |
|
1026 | 996 | this.revalidate();
|
1027 | 997 | }
|
@@ -1118,29 +1088,17 @@ private JPanel createPanelPython() {
|
1118 | 1088 | .createButton("Download", e -> SwingUtils.openBrowserOrThrow(url));
|
1119 | 1089 | p.add(btnDonwload, ccL().wrap());
|
1120 | 1090 | }
|
| 1091 | + |
1121 | 1092 | epPythonVer = new HtmlStyledJEditorPane("Python version: N/A");
|
1122 |
| - p.add(epPythonVer, ccL().wrap()); |
| 1093 | + epDbsplitText = new HtmlStyledJEditorPane(textDbsplitEnabled(false)); |
| 1094 | + epEasyPQPText = new HtmlStyledJEditorPane(textEasyPQP("N/A", "N/A", false, "")); |
| 1095 | + |
| 1096 | + final JButton btnFinishPythonInstall = UiUtils.createButton("Finish Python Install", e -> Bus.post(new MessageInstallEasyPQP(console))); |
1123 | 1097 |
|
1124 |
| -// final Runnable pipList = () -> { |
1125 |
| -// final ProcessBuilder pb = new ProcessBuilder(uiTextBinPython.getNonGhostText(), "-m", "pip", "freeze"); |
1126 |
| -// String pythonPipOutputNew; |
1127 |
| -// try { |
1128 |
| -// pythonPipOutputNew = ProcessUtils.captureOutput(pb); |
1129 |
| -// } catch (UnexpectedException ex) { |
1130 |
| -// pythonPipOutputNew = null; |
1131 |
| -// } |
1132 |
| -// if (pythonPipOutputNew != null && !pythonPipOutput.equals(pythonPipOutputNew)) { |
1133 |
| -// pythonPipOutput = pythonPipOutputNew; |
1134 |
| -// Bus.post(new MessageUiRevalidate()); |
1135 |
| -// } |
1136 |
| -// }; |
1137 |
| -// final javax.swing.Timer timer = new javax.swing.Timer(5000, e -> { |
1138 |
| -// final String binPython = uiTextBinPython.getNonGhostText(); |
1139 |
| -// if (StringUtils.isNotBlank(binPython)) |
1140 |
| -// javax.swing.SwingUtilities.invokeLater(pipList); |
1141 |
| -// }); |
1142 |
| -// timer.setInitialDelay(0); |
1143 |
| -// timer.start(); |
| 1098 | + p.add(epPythonVer, ccL().wrap()); |
| 1099 | + mu.add(p, epDbsplitText).growX().wrap(); |
| 1100 | + mu.add(p, epEasyPQPText).growX().wrap(); |
| 1101 | + mu.add(p, btnFinishPythonInstall).split().wrap(); |
1144 | 1102 |
|
1145 | 1103 | return p;
|
1146 | 1104 | }
|
@@ -1191,52 +1149,6 @@ public void on(MessageInstallEasyPQP m) {
|
1191 | 1149 | Bus.post(new MessageUiRevalidate(false, true));
|
1192 | 1150 | }
|
1193 | 1151 |
|
1194 |
| - private JPanel createPanelDbsplit() { |
1195 |
| - JPanel p = mu.newPanel("Database Splitting", true); |
1196 |
| - |
1197 |
| - StringBuilder tip = new StringBuilder() |
1198 |
| - .append("Used for searching very large databases by splitting into smaller chunks.<br/>") |
1199 |
| - .append("Requires <b>Python " + pythonMinVersion + "+</b> with packages <b>Numpy, Pandas</b>.\n") |
1200 |
| - .append("Ways to get everything set up:").append("<ul>") |
1201 |
| - .append("<li>Install Python " + pythonMinVersion + "+ if you don't yet have it.</li>") |
1202 |
| - .append( |
1203 |
| - "<li>Install required python modules using <i>pip</i>, the python package manager, with command:</li>") |
1204 |
| - .append("<ul>").append("<li>pip install numpy pandas</li>").append("</ul>") |
1205 |
| - .append("</ul>"); |
1206 |
| - String tipHtml = SwingUtils.makeHtml(tip.toString()); |
1207 |
| - p.setToolTipText(tipHtml); |
1208 |
| - |
1209 |
| - Dimension dim = new Dimension(400, 25); |
1210 |
| - epDbsplitText = new HtmlStyledJEditorPane(textDbsplitEnabled(false)); |
1211 |
| - epDbsplitText.setToolTipText(tipHtml); |
1212 |
| - epDbsplitText.setPreferredSize(dim); |
1213 |
| - epDbsplitErr = new HtmlStyledJEditorPane("Requires Python " + pythonMinVersion + "+ with modules Numpy and Pandas."); |
1214 |
| - epDbsplitErr.setPreferredSize(dim); |
1215 |
| - |
1216 |
| - mu.add(p, epDbsplitText).growX().pushX().wrap(); |
1217 |
| - mu.add(p, epDbsplitErr).growX().pushX().wrap(); |
1218 |
| - |
1219 |
| - return p; |
1220 |
| - } |
1221 |
| - |
1222 |
| - private JPanel createPanelSpeclibgen() { |
1223 |
| - JPanel p = mu.newPanel("Spectral Library Generation", true); |
1224 |
| - |
1225 |
| - p.setToolTipText(SwingUtils.makeHtml("EasyPQP: Requires <b>Python " + pythonMinVersion + "+</b> with package <b>EasyPQP</b> and <b>lxml</b>")); |
1226 |
| - Dimension dim = new Dimension(200, 25); |
1227 |
| - |
1228 |
| - epEasyPQPText = new HtmlStyledJEditorPane("Configuring EasyPQP."); |
1229 |
| - epEasyPQPText.setToolTipText(SwingUtils.makeHtml("EasyPQP: Requires <b>Python " + pythonMinVersion + "+</b> with package <b>EasyPQP</b> and <b>lxml</b>")); |
1230 |
| - epEasyPQPText.setPreferredSize(dim); |
1231 |
| - |
1232 |
| - final JButton btnInstallEasyPQP = UiUtils.createButton("Finish Python Install", e -> Bus.post(new MessageInstallEasyPQP(console))); |
1233 |
| - |
1234 |
| - mu.add(p, epEasyPQPText).growX().wrap(); |
1235 |
| - mu.add(p, btnInstallEasyPQP).split().wrap(); |
1236 |
| - |
1237 |
| - return p; |
1238 |
| - } |
1239 |
| - |
1240 | 1152 | private JFileChooser createDiannFilechooser() {
|
1241 | 1153 | JFileChooser fc = FileChooserUtils.create("Select DIA-NN binary", "Select", false, FcMode.FILES_ONLY, true);
|
1242 | 1154 | if (OsUtils.isWindows()) {
|
|
0 commit comments