package graphmatcher.gui;
import graphmatcher.gui.optionpanel.IOptionPanel;
import graphmatcher.gui.optionpanel.KOSystemOptionPanel;
import graphmatcher.gui.optionpanel.ShapeContextOptionPanel;
import graphmatcher.gui.optionpanel.SimpleOptionPanel;
import graphmatcher.matcher.MatchingOptions;
import java.awt.BorderLayout;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
public class MatchingOptionPanel extends JPanel {
private JTabbedPane tabbedPane;
private SimpleOptionPanel simpleOptionPanel;
private ShapeContextOptionPanel shapeContextOptionPanel;
private KOSystemOptionPanel koSystemOptionPanel;
public MatchingOptionPanel() {
setLayout(new BorderLayout());
setBorder(BorderFactory.createTitledBorder("Matching-Optionen"));
JPanel matcherPanel = new JPanel();
matcherPanel.setLayout(new BorderLayout());
tabbedPane = new JTabbedPane();
simpleOptionPanel = new SimpleOptionPanel();
tabbedPane.add("Simple", simpleOptionPanel);
shapeContextOptionPanel = new ShapeContextOptionPanel();
tabbedPane.add("ShapeContext", shapeContextOptionPanel);
koSystemOptionPanel = new KOSystemOptionPanel();
tabbedPane.add("KO-System", koSystemOptionPanel);
matcherPanel.add(tabbedPane, BorderLayout.CENTER);
tabbedPane.setSelectedIndex(1);
add(matcherPanel, BorderLayout.CENTER);
}
public String getSelectedMatcherID() {
IOptionPanel optionPanel = (IOptionPanel) tabbedPane.getSelectedComponent();
return optionPanel.getMatcherID();
}
public String getDefaultFileName() {
IOptionPanel optionPanel = (IOptionPanel) tabbedPane.getSelectedComponent();
return optionPanel.getDefaultFileName();
}
public MatchingOptions getMatchingOptions() {
IOptionPanel optionPanel = (IOptionPanel) tabbedPane.getSelectedComponent();
return optionPanel.getMatchingOptions();
}
public void setEditable(boolean editable) {
tabbedPane.setEnabled(editable);
simpleOptionPanel.setEditable(editable);
shapeContextOptionPanel.setEditable(editable);
koSystemOptionPanel.setEditable(editable);
}
}