From 6338f88d8dbc14ff2f7dad17a3f9c815f72d72b3 Mon Sep 17 00:00:00 2001 From: Jim Bowring Date: Thu, 11 Nov 2021 09:21:47 -0500 Subject: [PATCH 1/3] Updated Xstream and httpclient and new version --- pom.xml | 9 +- .../UPb_Redux/aliquots/UPbReduxAliquot.java | 2 - .../UPb_Redux/fractions/AnalysisFraction.java | 2 - .../UPbReduxFractions/UPbFraction.java | 2 - .../MineralStandardModel.java | 2 - .../earthtime/UPb_Redux/pbBlanks/PbBlank.java | 2 - .../samples/SESARSampleMetadata.java | 2 - .../UPb_Redux/samples/SampleMetaData.java | 2 - .../earthtime/UPb_Redux/tracers/Tracer.java | 714 +++++++----------- .../UPb_Redux/valueModels/ValueModel.java | 2 - .../UTh_Redux/aliquots/UThReduxAliquot.java | 2 - .../archivingTools/forSESAR/SesarSample.java | 2 - .../physicalConstants/PhysicalConstants.java | 2 - .../AbstractRatiosDataModel.java | 2 - .../reports/ReportSettingsInterface.java | 2 - 15 files changed, 275 insertions(+), 474 deletions(-) diff --git a/pom.xml b/pom.xml index 2828425a..9276d00e 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ true - JDK_1.8 diff --git a/pom.xml b/pom.xml index 9276d00e..ce5b610e 100644 --- a/pom.xml +++ b/pom.xml @@ -264,6 +264,33 @@ javaGeom 0.11.1 + + + + com.sun.activation + javax.activation + 1.2.0 + + + + javax.xml.bind + jaxb-api + 2.3.1 + + + + com.sun.xml.bind + jaxb-core + 3.0.2 + + + + com.sun.xml.bind + jaxb-impl + 2.3.1 + + + @@ -271,7 +298,7 @@ org.apache.maven.plugins maven-surefire-plugin - 2.20.1 + 3.0.0-M5 false diff --git a/src/main/java/org/earthtime/ETRedux.java b/src/main/java/org/earthtime/ETRedux.java index 32083940..318df65e 100644 --- a/src/main/java/org/earthtime/ETRedux.java +++ b/src/main/java/org/earthtime/ETRedux.java @@ -88,7 +88,7 @@ public ETRedux(File reduxFile) //throws3 IOException, InvalidPreferencesFormatEx if (MAC_OS_X) { //http://www.developer.com/java/other/article.php/1577161 - System.setProperty("apple.laf.useScreenMenuBar", "true"); + System.setProperty("apple.laf.useScreenMenuBar", "false"); } // removed feb 2014 to support linux diff --git a/src/main/java/org/earthtime/ETReduxFrame.java b/src/main/java/org/earthtime/ETReduxFrame.java index 7a1be7ae..1f14f183 100644 --- a/src/main/java/org/earthtime/ETReduxFrame.java +++ b/src/main/java/org/earthtime/ETReduxFrame.java @@ -111,7 +111,6 @@ import org.earthtime.UPb_Redux.utilities.BrowserControl; import org.earthtime.UPb_Redux.utilities.CustomIcon; import org.earthtime.UPb_Redux.utilities.ETSerializer; -import org.earthtime.UPb_Redux.utilities.MacOSAboutHandler; import org.earthtime.plots.evolution.TopsoilEvolutionPlot; import org.earthtime.XMLExceptions.BadOrMissingXMLSchemaException; import org.earthtime.aliquots.AliquotInterface; @@ -352,7 +351,7 @@ public ETReduxFrame( MAC_OS_X = lcOSName.startsWith("mac os x"); if (MAC_OS_X) { - new MacOSAboutHandler(this); +// new MacOSAboutHandler(this); } /** diff --git a/src/main/java/org/earthtime/UPb_Redux/utilities/MacOSAboutHandler.java b/src/main/java/org/earthtime/UPb_Redux/utilities/MacOSAboutHandler.java deleted file mode 100644 index 7aea9b7c..00000000 --- a/src/main/java/org/earthtime/UPb_Redux/utilities/MacOSAboutHandler.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * MacOSAboutHandler.java - * - * Created on April 28, 2007, 7:50 AM - * - * - * Copyright 2006-2018 James F. Bowring, CIRDLES.org, and Earth-Time.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.earthtime.UPb_Redux.utilities; - -import com.apple.eawt.Application; -import com.apple.eawt.ApplicationAdapter; -import com.apple.eawt.ApplicationEvent; -import java.awt.Component; -import javax.swing.AbstractButton; -import javax.swing.JFrame; -import org.earthtime.ETReduxFrame; -import org.earthtime.dialogs.AboutBox; -import org.earthtime.dialogs.PreferencesEditorDialog; - -//http://www.java2s.com/ExampleCode/Development-Class/MacOSApplicationAdapter.htm - -// http://developer.apple.com/documentation/Java/Reference/1.4.2/appledoc/api/com/apple/eawt/Application.html - -/** - * - * @author samuelbowring - */ -public class MacOSAboutHandler extends Application { - - JFrame parent; - //ShutdownHandler shutter; - - /** - * - * @param theParent - */ - public MacOSAboutHandler(JFrame theParent) { - parent = theParent; - - addApplicationListener(new AboutBoxHandler()); - - setEnabledPreferencesMenu(true); - addPreferencesMenuItem(); - } - - class AboutBoxHandler extends ApplicationAdapter { - - @Override - public void handleAbout(ApplicationEvent event) { - AboutBox myBox = new AboutBox(parent, true); - //myBox.setSize(290, 310); - myBox.setVisible(true); - - event.setHandled(true); - } - - @Override - public void handlePreferences(ApplicationEvent event) { - PreferencesEditorDialog myPrefs = - new PreferencesEditorDialog( - parent, - true, - ((ETReduxFrame)parent).getMyState().getReduxPreferences()); - myPrefs.setSize(375, 540); - myPrefs.setVisible(true); - - ((ETReduxFrame)parent) - .getTheSample() - .setFractionDataOverriddenOnImport( - myPrefs.getReduxPreferences().isFractionDataOverriddenOnImport()); - - event.setHandled(true); - } - - /** This is called when the user does Application->Quit */ - @Override - public void handleQuit(ApplicationEvent event) { - // TODO this should not be hardcoded --> look up by menuitem name - - Component[] sampleFile = parent.getJMenuBar().getMenu(0).getMenuComponents(); - for (Component sampleFile1 : sampleFile) { - if (sampleFile1.getClass().getName().equalsIgnoreCase("javax.swing.JMenuItem")) { - if (((AbstractButton) sampleFile1).getText().equalsIgnoreCase("Exit")) { - ((AbstractButton) sampleFile1).doClick(); - event.setHandled(true); - } - } - } - - } - } -} \ No newline at end of file diff --git a/src/main/java/org/earthtime/archivingTools/forSESAR/SesarSampleManager.form b/src/main/java/org/earthtime/archivingTools/forSESAR/SesarSampleManager.form index 2f65c18f..5c138acd 100644 --- a/src/main/java/org/earthtime/archivingTools/forSESAR/SesarSampleManager.form +++ b/src/main/java/org/earthtime/archivingTools/forSESAR/SesarSampleManager.form @@ -37,8 +37,8 @@ - - + + @@ -91,8 +91,8 @@ - - + + diff --git a/src/main/java/org/earthtime/archivingTools/forSESAR/SesarSampleManager.java b/src/main/java/org/earthtime/archivingTools/forSESAR/SesarSampleManager.java index 2f40403f..34bb1ac1 100644 --- a/src/main/java/org/earthtime/archivingTools/forSESAR/SesarSampleManager.java +++ b/src/main/java/org/earthtime/archivingTools/forSESAR/SesarSampleManager.java @@ -337,7 +337,7 @@ private void initComponents() { getContentPane().setLayout(null); buttonBar_panel.setBackground(new java.awt.Color(235, 255, 255)); - buttonBar_panel.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED)); + buttonBar_panel.setBorder(javax.swing.BorderFactory.createLineBorder(null)); buttonBar_panel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); close_button.setBackground(new java.awt.Color(204, 204, 204)); @@ -357,7 +357,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { buttonBar_panel.setBounds(0, 300, 450, 28); sesarSampleDetailsLayeredPane.setBackground(new java.awt.Color(255, 255, 255)); - sesarSampleDetailsLayeredPane.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED)); + sesarSampleDetailsLayeredPane.setBorder(javax.swing.BorderFactory.createLineBorder(null)); sesarSampleDetailsLayeredPane.setOpaque(true); getContentPane().add(sesarSampleDetailsLayeredPane); sesarSampleDetailsLayeredPane.setBounds(0, 0, 450, 300); diff --git a/src/main/java/org/earthtime/dialogs/AboutBox.form b/src/main/java/org/earthtime/dialogs/AboutBox.form index c4a54c15..28b200fe 100644 --- a/src/main/java/org/earthtime/dialogs/AboutBox.form +++ b/src/main/java/org/earthtime/dialogs/AboutBox.form @@ -86,7 +86,7 @@ - + @@ -124,7 +124,7 @@ - + diff --git a/src/main/java/org/earthtime/dialogs/AboutBox.java b/src/main/java/org/earthtime/dialogs/AboutBox.java index 88b46b73..9366ecbe 100644 --- a/src/main/java/org/earthtime/dialogs/AboutBox.java +++ b/src/main/java/org/earthtime/dialogs/AboutBox.java @@ -142,7 +142,7 @@ private void initComponents() { jLabel4.setFont(new java.awt.Font("Helvetica", 1, 12)); // NOI18N jLabel4.setForeground(new java.awt.Color(255, 255, 255)); jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); - jLabel4.setText(" Copyright 2006-2017 James F. Bowring and www.Earth-Time.org

Licensed under the Apache License, Version 2.0 (the \"License\");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at



Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an \"AS IS\" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied.

See the License for the specific language governing permissions and
limitations under the License. "); + jLabel4.setText(" Copyright 2006-2022 James F. Bowring and www.Earth-Time.org

Licensed under the Apache License, Version 2.0 (the \"License\");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at



Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an \"AS IS\" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied.

See the License for the specific language governing permissions and
limitations under the License. "); jPanel1.add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(12, 208, 415, 225)); releaseDate_text.setFont(new java.awt.Font("Helvetica", 3, 14)); // NOI18N @@ -156,7 +156,7 @@ private void initComponents() { jLabel1.setFont(new java.awt.Font("Helvetica", 1, 12)); // NOI18N jLabel1.setForeground(new java.awt.Color(255, 255, 255)); jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); - jLabel1.setText("Funding:

Development of ET_Redux is currently supported by NSF Award #0930223: Collaborative Research: Analytical Techniques and Software: Development of Cyber Infrastructure to Support Laser-Ablation ICP Mass Spectrometry

Development is also supported by the College of Charleston Department of Computer Science through its Cyber Infrastructure Research and Development Lab for the Earth Sciences (CIRDLES)."); + jLabel1.setText("Funding:

Development of ET_Redux is currently supported by NSF Award #0930223: Collaborative Research: Analytical Techniques and Software: Development of Cyber Infrastructure to Support Laser-Ablation ICP Mass Spectrometry

Development is also supported by the College of Charleston Department of Computer Science through its Cyber Infrastructure Research and Development Lab for the Earth Sciences (CIRDLES.org)."); jPanel1.add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(41, 439, 359, -1)); org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane()); From 9fb4754b3296d08cfc69b0c20518d47bd9c3a9df Mon Sep 17 00:00:00 2001 From: Jim Bowring Date: Thu, 11 Nov 2021 14:33:32 -0500 Subject: [PATCH 3/3] updated open screen to provide for github issue creator --- src/main/java/org/earthtime/ETReduxFrame.form | 14 ++- src/main/java/org/earthtime/ETReduxFrame.java | 92 ++++++++++++++----- .../UPb_Redux/utilities/BrowserControl.java | 60 +++++++----- 3 files changed, 115 insertions(+), 51 deletions(-) diff --git a/src/main/java/org/earthtime/ETReduxFrame.form b/src/main/java/org/earthtime/ETReduxFrame.form index 3a1eef3f..bd9395a2 100644 --- a/src/main/java/org/earthtime/ETReduxFrame.form +++ b/src/main/java/org/earthtime/ETReduxFrame.form @@ -913,8 +913,8 @@ - + @@ -952,6 +952,14 @@ + + + + + + + + @@ -1009,8 +1017,8 @@ - - + + diff --git a/src/main/java/org/earthtime/ETReduxFrame.java b/src/main/java/org/earthtime/ETReduxFrame.java index 1f14f183..c0b35458 100644 --- a/src/main/java/org/earthtime/ETReduxFrame.java +++ b/src/main/java/org/earthtime/ETReduxFrame.java @@ -109,6 +109,7 @@ import org.earthtime.UPb_Redux.user.ReduxPersistentState; import org.earthtime.UPb_Redux.utilities.AnnouncementPane; import org.earthtime.UPb_Redux.utilities.BrowserControl; +import static org.earthtime.UPb_Redux.utilities.BrowserControl.urlEncode; import org.earthtime.UPb_Redux.utilities.CustomIcon; import org.earthtime.UPb_Redux.utilities.ETSerializer; import org.earthtime.plots.evolution.TopsoilEvolutionPlot; @@ -405,10 +406,16 @@ private void changeContentOfTopPanel(ReduxConstants.TOP_PANEL_CONTENTS contents) visitCIRDLESbutton.setBounds(FRAME_WIDTH / 2 - 175, 130, 350, 25); visitCIRDLESbutton.addActionListener(new ActionListenerForGotoCirdles()); announcementPane.add(visitCIRDLESbutton); + + JButton gitubIssuebutton = new ET_JButton("Create an Issue at GitHub.com"); + gitubIssuebutton.setFont(ReduxConstants.sansSerif_12_Bold); + gitubIssuebutton.setBounds(FRAME_WIDTH / 2 - 175, 160, 350, 25); + gitubIssuebutton.addActionListener(new ActionListenerForCreateIssueAtGithub()); + announcementPane.add(gitubIssuebutton); JTextArea announce = new JTextArea(// "ANNOUNCEMENT: We are looking forward to a productive 2016. "// - + "ET_Redux, for EARTHTIME Redux, will complete LA-CIP MS functionality for Laserchronbin preparation for additional isotope systems, such as U-series. "// + + "ET_Redux, for EARTHTIME Redux, will complete LA-CIP MS functionality for Laserchron in preparation for additional isotope systems, such as U-series. "// + "We are moving the project to a GitHub repository in the near future to make collaboration easier and more transparent. " + "We are seeking a new logo for ET_Redux and invite your submissions."); announce.setFont(ReduxConstants.sansSerif_12_Bold); @@ -461,6 +468,17 @@ public void actionPerformed(ActionEvent e) { BrowserControl.displayURL("https://github.com/CIRDLES/ET_Redux");// 25 Mar 2015 updated https://cirdles.org"); } } + + private static class ActionListenerForCreateIssueAtGithub implements ActionListener { + + public ActionListenerForCreateIssueAtGithub() { + } + + @Override + public void actionPerformed(ActionEvent e) { + contributeIssueOnGitHubAction(); + } + } // serialize to persistent state /** @@ -1906,6 +1924,20 @@ public void produceExcelReport(boolean isNumeric) { ExcelResultsTable.produceExcelResultsTable(// theSample.getSampleName(), reportFractions, isNumeric); } + + public static void contributeIssueOnGitHubAction() { + String version = "ET_Redux Version: " + ETRedux.VERSION; + String javaVersion = "Java Version: " + System.getProperties().getProperty("java.version"); + String operatingSystem = "OS: " + System.getProperties().getProperty("os.name") + " " + System.getProperties().getProperty("os.version"); + + StringBuilder issueBody = new StringBuilder(); + issueBody.append(urlEncode(version + "\n")); + issueBody.append(urlEncode(javaVersion + "\n")); + issueBody.append(urlEncode(operatingSystem + "\n")); + issueBody.append(urlEncode("\nIssue details:\n")); + + BrowserControl.displayURL("https://github.com/CIRDLES/ET_Redux/issues/new?body=" + issueBody); + } /** * @@ -2160,6 +2192,7 @@ private void initComponents() { changeLogMenuItem = new javax.swing.JMenuItem(); aboutMenuItem = new javax.swing.JMenuItem(); credits_menuItem = new javax.swing.JMenuItem(); + createGithubIssue = new javax.swing.JMenuItem(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("EARTHTIME Redux"); @@ -2177,7 +2210,7 @@ public void windowClosing(java.awt.event.WindowEvent evt) { }); buttonBar_panel.setBackground(new java.awt.Color(235, 255, 255)); - buttonBar_panel.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED)); + buttonBar_panel.setBorder(javax.swing.BorderFactory.createLineBorder(null)); buttonBar_panel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); saveAndQuit_button.setBackground(new java.awt.Color(204, 204, 204)); @@ -2382,12 +2415,12 @@ public void componentResized(java.awt.event.ComponentEvent evt) { project_menu.setText("Project"); project_menu.addMenuListener(new javax.swing.event.MenuListener() { - public void menuSelected(javax.swing.event.MenuEvent evt) { - project_menuMenuSelected(evt); + public void menuCanceled(javax.swing.event.MenuEvent evt) { } public void menuDeselected(javax.swing.event.MenuEvent evt) { } - public void menuCanceled(javax.swing.event.MenuEvent evt) { + public void menuSelected(javax.swing.event.MenuEvent evt) { + project_menuMenuSelected(evt); } }); @@ -2580,13 +2613,13 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { sampleFileMenu.setToolTipText("UPb Redux Sample files are saved as [sample name].redux."); sampleFileMenu.setActionCommand("Redux File"); sampleFileMenu.addMenuListener(new javax.swing.event.MenuListener() { - public void menuSelected(javax.swing.event.MenuEvent evt) { - sampleFileMenuMenuSelected(evt); + public void menuCanceled(javax.swing.event.MenuEvent evt) { } public void menuDeselected(javax.swing.event.MenuEvent evt) { sampleFileMenuMenuDeselected(evt); } - public void menuCanceled(javax.swing.event.MenuEvent evt) { + public void menuSelected(javax.swing.event.MenuEvent evt) { + sampleFileMenuMenuSelected(evt); } }); sampleFileMenu.addActionListener(new java.awt.event.ActionListener() { @@ -2783,12 +2816,12 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { labDataMenu.setText("Lab Data"); labDataMenu.addMenuListener(new javax.swing.event.MenuListener() { - public void menuSelected(javax.swing.event.MenuEvent evt) { + public void menuCanceled(javax.swing.event.MenuEvent evt) { } public void menuDeselected(javax.swing.event.MenuEvent evt) { labDataMenuMenuDeselected(evt); } - public void menuCanceled(javax.swing.event.MenuEvent evt) { + public void menuSelected(javax.swing.event.MenuEvent evt) { } }); @@ -2900,12 +2933,12 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { reportMenu.setText("Reports"); reportMenu.addMenuListener(new javax.swing.event.MenuListener() { - public void menuSelected(javax.swing.event.MenuEvent evt) { + public void menuCanceled(javax.swing.event.MenuEvent evt) { } public void menuDeselected(javax.swing.event.MenuEvent evt) { reportMenuMenuDeselected(evt); } - public void menuCanceled(javax.swing.event.MenuEvent evt) { + public void menuSelected(javax.swing.event.MenuEvent evt) { } }); @@ -3030,12 +3063,12 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { referencesMenu.setText("References"); referencesMenu.addMenuListener(new javax.swing.event.MenuListener() { - public void menuSelected(javax.swing.event.MenuEvent evt) { + public void menuCanceled(javax.swing.event.MenuEvent evt) { } public void menuDeselected(javax.swing.event.MenuEvent evt) { referencesMenuMenuDeselected(evt); } - public void menuCanceled(javax.swing.event.MenuEvent evt) { + public void menuSelected(javax.swing.event.MenuEvent evt) { } }); @@ -3085,12 +3118,12 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { earthTimeWebSiteMenu.setText("Web Resources"); earthTimeWebSiteMenu.addMenuListener(new javax.swing.event.MenuListener() { - public void menuSelected(javax.swing.event.MenuEvent evt) { + public void menuCanceled(javax.swing.event.MenuEvent evt) { } public void menuDeselected(javax.swing.event.MenuEvent evt) { earthTimeWebSiteMenuMenuDeselected(evt); } - public void menuCanceled(javax.swing.event.MenuEvent evt) { + public void menuSelected(javax.swing.event.MenuEvent evt) { } }); @@ -3221,18 +3254,18 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { mainMenuBar.add(toolsMenu); helpMenu.setText("Help"); - helpMenu.addMouseListener(new java.awt.event.MouseAdapter() { - public void mouseClicked(java.awt.event.MouseEvent evt) { - helpMenuMouseClicked(evt); - } - }); helpMenu.addMenuListener(new javax.swing.event.MenuListener() { - public void menuSelected(javax.swing.event.MenuEvent evt) { + public void menuCanceled(javax.swing.event.MenuEvent evt) { } public void menuDeselected(javax.swing.event.MenuEvent evt) { helpMenuMenuDeselected(evt); } - public void menuCanceled(javax.swing.event.MenuEvent evt) { + public void menuSelected(javax.swing.event.MenuEvent evt) { + } + }); + helpMenu.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + helpMenuMouseClicked(evt); } }); @@ -3269,6 +3302,14 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { }); helpMenu.add(credits_menuItem); + createGithubIssue.setText("Create Github Issue"); + createGithubIssue.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + createGithubIssueActionPerformed(evt); + } + }); + helpMenu.add(createGithubIssue); + mainMenuBar.add(helpMenu); setJMenuBar(mainMenuBar); @@ -4499,6 +4540,10 @@ private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FI } }//GEN-LAST:event_jMenuItem1ActionPerformed + private void createGithubIssueActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_createGithubIssueActionPerformed + contributeIssueOnGitHubAction(); + }//GEN-LAST:event_createGithubIssueActionPerformed + private void helpMenuItemActionPerformed(java.awt.event.ActionEvent evt) { BrowserControl.displayURL("http://cirdles.org/projects/et_redux/"); } @@ -4521,6 +4566,7 @@ private void helpMenuItemActionPerformed(java.awt.event.ActionEvent evt) { private javax.swing.JMenuItem changeLogMenuItem; private javax.swing.JMenuItem closeProjectFile_menuItem; private javax.swing.JMenuItem closeSampleFile; + private javax.swing.JMenuItem createGithubIssue; private javax.swing.JMenuItem credits_menuItem; private javax.swing.JMenuItem customizeSampleMetadata_menuItem; private javax.swing.JMenuItem deSelectAllFractions_menuItem; diff --git a/src/main/java/org/earthtime/UPb_Redux/utilities/BrowserControl.java b/src/main/java/org/earthtime/UPb_Redux/utilities/BrowserControl.java index a13605c5..f02064e6 100644 --- a/src/main/java/org/earthtime/UPb_Redux/utilities/BrowserControl.java +++ b/src/main/java/org/earthtime/UPb_Redux/utilities/BrowserControl.java @@ -21,6 +21,8 @@ package org.earthtime.UPb_Redux.utilities; import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; /** * @@ -28,34 +30,33 @@ * * * A simple, static class to display a URL in the system browser. - - * - * Under Unix, the system browser is hard-coded to be 'netscape'. - * Netscape must be in your PATH for this to work. This has been - * tested with the following platforms: AIX, HP-UX and Solaris. - - * - * Under Windows, this will bring up the default browser under windows, - * usually either Netscape or Microsoft IE. The default browser is - * determined by the OS. This has been tested under Windows 95/98/NT. - - + * + * Under Unix, the system browser is hard-coded to be 'netscape'. Netscape must + * be in your PATH for this to work. This has been tested with the following + * platforms: AIX, HP-UX and Solaris. + * + * + * + * Under Windows, this will bring up the default browser under windows, usually + * either Netscape or Microsoft IE. The default browser is determined by the OS. + * This has been tested under Windows 95/98/NT. + * + * * * Examples: - - * -BrowserControl.displayURL("http://www.javaworld.com") * -BrowserControl.displayURL("file://c:\\docs\\index.html") * -BrowserContorl.displayURL("file:///user/joe/index.html"); + * BrowserControl.displayURL("http://www.javaworld.com") * - - * Note - you must include the url type -- either "http://" or - * "file://". + * BrowserControl.displayURL("file://c:\\docs\\index.html") + * + * BrowserContorl.displayURL("file:///user/joe/index.html"); + * + * + * Note - you must include the url type -- either "http://" or "file://". */ public class BrowserControl { // Used to identify the windows platform. @@ -72,7 +73,7 @@ public class BrowserControl { private static final String MAC_ID = "mac os x"; /** - * + * * @param url */ public static void displayURL(String url) { @@ -107,8 +108,8 @@ public static void displayURL(String url) { } /** - * Try to determine whether this application is running under Windows - * or some other platform by examing the "os.name" property. + * Try to determine whether this application is running under Windows or + * some other platform by examing the "os.name" property. * * @return true if this application is running under a Windows OS */ @@ -123,7 +124,7 @@ public static boolean isWindowsPlatform() { } /** - * + * * @return */ public static boolean isMacOS() { @@ -138,9 +139,18 @@ public static boolean isMacOS() { /** * Simple example. - * @param args + * + * @param args */ public static void main(String[] args) { displayURL("http://www.javaworld.com"); } + + public static String urlEncode(String text) { + try { + return URLEncoder.encode(text, "UTF-8"); + } catch (UnsupportedEncodingException ex) { + throw new RuntimeException(ex); + } + } }