コード例 #1
0
 private void runButtonActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_runButtonActionPerformed
   Substance[] substances = new Substance[selectedSubstanceNames.getSize()];
   for (int i = 0; i < substances.length; i++)
     substances[i] = (Substance) (system.get((String) (selectedSubstanceNames.get(i))));
   rss.start();
 } // GEN-LAST:event_runButtonActionPerformed
コード例 #2
0
  // <editor-fold defaultstate="collapsed"
  // desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {

    splitPane = new javax.swing.JSplitPane();
    jPanel2 = new javax.swing.JPanel();
    runButton = new javax.swing.JButton();
    stopButton = new javax.swing.JButton();
    plotButton = new javax.swing.JButton();
    jSplitPane4 = new javax.swing.JSplitPane();
    jPanel3 = new javax.swing.JPanel();
    jLabel1 = new javax.swing.JLabel();
    jLabel5 = new javax.swing.JLabel();
    jLabel7 = new javax.swing.JLabel();
    jPanel4 = new javax.swing.JPanel();
    systemName = new javax.swing.JLabel();
    cyclesField = new javax.swing.JTextField();
    timeField = new javax.swing.JTextField();

    setLayout(new java.awt.BorderLayout());

    splitPane.setDividerSize(5);
    splitPane.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);

    runButton.setText("Run");
    runButton.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            runButtonActionPerformed(evt);
          }
        });
    jPanel2.add(runButton);

    stopButton.setText("Stop");
    stopButton.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            stopButtonActionPerformed(evt);
          }
        });
    jPanel2.add(stopButton);

    plotButton.setText("Plot");
    plotButton.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            plotButtonActionPerformed(evt);
          }
        });
    jPanel2.add(plotButton);

    splitPane.setRightComponent(jPanel2);

    jSplitPane4.setDividerSize(1);

    jPanel3.setLayout(new java.awt.GridLayout(3, 1));

    jLabel1.setText("System");
    jLabel1.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N
    jPanel3.add(jLabel1);

    jLabel5.setText("Rounds");
    jLabel5.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N
    jPanel3.add(jLabel5);

    jLabel7.setText("Time");
    jLabel7.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N
    jPanel3.add(jLabel7);

    jSplitPane4.setLeftComponent(jPanel3);

    jPanel4.setLayout(new java.awt.GridLayout(3, 1));

    systemName.setText(system.getName());
    systemName.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
    systemName.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N
    jPanel4.add(systemName);

    cyclesField.setHorizontalAlignment(javax.swing.JTextField.TRAILING);
    cyclesField.setText(String.valueOf(rss.getRounds()));
    cyclesField.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            cyclesFieldActionPerformed(evt);
          }
        });
    cyclesField.addFocusListener(
        new java.awt.event.FocusAdapter() {
          public void focusLost(java.awt.event.FocusEvent evt) {
            cyclesFieldFocusLost(evt);
          }
        });
    jPanel4.add(cyclesField);

    timeField.setHorizontalAlignment(javax.swing.JTextField.TRAILING);
    timeField.setText(String.valueOf(rss.getTime()));
    timeField.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            timeFieldActionPerformed(evt);
          }
        });
    timeField.addFocusListener(
        new java.awt.event.FocusAdapter() {
          public void focusLost(java.awt.event.FocusEvent evt) {
            timeFieldFocusLost(evt);
          }
        });
    jPanel4.add(timeField);

    jSplitPane4.setRightComponent(jPanel4);

    splitPane.setLeftComponent(jSplitPane4);

    add(splitPane, java.awt.BorderLayout.CENTER);
  } // </editor-fold>//GEN-END:initComponents
コード例 #3
0
 private void cyclesFieldActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_cyclesFieldActionPerformed
   rss.setRounds(Integer.parseInt(cyclesField.getText()));
 } // GEN-LAST:event_cyclesFieldActionPerformed
コード例 #4
0
 private void timeFieldActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_timeFieldActionPerformed
   rss.setTime(Double.parseDouble(timeField.getText()));
 } // GEN-LAST:event_timeFieldActionPerformed
コード例 #5
0
 private void cyclesFieldFocusLost(
     java.awt.event.FocusEvent evt) { // GEN-FIRST:event_cyclesFieldFocusLost
   rss.setRounds(Integer.parseInt(cyclesField.getText()));
 } // GEN-LAST:event_cyclesFieldFocusLost
コード例 #6
0
 private void timeFieldFocusLost(
     java.awt.event.FocusEvent evt) { // GEN-FIRST:event_timeFieldFocusLost
   rss.setTime(Double.parseDouble(timeField.getText()));
 } // GEN-LAST:event_timeFieldFocusLost
コード例 #7
0
 private void stopButtonActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_stopButtonActionPerformed
   rss.pause();
 } // GEN-LAST:event_stopButtonActionPerformed