Skip to content

Commit

Permalink
Merge pull request #22 from Murali-group/hli4-develop
Browse files Browse the repository at this point in the history
Refs #20: Display URL of uploaded graph
  • Loading branch information
LHuang2019 authored Jul 30, 2018
2 parents fc93f4c + 2246589 commit 85eb78a
Show file tree
Hide file tree
Showing 22 changed files with 445 additions and 110 deletions.
2 changes: 1 addition & 1 deletion CyGraphSpaceApp/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="module" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
Expand All @@ -22,7 +23,6 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="miglayout15-swing.jar" sourcepath="miglayout-src.zip"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
Expand Down
8 changes: 8 additions & 0 deletions CyGraphSpaceApp/.settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.8
2 changes: 1 addition & 1 deletion CyGraphSpaceApp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.cytoscape.graphspace</groupId>
<artifactId>CyGraphSpace</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>

<name>CyGraphSpace</name>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import org.cytoscape.model.CyNetworkFactory;
import org.cytoscape.model.CyNetworkManager;
import org.cytoscape.model.subnetwork.CyRootNetworkManager;
import org.cytoscape.graphspace.cygraphspace.internal.gui.CyGraphSpaceResultPanel;
import org.cytoscape.graphspace.cygraphspace.internal.gui.GetGraphsPanel;
import org.cytoscape.graphspace.cygraphspace.internal.gui.PostGraphToolBarComponent;
import org.cytoscape.graphspace.cygraphspace.internal.singletons.CyObjectManager;
Expand All @@ -34,60 +35,64 @@
*/
public class CyActivator extends AbstractCyActivator {

@SuppressWarnings("rawtypes")
@SuppressWarnings("rawtypes")
@Override
public void start(BundleContext context) throws Exception {
CyApplicationManager applicationManager = getService(context, CyApplicationManager.class);
public void start(BundleContext context) throws Exception {
CyApplicationManager applicationManager = getService(context, CyApplicationManager.class);

AbstractCyAction action = null;
Properties properties = null;
BundleContext bc = context;
AbstractCyAction action = null;
Properties properties = null;
BundleContext bc = context;

//register Post Graph Action
action = new CyGraphSpaceMenuAction(MessageConfig.MenuActionTitle);
properties = new Properties();
registerService(context, action, CyAction.class, properties);

//getting cytoscape services
CyApplicationConfiguration config = getService(context,CyApplicationConfiguration.class);
CySwingAppAdapter appAdapter = getService(context, CySwingAppAdapter.class);
CySwingApplication desktop = getService(bc,CySwingApplication.class);
LoadNetworkFileTaskFactory loadNetworkFileTaskFactory = getService(bc, LoadNetworkFileTaskFactory.class);
ExportNetworkTaskFactory exportNetworkTaskFactory = getService(bc, ExportNetworkTaskFactory.class);
ExportNetworkViewTaskFactory exportNetworkViewTaskFactory = getService(bc, ExportNetworkViewTaskFactory.class);
LoadVizmapFileTaskFactory loadVizmapFileTaskFactory = getService(bc, LoadVizmapFileTaskFactory.class);
ExportVizmapTaskFactory exportVizmapTaskFactory = getService(bc, ExportVizmapTaskFactory.class);
TaskManager taskManager = getService(context, DialogTaskManager.class);
final CyNetworkFactory cyNetworkFactory = getService(bc, CyNetworkFactory.class);
//getting cytoscape services
CyApplicationConfiguration config = getService(context,CyApplicationConfiguration.class);
CySwingAppAdapter appAdapter = getService(context, CySwingAppAdapter.class);
CySwingApplication desktop = getService(bc,CySwingApplication.class);
LoadNetworkFileTaskFactory loadNetworkFileTaskFactory = getService(bc, LoadNetworkFileTaskFactory.class);
ExportNetworkTaskFactory exportNetworkTaskFactory = getService(bc, ExportNetworkTaskFactory.class);
ExportNetworkViewTaskFactory exportNetworkViewTaskFactory = getService(bc, ExportNetworkViewTaskFactory.class);
LoadVizmapFileTaskFactory loadVizmapFileTaskFactory = getService(bc, LoadVizmapFileTaskFactory.class);
ExportVizmapTaskFactory exportVizmapTaskFactory = getService(bc, ExportVizmapTaskFactory.class);
TaskManager taskManager = getService(context, DialogTaskManager.class);
final CyNetworkFactory cyNetworkFactory = getService(bc, CyNetworkFactory.class);
final CyNetworkManager cyNetworkManager = getService(bc, CyNetworkManager.class);
final CyRootNetworkManager cyRootNetworkManager = getService(bc, CyRootNetworkManager.class);
//Register these with the CyObjectManager singleton.
CyObjectManager manager = CyObjectManager.INSTANCE;
File configDir = config.getAppConfigurationDirectoryLocation(CyActivator.class);
configDir.mkdirs();
//setting services to manager singleton
manager.setCyApplicationManager(applicationManager);
manager.setConfigDir(configDir);
manager.setCySwingAppAdapter(appAdapter);
manager.setCySwingApplition(desktop);
manager.setLoadNetworkFileTaskFactory(loadNetworkFileTaskFactory);
manager.setExportNetworkTaskFactory(exportNetworkTaskFactory);
manager.setExportNetworkViewTaskFactory(exportNetworkViewTaskFactory);
manager.setLoadVizmapTaskFactory(loadVizmapFileTaskFactory);
manager.setExportVizmapTaskFactory(exportVizmapTaskFactory);

//Register these with the CyObjectManager singleton.
CyObjectManager manager = CyObjectManager.INSTANCE;
File configDir = config.getAppConfigurationDirectoryLocation(CyActivator.class);
configDir.mkdirs();

//setting services to manager singleton
manager.setCyApplicationManager(applicationManager);
manager.setConfigDir(configDir);
manager.setCySwingAppAdapter(appAdapter);
manager.setCySwingApplition(desktop);
manager.setLoadNetworkFileTaskFactory(loadNetworkFileTaskFactory);
manager.setExportNetworkTaskFactory(exportNetworkTaskFactory);
manager.setExportNetworkViewTaskFactory(exportNetworkViewTaskFactory);
manager.setLoadVizmapTaskFactory(loadVizmapFileTaskFactory);
manager.setExportVizmapTaskFactory(exportVizmapTaskFactory);
manager.setCyNetworkFactory(cyNetworkFactory);
manager.setCyNetworkManager(cyNetworkManager);
manager.setCyRootNetworkManager(cyRootNetworkManager);

//registering Toolbar component
PostGraphToolBarComponent toolBarComponent = new PostGraphToolBarComponent();

//register result panel
CyGraphSpaceResultPanel resultPanel = new CyGraphSpaceResultPanel(MessageConfig.RESULT_PANEL_TITLE);
registerAllServices(context, resultPanel, new Properties());

//registering Toolbar component
PostGraphToolBarComponent toolBarComponent = new PostGraphToolBarComponent(resultPanel);
registerAllServices(bc, toolBarComponent, new Properties());


//register Post Graph Action
action = new CyGraphSpaceMenuAction(MessageConfig.MenuActionTitle, resultPanel);
properties = new Properties();
registerService(context, action, CyAction.class, properties);

//registering openBrowser for opening graph in GraphSpace
OpenBrowser openBrowser = getService(context, OpenBrowser.class);
GetGraphsPanel getGraphsPanel = new GetGraphsPanel(taskManager, openBrowser);
registerAllServices(context, getGraphsPanel, new Properties());
}
GetGraphsPanel getGraphsPanel = new GetGraphsPanel(taskManager, openBrowser);
registerAllServices(context, getGraphsPanel, new Properties());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@
import javax.swing.event.MenuEvent;

import org.cytoscape.application.swing.AbstractCyAction;
import org.cytoscape.graphspace.cygraphspace.internal.gui.CyGraphSpaceResultPanel;
import org.cytoscape.graphspace.cygraphspace.internal.singletons.CyObjectManager;

public class CyGraphSpaceMenuAction extends AbstractCyAction {

private static final long serialVersionUID = 1L;
private PostGraphMenuActionListener actionListener;

public CyGraphSpaceMenuAction(String menuTitle) {

public CyGraphSpaceMenuAction(String menuTitle, CyGraphSpaceResultPanel resultPanel) {
super(menuTitle, CyObjectManager.INSTANCE.getApplicationManager(), null, null);

// Menu under File>Export
setPreferredMenu("File.Export");

actionListener = new PostGraphMenuActionListener();
actionListener = new PostGraphMenuActionListener(resultPanel);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.awt.event.ActionListener;

import org.cytoscape.graphspace.cygraphspace.internal.gui.AuthenticationDialog;
import org.cytoscape.graphspace.cygraphspace.internal.gui.CyGraphSpaceResultPanel;
import org.cytoscape.graphspace.cygraphspace.internal.singletons.CyObjectManager;
import org.cytoscape.graphspace.cygraphspace.internal.singletons.Server;
import org.cytoscape.graphspace.cygraphspace.internal.util.MessageConfig;
Expand All @@ -22,8 +23,12 @@ public class PostGraphMenuActionListener implements ActionListener {
private static ImageIcon loading;
private static JLabel loadingLabel;
private static AuthenticationDialog dialog;
private CyGraphSpaceResultPanel resultPanel;

public PostGraphMenuActionListener(CyGraphSpaceResultPanel resultPanel) {

this.resultPanel = resultPanel;

public PostGraphMenuActionListener() {
loadingFrame = new JFrame("Checking if the graph already exists");
loading = new ImageIcon(this.getClass().getClassLoader().getResource("loading.gif"));
loadingLabel = new JLabel("", loading, JLabel.CENTER);
Expand Down Expand Up @@ -59,7 +64,7 @@ public void run() {
new Thread() {
public void run() {
try {
PostGraphExportUtils.populate(CyObjectManager.INSTANCE.getApplicationFrame(), loadingFrame);
PostGraphExportUtils.populate(CyObjectManager.INSTANCE.getApplicationFrame(), loadingFrame, resultPanel);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
Expand All @@ -71,7 +76,7 @@ public void run() {
//if there is a network but the user is not authenticated, open the login dialog for the user to log in. Once logged in, open the post graph dialog
else {
if (dialog == null)
dialog = new AuthenticationDialog(loadingFrame);
dialog = new AuthenticationDialog(loadingFrame, resultPanel);

dialog.setLocationRelativeTo(CyObjectManager.INSTANCE.getApplicationFrame());
dialog.setVisible(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,14 @@ public class AuthenticationDialog extends JDialog {
private JButton loginButton;
JButton cancelButton;
private JFrame loadingFrame;

private CyGraphSpaceResultPanel resultPanel;

public AuthenticationDialog(JFrame loadingFrame) {
public AuthenticationDialog(JFrame loadingFrame, CyGraphSpaceResultPanel resultPanel) {
super(CyObjectManager.INSTANCE.getApplicationFrame(), "Log in to the Server", ModalityType.APPLICATION_MODAL);

this.resultPanel = resultPanel;

JLabel hostLabel = new JLabel("Host");

AuthTextFieldListener textFieldListener = new AuthTextFieldListener();
Expand Down Expand Up @@ -184,7 +189,7 @@ public void run() {
new Thread() {
public void run() {
try {
PostGraphExportUtils.populate(CyObjectManager.INSTANCE.getApplicationFrame(), loadingFrame);
PostGraphExportUtils.populate(CyObjectManager.INSTANCE.getApplicationFrame(), loadingFrame, resultPanel);
} catch (Exception e) {
e.printStackTrace();
}
Expand Down
Loading

0 comments on commit 85eb78a

Please sign in to comment.