diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/core/Core.java b/src/main/java/de/hhu/ba/yoshikoWrapper/core/Core.java index 04a3c6860b92300591092b03a47505047557fba7..6a18e92d4a6360f2d2c50101cac16432975dcb4f 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/core/Core.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/core/Core.java @@ -1,7 +1,4 @@ package de.hhu.ba.yoshikoWrapper.core; - -import java.util.HashMap; - //TODO: ADD LOGGER SYSTEM import org.cytoscape.application.CyApplicationManager; @@ -21,12 +18,14 @@ public class Core { cy = cyApplicationManager; } - public static void performYoshiko() { + public static void performYoshiko(int timeLimit) { CyNetwork currentNetwork = cy.getCurrentNetwork(); if (currentNetwork == null) { //TODO } + LibraryInterface.setTimeLimit(timeLimit); + NodeMap nodeMap = new NodeMap(currentNetwork); SWIGTYPE_p_yskInput__LibraryInput input = NetworkParser.parseNetwork(currentNetwork,nodeMap); 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 9a817bd8f4f239f80386ba4981be3b210e4deb8e..6a4a110d82c602c020dbd5ddb21bd61018bf318f 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/MainPanel.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/MainPanel.java @@ -3,26 +3,19 @@ package de.hhu.ba.yoshikoWrapper.gui; import java.awt.Component; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.util.HashMap; +import javax.swing.BoxLayout; 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 org.cytoscape.model.CyNode; - import de.hhu.ba.yoshikoWrapper.core.Core; -import de.hhu.ba.yoshikoWrapper.core.NetworkParser; -import de.hhu.ba.yoshikoWrapper.core.NodeMap; import de.hhu.ba.yoshikoWrapper.core.YoshikoLoader; -import de.hhu.ba.yoshikoWrapper.gui.TimeLimitSetter; +import de.hhu.ba.yoshikoWrapper.gui.*; import de.hhu.ba.yoshikoWrapper.swig.LibraryInterface; -import de.hhu.ba.yoshikoWrapper.swig.SWIGTYPE_p_yskInput__LibraryInput; -import de.hhu.ba.yoshikoWrapper.swig.SWIGTYPE_p_ysk__ClusterEditingSolutions; /**This class describes the Swing Panel that the user interacts with in cytoscape * @author Philipp Spohr, Aug 6, 2017 @@ -50,6 +43,8 @@ public class MainPanel extends JPanel implements CytoPanelComponent { */ public MainPanel() { + + this.setLayout(new BoxLayout(this,BoxLayout.PAGE_AXIS)); //SWING COMPONENT INITIALIZATION libStatusPanel = new LibStatusPanel(); @@ -83,7 +78,7 @@ public class MainPanel extends JPanel implements CytoPanelComponent { @Override public void actionPerformed(ActionEvent e) { if (yoshikoLoader.isLibraryLoaded()){ - Core.performYoshiko(); + Core.performYoshiko(timeLimitSetter.getTimeLimit()); } } diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/NumberInputField.java b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/NumberInputField.java index c876695ea66782ad73d82653060b4ba121c1afcc..dfd80653f442620f8b97281d03ca4b6bb166752d 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/NumberInputField.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/NumberInputField.java @@ -20,4 +20,7 @@ public class NumberInputField extends JFormattedTextField{ super(FormatHelper.getIntegerFormatter()); } + public int getTimeLimit() { + return Integer.parseInt(getText()); + } } diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/TimeLimitSetter.java b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/TimeLimitSetter.java index 7bb6cb51abe7cf825388694d20df59e019f404f1..1c8a3a83719f1c8f6744dc33f4930575286f7430 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/TimeLimitSetter.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/TimeLimitSetter.java @@ -20,6 +20,7 @@ public class TimeLimitSetter extends JPanel{ checkBox = new JCheckBox(); numberField = new NumberInputField(); numberField.setEnabled(false); //By default time limit is turned off + numberField.setSize(40, 10); checkBox.addActionListener( new ActionListener() { @@ -39,7 +40,7 @@ public class TimeLimitSetter extends JPanel{ if (checkBox.isSelected()) { return -1; } - return (int)numberField.getValue(); + return numberField.getTimeLimit(); } }