Select Git revision
EditCostPanel.java
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
EditCostPanel.java 1.29 KiB
package de.hhu.ba.yoshikoWrapper.gui;
import javax.swing.BorderFactory;
import javax.swing.JLabel;
import javax.swing.border.EtchedBorder;
import org.cytoscape.model.CyColumn;
@SuppressWarnings("serial") //Will never be serialized
public class EditCostPanel extends ComfortPanel {
//SWING COMPONENTS
private ModificationCostMapper modCostMapper;
private DoubleInputField icField;
private DoubleInputField dcField;
private JLabel icLabel;
private JLabel dcLabel;
public EditCostPanel() {
//Initialize components
modCostMapper = new ModificationCostMapper();
icField = new DoubleInputField(Double.NEGATIVE_INFINITY,0);
dcField = new DoubleInputField(0,Double.POSITIVE_INFINITY);
icField.setText("-1.0");
dcField.setText("1.0");
icLabel = new JLabel("Insertion Cost:");
dcLabel = new JLabel("Deletion Cost:");
icLabel.setLabelFor(icField);
dcLabel.setLabelFor(dcField);
this.addAll(modCostMapper,icField,dcField,icLabel,dcLabel);
//
this.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED));
}
//SETTER / GETTER
public CyColumn getWeightColumn() {
return modCostMapper.getValue();
}
public double getDefaultInsertionCost() {
return icField.getValueAsDouble();
}
public double getDefaultDeletionCost() {
return dcField.getValueAsDouble();
}
}