diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/core/YoshikoInterface.java b/src/main/java/de/hhu/ba/yoshikoWrapper/core/YoshikoLoader.java similarity index 75% rename from src/main/java/de/hhu/ba/yoshikoWrapper/core/YoshikoInterface.java rename to src/main/java/de/hhu/ba/yoshikoWrapper/core/YoshikoLoader.java index 337d34e4211db1ec64fb209f22793c503e7d0000..e718bac5632df2c30e4f12b81aeb76adb3b1c3e7 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/core/YoshikoInterface.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/core/YoshikoLoader.java @@ -1,20 +1,20 @@ 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; } diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/MainPanel.java b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/MainPanel.java index 3a5ff3cf9ce328a9cc5bde8cf06571da4aac4a4e..763870777c57d436f7d6d20c040a39b27ca51a69 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/MainPanel.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/MainPanel.java @@ -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); }