Select Git revision
ReductionRulesChooser.java
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
ReductionRulesChooser.java 5.12 KiB
/*******************************************************************************
* Copyright (C) 2017 Philipp Spohr
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
******************************************************************************/
package de.hhu.ba.yoshikoWrapper.gui;
import static javax.swing.GroupLayout.DEFAULT_SIZE;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.BoxLayout;
import javax.swing.GroupLayout;
import javax.swing.JCheckBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.GroupLayout.Alignment;
import de.hhu.ba.yoshikoWrapper.core.LocalizationManager;
@SuppressWarnings("serial")
public class ReductionRulesChooser extends JPanel{
private final JCheckBox useCRule;
private final JCheckBox useCCRule;
private final JCheckBox useACRule;
private final JCheckBox useHERule;
private final JCheckBox usePDRRule;
private final JCheckBox useSNRule;
private final DoubleInputField multFactor;
private final JPanel SNPanel;
public ReductionRulesChooser() {
//Initialize subcomponents
useCRule = new JCheckBox("Use Clique Rule");
useCCRule = new JCheckBox("Use Critical-Clique Rule");
useACRule = new JCheckBox("Use Almost-Clique Rule");
useHERule = new JCheckBox("Use Heavy-Edge 3 in 1 Rule");
usePDRRule = new JCheckBox("Use Parameter Dependent Reduction Rule");
useSNRule = new JCheckBox("Use Similar Neighborhood Rule");
multFactor = new DoubleInputField(1, Double.POSITIVE_INFINITY);
multFactor.setText("1.0");
SNPanel = new JPanel();
SNPanel.setLayout(new BoxLayout(SNPanel,BoxLayout.X_AXIS));
SwingUtil.addAll(SNPanel,new JLabel(LocalizationManager.get("multFactor")),multFactor);
useSNRule.setSelected(true);
useCRule.setSelected(true);
useCCRule.setSelected(true);