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

minor stuff, codestyle

parent 3cfe5eaf
No related branches found
No related tags found
No related merge requests found
...@@ -35,11 +35,18 @@ import org.cytoscape.work.util.ListSingleSelection; ...@@ -35,11 +35,18 @@ import org.cytoscape.work.util.ListSingleSelection;
public class ParameterSet implements TunableValidator public class ParameterSet implements TunableValidator
{ {
//GLOBAL ACCESSIBLE DEFAULT VALUES FOR REFERENCE
public static final int DEFAULT_VALUE_TIME_LIMIT = -1;
public static final int DEFAULT_VALUE_TIME_LIMIT_IF_USED = 30;
public static final double DEFAULT_INSERTION_COST = -1.0;
public static final double DEFAULT_DELETION_COST = 1.0;
@Tunable(description="Network to analyze for clusters", context="nogui") @Tunable(description="Network to analyze for clusters", context="nogui")
public CyNetwork net = CyCore.cy.getCurrentNetwork(); public CyNetwork net = CyCore.cy.getCurrentNetwork();
@Tunable(description="Time Limit for the ILP mode", context="nogui") @Tunable(description="Time Limit for the ILP mode", context="nogui")
public int timeLimit = -1; public int timeLimit = DEFAULT_VALUE_TIME_LIMIT;
//COLUMN-MAPPINGS //COLUMN-MAPPINGS
...@@ -51,9 +58,9 @@ public class ParameterSet implements TunableValidator ...@@ -51,9 +58,9 @@ public class ParameterSet implements TunableValidator
public ListSingleSelection<CyColumn> forbiddenColumn = null; public ListSingleSelection<CyColumn> forbiddenColumn = null;
@Tunable(description="The default insertion cost that is to be used for non-existing edges",context="nogui") @Tunable(description="The default insertion cost that is to be used for non-existing edges",context="nogui")
public double defaultInsertionCost = -1; public double defaultInsertionCost = DEFAULT_INSERTION_COST;
@Tunable(description="The default deletion cost that is to be used for edges without an associated weight",context="nogui") @Tunable(description="The default deletion cost that is to be used for edges without an associated weight",context="nogui")
public double defaultDeletionCost = 1; public double defaultDeletionCost = DEFAULT_DELETION_COST;
@Tunable(description="A bitmask representing which reduction rules should be used",context="nogui") @Tunable(description="A bitmask representing which reduction rules should be used",context="nogui")
public String reductionRulesBitMask = "000000"; public String reductionRulesBitMask = "000000";
...@@ -72,7 +79,7 @@ public class ParameterSet implements TunableValidator ...@@ -72,7 +79,7 @@ public class ParameterSet implements TunableValidator
public int solCount = 1; public int solCount = 1;
@Tunable(description="Disable multithreading to keep the system responsive",context="nogui") @Tunable(description="Disable multithreading to keep the system responsive",context="nogui")
public boolean disableMultiThreading; public boolean disableMultiThreading = false;
@Tunable(description="Automatically choose an appopriate set of reduction rules (overrides a given bitmask)",context="nogui") @Tunable(description="Automatically choose an appopriate set of reduction rules (overrides a given bitmask)",context="nogui")
/**Describes whether auto configuration of the reduction rules is to be used. Overrides the bit mask.**/ /**Describes whether auto configuration of the reduction rules is to be used. Overrides the bit mask.**/
......
/******************************************************************************* /*******************************************************************************
* Copyright (C) 2017 Philipp Spohr * Copyright (C) 2018 Philipp Spohr
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
...@@ -32,11 +32,14 @@ import org.cytoscape.model.CyColumn; ...@@ -32,11 +32,14 @@ import org.cytoscape.model.CyColumn;
import javax.swing.GroupLayout.Alignment; import javax.swing.GroupLayout.Alignment;
import de.hhu.ba.yoshikoWrapper.core.LocalizationManager; import de.hhu.ba.yoshikoWrapper.core.LocalizationManager;
import de.hhu.ba.yoshikoWrapper.core.ParameterSet;
import de.hhu.ba.yoshikoWrapper.swing.SwingUtil; import de.hhu.ba.yoshikoWrapper.swing.SwingUtil;
@SuppressWarnings("serial") //Will never be serialized @SuppressWarnings("serial") //Will never be serialized
public class EditCostPanel extends JPanel { public class EditCostPanel extends JPanel {
private static final int GAP_SIZE_EC_PANEL = 4;
//SWING COMPONENTS //SWING COMPONENTS
private final ColumnMapper columnMapper; private final ColumnMapper columnMapper;
...@@ -60,9 +63,9 @@ public class EditCostPanel extends JPanel { ...@@ -60,9 +63,9 @@ public class EditCostPanel extends JPanel {
icField = new DoubleInputField(Double.NEGATIVE_INFINITY,0); icField = new DoubleInputField(Double.NEGATIVE_INFINITY,0);
dcField = new DoubleInputField(0,Double.POSITIVE_INFINITY); dcField = new DoubleInputField(0,Double.POSITIVE_INFINITY);
icField.setText("-1.0"); icField.setText(""+ParameterSet.DEFAULT_INSERTION_COST);
icField.setToolTipText(LocalizationManager.get("icTooltip")); icField.setToolTipText(LocalizationManager.get("icTooltip"));
dcField.setText("1.0"); dcField.setText(""+ParameterSet.DEFAULT_DELETION_COST);
separator = new JSeparator(JSeparator.HORIZONTAL); separator = new JSeparator(JSeparator.HORIZONTAL);
...@@ -87,7 +90,7 @@ public class EditCostPanel extends JPanel { ...@@ -87,7 +90,7 @@ public class EditCostPanel extends JPanel {
.addComponent(icLabel) .addComponent(icLabel)
.addComponent(dcLabel) .addComponent(dcLabel)
) )
.addGap(4) .addGap(GAP_SIZE_EC_PANEL)
.addGroup(layout.createParallelGroup(Alignment.LEADING) .addGroup(layout.createParallelGroup(Alignment.LEADING)
.addComponent(icField) .addComponent(icField)
.addComponent(dcField) .addComponent(dcField)
...@@ -101,12 +104,12 @@ public class EditCostPanel extends JPanel { ...@@ -101,12 +104,12 @@ public class EditCostPanel extends JPanel {
.addComponent(separator) .addComponent(separator)
.addGroup(layout.createParallelGroup(Alignment.BASELINE) .addGroup(layout.createParallelGroup(Alignment.BASELINE)
.addComponent(icLabel) .addComponent(icLabel)
.addGap(4) .addGap(GAP_SIZE_EC_PANEL)
.addComponent(icField) .addComponent(icField)
) )
.addGroup(layout.createParallelGroup(Alignment.BASELINE) .addGroup(layout.createParallelGroup(Alignment.BASELINE)
.addComponent(dcLabel) .addComponent(dcLabel)
.addGap(4) .addGap(GAP_SIZE_EC_PANEL)
.addComponent(dcField) .addComponent(dcField)
) )
); );
......
/******************************************************************************* /*******************************************************************************
* Copyright (C) 2017 Philipp Spohr * Copyright (C) 2018 Philipp Spohr
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
...@@ -29,6 +29,7 @@ import javax.swing.JCheckBox; ...@@ -29,6 +29,7 @@ import javax.swing.JCheckBox;
import javax.swing.JPanel; import javax.swing.JPanel;
import de.hhu.ba.yoshikoWrapper.core.LocalizationManager; import de.hhu.ba.yoshikoWrapper.core.LocalizationManager;
import de.hhu.ba.yoshikoWrapper.core.ParameterSet;
import de.hhu.ba.yoshikoWrapper.swing.SwingUtil; import de.hhu.ba.yoshikoWrapper.swing.SwingUtil;
@SuppressWarnings("serial") @SuppressWarnings("serial")
...@@ -41,7 +42,7 @@ public class TimeLimitSetter extends JPanel{ ...@@ -41,7 +42,7 @@ public class TimeLimitSetter extends JPanel{
this.setLayout(new BoxLayout(this,BoxLayout.X_AXIS)); this.setLayout(new BoxLayout(this,BoxLayout.X_AXIS));
checkBox = new JCheckBox(LocalizationManager.get("timeLimitILP")); checkBox = new JCheckBox(LocalizationManager.get("timeLimitILP"));
numberField = new IntegerInputField(); numberField = new IntegerInputField();
numberField.setText("30"); numberField.setText(""+ParameterSet.DEFAULT_VALUE_TIME_LIMIT_IF_USED);
checkBox.addActionListener( checkBox.addActionListener(
new ActionListener() { new ActionListener() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment