-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
524 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="src" path="src"/> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> | ||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> | ||
<classpathentry kind="output" path="bin"/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>MAPPBuilder</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.pde.ManifestBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.pde.SchemaBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
<nature>org.eclipse.pde.PluginNature</nature> | ||
</natures> | ||
</projectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Manifest-Version: 1.0 | ||
Bundle-ManifestVersion: 2 | ||
Bundle-Name: MAPPBuilder plugin | ||
Bundle-SymbolicName: org.pathvisio.mappbuilder | ||
Bundle-Version: 1.0.0 | ||
Bundle-Activator: org.pathvisio.mappbuilder.Activator | ||
Export-Package: org.pathvisio.mappbuilder | ||
Require-Bundle: org.pathvisio.core;bundle-version="3.0.0", | ||
org.pathvisio.desktop;bundle-version="3.0.0", | ||
org.pathvisio.gui;bundle-version="3.0.0", | ||
org.bridgedb;bundle-version="1.1.0", | ||
org.bridgedb.bio;bundle-version="1.1.0", | ||
org.pathvisio.jgoodies.forms;bundle-version="1.2.0" | ||
Import-Package: org.osgi.framework;version="1.5.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<?xml version="1.0"?> | ||
<project name="org.pathvisio.mappbuilder" default="jar" basedir="."> | ||
|
||
<property name="pathvisio.dir" value="../trunk/"/> | ||
<property name="bundle.dest" value="dist"/> | ||
|
||
<target name="prepare-jar-name"> | ||
<!-- the name of the plug-in jar uses the project name of the calling build file --> | ||
<property name="jar.name" value="${bundle.dest}/${ant.project.name}.jar"/> | ||
</target> | ||
|
||
<path id="project.class.path"> | ||
<fileset dir="${pathvisio.dir}/modules"> | ||
<include name="org.pathvisio.core.jar"/> | ||
<include name="org.pathvisio.desktop.jar"/> | ||
<include name="org.pathvisio.gui.jar"/> | ||
</fileset> | ||
<fileset dir="${pathvisio.dir}/lib"> | ||
<include name="org.bridgedb.jar"/> | ||
<include name="com.springsource.org.jdom-1.1.0.jar"/> | ||
<include name="felix.jar"/> | ||
<include name="org.pathvisio.jgoodies.forms.jar"/> | ||
</fileset> | ||
</path> | ||
|
||
<target name="prepare"> | ||
<mkdir dir="build"/> | ||
<mkdir dir="${bundle.dest}"/> | ||
<fail message="Can't find ${pathvisio.dir}/modules/org.pathvisio.core.jar, please specify the path to pathvisio with -Dpathvisio.dir=...."> | ||
<condition> | ||
<not><available file="${pathvisio.dir}/modules/org.pathvisio.core.jar"/></not> | ||
</condition> | ||
</fail> | ||
</target> | ||
|
||
<target name="clean"> | ||
<delete dir="build"/> | ||
<delete file="${jar.name}"/> | ||
</target> | ||
|
||
<target name="compile" depends="prepare,prepare-jar-name"> | ||
<echo>Compiling: ${jar.name}</echo> | ||
<javac srcdir="src" | ||
includes="**" | ||
destdir="build" | ||
debug="${debug.mode}" | ||
source="1.5"> | ||
<classpath refid="project.class.path"/> | ||
</javac> | ||
</target> | ||
|
||
<target name="jar" depends="compile"> | ||
<echo>Creating JAR: ${jar.name}</echo> | ||
<jar jarfile="${jar.name}" manifest="META-INF/MANIFEST.MF"> | ||
<fileset dir="build"> | ||
<include name="**/*"/> | ||
</fileset> | ||
</jar> | ||
</target> | ||
|
||
<target name="install" depends="jar"> | ||
<copy toDir="${bundle.dest}" flatten="true"> | ||
<path refid="project.class.path"/> | ||
</copy> | ||
</target> | ||
|
||
<target name="dist-clean" depends="clean"> | ||
<delete file="${jar.name}"/> | ||
<delete dir="${bundle.dest}"/> | ||
</target> | ||
|
||
</project> |
Binary file not shown.
41 changes: 41 additions & 0 deletions
41
org.pathvisio.mappbuilder/src/org/pathvisio/mappbuilder/Activator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// MAPPBuilder plugin for PathVisio | ||
// Copyright 2016 BiGCaT Bioinformatics | ||
// | ||
// 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.pathvisio.mappbuilder; | ||
|
||
import org.osgi.framework.BundleActivator; | ||
import org.osgi.framework.BundleContext; | ||
import org.pathvisio.desktop.plugin.Plugin; | ||
|
||
/** | ||
* MAPPBuilder activator class (OSGi) | ||
* @author mku | ||
* | ||
*/ | ||
public class Activator implements BundleActivator { | ||
|
||
private MAPPBuilder plugin; | ||
|
||
@Override | ||
public void start(BundleContext context) throws Exception { | ||
plugin = new MAPPBuilder(); | ||
context.registerService(Plugin.class.getName(), plugin, null); | ||
} | ||
|
||
@Override | ||
public void stop(BundleContext context) throws Exception { | ||
if (plugin != null) plugin.done(); | ||
} | ||
} |
70 changes: 70 additions & 0 deletions
70
org.pathvisio.mappbuilder/src/org/pathvisio/mappbuilder/MAPPBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// MAPPBuilder plugin for PathVisio | ||
// Copyright 2016 BiGCaT Bioinformatics | ||
// | ||
// 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.pathvisio.mappbuilder; | ||
|
||
import java.awt.event.ActionEvent; | ||
import javax.swing.AbstractAction; | ||
import javax.swing.JPopupMenu; | ||
|
||
import org.pathvisio.core.view.VPathwayElement; | ||
import org.pathvisio.desktop.PvDesktop; | ||
import org.pathvisio.desktop.plugin.Plugin; | ||
import org.pathvisio.gui.PathwayElementMenuListener.PathwayElementMenuHook; | ||
|
||
/** | ||
* | ||
* This class is a plug-in for a MAPPBuilder | ||
* The user can open a file who contains the list of the genes to draw them | ||
* or he can directly type the list of the genes | ||
* | ||
*/ | ||
public class MAPPBuilder implements Plugin { | ||
|
||
PvDesktop desktop; | ||
|
||
public void init(PvDesktop desktop) { | ||
this.desktop = desktop; | ||
desktop.registerMenuAction ("Plugins", mappBuilderAction); | ||
PathwayElementMenuHook mappBuilderHook = new PathwayElementMenuHook() | ||
{ | ||
private MAPPBuilderAction mapp_action = new MAPPBuilderAction(false); | ||
public void pathwayElementMenuHook(VPathwayElement e, JPopupMenu menu) { | ||
menu.add(mapp_action); | ||
} | ||
}; | ||
desktop.addPathwayElementMenuHook(mappBuilderHook); | ||
} | ||
|
||
public void done() { | ||
desktop.unregisterMenuAction("Plugins", mappBuilderAction); | ||
} | ||
|
||
private final MAPPBuilderAction mappBuilderAction = new MAPPBuilderAction(true); | ||
|
||
private class MAPPBuilderAction extends AbstractAction { | ||
|
||
private boolean n_pv; | ||
public MAPPBuilderAction(boolean b) { | ||
this.n_pv = b; | ||
putValue (NAME, "MAPP Builder"); | ||
} | ||
|
||
public void actionPerformed(ActionEvent e) { | ||
MAPPBuilderFrame mappBuilderFrame = new MAPPBuilderFrame(desktop.getFrame(), MAPPBuilder.this, n_pv); | ||
mappBuilderFrame.setVisible(true); | ||
} | ||
} | ||
} |
Oops, something went wrong.