Skip to content

Commit

Permalink
Updated to working Cytoscape 3.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jstoecker committed Oct 16, 2013
1 parent ec8e47a commit 6601e11
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 36 deletions.
33 changes: 23 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<properties>
<bundle.symbolicName>edu.miami.cyto3d.cyto3d</bundle.symbolicName>
<bundle.symbolicName>edu.miami.cyto3d.cyto3d</bundle.symbolicName>
<bundle.namespace>edu.miami.cyto3d</bundle.namespace>
</properties>

Expand All @@ -11,8 +12,8 @@
<artifactId>cyto3d</artifactId>
<version>1.0.0</version>

<name>${bundle.symbolicName} [${bundle.namespace}]</name>
<name>${bundle.symbolicName} [${bundle.namespace}]</name>

<packaging>bundle</packaging>

<build>
Expand Down Expand Up @@ -71,12 +72,12 @@
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${bundle.symbolicName}</Bundle-SymbolicName>
<Bundle-SymbolicName>${bundle.symbolicName}</Bundle-SymbolicName>
<Bundle-Version>${project.version}</Bundle-Version>
<Export-Package>${bundle.namespace}</Export-Package>
<Private-Package>${bundle.namespace}.internal.*</Private-Package>
<Bundle-Activator>${bundle.namespace}.internal.CyActivator</Bundle-Activator>
</instructions>
</instructions>
</configuration>
</plugin>
</plugins>
Expand Down Expand Up @@ -113,21 +114,21 @@
<artifactId>org.osgi.core</artifactId>
<version>4.2.0</version>
</dependency>

<dependency>
<groupId>org.cytoscape</groupId>
<artifactId>service-api</artifactId>
<version>[3.1.0-SNAPSHOT,4.0)</version>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>org.cytoscape</groupId>
<artifactId>swing-application-api</artifactId>
<version>[3.1.0-SNAPSHOT,4.0)</version>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>org.cytoscape</groupId>
<artifactId>session-api</artifactId>
<version>[3.1.0-SNAPSHOT,4.0)</version>
<version>3.0.1</version>
</dependency>

<!-- Logging -->
Expand All @@ -138,6 +139,18 @@
<scope>provided</scope>
</dependency>

<!-- JOGL -->
<dependency>
<groupId>org.jogamp.gluegen</groupId>
<artifactId>gluegen-rt-main</artifactId>
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>org.jogamp.jogl</groupId>
<artifactId>jogl-all-main</artifactId>
<version>2.1.0</version>
</dependency>

</dependencies>

</project>
34 changes: 29 additions & 5 deletions src/main/java/edu/miami/cyto3d/internal/C3DApp.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,39 @@
package edu.miami.cyto3d.internal;

import javax.media.opengl.GLCapabilities;
import javax.media.opengl.GLProfile;
import javax.media.opengl.awt.GLCanvas;
import javax.swing.JDialog;
import javax.swing.JFrame;

public class C3DApp {

public static final String APP_NAME = "Cyto3D";
public static final String APP_NAME = "Cyto3D";

private final JDialog settingsDialog;
private final JDialog settingsDialog;
private final JFrame rendererFrame;

public C3DApp(JFrame mainAppFrame) {
settingsDialog = new JDialog(mainAppFrame, APP_NAME);
}
public C3DApp(JFrame mainAppFrame) {

// initialize OpenGL context
GLProfile glp = GLProfile.get(GLProfile.GL2);
GLCapabilities glc = new GLCapabilities(glp);
GLCanvas canvas = new GLCanvas(glc);

// initialize settings dialog
settingsDialog = new JDialog(mainAppFrame, APP_NAME);
settingsDialog.setSize(600, 600);
settingsDialog.setLocationRelativeTo(null);

// initialize OpenGL renderer frame
rendererFrame = new JFrame(APP_NAME);
rendererFrame.setSize(600, 600);
rendererFrame.setLocationRelativeTo(null);
rendererFrame.add(canvas);
}

public void showSettings() {
settingsDialog.setVisible(true);
rendererFrame.setVisible(true);
}
}
42 changes: 21 additions & 21 deletions src/main/java/edu/miami/cyto3d/internal/CyActivator.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,31 @@
/** Entry point for the OSGi bundle app */
public class CyActivator extends AbstractCyActivator {

private C3DApp app;
private CyApplicationManager cyApplicationManager;
private C3DApp app;
private CyApplicationManager cyApplicationManager;

@Override
public void start(BundleContext context) throws Exception {
cyApplicationManager = getService(context, CyApplicationManager.class);
@Override
public void start(BundleContext context) throws Exception {
cyApplicationManager = getService(context, CyApplicationManager.class);

CySwingApplication cySwingApplication = getService(context, CySwingApplication.class);
app = new C3DApp(cySwingApplication.getJFrame());
CySwingApplication cySwingApplication = getService(context, CySwingApplication.class);
app = new C3DApp(cySwingApplication.getJFrame());

MenuAction action = new MenuAction();
Properties properties = new Properties();
registerAllServices(context, action, properties);
}
MenuAction action = new MenuAction();
Properties properties = new Properties();
registerAllServices(context, action, properties);
}

/** Triggered when the user clicks on the menu item for the app */
private class MenuAction extends AbstractCyAction {
/** Triggered when the user clicks on the menu item for the app */
private class MenuAction extends AbstractCyAction {

public MenuAction() {
super(C3DApp.APP_NAME, cyApplicationManager, null, null);
setPreferredMenu("Apps");
}
public MenuAction() {
super(C3DApp.APP_NAME, cyApplicationManager, null, null);
setPreferredMenu("Apps");
}

public void actionPerformed(ActionEvent e) {

}
}
public void actionPerformed(ActionEvent e) {
app.showSettings();
}
}
}

0 comments on commit 6601e11

Please sign in to comment.