<commit_before>package etomica.graphics;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.Iterator;
import java.util.LinkedList;

import etomica.EtomicaElement;
import etomica.EtomicaInfo;
import etomica.action.Action;
import etomica.exception.ConfigurationOverlapException;
import etomica.integrator.Integrator;
import etomica.simulation.Simulation;
import etomica.simulation.prototypes.HSMD3D;
import etomica.units.Dimension;
import etomica.units.PrefixedUnit;
import etomica.units.Unit;

/**
 * Permits selection of temperature from a discrete set of values.  Also has option
 * to select adiabatic.  Enforces selection by manipulating properties of integrator.
 * By default, last integrator added to simulation is the only one controlled by this device.
 *
 * @author <NAME>
 */
public class DeviceThermoSelector extends Device implements EtomicaElement {
    
     public DeviceThermoSelector(Simulation sim, final Integrator integrator) {
        this(Dimension.TEMPERATURE.defaultIOUnit(),sim.getDefaults().ignoreOverlap);
        setController(controller);
        setIntegrator(integrator);
     }
     
     public DeviceThermoSelector(Unit tempUnit, boolean fixOverlap) {
        super();
        selector = new javax.swing.JComboBox(new Object[] {new Object()});
        setTemperatures(new double[] {200.0, 400.0, 600.0});
        selector.setEditable(false);
        label = new javax.swing.JLabel("");<commit_msg>needs to go through the controller if one is available<commit_after>package etomica.graphics;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.Iterator;
import java.util.LinkedList;

import etomica.EtomicaElement;
import etomica.EtomicaInfo;
import etomica.action.Action;
import etomica.action.activity.Controller;
import etomica.exception.ConfigurationOverlapException;
import etomica.integrator.Integrator;
import etomica.simulation.Simulation;
import etomica.simulation.prototypes.HSMD3D;
import etomica.units.Dimension;
import etomica.units.PrefixedUnit;
import etomica.units.Unit;

/**
 * Permits selection of temperature from a discrete set of values.  Also has option
 * to select adiabatic.  Enforces selection by manipulating properties of integrator.
 * By default, last integrator added to simulation is the only one controlled by this device.
 *
 * @author <NAME>
 */
public class DeviceThermoSelector extends Device implements EtomicaElement {
    
     public DeviceThermoSelector(Simulation sim, final Integrator integrator) {
        this(sim.getController(),Dimension.TEMPERATURE.defaultIOUnit(),sim.getDefaults().ignoreOverlap);
        setController(controller);
        setIntegrator(integrator);
     }
     
     public DeviceThermoSelector(Controller controller, Unit tempUnit, boolean fixOverlap) {
        super(controller);
        selector = new javax.swing.JComboBox(new Object[] {new Object()});
        setTemperatures(new double[] {200.0, 400.0, 600.0});
        selector.setEditable(false);
        label = new javax.swing.JLabel("");
{'fraction_non_alphanumeric': 0.08960573476702509, 'fraction_numerical': 0.008471814923427827, 'mean_word_length': 4.561594202898551, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7138719', 'n_tokens_mistral': 887, 'n_tokens_neox': 855, 'n_words': 226}