Package java.awt.event

Examples of java.awt.event.AdjustmentListener


  private boolean autoscroll;
 
  public ScrollableJTextArea() {
    text = new JTextArea();
    setViewportView(text);
    getVerticalScrollBar().addAdjustmentListener(new AdjustmentListener() {
      @Override
      public void adjustmentValueChanged(AdjustmentEvent e) {
        if(e.getValue() != ((JScrollBar)e.getSource()).getMaximum() - ((JScrollBar)e.getSource()).getVisibleAmount()) autoscroll = false;
        else autoscroll = true;
      }
View Full Code Here


    // setar o conteudo e o tamanho do graphViewport
    graphViewport.setView(graphPane);
    graphViewport.setSize(800, 600);

    jspGraph.getHorizontalScrollBar().addAdjustmentListener(
        new AdjustmentListener() {
          public void adjustmentValueChanged(AdjustmentEvent e) {
            graphPane.update();
          }
        });

    jspGraph.getVerticalScrollBar().addAdjustmentListener(
        new AdjustmentListener() {
          public void adjustmentValueChanged(AdjustmentEvent e) {
            graphPane.update();
          }
        });
View Full Code Here

    public StatisticsPanel() {
        paintPanel = new StatisticsPaintPanel();
        //
        final JScrollPane jsp = new JScrollPane(paintPanel);
        jsp.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
        jsp.getHorizontalScrollBar().addAdjustmentListener(new AdjustmentListener() {

            @Override
            public void adjustmentValueChanged(AdjustmentEvent e) {
//        if (!e.getValueIsAdjusting()) {
                paintPanel.setViewSize(jsp.getViewport().getViewRect());
//        }
            }
        });
        jsp.getVerticalScrollBar().addAdjustmentListener(new AdjustmentListener() {

            @Override
            public void adjustmentValueChanged(AdjustmentEvent e) {
//        if (!e.getValueIsAdjusting()) {
                paintPanel.setViewSize(jsp.getViewport().getViewRect());
View Full Code Here

        });

        // setup the scrollbar so the user can quickly scroll through the test sequences
        explScrollBar.setOrientation(JScrollBar.HORIZONTAL);
        explScrollBar.setToolTipText("Use the slider to scroll through test sequences");
        explScrollBar.addAdjustmentListener(new AdjustmentListener() {
            public void adjustmentValueChanged(AdjustmentEvent evt) {
                explScrollBar.setMaximum(tree.getRowCount());
                explScrollBar.setMinimum(0);
                explScrollBar.setVisibleAmount(1);
                tree.setSelectionPath(tree.getPathForRow(explScrollBar.getValue()));
View Full Code Here

        });
        sourceDataLine = null;

        scrollPane.setViewportView(wavePanel);

        scrollPane.getHorizontalScrollBar().addAdjustmentListener(new AdjustmentListener() {
            public void adjustmentValueChanged(AdjustmentEvent evt) {
                if (sourceDataLine == null) return;
                if ((sourceDataLine.isRunning())&&((scrollPosition != evt.getValue())||(evt.getAdjustmentType() == AdjustmentEvent.ADJUSTMENT_LAST))) {
                    wavePanel.seekPosition(evt.getValue());
                }
View Full Code Here

        populationLabel = new Label(Integer.toString(populationSize));
        panel.add(new Label("Population Size", Label.RIGHT));
        panel.add(new Scrollbar(Scrollbar.HORIZONTAL, populationSize, 1,
                          MIN_POPULATION_SIZE, MAX_POPULATION_SIZE) {
                      {
                          addAdjustmentListener(new AdjustmentListener() {
                                                    public void adjustmentValueChanged(AdjustmentEvent evt) {
                                                        populationSize = getValue();
                                                        populationLabel.setText(Integer.toString(getValue()));
                                                        populationLabel.repaint();
                                                    }
View Full Code Here

                (int) (weighting[0] * 100)));
        panel.add(new Label("Note Density", Label.RIGHT));
        panel.add(new Scrollbar(Scrollbar.HORIZONTAL,
                          (int) (weighting[0] * 100), 1, 0, 100) {
                      {
                          addAdjustmentListener(new AdjustmentListener() {
                                                    public void adjustmentValueChanged(AdjustmentEvent evt) {
                                                        weighting[0] = getValue() / 100.0;
                                                        F1Label.setText(Integer.toString(getValue()));
                                                        F1Label.repaint();
                                                    }
                                                }
                          );
                      }
                  }
        );
        panel.add(F1Label);

        F2Label = new Label(Integer.toString(
                (int) (weighting[1] * 100)));
        panel.add(new Label("Pitch Variety", Label.RIGHT));
        panel.add(new Scrollbar(Scrollbar.HORIZONTAL,
                          (int) (weighting[1] * 100), 1, 0, 100) {
                      {
                          addAdjustmentListener(new AdjustmentListener() {
                                                    public void adjustmentValueChanged(AdjustmentEvent evt) {
                                                        weighting[1] = getValue() / 100.0;
                                                        F2Label.setText(Integer.toString(getValue()));
                                                        F2Label.repaint();
                                                    }
                                                }
                          );
                      }
                  }
        );
        panel.add(F2Label);

        F3Label = new Label(Integer.toString(
                (int) (weighting[1] * 100)));
        panel.add(new Label("Rhythmic Variety", Label.RIGHT));
        panel.add(new Scrollbar(Scrollbar.HORIZONTAL,
                          (int) (weighting[2] * 100), 1, 0, 100) {
                      {
                          addAdjustmentListener(new AdjustmentListener() {
                                                    public void adjustmentValueChanged(AdjustmentEvent evt) {
                                                        weighting[2] = getValue() / 100.0;
                                                        F3Label.setText(Integer.toString(getValue()));
                                                        F3Label.repaint();
                                                    }
                                                }
                          );
                      }
                  }
        );
        panel.add(F3Label);

        F4Label = new Label(Integer.toString(
                (int) (weighting[3] * 100)));
        panel.add(new Label("Climax Strength", Label.RIGHT));
        panel.add(new Scrollbar(Scrollbar.HORIZONTAL,
                          (int) (weighting[3] * 100), 1, 0, 100) {
                      {
                          addAdjustmentListener(new AdjustmentListener() {
                                                    public void adjustmentValueChanged(AdjustmentEvent evt) {
                                                        weighting[3] = getValue() / 100.0;
                                                        F4Label.setText(Integer.toString(getValue()));
                                                        F4Label.repaint();
                                                    }
                                                }
                          );
                      }
                  }
        );
        panel.add(F4Label);

        F5Label = new Label(Integer.toString(
                (int) (weighting[4] * 100)));
        panel.add(new Label("Rest Density", Label.RIGHT));
        panel.add(new Scrollbar(Scrollbar.HORIZONTAL,
                          (int) (weighting[4] * 100), 1, 0, 100) {
                      {
                          addAdjustmentListener(new AdjustmentListener() {
                                                    public void adjustmentValueChanged(AdjustmentEvent evt) {
                                                        weighting[4] = getValue() / 100.0;
                                                        F5Label.setText(Integer.toString(getValue()));
                                                        F5Label.repaint();
                                                    }
                                                }
                          );
                      }
                  }
        );
        panel.add(F5Label);

        F6Label = new Label(Integer.toString(
                (int) (weighting[5] * 100)));
        panel.add(new Label("Tonal Deviation", Label.RIGHT));
        panel.add(new Scrollbar(Scrollbar.HORIZONTAL,
                          (int) (weighting[5] * 100), 1, 0, 100) {
                      {
                          addAdjustmentListener(new AdjustmentListener() {
                                                    public void adjustmentValueChanged(AdjustmentEvent evt) {
                                                        weighting[5] = getValue() / 100.0;
                                                        F6Label.setText(Integer.toString(getValue()));
                                                        F6Label.repaint();
                                                    }
                                                }
                          );
                      }
                  }
        );
        panel.add(F6Label);

        F7Label = new Label(Integer.toString(
                (int) (weighting[6] * 100)));
        panel.add(new Label("Key Centeredness", Label.RIGHT));
        panel.add(new Scrollbar(Scrollbar.HORIZONTAL,
                          (int) (weighting[6] * 100), 1, 0, 100) {
                      {
                          addAdjustmentListener(new AdjustmentListener() {
                                                    public void adjustmentValueChanged(AdjustmentEvent evt) {
                                                        weighting[6] = getValue() / 100.0;
                                                        F7Label.setText(Integer.toString(getValue()));
                                                        F7Label.repaint();
                                                    }
                                                }
                          );
                      }
                  }
        );
        panel.add(F7Label);

        F8Label = new Label(Integer.toString(
                (int) (weighting[7] * 100)));
        panel.add(new Label("Pitch Range", Label.RIGHT));
        panel.add(new Scrollbar(Scrollbar.HORIZONTAL,
                          (int) (weighting[7] * 100), 1, 0, 100) {
                      {
                          addAdjustmentListener(new AdjustmentListener() {
                                                    public void adjustmentValueChanged(AdjustmentEvent evt) {
                                                        weighting[7] = getValue() / 100.0;
                                                        F8Label.setText(Integer.toString(getValue()));
                                                        F8Label.repaint();
                                                    }
                                                }
                          );
                      }
                  }
        );
        panel.add(F8Label);

        F9Label = new Label(Integer.toString(
                (int) (weighting[8] * 100)));
        panel.add(new Label("Rhythm Range", Label.RIGHT));
        panel.add(new Scrollbar(Scrollbar.HORIZONTAL,
                          (int) (weighting[8] * 100), 1, 0, 100) {
                      {
                          addAdjustmentListener(new AdjustmentListener() {
                                                    public void adjustmentValueChanged(AdjustmentEvent evt) {
                                                        weighting[8] = getValue() / 100.0;
                                                        F9Label.setText(Integer.toString(getValue()));
                                                        F9Label.repaint();
                                                    }
                                                }
                          );
                      }
                  }
        );
        panel.add(F9Label);

        F10Label = new Label(Integer.toString(
                (int) (weighting[9] * 100)));
        panel.add(new Label("Repeated Pitch Density", Label.RIGHT));
        panel.add(new Scrollbar(Scrollbar.HORIZONTAL,
                          (int) (weighting[9] * 100), 1, 0, 100) {
                      {
                          addAdjustmentListener(new AdjustmentListener() {
                                                    public void adjustmentValueChanged(AdjustmentEvent evt) {
                                                        weighting[9] = getValue() / 100.0;
                                                        F10Label.setText(Integer.toString(getValue()));
                                                        F10Label.repaint();
                                                    }
                                                }
                          );
                      }
                  }
        );
        panel.add(F10Label);

        F11Label = new Label(Integer.toString(
                (int) (weighting[10] * 100)));
        panel.add(new Label("Repeated Rhythm Density", Label.RIGHT));
        panel.add(new Scrollbar(Scrollbar.HORIZONTAL,
                          (int) (weighting[10] * 100), 1, 0, 100) {
                      {
                          addAdjustmentListener(new AdjustmentListener() {
                                                    public void adjustmentValueChanged(AdjustmentEvent evt) {
                                                        weighting[10] = getValue() / 100.0;
                                                        F11Label.setText(Integer.toString(getValue()));
                                                        F11Label.repaint();
                                                    }
                                                }
                          );
                      }
                  }
        );
        panel.add(F11Label);

        F12Label = new Label(Integer.toString(
                (int) (weighting[11] * 100)));
        panel.add(new Label("Melodic Direction Stability", Label.RIGHT));
        panel.add(new Scrollbar(Scrollbar.HORIZONTAL,
                          (int) (weighting[11] * 100), 1, 0, 100) {
                      {
                          addAdjustmentListener(new AdjustmentListener() {
                                                    public void adjustmentValueChanged(AdjustmentEvent evt) {
                                                        weighting[11] = getValue() / 100.0;
                                                        F12Label.setText(Integer.toString(getValue()));
                                                        F12Label.repaint();
                                                    }
                                                }
                          );
                      }
                  }
        );
        panel.add(F12Label);

        F13Label = new Label(Integer.toString(
                (int) (weighting[12] * 100)));
        panel.add(new Label("Overall Pitch Direction", Label.RIGHT));
        panel.add(new Scrollbar(Scrollbar.HORIZONTAL,
                          (int) (weighting[12] * 100), 1, 0, 100) {
                      {
                          addAdjustmentListener(new AdjustmentListener() {
                                                    public void adjustmentValueChanged(AdjustmentEvent evt) {
                                                        weighting[12] = getValue() / 100.0;
                                                        F13Label.setText(Integer.toString(getValue()));
                                                        F13Label.repaint();
                                                    }
                                                }
                          );
                      }
                  }
        );
        panel.add(F13Label);

        F14Label = new Label(Integer.toString(
                (int) (weighting[13] * 100)));
        panel.add(new Label("Pitch Movement", Label.RIGHT));
        panel.add(new Scrollbar(Scrollbar.HORIZONTAL,
                          (int) (weighting[13] * 100), 1, 0, 100) {
                      {
                          addAdjustmentListener(new AdjustmentListener() {
                                                    public void adjustmentValueChanged(AdjustmentEvent evt) {
                                                        weighting[13] = getValue() / 100.0;
                                                        F14Label.setText(Integer.toString(getValue()));
                                                        F14Label.repaint();
                                                    }
                                                }
                          );
                      }
                  }
        );
        panel.add(F14Label);

        F15Label = new Label(Integer.toString(
                (int) (weighting[14] * 100)));
        panel.add(new Label("Dissonance", Label.RIGHT));
        panel.add(new Scrollbar(Scrollbar.HORIZONTAL,
                          (int) (weighting[14] * 100), 1, 0, 100) {
                      {
                          addAdjustmentListener(new AdjustmentListener() {
                                                    public void adjustmentValueChanged(AdjustmentEvent evt) {
                                                        weighting[14] = getValue() / 100.0;
                                                        F15Label.setText(Integer.toString(getValue()));
                                                        F15Label.repaint();
                                                    }
                                                }
                          );
                      }
                  }
        );
        panel.add(F15Label);

        F16Label = new Label(Integer.toString(
                (int) (weighting[15] * 100)));
        panel.add(new Label("Leap Compensation", Label.RIGHT));
        panel.add(new Scrollbar(Scrollbar.HORIZONTAL,
                          (int) (weighting[15] * 100), 1, 0, 100) {
                      {
                          addAdjustmentListener(new AdjustmentListener() {
                                                    public void adjustmentValueChanged(AdjustmentEvent evt) {
                                                        weighting[15] = getValue() / 100.0;
                                                        F16Label.setText(Integer.toString(getValue()));
                                                        F16Label.repaint();
                                                    }
                                                }
                          );
                      }
                  }
        );
        panel.add(F16Label);

        F17Label = new Label(Integer.toString(
                (int) (weighting[16] * 100)));
        panel.add(new Label("Syncopation", Label.RIGHT));
        panel.add(new Scrollbar(Scrollbar.HORIZONTAL,
                          (int) (weighting[16] * 100), 1, 0, 100) {
                      {
                          addAdjustmentListener(new AdjustmentListener() {
                                                    public void adjustmentValueChanged(AdjustmentEvent evt) {
                                                        weighting[16] = getValue() / 100.0;
                                                        F17Label.setText(Integer.toString(getValue()));
                                                        F17Label.repaint();
                                                    }
                                                }
                          );
                      }
                  }
        );
        panel.add(F17Label);

        F18Label = new Label(Integer.toString(
                (int) (weighting[17] * 100)));
        panel.add(new Label("Repeated Pitch Patterns of 3", Label.RIGHT));
        panel.add(new Scrollbar(Scrollbar.HORIZONTAL,
                          (int) (weighting[17] * 100), 1, 0, 100) {
                      {
                          addAdjustmentListener(new AdjustmentListener() {
                                                    public void adjustmentValueChanged(AdjustmentEvent evt) {
                                                        weighting[17] = getValue() / 100.0;
                                                        F18Label.setText(Integer.toString(getValue()));
                                                        F18Label.repaint();
                                                    }
                                                }
                          );
                      }
                  }
        );
        panel.add(F18Label);

        F19Label = new Label(Integer.toString(
                (int) (weighting[18] * 100)));
        panel.add(new Label("Repeated Pitch Patterns of 4", Label.RIGHT));
        panel.add(new Scrollbar(Scrollbar.HORIZONTAL,
                          (int) (weighting[18] * 100), 1, 0, 100) {
                      {
                          addAdjustmentListener(new AdjustmentListener() {
                                                    public void adjustmentValueChanged(AdjustmentEvent evt) {
                                                        weighting[18] = getValue() / 100.0;
                                                        F19Label.setText(Integer.toString(getValue()));
                                                        F19Label.repaint();
                                                    }
                                                }
                          );
                      }
                  }
        );
        panel.add(F19Label);

        F20Label = new Label(Integer.toString(
                (int) (weighting[19] * 100)));
        panel.add(new Label("Repeated Rhythm Patterns of 3", Label.RIGHT));
        panel.add(new Scrollbar(Scrollbar.HORIZONTAL,
                          (int) (weighting[19] * 100), 1, 0, 100) {
                      {
                          addAdjustmentListener(new AdjustmentListener() {
                                                    public void adjustmentValueChanged(AdjustmentEvent evt) {
                                                        weighting[19] = getValue() / 100.0;
                                                        F20Label.setText(Integer.toString(getValue()));
                                                        F20Label.repaint();
                                                    }
                                                }
                          );
                      }
                  }
        );
        panel.add(F20Label);

        F21Label = new Label(Integer.toString(
                (int) (weighting[20] * 100)));
        panel.add(new Label("Repeated Rhythm Patterns of 4", Label.RIGHT));
        panel.add(new Scrollbar(Scrollbar.HORIZONTAL,
                          (int) (weighting[20] * 100), 1, 0, 100) {
                      {
                          addAdjustmentListener(new AdjustmentListener() {
                                                    public void adjustmentValueChanged(AdjustmentEvent evt) {
                                                        weighting[20] = getValue() / 100.0;
                                                        F21Label.setText(Integer.toString(getValue()));
                                                        F21Label.repaint();
                                                    }
                                                }
                          );
                      }
                  }
        );
        panel.add(F21Label);

        F22Label = new Label(Integer.toString(
                (int) (weighting[21] * 100)));
        panel.add(new Label("Climax Position", Label.RIGHT));
        panel.add(new Scrollbar(Scrollbar.HORIZONTAL,
                          (int) (weighting[21] * 100), 1, 0, 100) {
                      {
                          addAdjustmentListener(new AdjustmentListener() {
                                                    public void adjustmentValueChanged(AdjustmentEvent evt) {
                                                        weighting[21] = getValue() / 100.0;
                                                        F22Label.setText(Integer.toString(getValue()));
                                                        F22Label.repaint();
                                                    }
                                                }
                          );
                      }
                  }
        );
        panel.add(F22Label);

        F23Label = new Label(Integer.toString(
                (int) (weighting[22] * 100)));
        panel.add(new Label("Climax Tonality", Label.RIGHT));
        panel.add(new Scrollbar(Scrollbar.HORIZONTAL,
                          (int) (weighting[22] * 100), 1, 0, 100) {
                      {
                          addAdjustmentListener(new AdjustmentListener() {
                                                    public void adjustmentValueChanged(AdjustmentEvent evt) {
                                                        weighting[22] = getValue() / 100.0;
                                                        F23Label.setText(Integer.toString(getValue()));
                                                        F23Label.repaint();
                                                    }
View Full Code Here

        textPane.setFont(new Font("Monospaced", Font.PLAIN, 12));
        textPane.setBackground(Color.white);
        textPane.setForeground(Color.black);

        scolls.getVerticalScrollBar().addAdjustmentListener(new AdjustmentListener() {
            @Override
            public void adjustmentValueChanged(AdjustmentEvent e)
            {
                lnums.repaint();
            }
View Full Code Here

        });

        // A fix for name panel painting problems.   Not sure why this is neccessary, but it is.
        // The adustment listener forces a repaint after a scroll action is complete.
        final JScrollBar sb = this.getVerticalScrollBar();
        sb.addAdjustmentListener(new AdjustmentListener() {
            public void adjustmentValueChanged(AdjustmentEvent adjustmentEvent) {
                if (isScrolling) {
                    if (!adjustmentEvent.getValueIsAdjusting()) {
                        isScrolling = false;
                        trackPanel.getNamePanel().repaint();
View Full Code Here

    {
      setLayout(new BorderLayout());
      add(calendarPanel, BorderLayout.CENTER);
      bar=new JScrollBar(JScrollBar.VERTICAL);
      add(bar, BorderLayout.EAST);
      bar.addAdjustmentListener(new AdjustmentListener() {     
        @Override
        public void adjustmentValueChanged(AdjustmentEvent e) {
          visuals.grid.setDY(bar.getValue());
         
          // set time in model.
View Full Code Here

TOP

Related Classes of java.awt.event.AdjustmentListener

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.