Skip to content

Commit

Permalink
Merge branch 'release/3.5.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
mikekucera committed Mar 10, 2017
2 parents a3b0e46 + 30cca33 commit 2496244
Show file tree
Hide file tree
Showing 576 changed files with 31,624 additions and 11,900 deletions.
4 changes: 2 additions & 2 deletions app-impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>impl-parent</artifactId>
<groupId>org.cytoscape</groupId>
<version>3.4.0</version>
<version>3.5.0</version>
</parent>

<properties>
Expand All @@ -14,7 +14,7 @@

<modelVersion>4.0.0</modelVersion>
<artifactId>app-impl</artifactId>
<version>3.4.0</version>
<version>3.5.0</version>

<name>Cytoscape App Impl (${project.artifactId})</name>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
import org.cytoscape.command.util.NodeList;
import org.cytoscape.command.util.RowList;
import org.cytoscape.equations.AbstractFunction;
import org.cytoscape.equations.event.EquationFunctionAddedEvent;
import org.cytoscape.equations.event.EquationFunctionRemovedEvent;
import org.cytoscape.event.CyEventHelper;
import org.cytoscape.filter.TransformerManager;
import org.cytoscape.filter.model.Transformer;
Expand Down Expand Up @@ -109,6 +111,7 @@
import org.cytoscape.work.swing.DialogTaskManager;
import org.cytoscape.work.swing.PanelTaskManager;
import org.cytoscape.work.swing.undo.SwingUndoSupport;
import org.cytoscape.work.swing.util.UserAction;
import org.cytoscape.work.undo.UndoSupport;
import org.cytoscape.work.util.BoundedDouble;

Expand Down Expand Up @@ -221,6 +224,8 @@ public class CyAppAdapterImpl implements CySwingAppAdapter {
private Transformers transformers;
private TransformerViewFactory transformerViewFactory;
private CyJobManager cyjobManager;
private EquationFunctionAddedEvent equationFunctionAddedEvent;
private EquationFunctionRemovedEvent equationFunctionRemovedEvent;

/// from core-task api
private LoadVizmapFileTaskFactory loadVizmapFileTaskFactory;
Expand Down Expand Up @@ -295,6 +300,9 @@ public class CyAppAdapterImpl implements CySwingAppAdapter {
private CommandExecutorTaskFactory commandExecutorTaskFactory;
private AvailableCommands availableCommands;

// From work-swing-api
private UserAction userAction;

private LoadTableFileTaskFactory loadAttributesFileTaskFactory;
private LoadTableURLTaskFactory loadAttributesURLTaskFactory;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,14 +247,17 @@ void initializeApps() {
for (App app: installOnRestartApps) {
try {
app.moveAppFile(this, new File(getInstalledAppsPath()));
userLogger.info("Moved app '" + app.getAppName() + "' that was marked for install on restart to the 'installed' directory.");
} catch (IOException e) {
userLogger.error("Cannot move app '" + app.getAppName() + "' that was marked for install on restart to the 'installed' directory:", e);
}
}

// Remove the install-on-restart directory after apps were moved
try {
FileUtils.deleteDirectory(new File(getInstallOnRestartAppsPath()));
} catch (IOException e) {
userLogger.warn("Could not delete the directory of apps to install on restart:", e);
}

setupAlterationMonitor();
Expand All @@ -266,18 +269,22 @@ void initializeApps() {
try {
boolean appRegistered = false;
for (App regApp : apps) {
if (regApp.heuristicEquals(app))
if (regApp.heuristicEquals(app)) {
userLogger.warn("Disabled app '" + app.getAppName() + "' in file '" + app.getAppFile().getAbsolutePath() + "' is equal to an already registered app '" + regApp.getAppName() + "' in file '" + (regApp.getAppFile() == null ? "N/A" : regApp.getAppFile().getAbsolutePath()) + "'");
appRegistered = true;
}
}
if (!appRegistered) {
apps.add(app);
app.setStatus(AppStatus.DISABLED);
} else {
// Delete the copy
userLogger.info("Trying to delete the disabled copy of app '" + app.getAppName() + "' in file '" + app.getAppFile().getAbsolutePath() + "' because another copy exists.");
FileUtils.deleteQuietly(app.getAppFile());
app.setAppFile(null);
}
} catch (Throwable e) {
userLogger.error("Error validating status of the disabled app '" + app.getAppName() + "'.", e);
}
}

Expand All @@ -286,18 +293,22 @@ void initializeApps() {
try {
boolean appRegistered = false;
for (App regApp : apps) {
if (regApp.heuristicEquals(app))
if (regApp.heuristicEquals(app)) {
userLogger.warn("Uninstalled app '" + app.getAppName() + "' in file '" + app.getAppFile().getAbsolutePath() + "' is equal to an already registered app '" + regApp.getAppName() + "' in file '" + (regApp.getAppFile() == null ? "N/A" : regApp.getAppFile().getAbsolutePath()) + "'");
appRegistered = true;
}
}
if (!appRegistered) {
apps.add(app);
app.setStatus(AppStatus.UNINSTALLED);
} else {
// Delete the copy
userLogger.info("Trying to delete the uninstalled copy of app '" + app.getAppName() + "' in file '" + app.getAppFile().getAbsolutePath() + "' because another copy exists.");
FileUtils.deleteQuietly(app.getAppFile());
app.setAppFile(null);
}
} catch (Throwable e) {
userLogger.error("Error validating status of the uninstalled app '" + app.getAppName() + "'.", e);
}
}

Expand All @@ -309,19 +320,35 @@ void initializeApps() {
for(App app: installedApps) {
boolean appRegistered = false;
for (App regApp : apps) {
if (regApp.heuristicEquals(app))
if (regApp.heuristicEquals(app)) {
userLogger.warn("Installed app '" + app.getAppName() + "' in file '" + app.getAppFile().getAbsolutePath() + "' is equal to an already registered app '" + regApp.getAppName() + "' in file '" + (regApp.getAppFile() == null ? "N/A" : regApp.getAppFile().getAbsolutePath()) + "'");
appRegistered = true;
}
}
if (!appRegistered) {
apps.add(app);
String appName = app.getAppName().toLowerCase();
App currentVersion = appsToStart.get(appName);
if(app.isCompatible(version) && (currentVersion == null ||
compareApps(currentVersion, app) > 0))
appsToStart.put(appName, app);
if(app.isCompatible(version)) {
if (currentVersion == null) {
appsToStart.put(appName, app);
}
else if (compareApps(currentVersion, app) > 0) {
userLogger.warn("Installed app '" + app.getAppName() + "' version " + app.getVersion() + " will override an older version (" + currentVersion.getVersion() + ") that was registered previously.");
appsToStart.put(appName, app);
}
else
{
userLogger.warn("Installed app '" + app.getAppName() + "' version " + app.getVersion() + " will not be started, because a newer version (" + currentVersion.getVersion() + ") was already registered.");
}
}
else {
userLogger.error("Installed app '" + app.getAppName() + "' is not compatible with the running version of Cytoscape (" + version.getVersion() + ").");
}
}
else {
// Delete the copy
userLogger.info("Trying to delete the installed copy of app '" + app.getAppName() + "' in file '" + app.getAppFile().getAbsolutePath() + "' because another copy exists.");
FileUtils.deleteQuietly(app.getAppFile());
app.setAppFile(null);
}
Expand Down Expand Up @@ -365,6 +392,7 @@ private boolean startApps(Collection<App> apps) {
App app = i.next();
try {
app.load(this);
userLogger.info("Loaded app " + app.getAppName());
} catch (AppLoadingException e) {
i.remove();
success = false;
Expand All @@ -377,6 +405,7 @@ private boolean startApps(Collection<App> apps) {
try {
app.start(this);
app.setStatus(AppStatus.INSTALLED);
userLogger.info("Started app " + app.getAppName());
} catch (AppStartupException e) {
success = false;
app.setStatus(AppStatus.FAILED_TO_START);
Expand Down Expand Up @@ -409,36 +438,48 @@ public void onFileCreate(File file) {
parsedApp = appParser
.parseApp(file);
} catch (AppParsingException e) {
userLogger.error("Could not parse app from newly discovered file '" + file.getAbsolutePath() + "' :", e);
return;
}
boolean startApp = parsedApp.isCompatible(version);

if(!startApp) {
userLogger.error("Newly discovered app '" + parsedApp.getAppName() + "' is not compatible with the running version of Cytoscape (" + version + ").");
}

App registeredApp = null;
for (App app : apps) {
if (parsedApp.heuristicEquals(app)) {
registeredApp = app;

userLogger.warn("Newly discovered app '" + parsedApp.getAppName() + "' in file '" + parsedApp.getAppFile().getAbsolutePath() + "' is equal to an already registered app '" + registeredApp.getAppName() + "' in file '" + (registeredApp.getAppFile() == null ? "N/A" : registeredApp.getAppFile().getAbsolutePath()) + "'");

// Delete old file if it was still there
File oldFile = registeredApp
.getAppFile();

if (oldFile != null && oldFile.exists() && !registeredApp
.getAppFile().equals(parsedApp
.getAppFile())) {
userLogger.info("Trying to delete the installed copy of app '" + registeredApp.getAppName() + "' in file '" + registeredApp.getAppFile().getAbsolutePath() + "' because another copy exists.");
FileUtils.deleteQuietly(oldFile);
}

// Update file reference to reflect file having been moved
registeredApp.setAppFile(file);
registeredApp.setStatus(AppStatus.INACTIVE);
}
}
else if(parsedApp.isCompatible(version) && parsedApp.getAppName().equals(app.getAppName())) {
try {
if(!app.isDetached() && app.isCompatible(version)) {
if(compareApps(parsedApp, app) > 0)
if(compareApps(parsedApp, app) > 0) {
startApp = false;
userLogger.warn("Not starting newly discovered app '" + parsedApp.getAppName() + "' because a newer version is already loaded.");
}
else {
app.unload(AppManager.this);
app.setStatus(AppStatus.INACTIVE);
userLogger.warn("Unloading app '" + app.getAppName() + "' because the newly discovered app '" + parsedApp.getAppName() + "' is a newer version.");
}
}
} catch (AppUnloadingException e) {
Expand All @@ -460,6 +501,7 @@ else if(parsedApp.isCompatible(version) && parsedApp.getAppName().equals(app.get
app.load(appManager);
app.start(appManager);
app.setStatus(AppStatus.INSTALLED);
userLogger.info("Started newly discovered app '" + app.getAppName() + "'.");
}
}
catch (AppLoadingException e) {
Expand Down Expand Up @@ -502,6 +544,7 @@ public void onFileDelete(File file) {
try {
registeredApp.unload(appManager);
registeredApp.setStatus(AppStatus.FILE_MOVED);
userLogger.info("Unloaded app '" + registeredApp.getAppName() + "', because its file is no longer available.");
}
catch (AppUnloadingException e) {
userLogger.warn("Failed to unload app " + registeredApp.getAppName(), e);
Expand Down Expand Up @@ -536,6 +579,7 @@ public void onFileDelete(File file) {
appToStart.load(appManager);
appToStart.start(appManager);
appToStart.setStatus(AppStatus.INSTALLED);
userLogger.info("Started app " + appToStart.getAppName() + " because a different version has been unloaded.");
}
catch (AppLoadingException e) {
appToStart.setStatus(AppStatus.FAILED_TO_LOAD);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,14 @@
import org.cytoscape.app.internal.ui.downloadsites.DownloadSitesManager;
import org.cytoscape.app.internal.ui.downloadsites.ManageDownloadSitesDialog;
import org.cytoscape.util.swing.FileUtil;
// import Help;
// import org.cytoscape.util.swing.HelpImpl;
import org.cytoscape.util.swing.LookAndFeelUtil;
import org.cytoscape.work.TaskManager;

import javax.swing.Box;
import javax.swing.BoxLayout;
import java.awt.Desktop;
import java.net.URI;
/*
* #%L
* Cytoscape App Impl (app-impl)
Expand Down Expand Up @@ -85,7 +90,7 @@ public AppManagerDialog(
this.downloadSitesManager = downloadSitesManager;
this.updateManager = updateManager;
this.fileUtil = fileUtil;
this.taskManager = taskManager;
this.taskManager = taskManager;
initComponents();

// Create new manage download sites dialog
Expand Down Expand Up @@ -128,7 +133,7 @@ public void actionPerformed(ActionEvent e) {
}
});

final JPanel buttonPanel = LookAndFeelUtil.createOkCancelPanel(null, closeButton);
final JPanel buttonPanel = LookAndFeelUtil.createOkCancelPanel(null, closeButton, "App_Manager");

final GroupLayout layout = new GroupLayout(getContentPane());
getContentPane().setLayout(layout);
Expand Down Expand Up @@ -185,4 +190,6 @@ public void run() {
networkErrorLabel.setVisible(false);
}
}
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public String toString(final String fmtString) {
* Retrieves article summaries from PubMed and stores them in {@code Article} instances.
*/
class PubMedParser {
static final String REQUEST_URL_BASE = "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=pubmed&id=";
static final String REQUEST_URL_BASE = "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=pubmed&id=";

/**
* Takes a sequence of PubMed IDs and returns a URL for requesting article summaries from PubMed.
Expand Down Expand Up @@ -405,4 +405,4 @@ private static void formatArticleAsHtmlDefinition(final String name, final Artic

public void cancel() {
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package org.cytoscape.app.internal.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/*
* #%L
* Cytoscape App Impl (app-impl)
Expand Down Expand Up @@ -28,13 +31,16 @@
* A class used to manage print commands for aiding in debugging
*/
public class DebugHelper {
private static final Logger sysLogger = LoggerFactory.getLogger(DebugHelper.class);

private static boolean debug = false;
// private static boolean debug = true;

public static void print(String message) {
if (debug) {
System.out.println("DebugHelper: " + message);
}
sysLogger.debug(message);
}

/**
Expand All @@ -46,5 +52,9 @@ public static void print(Object source, String message) {
if (debug) {
System.out.println("<" + source + ">: " + message);
}
if(sysLogger.isDebugEnabled())
{
sysLogger.debug("<" + source + ">: " + message);
}
}
}
4 changes: 2 additions & 2 deletions application-impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>impl-parent</artifactId>
<groupId>org.cytoscape</groupId>
<version>3.4.0</version>
<version>3.5.0</version>
</parent>

<properties>
Expand All @@ -14,7 +14,7 @@

<modelVersion>4.0.0</modelVersion>
<artifactId>application-impl</artifactId>
<version>3.4.0</version>
<version>3.5.0</version>

<name>Cytoscape Application Impl (${project.artifactId})</name>

Expand Down
Loading

0 comments on commit 2496244

Please sign in to comment.