package graphmatcher.gui.optionpanel;
import graphmatcher.gui.LabeledTextField;
import graphmatcher.matcher.MatchingOptions;
import graphmatcher.matcher.komatcher.KOSystemGraphMatcher;
import java.awt.GridLayout;
import javax.swing.JCheckBox;
import javax.swing.JPanel;
public class KOSystemOptionPanel extends IOptionPanel {
private LabeledTextField minimumCandidateFitnessField;
private LabeledTextField minimumMergeFitnessField;
private JCheckBox rotationCheckBox;
public KOSystemOptionPanel() {
JPanel content = new JPanel();
GridLayout layout = new GridLayout(0, 1);
layout.setHgap(10);
content.setLayout(layout);
minimumCandidateFitnessField = new LabeledTextField("Min. f�r initiale Kandidaten", "0.95", true);
content.add(minimumCandidateFitnessField);
minimumMergeFitnessField = new LabeledTextField("Min. bei Vereinigung", "0.7", true);
content.add(minimumMergeFitnessField);
rotationCheckBox = new JCheckBox("Rotation ber�cksichtigen", true);
content.add(rotationCheckBox);
add(content);
}
@Override
public String getMatcherID() {
return KOSystemGraphMatcher.matcherID;
}
@Override
public MatchingOptions getMatchingOptions() {
MatchingOptions options = new MatchingOptions(KOSystemGraphMatcher.matcherID);
options.setCandidateLimit(Double.parseDouble(minimumCandidateFitnessField.getText()));
options.setMinimimRatingForGoodPair(Double.parseDouble(minimumMergeFitnessField.getText()));
// options.setAngle(Double.parseDouble(maxAngleDiffField.getText()));
options.setNoRotation(!rotationCheckBox.isSelected());
return options;
}
@Override
public String getDefaultFileName() {
return "kosystemMatcher.txt";
}
@Override
public void setEditable(boolean editable) {
minimumCandidateFitnessField.setEditable(editable);
minimumMergeFitnessField.setEditable(editable);
rotationCheckBox.setEnabled(editable);
}
}