public void paint(Graphics g) {
   int x = s1.getValue();
   int y = s2.getValue();
   int z = s3.getValue();
   Color c = new Color(x, y, z);
   setBackground(c);
 }
 public void adjustmentValueChanged(AdjustmentEvent e) {
   Object ob = e.getSource();
   int p, q, r;
   p = s1.getValue();
   q = s2.getValue();
   r = s3.getValue();
   Color c = new Color(p, q, r);
   p1.setBackground(c);
 }
  public void paint(Graphics g) {

    msg = "Vertical: " + vertSB.getValue();
    msg += ", Horizontal: " + horzSB.getValue();
    g.drawString(msg, 6, 160);

    // show current mouse drag position

    g.drawString("*", horzSB.getValue(), vertSB.getValue());
  }
 /** Capture des évènements des scrollbars */
 public void adjustmentValueChanged(AdjustmentEvent e) {
   if (e.getSource().equals(sb_victoires)) {
     int valeur = sb_victoires.getValue();
     lbl_victoires.setText("Nombre De Victoires: " + valeur);
     nb_victoires = valeur;
   } else {
     int valeur = sb_fps.getValue();
     lbl_fps.setText("FPS: " + valeur);
     fps = valeur;
   }
 } // adjustmentValueChanged()
Beispiel #5
0
 public void adjustmentValueChanged(AdjustmentEvent event) {
   if (event.getSource() == SBrecpos) {
     if (event.getAdjustmentType() == AdjustmentEvent.TRACK) {
       goTo(SBrecpos.getValue());
       return;
     }
     if (event.getID() == AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED) {
       SBrecpos.setEnabled(false);
       goTo(SBrecpos.getValue());
       SBrecpos.setEnabled(true);
     }
   }
 }
 public void recalcStats() { // TODO - poprawić przewidywany czas turnieju
   groupsL.setText(Strings.groupsT + groupsSB.getValue());
   boardsL.setText(Strings.boardsT + boardsSB.getValue());
   sgTimeL.setText(Strings.sgTimeT + (sgTimeSB.getValue() / 2f) + " min");
   int graczy = DB.getCompetitors(turniej.getId()).size();
   if (turniej.getBoards() < 1 || graczy < 2) return;
   float czasSG = sgTimeSB.getValue() / 2f;
   int grup = groupsSB.getValue();
   int rozgrywek = Simulator.rozgrywek_eliminacje(graczy, grup);
   stats1L.setText(Strings.gamesT + String.valueOf(rozgrywek));
   int gier_naraz = (int) Math.min(Math.floor(graczy / 2), turniej.getBoards());
   stats2L.setText(Strings.timeRRET + Math.ceil(rozgrywek / gier_naraz) * czasSG + " min");
 }
 /**
  * Called to process scrollbar events.
  *
  * @param event to process.
  */
 public void adjustmentValueChanged(AdjustmentEvent event) {
   try {
     final Scrollbar hScroll = getScrollbar(Scrollbar.HORIZONTAL);
     final Scrollbar vScroll = getScrollbar(Scrollbar.VERTICAL);
     final Point scrollPosition = getScrollPosition();
     setScrollPosition(
         (hScroll != null) ? hScroll.getValue() : scrollPosition.x,
         (vScroll != null) ? vScroll.getValue() : scrollPosition.y);
   } catch (final Throwable exp) {
     exp.printStackTrace(DjVuOptions.err);
     System.gc();
   }
 }
Beispiel #8
0
  public void adjustmentValueChanged(AdjustmentEvent evt) {
    // chamado quando o usu�rio modifica o valor de uma das
    // barras de rolagem

    int r = redScroll.getValue();
    int g = greenScroll.getValue();
    int b = blueScroll.getValue();
    redLabel.setText(" R = " + r);
    greenLabel.setText(" G = " + g);
    blueLabel.setText(" B = " + b);
    colorCanvas.setBackground(new Color(r, g, b));
    colorCanvas.repaint();
    // Redraw the canvas in its new color.

  } // end adjustmentValueChanged
 private void setComponentsActions() {
   nameTF
       .getDocument()
       .addDocumentListener(
           new MyDocumentListener() {
             @Override
             public void action() {
               turniej.setName(nameTF.getText());
               DB.insertOrUpdateTournament(turniej);
             }
           });
   yearTF
       .getDocument()
       .addDocumentListener(
           new MyDocumentListener() {
             @Override
             public void action() {
               turniej.setYear(yearTF.getText());
               DB.insertOrUpdateTournament(turniej);
             }
           });
   groupsSB.addAdjustmentListener(
       e -> {
         if (!turniej.isPlayersEditAllowed()) {
           groupsSB.setValue(turniej.getRounds());
           return;
         }
         int g = groupsSB.getValue();
         turniej.setRounds(g);
         DB.insertOrUpdateTournament(turniej);
         recalcStats();
       });
   boardsSB.addAdjustmentListener(
       e -> {
         if (!turniej.isPlayersEditAllowed()) {
           boardsSB.setValue(turniej.getBoards());
           return;
         }
         int g = boardsSB.getValue();
         turniej.setBoards(g);
         DB.insertOrUpdateTournament(turniej);
         recalcStats();
       });
   sgTimeSB.addAdjustmentListener(
       e -> {
         recalcStats();
       });
 }
Beispiel #10
0
  private void updateFromSlider() {
    double v = getValue(scroll.getValue());
    field.setText(ftoa(v));
    val = v;

    value_changed.notify(new Double(val));
  }
Beispiel #11
0
 public synchronized void adjustmentValueChanged(AdjustmentEvent e) {
   Object source = e.getSource();
   for (int i = 0; i < slider.size(); i++) {
     if (source == slider.elementAt(i)) {
       Scrollbar sb = (Scrollbar) source;
       TextField tf = (TextField) numberField.elementAt(sliderIndexes[i]);
       int digits = sliderScales[i] == 1.0 ? 0 : 2;
       tf.setText("" + IJ.d2s(sb.getValue() / sliderScales[i], digits));
     }
   }
 }
    public synchronized void adjustmentValueChanged(AdjustmentEvent e) {

      if (!checkImage()) {
        IJ.beep();
        IJ.showStatus("No Image");
        return;
      }

      if (e.getSource() == minSlider) {
        adjustMinHue((int) minSlider.getValue());
      } else if (e.getSource() == maxSlider) {
        adjustMaxHue((int) maxSlider.getValue());
      } else if (e.getSource() == minSlider2) {
        adjustMinSat((int) minSlider2.getValue());
      } else if (e.getSource() == maxSlider2) {
        adjustMaxSat((int) maxSlider2.getValue());
      } else if (e.getSource() == minSlider3) {
        adjustMinBri((int) minSlider3.getValue());
      } else if (e.getSource() == maxSlider3) {
        adjustMaxBri((int) maxSlider3.getValue());
      }
      originalB.setEnabled(true);
      updateLabels();
      updatePlot();
      notify();
    }
 public double getVoltage() {
   frequency = slider.getValue() * (maxVoltage - bias) / 100. + bias;
   return frequency;
 }
Beispiel #14
0
 @Override
 public int getValue() {
   return bar.getValue();
 }