Skip to content
Snippets Groups Projects
Commit d3c61407 authored by Philipp Spohr's avatar Philipp Spohr
Browse files

finally got some c++ interaction going

parent 67a98697
Branches
Tags
No related merge requests found
package de.hhu.ba.yoshikoWrapper.core;
public class YoshikoInterface {
public class YoshikoLoader {
//SINGLETON TEMPLATE
private static YoshikoInterface instance;
private static YoshikoLoader instance;
private static boolean libraryLoaded;
public static YoshikoInterface getInstance() {
public static YoshikoLoader getInstance() {
if (instance == null){
instance = new YoshikoInterface();
instance = new YoshikoLoader();
}
return instance;
}
private YoshikoInterface() {
private YoshikoLoader() {
libraryLoaded = false;
}
......
......@@ -7,12 +7,14 @@ import java.awt.event.ActionListener;
import javax.swing.Icon;
import javax.swing.JButton;
import javax.swing.JFileChooser;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import org.cytoscape.application.swing.CytoPanelComponent;
import org.cytoscape.application.swing.CytoPanelName;
import de.hhu.ba.yoshikoWrapper.core.YoshikoInterface;
import de.hhu.ba.yoshikoWrapper.core.YoshikoLoader;
import de.hhu.ba.yoshikoWrapper.swig.LibraryInterface;
/**This class describes the Swing Panel that the user interacts with in cytoscape
* @author Philipp Spohr, Aug 6, 2017
......@@ -26,12 +28,13 @@ public class MainPanel extends JPanel implements CytoPanelComponent {
private static final long serialVersionUID = 6214827920591046457L;
//SYMBOLIC LINKS
private YoshikoInterface yoshikoInterface = YoshikoInterface.getInstance();
private YoshikoLoader yoshikoInterface = YoshikoLoader.getInstance();
private MainPanel self = this; //for lambda function references
//SWING COMPONENTS
private LibStatusPanel libStatusPanel;
private JButton searchLibButton;
private JLabel yoshikoVersionLabel;
/**
* Main constructor, creates a new Panel and intializes subcomponents
......@@ -54,11 +57,16 @@ public class MainPanel extends JPanel implements CytoPanelComponent {
if (returnVal == JFileChooser.APPROVE_OPTION) {
yoshikoInterface.loadLibrary(c.getSelectedFile().getAbsolutePath());
}
libStatusPanel.setStyle(yoshikoInterface.isLibraryLoaded());
yoshikoVersionLabel.setText(LibraryInterface.getVersionString());
}
});
this.add(searchLibButton);
yoshikoVersionLabel = new JLabel("YOSHIKO VERSION");
this.add(yoshikoVersionLabel);
this.setVisible(true);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment