public void setXRangeToTime() {
    showTime();
    // set the x axis from the time range of the data
    GeoDate minDate = mFileViewer.getMinDate();
    GeoDate maxDate = mFileViewer.getMaxDate();

    xTics.setValue(new Integer(xTicsVal));
  }
 public void setType(String type) {
   if ("Control Change".equals(type)) {
     channel.setEnabled(true);
     cc.setEnabled(true);
     min.setEnabled(true);
     max.setEnabled(true);
     min.setValue(0);
     max.setValue(127);
     modeList.setEnabled(false);
   } else if ("NRPN".equals(type)) {
     channel.setEnabled(true);
     cc.setEnabled(true);
     min.setEnabled(true);
     max.setEnabled(true);
     min.setValue(0);
     max.setValue(127);
     modeList.setEnabled(false);
   } else if ("Pitch Bend".equals(type)) {
     channel.setEnabled(true);
     cc.setEnabled(false);
     min.setEnabled(true);
     max.setEnabled(true);
     min.setValue(-8192);
     max.setValue(8191);
     modeList.setEnabled(false);
   } else if ("Basenote".equals(type)) {
     channel.setEnabled(false);
     cc.setEnabled(false);
     min.setEnabled(true);
     max.setEnabled(true);
     min.setValue(0);
     max.setValue(127);
     modeList.setEnabled(false);
   } else if ("Scale".equals(type)) {
     channel.setEnabled(false);
     cc.setEnabled(false);
     min.setEnabled(false);
     max.setEnabled(false);
     modeList.setEnabled(false);
   } else if ("Mode Change".equals(type)) {
     channel.setEnabled(false);
     cc.setEnabled(false);
     min.setEnabled(false);
     max.setEnabled(false);
     modeList.setEnabled(true);
   } else if ("Unassigned".equals(type)) {
     channel.setEnabled(false);
     cc.setEnabled(false);
     min.setEnabled(false);
     max.setEnabled(false);
     modeList.setEnabled(false);
   }
 }
  public void setAdvancedValues() {
    // get pretty ranges for the current parameters
    // get the range for the station value
    double min = 10000;
    double max = 0;
    for (int fc = 0; fc < mFileViewer.mNumOpenFiles; fc++) {
      OpenDataFile of = (OpenDataFile) mFileViewer.mOpenFiles.elementAt(fc);

      for (int sec = 0; sec < of.mNumSections; sec++) {
        Section sech = (Section) of.mSections.elementAt(sec);

        if (sech.mNumCasts == 0) {
          continue;
        }

        for (int stc = 0; stc < sech.mStations.size(); stc++) {
          Station sh = (Station) sech.mStations.elementAt(stc);
          if (!sh.mUseStn) {
            continue;
          }

          // get the station value
          double y = sh.getStnValue(mSelYParam);
          if (y == JOAConstants.MISSINGVALUE || y >= JOAConstants.EPICMISSINGVALUE) {
            continue;
          } else {
            min = y < min ? y : min;
            max = y > max ? y : max;
          }
        }
      }
    }

    Triplet newRange = JOAFormulas.GetPrettyRange(min, max);
    double yMinv = newRange.getVal1();
    double yMaxv = newRange.getVal2();
    double yIncv = newRange.getVal3();
    yMin.setText(JOAFormulas.formatDouble(String.valueOf(yMinv), 3, false));
    yMax.setText(JOAFormulas.formatDouble(String.valueOf(yMaxv), 3, false));
    yInc.setText(JOAFormulas.formatDouble(String.valueOf(yIncv), 3, false));
    yTics.setValue(new Integer(yTicsVal));
    if (b1.isSelected()) {
      mOffset = JOAConstants.PROFSEQUENCE;
      setXRangeToSequence();
    } else if (b2.isSelected()) {
      mOffset = JOAConstants.PROFDISTANCE;
      setXRangeToDistance();
    } else if (b3.isSelected()) {
      mOffset = JOAConstants.PROFTIME;
      setXRangeToTime();
    }
  }
示例#4
0
  @Override
  public void setAIChoices(String[] value) {

    java.util.List<String> choiceList = new ArrayList<String>();
    for (String v : value) {
      choiceList.add(v);
    }

    aiModel.setList(choiceList);

    if (value.length > 0) {
      aiChoices.setValue(value[0]);
    }
  }
 public void setXRangeToSequence() {
   hideTime();
   // set the x axis from the total mercator distance
   double tempXMin = 0;
   double tempXMax = mFileViewer.mTotalStations;
   Triplet newRange = JOAFormulas.GetPrettyRange(tempXMin, tempXMax);
   double xMinv = newRange.getVal1();
   double xMaxv = newRange.getVal2();
   double xIncv = newRange.getVal3();
   xMin.setText(String.valueOf((int) xMinv));
   xMax.setText(String.valueOf((int) xMaxv));
   xInc.setText(String.valueOf((int) xIncv));
   xTics.setValue(new Integer(xTicsVal));
 }
 public void setXRangeToDistance() {
   hideTime();
   // set the x axis from the total mercator distance
   double tempXMin = 0;
   double tempXMax = mFileViewer.mTotMercDist * 1.852;
   Triplet newRange = JOAFormulas.GetPrettyRange(tempXMin, tempXMax);
   double xMinv = newRange.getVal1();
   double xMaxv = newRange.getVal2();
   double xIncv = newRange.getVal3();
   xMin.setText(JOAFormulas.formatDouble(String.valueOf(xMinv), 3, false));
   xMax.setText(JOAFormulas.formatDouble(String.valueOf(xMaxv), 3, false));
   xInc.setText(JOAFormulas.formatDouble(String.valueOf(xIncv), 3, false));
   xTics.setValue(new Integer(xTicsVal));
 }
示例#7
0
    private JPanel makeInteriorAttributesPanel() {
      JPanel outerPanel = new JPanel(new BorderLayout(6, 6));
      outerPanel.setBorder(this.createTitleBorder("Surface Attributes"));

      GridLayout nameLayout = new GridLayout(0, 1, 6, 6);
      JPanel namePanel = new JPanel(nameLayout);

      GridLayout valueLayout = new GridLayout(0, 1, 6, 6);
      JPanel valuePanel = new JPanel(valueLayout);

      namePanel.add(new JLabel("Style"));
      final JComboBox cb1 = new JComboBox(new String[] {"None", "Solid"});
      cb1.addActionListener(
          new ActionListener() {
            public void actionPerformed(ActionEvent actionEvent) {
              currentInteriorStyle = (String) cb1.getSelectedItem();
              update();
            }
          });
      cb1.setSelectedItem("Solid");
      valuePanel.add(cb1);

      namePanel.add(new JLabel("Opacity"));
      JSpinner sp = new JSpinner(new SpinnerNumberModel(this.currentBorderOpacity, 0, 10, 1));
      sp.addChangeListener(
          new ChangeListener() {
            public void stateChanged(ChangeEvent changeEvent) {
              currentInteriorOpacity = (Integer) ((JSpinner) changeEvent.getSource()).getValue();
              update();
            }
          });
      valuePanel.add(sp);

      namePanel.add(new JLabel("Color"));
      final JComboBox cb2 = new JComboBox(new String[] {"Red", "Green", "Blue", "Yellow"});
      cb2.setSelectedItem(currentInteriorColor);
      cb2.addActionListener(
          new ActionListener() {
            public void actionPerformed(ActionEvent actionEvent) {
              currentInteriorColor =
                  (String) ((JComboBox) actionEvent.getSource()).getSelectedItem();
              update();
            }
          });
      valuePanel.add(cb2);

      namePanel.add(new JLabel("Border"));
      final JComboBox cb5 = new JComboBox(new String[] {"None", "Solid"});
      cb5.addActionListener(
          new ActionListener() {
            public void actionPerformed(ActionEvent actionEvent) {
              currentBorderStyle = (String) cb5.getSelectedItem();
              update();
            }
          });
      cb5.setSelectedItem("Solid");
      valuePanel.add(cb5);

      namePanel.add(new JLabel("Border Width"));
      sp = new JSpinner(new SpinnerNumberModel(this.currentBorderWidth, 1d, 10d, 1d));
      sp.addChangeListener(
          new ChangeListener() {
            public void stateChanged(ChangeEvent changeEvent) {
              currentBorderWidth = (Double) ((JSpinner) changeEvent.getSource()).getValue();
              update();
            }
          });
      sp.setValue(currentBorderWidth);
      valuePanel.add(sp);

      namePanel.add(new JLabel("Border Color"));
      JComboBox cb4 = new JComboBox(new String[] {"Red", "Green", "Blue", "Yellow"});
      cb4.setSelectedItem(currentBorderColor);
      cb4.addActionListener(
          new ActionListener() {
            public void actionPerformed(ActionEvent actionEvent) {
              currentBorderColor = (String) ((JComboBox) actionEvent.getSource()).getSelectedItem();
              update();
            }
          });
      valuePanel.add(cb4);

      namePanel.add(new JLabel("Border Opacity"));
      sp = new JSpinner(new SpinnerNumberModel(this.currentBorderOpacity, 0, 10, 1));
      sp.addChangeListener(
          new ChangeListener() {
            public void stateChanged(ChangeEvent changeEvent) {
              currentBorderOpacity = (Integer) ((JSpinner) changeEvent.getSource()).getValue();
              update();
            }
          });
      valuePanel.add(sp);

      outerPanel.add(namePanel, BorderLayout.WEST);
      outerPanel.add(valuePanel, BorderLayout.CENTER);

      return outerPanel;
    }
示例#8
0
    private JPanel makePathAttributesPanel() {
      JPanel outerPanel = new JPanel(new BorderLayout(6, 6));
      outerPanel.setBorder(this.createTitleBorder("Path Attributes"));

      GridLayout nameLayout = new GridLayout(0, 1, 6, 6);
      JPanel namePanel = new JPanel(nameLayout);

      GridLayout valueLayout = new GridLayout(0, 1, 6, 6);
      JPanel valuePanel = new JPanel(valueLayout);

      namePanel.add(new JLabel("Follow Terrain"));
      JCheckBox ckb = new JCheckBox();
      ckb.setSelected(currentFollowTerrain);
      ckb.addActionListener(
          new ActionListener() {
            public void actionPerformed(ActionEvent actionEvent) {
              currentFollowTerrain = ((JCheckBox) actionEvent.getSource()).isSelected();
              update();
            }
          });
      valuePanel.add(ckb);

      JLabel label;

      namePanel.add(label = new JLabel("Conformance"));
      int[] values = new int[] {1, 2, 4, 8, 10, 15, 20, 30, 40, 50};
      String[] strings = new String[values.length];
      for (int i = 0; i < values.length; i++) {
        strings[i] = Integer.toString(values[i]) + " pixels";
      }
      JSpinner sp = new JSpinner(new SpinnerListModel(strings));
      onTerrainOnlyItems.add(label);
      onTerrainOnlyItems.add(sp);
      sp.addChangeListener(
          new ChangeListener() {
            public void stateChanged(ChangeEvent changeEvent) {
              String v = (String) ((JSpinner) changeEvent.getSource()).getValue();
              currentTerrainConformance = Integer.parseInt(v.substring(0, v.indexOf(" ")));
              update();
            }
          });
      sp.setValue(Integer.toString(currentTerrainConformance) + " pixels");
      valuePanel.add(sp);

      namePanel.add(label = new JLabel("Subsegments"));
      sp = new JSpinner(new SpinnerListModel(new String[] {"1", "2", "5", "10", "20", "40", "50"}));
      offTerrainOnlyItems.add(label);
      offTerrainOnlyItems.add(sp);
      sp.addChangeListener(
          new ChangeListener() {
            public void stateChanged(ChangeEvent changeEvent) {
              String v = (String) ((JSpinner) changeEvent.getSource()).getValue();
              currentNumSubsegments = Integer.parseInt(v);
              update();
            }
          });
      sp.setValue(Integer.toString(currentNumSubsegments));
      valuePanel.add(sp);

      namePanel.add(new JLabel("Type"));
      final JComboBox cb = new JComboBox(new String[] {"Great Circle", "Linear", "Rhumb Line"});
      cb.addActionListener(
          new ActionListener() {
            public void actionPerformed(ActionEvent actionEvent) {
              currentPathType = (String) cb.getSelectedItem();
              update();
            }
          });
      cb.setSelectedItem("Great Circle");
      valuePanel.add(cb);

      namePanel.add(new JLabel("Style"));
      final JComboBox cb1 = new JComboBox(new String[] {"None", "Solid", "Dash"});
      cb1.addActionListener(
          new ActionListener() {
            public void actionPerformed(ActionEvent actionEvent) {
              currentPathStyle = (String) cb1.getSelectedItem();
              update();
            }
          });
      cb1.setSelectedItem("Solid");
      valuePanel.add(cb1);

      namePanel.add(new JLabel("Width"));
      sp = new JSpinner(new SpinnerNumberModel(this.currentPathWidth, 1d, 10d, 1d));
      sp.addChangeListener(
          new ChangeListener() {
            public void stateChanged(ChangeEvent changeEvent) {
              currentPathWidth = (Double) ((JSpinner) changeEvent.getSource()).getValue();
              update();
            }
          });
      sp.setValue(currentPathWidth);
      valuePanel.add(sp);

      namePanel.add(new JLabel("Color"));
      JComboBox cb2 = new JComboBox(new String[] {"Red", "Green", "Blue", "Yellow"});
      cb2.setSelectedItem(currentPathColor);
      cb2.addActionListener(
          new ActionListener() {
            public void actionPerformed(ActionEvent actionEvent) {
              currentPathColor = (String) ((JComboBox) actionEvent.getSource()).getSelectedItem();
              update();
            }
          });
      valuePanel.add(cb2);

      namePanel.add(new JLabel("Opacity"));
      sp = new JSpinner(new SpinnerNumberModel(this.currentPathOpacity, 0, 10, 1));
      sp.addChangeListener(
          new ChangeListener() {
            public void stateChanged(ChangeEvent changeEvent) {
              currentPathOpacity = (Integer) ((JSpinner) changeEvent.getSource()).getValue();
              update();
            }
          });
      valuePanel.add(sp);

      namePanel.add(new JLabel("Offset"));
      sp =
          new JSpinner(
              new SpinnerListModel(
                  new String[] {"0", "10", "100", "1000", "10000", "100000", "1000000"}));
      sp.addChangeListener(
          new ChangeListener() {
            public void stateChanged(ChangeEvent changeEvent) {
              currentOffset =
                  Float.parseFloat((String) ((JSpinner) changeEvent.getSource()).getValue());
              update();
            }
          });
      sp.setValue("0");
      valuePanel.add(sp);

      outerPanel.add(namePanel, BorderLayout.WEST);
      outerPanel.add(valuePanel, BorderLayout.CENTER);

      return outerPanel;
    }
示例#9
0
  /**
   * Creates the video advanced settings.
   *
   * @return video advanced settings panel.
   */
  private static Component createVideoAdvancedSettings() {
    ResourceManagementService resources = NeomediaActivator.getResources();

    final DeviceConfiguration deviceConfig = mediaService.getDeviceConfiguration();

    TransparentPanel centerPanel = new TransparentPanel(new GridBagLayout());
    centerPanel.setMaximumSize(new Dimension(WIDTH, 150));

    JButton resetDefaultsButton =
        new JButton(resources.getI18NString("impl.media.configform.VIDEO_RESET"));
    JPanel resetButtonPanel = new TransparentPanel(new FlowLayout(FlowLayout.RIGHT));
    resetButtonPanel.add(resetDefaultsButton);

    final JPanel centerAdvancedPanel = new TransparentPanel(new BorderLayout());
    centerAdvancedPanel.add(centerPanel, BorderLayout.NORTH);
    centerAdvancedPanel.add(resetButtonPanel, BorderLayout.SOUTH);

    GridBagConstraints constraints = new GridBagConstraints();
    constraints.fill = GridBagConstraints.HORIZONTAL;
    constraints.anchor = GridBagConstraints.NORTHWEST;
    constraints.insets = new Insets(5, 5, 0, 0);
    constraints.gridx = 0;
    constraints.weightx = 0;
    constraints.weighty = 0;
    constraints.gridy = 0;

    centerPanel.add(
        new JLabel(resources.getI18NString("impl.media.configform.VIDEO_RESOLUTION")), constraints);
    constraints.gridy = 1;
    constraints.insets = new Insets(0, 0, 0, 0);
    final JCheckBox frameRateCheck =
        new SIPCommCheckBox(resources.getI18NString("impl.media.configform.VIDEO_FRAME_RATE"));
    centerPanel.add(frameRateCheck, constraints);
    constraints.gridy = 2;
    constraints.insets = new Insets(5, 5, 0, 0);
    centerPanel.add(
        new JLabel(resources.getI18NString("impl.media.configform.VIDEO_PACKETS_POLICY")),
        constraints);

    constraints.weightx = 1;
    constraints.gridx = 1;
    constraints.gridy = 0;
    constraints.insets = new Insets(5, 0, 0, 5);
    Object[] resolutionValues = new Object[DeviceConfiguration.SUPPORTED_RESOLUTIONS.length + 1];
    System.arraycopy(
        DeviceConfiguration.SUPPORTED_RESOLUTIONS,
        0,
        resolutionValues,
        1,
        DeviceConfiguration.SUPPORTED_RESOLUTIONS.length);
    final JComboBox sizeCombo = new JComboBox(resolutionValues);
    sizeCombo.setRenderer(new ResolutionCellRenderer());
    sizeCombo.setEditable(false);
    centerPanel.add(sizeCombo, constraints);

    // default value is 20
    final JSpinner frameRate = new JSpinner(new SpinnerNumberModel(20, 5, 30, 1));
    frameRate.addChangeListener(
        new ChangeListener() {
          public void stateChanged(ChangeEvent e) {
            deviceConfig.setFrameRate(
                ((SpinnerNumberModel) frameRate.getModel()).getNumber().intValue());
          }
        });
    constraints.gridy = 1;
    constraints.insets = new Insets(0, 0, 0, 5);
    centerPanel.add(frameRate, constraints);

    frameRateCheck.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            if (frameRateCheck.isSelected()) {
              deviceConfig.setFrameRate(
                  ((SpinnerNumberModel) frameRate.getModel()).getNumber().intValue());
            } else // unlimited framerate
            deviceConfig.setFrameRate(-1);

            frameRate.setEnabled(frameRateCheck.isSelected());
          }
        });

    final JSpinner videoMaxBandwidth =
        new JSpinner(
            new SpinnerNumberModel(deviceConfig.getVideoMaxBandwidth(), 1, Integer.MAX_VALUE, 1));
    videoMaxBandwidth.addChangeListener(
        new ChangeListener() {
          public void stateChanged(ChangeEvent e) {
            deviceConfig.setVideoMaxBandwidth(
                ((SpinnerNumberModel) videoMaxBandwidth.getModel()).getNumber().intValue());
          }
        });
    constraints.gridx = 1;
    constraints.gridy = 2;
    constraints.insets = new Insets(0, 0, 5, 5);
    centerPanel.add(videoMaxBandwidth, constraints);

    resetDefaultsButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            // reset to defaults
            sizeCombo.setSelectedIndex(0);
            frameRateCheck.setSelected(false);
            frameRate.setEnabled(false);
            frameRate.setValue(20);
            // unlimited framerate
            deviceConfig.setFrameRate(-1);
            videoMaxBandwidth.setValue(DeviceConfiguration.DEFAULT_VIDEO_MAX_BANDWIDTH);
          }
        });

    // load selected value or auto
    Dimension videoSize = deviceConfig.getVideoSize();

    if ((videoSize.getHeight() != DeviceConfiguration.DEFAULT_VIDEO_HEIGHT)
        && (videoSize.getWidth() != DeviceConfiguration.DEFAULT_VIDEO_WIDTH))
      sizeCombo.setSelectedItem(deviceConfig.getVideoSize());
    else sizeCombo.setSelectedIndex(0);
    sizeCombo.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            Dimension selectedVideoSize = (Dimension) sizeCombo.getSelectedItem();

            if (selectedVideoSize == null) {
              // the auto value, default one
              selectedVideoSize =
                  new Dimension(
                      DeviceConfiguration.DEFAULT_VIDEO_WIDTH,
                      DeviceConfiguration.DEFAULT_VIDEO_HEIGHT);
            }
            deviceConfig.setVideoSize(selectedVideoSize);
          }
        });

    frameRateCheck.setSelected(
        deviceConfig.getFrameRate() != DeviceConfiguration.DEFAULT_VIDEO_FRAMERATE);
    frameRate.setEnabled(frameRateCheck.isSelected());

    if (frameRate.isEnabled()) frameRate.setValue(deviceConfig.getFrameRate());

    return centerAdvancedPanel;
  }
 // Reset combobox and spinner
 private void courseReset() {
   coursecombobox.setSelectedIndex(0);
   spinner.setValue(0);
 }
示例#11
0
  static String[] input(int d, int m, int y) { // input frame for schedule
    String[] out = new String[4]; // appointment info storage

    final String[] doctors = {"Dr. Whitehead", "Dr. Namie", "Dr. Liddell"};

    final JFrame input = new JFrame("Make Appointment");
    Container pane1;
    JPanel pan = new JPanel(null);
    JLabel doctor = new JLabel("Choose your Doctor:");
    JLabel da = new JLabel("Date:");
    /*JLabel day=new JLabel(Integer.toString(d));
    JLabel mo=new JLabel("Month:");
    JLabel month=new JLabel(Integer.toString(m));
    JLabel ye=new JLabel("Year:");
    JLabel year=new JLabel(Integer.toString(y));*/
    JLabel time = new JLabel("Appointment Time:");
    JButton submit = new JButton("Submit");
    docName = new JComboBox(doctors);

    JSpinner timeSpinner = new JSpinner(new SpinnerDateModel());
    JSpinner.DateEditor timeEditor = new JSpinner.DateEditor(timeSpinner, "hh:mm a");
    timeSpinner.setEditor(timeEditor);
    timeSpinner.setValue(new Date());

    JSpinner dateSpinner = new JSpinner(new SpinnerDateModel());
    JSpinner.DateEditor dateEditor = new JSpinner.DateEditor(dateSpinner, "MMM/dd/yyyy");
    dateSpinner.setEditor(dateEditor);
    dateSpinner.setValue(new Date());

    input.setSize(330, 375); // Set size to 400x400 pixels
    pane1 = input.getContentPane();
    pane1.setLayout(null); // Apply null layout
    pan.setLayout(new GridLayout(4, 2, 20, 50));
    pane1.setSize((int) (input.getHeight() / 2), (int) (input.getWidth() / 2));
    pane1.setLocation(
        input.getHeight() - ((int) (input.getHeight() / 2)),
        input.getWidth() - ((int) (input.getWidth() / 2))); // trying to center failed
    input.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); // Close when X is clicked
    pane1.add(pan);
    // pan.add(ye);
    // pan.add(year);
    pan.add(da);
    pan.add(dateSpinner);
    pan.add(time);
    pan.add(timeSpinner);
    pan.add(doctor);
    pan.add(docName);
    pan.add(submit);

    submit.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent event) {
            fmain.setVisible(true);
            input.setVisible(false);
          }
        });

    pan.setBounds(0, 0, 320, 335);
    input.setResizable(false);
    input.setVisible(true);
    return out;
  }
      public ParameterConfigurationPanel(String name, SensorType type) {
        this.type = type;
        this.name = name;
        setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));

        add(new Label(name));
        typeList = new JComboBox(controlTypes);
        typeList.addActionListener(
            new AbstractAction() {
              public void actionPerformed(ActionEvent e) {
                setType((String) typeList.getSelectedItem());
                configure();
              }
            });
        add(typeList);

        add(new Label("channel"));
        channel = new JSpinner(new SpinnerNumberModel(1, 1, 16, 1));
        channel.setValue(1);
        channel.addChangeListener(
            new ChangeListener() {
              public void stateChanged(ChangeEvent e) {
                configure();
              }
            });
        add(channel);

        add(new Label("cc"));
        cc = new JSpinner(new SpinnerNumberModel(21, 1, 127, 1));
        cc.setValue(21);
        cc.addChangeListener(
            new ChangeListener() {
              public void stateChanged(ChangeEvent e) {
                configure();
              }
            });
        add(cc);

        add(new Label("min"));
        min = new JSpinner();
        min.addChangeListener(
            new ChangeListener() {
              public void stateChanged(ChangeEvent e) {
                configure();
              }
            });
        add(min);

        add(new Label("max"));
        max = new JSpinner();
        max.setValue(127);
        max.addChangeListener(
            new ChangeListener() {
              public void stateChanged(ChangeEvent e) {
                configure();
              }
            });
        add(max);

        JButton button = new JButton("invert");
        button.addActionListener(
            new AbstractAction() {
              public void actionPerformed(ActionEvent e) {
                int saved = (Integer) min.getValue();
                min.setValue(max.getValue());
                max.setValue(saved);
              }
            });
        add(button);

        modeList = new JComboBox(eventhandler.getModeNames());
        modeList.addActionListener(
            new AbstractAction() {
              public void actionPerformed(ActionEvent e) {
                configure();
              }
            });
        add(modeList);
      }
      public NotePlayerConfigurationPanel() {
        setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
        JPanel panel = new JPanel(new MigLayout());
        add(panel);

        play = new JCheckBox("Play notes", true);
        play.addActionListener(
            new AbstractAction() {
              public void actionPerformed(ActionEvent e) {
                doPlay = !doPlay;
                if (doPlay) {
                  pb.setEnabled(true);
                  at.setEnabled(true);
                } else {
                  pb.setEnabled(false);
                  at.setEnabled(false);
                }
                configure();
              }
            });
        panel.add(play, "wrap");

        pb = new JCheckBox("Pitch Bend", false);
        pb.addActionListener(
            new AbstractAction() {
              public void actionPerformed(ActionEvent e) {
                doPb = !doPb;
                configure();
              }
            });
        panel.add(pb, "wrap");

        at = new JCheckBox("Aftertouch", false);
        at.addActionListener(
            new AbstractAction() {
              public void actionPerformed(ActionEvent e) {
                doAt = !doAt;
                configure();
              }
            });
        panel.add(at, "wrap");

        panel = new JPanel(new MigLayout());
        add(panel);

        panel.add(new Label("Follow Mode"), "label");
        JComboBox box = new JComboBox(sender.getFollowModes());
        box.setSelectedItem(eventhandler.getConfigurationMode(getOperationMode()).getFollowMode());
        box.addActionListener(
            new AbstractAction() {
              public void actionPerformed(ActionEvent e) {
                JComboBox box = (JComboBox) e.getSource();
                String name = (String) box.getSelectedItem();
                eventhandler.getConfigurationMode(getOperationMode()).setFollowMode(name);
                sender.setFollowMode(name);
              }
            });
        panel.add(box, "wrap");

        panel.add(new Label("Scale"), "label");
        scale = new JComboBox(eventhandler.getScaleMapper().getScaleNames());
        scale.setSelectedItem(eventhandler.getCurrentScale());
        scale.addActionListener(
            new AbstractAction() {
              public void actionPerformed(ActionEvent e) {
                String scalename = (String) scale.getSelectedItem();
                eventhandler.getScaleMapper(getOperationMode()).setScale(scalename);
              }
            });
        panel.add(scale, "wrap");

        panel.add(new Label("Basenote"), "label");
        basenote = new JSpinner(new SpinnerNumberModel(1, 1, 127, 1));
        basenote.setValue(eventhandler.getBaseNote());
        basenote.addChangeListener(
            new ChangeListener() {
              public void stateChanged(ChangeEvent e) {
                Integer value = (Integer) basenote.getValue();
                eventhandler.setBaseNote(getOperationMode(), value);
              }
            });
        panel.add(basenote, "wrap");
      }