Пример #1
1
  public void stateChanged(ChangeEvent e) {
    JSpinner source = (JSpinner) e.getSource();
    Calendar c = this.getDateCalendar();
    if (source.getName().equals("Hour")) {
      c.set(Calendar.HOUR_OF_DAY, getSelectedHour());
      this.date = c.getTime();
      return;
    } else if (source.getName().equals("Minute")) {
      c.set(Calendar.MINUTE, getSelectedMinute());
      this.date = c.getTime();
      return;
    } else if (source.getName().equals("Second")) {
      c.set(Calendar.SECOND, getSelectedSecond());
      this.date = c.getTime();
      return;
    }
    dayColorUpdate(true);

    if (source.getName().equals("Year")) {
      c.set(Calendar.YEAR, getSelectedYear());
    } else {
      c.set(Calendar.MONTH, getSelectedMonth() - 1);
    }
    this.date = c.getTime();
    flushWeekAndDay();
  }
Пример #2
0
 public void stateChanged(ChangeEvent e) {
   if (e.getSource() == angleSlider) {
     angle.setValue(new Double(-angleSlider.getValue()));
   } else if (e.getSource() == angle) {
     angleSlider.setValue(-((Double) angle.getValue()).floatValue());
   }
 }
 @Override
 public void stateChanged(ChangeEvent event) {
   if ((event.getSource() == battlefieldWidthSlider)
       || (event.getSource() == battlefieldHeightSlider)) {
     updateBattlefieldSizeLabel();
   }
 }
Пример #4
0
 /**
  * Method required by ChangeListener interface. This method is called when the tab panel or slider
  * change
  */
 @Override
 public void stateChanged(ChangeEvent ce) {
   if (ce.getSource()
       instanceof JSlider) { // the slider changed, so notify the currently displayed ManPage
     JSlider slider = (JSlider) ce.getSource();
     if (!slider.getValueIsAdjusting()) {
       ISliderUpdated currentManPage = (ISliderUpdated) tabPanel.getSelectedComponent();
       currentManPage.sliderChanged(slider);
     }
   } else if (ce.getSource()
       instanceof TabPane) { // the active tab changed, so update the state of the slider
     TabPane tabPanel = (TabPane) ce.getSource();
     if (tabPanel.getTabCount() > 0) {
       switch (((ManPage) tabPanel.getSelectedComponent()).getHelpLevel()) {
         case DETAIL:
           toolbarPanel.getHelpLevelSlider().setValue(3);
           break;
         case SUMMARY:
           toolbarPanel.getHelpLevelSlider().setValue(2);
           break;
         case TOPIC:
           toolbarPanel.getHelpLevelSlider().setValue(1);
           break;
         default:
           break;
       }
     }
   }
 }
Пример #5
0
 public void stateChanged(ChangeEvent e) {
   if (!locked && e.getSource() instanceof NodeAttributeObserver) {
     URI uri = ((NodeAttributeObserver) e.getSource()).getUri();
     this.setPath(uri);
     this.refresh();
   }
 }
Пример #6
0
 public void stateChanged(ChangeEvent chev) {
   Object source = chev.getSource();
   if (source instanceof Breakpoint.VALIDITY) {
     setValidity((Breakpoint.VALIDITY) source, chev.toString());
   } else {
     throw new UnsupportedOperationException(chev.toString());
   }
 }
 @Override
 public void stateChanged(ChangeEvent e) {
   Object newValue = ((JSpinner) e.getSource()).getValue();
   if (newValue != null && !newValue.equals(oldValue)) {
     spinnerValueChanged((JSpinner) e.getSource());
   }
   oldValue = newValue;
 }
 public void spinnerChangeEvent(javax.swing.event.ChangeEvent ae) {
   if (ae.getSource() == spinTrainIconX && _tIon != null) {
     _tIon.setLocation((Integer) spinTrainIconX.getValue(), _tIon.getLocation().y);
   }
   if (ae.getSource() == spinTrainIconY && _tIon != null) {
     _tIon.setLocation(_tIon.getLocation().x, (Integer) spinTrainIconY.getValue());
   }
 }
 public void stateChanged(ChangeEvent ce) {
   if (ce.getSource() == freqSlider) {
     cadBlock.setFreq((double) freqSlider.getValue());
     updateFreqLabel();
   } else if (ce.getSource() == qSlider) {
     cadBlock.setQ((double) qSlider.getValue());
     updateQLabel();
   }
 }
 public void stateChanged(ChangeEvent e) {
   if (e.getSource() == this.spinner) {
     showTHInDialog();
   } else if (e.getSource() == cpe.getQuickAccessSpinner()) {
     selectedPairIndex = ((Integer) cpe.getQuickAccessSpinner().getValue()).intValue();
     lastSelected = selectedPairIndex;
     setSelectionInGui();
   }
 }
Пример #11
0
 /**
  * Reacts to state changes in the {@link ImViewer}.
  *
  * @see ChangeListener#stateChanged(ChangeEvent)
  */
 public void stateChanged(ChangeEvent e) {
   if (e.getSource() instanceof JTabbedPane) {
     JTabbedPane pane = (JTabbedPane) e.getSource();
     if (view.checkIfTabEnabled(pane.getSelectedIndex())) {
       if (pane.getSelectedIndex() == EditorUI.RND_INDEX)
         model.loadRenderingControl(RenderingControlLoader.LOAD);
     }
   }
 }
Пример #12
0
 public void stateChanged(ChangeEvent e) {
   if (e.getSource() == saveToProjectRadio) {
     updateValidity();
   } else if (e.getSource() == saveToFileRadio) {
     saveToFileField.setEnabled(saveToFileRadio.isSelected());
     saveToFileButton.setEnabled(saveToFileRadio.isSelected());
     updateValidity();
   }
 }
Пример #13
0
 /**
  * When the state of a widget changes, it will notify the gui. the method then enables or disables
  * certain parameters.
  */
 @Override
 public void stateChanged(ChangeEvent event) {
   if (event.getSource() == useAuth) {
     mqttUser.setEnabled(useAuth.isSelected());
     mqttPwd.setEnabled(useAuth.isSelected());
   } else if (event.getSource() == suffixClientId) {
     updateChoice("Suffix=" + String.valueOf(this.suffixClientId.isSelected()));
   }
 }
 /** Handles slider input */
 @Override
 public void stateChanged(ChangeEvent arg0) {
   if (arg0.getSource() == direction) {
     if (direction.getValue() == 0) previewBox.setDirection(-1);
     else previewBox.setDirection(direction.getValue());
   }
   if (arg0.getSource() == walkCycle) {
     if (walkCycle.getValue() == 0) previewBox.setStep(-1);
     else previewBox.setStep(walkCycle.getValue());
   }
 }
Пример #15
0
  /* (non-Javadoc)
   * @see javax.swing.event.ChangeListener#stateChanged(javax.swing.event.ChangeEvent)
   */
  public void stateChanged(ChangeEvent e) {
    if (e.getSource() instanceof AlphaColorJButton) {
      draw_font_ =
          new DrawSWFFont(
              text_field_.getFont(),
              effect_,
              text_field_.getText(),
              ((AlphaColorJButton) e.getSource()).getColor());
    }

    fireStateChanged();
  }
 @Override
 public void stateChanged(ChangeEvent e) {
   if (e.getSource().equals(viewMainFeeder.getrBtnAir())) {
     if (viewMainFeeder.getrBtnAir().isSelected()) {
       typeCaliber = TypeRush.AIR;
     }
   } else if (e.getSource().equals(viewMainFeeder.getrBtnGround())) {
     if (viewMainFeeder.getrBtnGround().isSelected()) {
       typeCaliber = TypeRush.UNDERGROUND;
     }
   }
 }
    public void stateChanged(ChangeEvent ce) {
      if (silentGUIChange == true) return;

      if (ce.getSource() == filtSlider) {
        gCB.setfilt(
            (double) gCB.freqToFilt(gCB.sliderToLogval((int) (filtSlider.getValue()), 100.0)));
        updatefiltSpinner();
      }
      if (ce.getSource() == filtSpinner) {
        gCB.setfilt(gCB.freqToFilt((double) (filtSpinner.getValue())));
        updatefiltSlider();
      }
    }
Пример #18
0
        @Override
        public void stateChanged(ChangeEvent e) {
          if (e.getSource() instanceof DrumNoteMap) {
            DrumNoteMap map = (DrumNoteMap) e.getSource();

            // Don't write pass-through drum maps to the prefs node
            // these are used for non-drum tracks and their mapping
            // isn't desirable to save.
            if (!(map instanceof PassThroughDrumNoteMap)) map.save(drumPrefs);

            fireChangeEvent(AbcPartProperty.DRUM_MAPPING);
          }
        }
Пример #19
0
 @Override
 public void stateChanged(ChangeEvent ce) {
   JSlider slider = (JSlider) ce.getSource();
   float percentage = slider.getValue() / 1000f;
   float newTime = percentage * cinematic.getDuration();
   enqueue(() -> cinematic.setTime(newTime));
 }
Пример #20
0
 public void stateChanged(ChangeEvent e) {
   SolutionFlagsStateChange state = (SolutionFlagsStateChange) e.getSource();
   Solution solution = state.solution;
   int showOffset = state.showGraphChanged ? (solution.isShowGraph() ? 1 : -1) : 0;
   int sonifyOffset = state.sonifyGraphChanged ? (solution.isSonifyGraph() ? 1 : -1) : 0;
   updateShowSonifyCounts(solution, showOffset, sonifyOffset);
 }
Пример #21
0
 /** Reaction to value changes in the form. */
 public void stateChanged(ChangeEvent e) {
   String nm = ((JComponent) e.getSource()).getName();
   double x;
   if (nm.equals(nmSpinMaxFlow)) {
     x = (Double) spinMaxFlow.getValue();
     mf = x;
   }
   if (nm.equals(nmSpinCapDrop)) {
     x = (Double) spinCapDrop.getValue();
     drp = x;
   }
   if (nm.equals(nmSpinCritDen)) {
     x = (Double) spinCritDen.getValue();
     if (x <= jd) cd = x;
   }
   if (nm.equals(nmSpinJamDen)) {
     x = (Double) spinJamDen.getValue();
     if (x >= cd) jd = x;
   }
   if (nm.equals(nmSpinVff)) {
     x = (Double) spinVff.getValue();
     if (x > 0.0) cd = mf / x;
     double xx = (Double) spinWc.getValue();
     if (xx > 0.0) jd = cd + (mf / xx);
   }
   if (nm.equals(nmSpinWc)) {
     x = (Double) spinWc.getValue();
     if (x > 0.0) jd = cd + (mf / x);
   }
   updateSpinners();
   updateFDSeries();
   return;
 }
Пример #22
0
  public void stateChanged(ChangeEvent evt) {
    Object obj = evt.getSource();

    if (obj == f_sl) {
      final float val = 1 + (float) f_sl.getValue() / 100;
      String text = Float.toString(val);

      if (text.length() > 3) text = text.substring(0, 4);
      else if (text.length() < 4) text = text + "0";

      f_tf.setText(text);

      /*
       * Calculate LUT...
       */
      final float[] array = new float[f_max];

      for (int i = 0; i < f_max; ++i) array[i] = (i * (float) val);

      final float max = array[f_max - 1];

      f_lut = new LUT(f_chan, array, f_max - 1);

      // System.out.println("@@ LevelSiderPanel: Adjusting channel " +
      // f_chan + " values...");
      // System.out.println("                    Adjusting " +
      // CHANNEL_NICKNAME[f_chan] + " values...");

      fireLUTChangeEvent();
    }
  }
Пример #23
0
  /** Change-Events of the MainTabPane */
  public void stateChanged(ChangeEvent event) {
    GuiMainTabPane pane = (GuiMainTabPane) event.getSource();
    int count = pane.getSelectedIndex(); // number of selected Tab

    while (true) {
      // Change-Events bei betreten neuer Tabs
      if (count == 0) { // StartTab
        pane.setComponentAt(count, pane.getTabStart());
        new Thread(pane.getTabStart().getControl()).start();
        break;
      }
      if (count == 1) { // ProgrammTab
        pane.setComponentAt(count, pane.getTabProgramm());
        break;
      }
      if (count == 2) { // TimerTab
        pane.setComponentAt(count, pane.getTabTimer());
        new Thread(pane.getTabTimer().getControl()).start();
        break;
      }
      if (count == 3) { // MovieGuideTab
        pane.getTabMovieGuide().getControl().askToDownloadMG();
        break;
      }
      break;
    }

    pane.setIndex(count);
  }
 /** Called when the speed slider was moved. */
 public void SpeedSlider_stateChanged(ChangeEvent e) {
   JSlider source = (JSlider) e.getSource();
   if (!source.getValueIsAdjusting()) {
     int speed = source.getValue();
     notifyControllerListeners(ControllerEvent.SPEED_CHANGE, new Integer(speed));
   }
 }
 public void stateChanged(ChangeEvent e) {
   JSlider source = (JSlider) e.getSource();
   if (!source.getValueIsAdjusting()) {
     int delay = 1000 * (int) source.getValue();
     LifeSimulation.timer().setDelay(delay);
   }
 }
Пример #26
0
 public void stateChanged(ChangeEvent e) {
   if (lecteur != null) {
     if (e.getSource() == deplacement) {
       deplacement.setToolTipText(toString(lecteur.getMediaTime()));
     }
   }
 }
Пример #27
0
  //
  //  Implement the ChangeListener
  //
  public void stateChanged(ChangeEvent e) {
    //  Keep the scrolling of the row table in sync with main table

    JViewport viewport = (JViewport) e.getSource();
    JScrollPane scrollPane = (JScrollPane) viewport.getParent();
    scrollPane.getVerticalScrollBar().setValue(viewport.getViewPosition().y);
  }
    @Override
    public void stateChanged(ChangeEvent e) {
      JSlider slider = (JSlider) e.getSource();

      elementCount = slider.getValue();
      chooseElementCount.setText("WŠhlen sie die maximale Elementzahl: " + elementCount);
    }
 /** Sets the direction of the vehicle */
 public void stateChanged(ChangeEvent event) {
   JSlider source = (JSlider) event.getSource();
   if (!source.getValueIsAdjusting()) {
     SensorInfo.getInstance().setSliderDirection(source.getValue());
     Controller.getInstance().setMotors();
   }
 }
  public void stateChanged(ChangeEvent e) {
    JSlider source = (JSlider) e.getSource();
    if (!source.getValueIsAdjusting()) numRand = (int) source.getValue();

    // Get rid of the old lines
    this.randLines.clear();

    // add the new random lines to the randLines arrayList
    for (int i = 0; i < numRand; i++) {
      shuffle(this.order);
      this.randLines.add(
          new StepFunctionLine(
              this.sc,
              this.order,
              new Color(200, 200, 200),
              1,
              windowWidth - (infoWidth + axesWidth),
              windowHeight - axesWidth - edgeBuffer,
              infoWidth + (axesWidth * 3 / 4),
              windowHeight - axesWidth * 3 / 4,
              "Random",
              "N/A"));
    }

    repaint();
  }