Skip to content

Commit

Permalink
Updated to run on Java 8, 11, 17. (#204)
Browse files Browse the repository at this point in the history
* Updated Xstream and httpclient and new version

* Upgraded to run on Java 8,11, and 17

* updated open screen to provide for github issue creator
  • Loading branch information
bowring authored Nov 11, 2021
1 parent bdaf964 commit ca80dcd
Show file tree
Hide file tree
Showing 25 changed files with 430 additions and 646 deletions.
1 change: 0 additions & 1 deletion nb-configuration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@ That way multiple projects can share the same settings (useful for formatting ru
Any value defined here will override the pom.xml file value but is only applicable to the current project.
-->
<org-netbeans-modules-javascript2-requirejs.enabled>true</org-netbeans-modules-javascript2-requirejs.enabled>
<netbeans.hint.jdkPlatform>JDK_1.8</netbeans.hint.jdkPlatform>
</properties>
</project-shared-configuration>
38 changes: 33 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!--/*
* pom.xml
*
* Copyright 2006-2019 James F. Bowring, CIRDLES.org, and Earth-Time.org
* Copyright 2006-2022 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.
Expand All @@ -21,7 +21,7 @@
<groupId>org.cirdles</groupId>
<artifactId>ET_Redux</artifactId>
<name>ET_Redux</name>
<version>3.6.93</version>
<version>3.7.0</version>
<description>Successor to U-Pb_Redux</description>
<url>https://cirdles.org</url>
<inceptionYear>2006</inceptionYear>
Expand Down Expand Up @@ -119,7 +119,7 @@
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>1.4.16</version>
<version>[1.4.18,)</version>
</dependency>
<dependency>
<groupId>javax.help</groupId>
Expand Down Expand Up @@ -203,7 +203,7 @@
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.4</version>
<version>[4.5.13,)</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
Expand Down Expand Up @@ -264,14 +264,41 @@
<artifactId>javaGeom</artifactId>
<version>0.11.1</version>
</dependency>

<!-- https://mvnrepository.com/artifact/com.sun.activation/javax.activation -->
<dependency>
<groupId>com.sun.activation</groupId>
<artifactId>javax.activation</artifactId>
<version>1.2.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.xml.bind/jaxb-api -->
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.sun.xml.bind/jaxb-core -->
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>3.0.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.sun.xml.bind/jaxb-impl -->
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.3.1</version>
</dependency>



</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20.1</version>
<version>3.0.0-M5</version>

<configuration>
<skipTests>false</skipTests>
Expand All @@ -290,6 +317,7 @@
<configuration>
<source>1.8</source>
<target>1.8</target>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/earthtime/ETRedux.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 11 additions & 3 deletions src/main/java/org/earthtime/ETReduxFrame.form
Original file line number Diff line number Diff line change
Expand Up @@ -913,8 +913,8 @@
<Property name="text" type="java.lang.String" value="Help"/>
</Properties>
<Events>
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="helpMenuMouseClicked"/>
<EventHandler event="menuDeselected" listener="javax.swing.event.MenuListener" parameters="javax.swing.event.MenuEvent" handler="helpMenuMenuDeselected"/>
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="helpMenuMouseClicked"/>
</Events>
<SubComponents>
<MenuItem class="javax.swing.JMenuItem" name="helpMenuItem">
Expand Down Expand Up @@ -952,6 +952,14 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="credits_menuItemActionPerformed"/>
</Events>
</MenuItem>
<MenuItem class="javax.swing.JMenuItem" name="createGithubIssue">
<Properties>
<Property name="text" type="java.lang.String" value="Create Github Issue"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="createGithubIssueActionPerformed"/>
</Events>
</MenuItem>
</SubComponents>
</Menu>
</SubComponents>
Expand Down Expand Up @@ -1009,8 +1017,8 @@
<Color blue="ff" green="ff" red="eb" type="rgb"/>
</Property>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.BevelBorderInfo">
<BevelBorder bevelType="1"/>
<Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo">
<LineBorder/>
</Border>
</Property>
</Properties>
Expand Down
95 changes: 70 additions & 25 deletions src/main/java/org/earthtime/ETReduxFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@
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.UPb_Redux.utilities.MacOSAboutHandler;
import org.earthtime.plots.evolution.TopsoilEvolutionPlot;
import org.earthtime.XMLExceptions.BadOrMissingXMLSchemaException;
import org.earthtime.aliquots.AliquotInterface;
Expand Down Expand Up @@ -352,7 +352,7 @@ public ETReduxFrame(
MAC_OS_X = lcOSName.startsWith("mac os x");

if (MAC_OS_X) {
new MacOSAboutHandler(this);
// new MacOSAboutHandler(this);
}

/**
Expand Down Expand Up @@ -406,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);
Expand Down Expand Up @@ -462,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
/**
Expand Down Expand Up @@ -1907,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);
}

/**
*
Expand Down Expand Up @@ -2161,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");
Expand All @@ -2178,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));
Expand Down Expand Up @@ -2383,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);
}
});

Expand Down Expand Up @@ -2581,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() {
Expand Down Expand Up @@ -2784,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) {
}
});

Expand Down Expand Up @@ -2901,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) {
}
});

Expand Down Expand Up @@ -3031,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) {
}
});

Expand Down Expand Up @@ -3086,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) {
}
});

Expand Down Expand Up @@ -3222,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);
}
});

Expand Down Expand Up @@ -3270,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);
Expand Down Expand Up @@ -4500,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/");
}
Expand All @@ -4522,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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -540,8 +540,6 @@ public XStream getXStreamReader() {

customizeXstream(xstream);

// http://x-stream.github.io/security.html
XStream.setupDefaultSecurity(xstream);
// clear out existing permissions and set own ones
xstream.addPermission(NoTypePermission.NONE);
// allow some basics
Expand Down
Loading

0 comments on commit ca80dcd

Please sign in to comment.