Skip to content

Commit

Permalink
fix #1
Browse files Browse the repository at this point in the history
bug fix, code clean, added license header
  • Loading branch information
mkutmon committed Apr 25, 2018
1 parent ac5a446 commit 9d64416
Show file tree
Hide file tree
Showing 6 changed files with 209 additions and 258 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/bin/
/build/
/dist/
6 changes: 5 additions & 1 deletion META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: FindYourInteraction
Bundle-SymbolicName: org.pathvisio.findyourinteraction
Bundle-Version: 1.0.0
Bundle-Version: 1.0.1
Bundle-Activator: org.pathvisio.findyourinteraction.Activator
Import-Package: org.osgi.framework
Require-Bundle: org.pathvisio.desktop,
org.pathvisio.core,
org.pathvisio.gui,
org.bridgedb
Bundle-License: http://www.apache.org/licenses/LICENSE-2.0
Bundle-DocURL: https://github.com/PathVisio/FindYourInteraction
Bundle-Description: PathVisio plugin to load metabolic reactions from Rhea
Bundle-Copyright: 2016-2018 BiGCaT Bioinformatics


2 changes: 1 addition & 1 deletion build.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<project name="org.pathvisio.findyourinteraction" default="install" basedir=".">

<property name="pathvisio.dir" value="../../../trunk"/>
<property name="pathvisio.dir" value="../pathvisio"/>
<property name="bundle.dest" value="dist"/>
<property name="jar.name" value="org.pathvisio.findyourinteraction.jar"/>

Expand Down
28 changes: 14 additions & 14 deletions src/org/pathvisio/findyourinteraction/Activator.java
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
// FindYourInteraction Plugin for PathVisio,
// a tool for data visualization and analysis using Biological Pathways
// Copyright 2006-2015 BiGCaT Bioinformatics
// FindYourInteraction Plugin for PathVisio
// Find metabolic reaction from Rhea
// Copyright 2016-2018 BiGCaT, Maastricht University
//
// 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
// 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.
// 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.findyourinteraction;

/**
* @author anwesha, jonathan
* OSGI activator of the plugin
* @author anwesha, jonathan, mkutmon
*/
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
// FindYourInteraction Plugin for PathVisio
// Find metabolic reaction from Rhea
// Copyright 2016-2018 BiGCaT, Maastricht University
//
// 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.findyourinteraction;

import javax.swing.JPopupMenu;
Expand All @@ -7,41 +23,43 @@
import org.pathvisio.desktop.plugin.Plugin;
import org.pathvisio.gui.PathwayElementMenuListener.PathwayElementMenuHook;

/**
* PathVisio plugin class
* Registering menu items and actions
* @author anwesha, jonathan, mkutmon
*
*/
public class FindYourInteractionPlugin implements Plugin{
private PvDesktop desktop;
private PathwayElementMenuHook menuHook;

@Override
public void init(final PvDesktop desktop) {
// TODO Auto-generated method stub
this.desktop = desktop;
desktop.addPathwayElementMenuHook(new PathwayElementMenuHook(){
/**

menuHook = new PathwayElementMenuHook() {
@Override
public void pathwayElementMenuHook(VPathwayElement e, JPopupMenu menu) {
SearchInteractionAction showInfoAction = new SearchInteractionAction(desktop, e);
menu.add (showInfoAction);
}
};
desktop.addPathwayElementMenuHook(new PathwayElementMenuHook() {
/**
* This method is called whenever the user right-clicks
* on an element in the Pathway.
* VPathwayElement contains the object that was clicked on.
*/
@Override
public void pathwayElementMenuHook(VPathwayElement e,
JPopupMenu menu) {
// TODO Auto-generated method stub
// We instantiate an Action
SearchInteractionAction showInfoAction = new SearchInteractionAction(desktop);

// pass the clicked element to the action object
showInfoAction.setElement(e);
// desktop.getSwingEngine().getEngine().getActivePathway().get
// Insert action into the menu.
// NB: this is optional, we can choose e.g.
// to insert only when the clicked element is a certain type.
public void pathwayElementMenuHook(VPathwayElement e, JPopupMenu menu) {
SearchInteractionAction showInfoAction = new SearchInteractionAction(desktop, e);
menu.add (showInfoAction);
}
});
}

@Override
public void done() {
// TODO Auto-generated method stub
// desktop.dispose();;
desktop.getSwingEngine().getApplicationPanel().getPathwayElementMenuListener().removePathwayElementMenuHook(menuHook);
}

}
Loading

0 comments on commit 9d64416

Please sign in to comment.