Package javax.swing

Examples of javax.swing.JSlider$AccessibleJSlider


      JButton c = (JButton) cmp;
      c.setOpaque(false);
    }

    if (cmp instanceof JSlider) {
      JSlider c = (JSlider) cmp;
      c.setOpaque(false);
      c.setForeground(MAIN_FOREGROUND);
    }
  }
View Full Code Here


        memoryCapacityLabel = new JLabel("16 MB");
        memoryCapacityLabel.setBackground(LIGHT_BLUE);
        memoryCapacityLabel.setForeground(Color.black);
        p1.add(memoryCapacityLabel, BorderLayout.NORTH);

        memoryCapacitySlider = new JSlider(JSlider.VERTICAL, 0, 128, 16);

        memoryCapacitySlider.setBorder(BEVEL_BORDER);
        memoryCapacitySlider.createStandardLabels(64, 0);
        memoryCapacitySlider.setBackground(BACKGROUND);
        memoryCapacitySlider.setForeground(Color.black);
        memoryCapacitySlider.setPaintLabels(true);
        memoryCapacitySlider.setPaintTicks(true);
        memoryCapacitySlider.setMajorTickSpacing(32);
        memoryCapacitySlider.setMinorTickSpacing(8);
        memoryCapacitySlider.setSnapToTicks(false);
        memoryCapacitySlider.addChangeListener(this);

        p1.add(memoryCapacitySlider);
        add(p1);

        // controller for tile cache threshold
        JPanel p2 = new JPanel();
        p2.setLayout( new BorderLayout() );
        p2.setBackground(LIGHT_BLUE);

        memoryThresholdLabel = new JLabel("75%");
        memoryThresholdLabel.setBackground(LIGHT_BLUE);
        memoryThresholdLabel.setForeground(Color.black);
        p2.add(memoryThresholdLabel, BorderLayout.NORTH);

        memoryThresholdSlider = new JSlider(JSlider.VERTICAL, 0, 100, 75);

        memoryThresholdSlider.setBorder(BEVEL_BORDER);
        Hashtable mt_labels = new Hashtable();

        for ( int j = 0; j <= 100; j+=10 ) {
View Full Code Here

    /**
     * Responce to slider changes
     */
    public void stateChanged(ChangeEvent e) {
        JSlider slider = (JSlider) e.getSource();

        if ( slider == memoryCapacitySlider ) {
            memoryCapacityLabel.setText( slider.getValue() + " MB" );
            cache.setMemoryCapacity( (long) slider.getValue() * 1024L * 1024L );

            if ( statistics != null ) {
                memoryCapacity = (float) cache.getMemoryCapacity();
                memoryUsage    = (float) cache.getCacheMemoryUsed();
                percentTCM = (int)((100.0F * memoryUsage / memoryCapacity) + 0.5F);
                statistics.set(percentTCM);
            }
        } else if ( slider == memoryThresholdSlider ) {
            memoryThresholdLabel.setText( slider.getValue() + "%" );
            cache.setMemoryThreshold( (float)slider.getValue() / 100.0F );
        }
    }
View Full Code Here

    eventPanel.setBackground(c);
        JPanel thresholdPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
        thresholdPanel.setBackground(c);
    JLabel thresholdLabel = new JLabel("segment sensitivity: ");
    thresholdPanel.add(thresholdLabel);
    thresholdSlider = new JSlider(JSlider.HORIZONTAL, 0, 100, 1);
    thresholdSlider.setBackground(c);
    thresholdSlider.setValue(75);
    Hashtable labelTable = new Hashtable();
    labelTable.put( new Integer(0), new JLabel("low") );
    labelTable.put( new Integer(100), new JLabel("high") );
    thresholdSlider.setLabelTable( labelTable );
    thresholdSlider.setPaintLabels(true);
    thresholdSlider.setMajorTickSpacing(10);
    thresholdSlider.setPaintTicks(true);
    thresholdPanel.add(thresholdSlider);
        eventPanel.add(thresholdPanel);

        JPanel densityPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
        densityPanel.setBackground(c);
        JLabel densityLabel = new JLabel("segment density: ");
        densityPanel.add(densityLabel);
        densitySlider = new JSlider(JSlider.HORIZONTAL, 0, 20, 1);
        densitySlider.setBackground(c);
        densitySlider.setValue(15);
        densitySlider.setMajorTickSpacing(2);
        densitySlider.setPaintTicks(true);
    densitySlider.setLabelTable(labelTable);
View Full Code Here

        // positionProgressBar.setMinimum(0);
        // positionProgressBar.setMaximum(1000);
        // positionProgressBar.setValue(0);
        // positionProgressBar.setToolTipText("Time");

        positionSlider = new JSlider();
        positionSlider.setMinimum(0);
        positionSlider.setMaximum(1000);
        positionSlider.setValue(0);
        positionSlider.setToolTipText("Position");

        chapterLabel = new JLabel("00/00");

        previousChapterButton = new JButton();
        previousChapterButton.setIcon(new ImageIcon(getClass().getClassLoader().getResource("icons/control_start_blue.png")));
        previousChapterButton.setToolTipText("Go to previous chapter");

        rewindButton = new JButton();
        rewindButton.setIcon(new ImageIcon(getClass().getClassLoader().getResource("icons/control_rewind_blue.png")));
        rewindButton.setToolTipText("Skip back");

        stopButton = new JButton();
        stopButton.setIcon(new ImageIcon(getClass().getClassLoader().getResource("icons/control_stop_blue.png")));
        stopButton.setToolTipText("Stop");

        pauseButton = new JButton();
        pauseButton.setIcon(new ImageIcon(getClass().getClassLoader().getResource("icons/control_pause_blue.png")));
        pauseButton.setToolTipText("Play/pause");

        playButton = new JButton();
        playButton.setIcon(new ImageIcon(getClass().getClassLoader().getResource("icons/control_play_blue.png")));
        playButton.setToolTipText("Play");

        fastForwardButton = new JButton();
        fastForwardButton.setIcon(new ImageIcon(getClass().getClassLoader().getResource("icons/control_fastforward_blue.png")));
        fastForwardButton.setToolTipText("Skip forward");

        nextChapterButton = new JButton();
        nextChapterButton.setIcon(new ImageIcon(getClass().getClassLoader().getResource("icons/control_end_blue.png")));
        nextChapterButton.setToolTipText("Go to next chapter");

        toggleMuteButton = new JButton();
        toggleMuteButton.setIcon(new ImageIcon(getClass().getClassLoader().getResource("icons/sound_mute.png")));
        toggleMuteButton.setToolTipText("Toggle Mute");

        volumeSlider = new JSlider();
        volumeSlider.setOrientation(JSlider.HORIZONTAL);
        volumeSlider.setMinimum(LibVlcConst.MIN_VOLUME);
        volumeSlider.setMaximum(LibVlcConst.MAX_VOLUME);
        volumeSlider.setPreferredSize(new Dimension(100, 40));
        volumeSlider.setToolTipText("Change volume");
View Full Code Here

        });

        volumeSlider.addChangeListener(new ChangeListener() {
            @Override
            public void stateChanged(ChangeEvent e) {
                JSlider source = (JSlider)e.getSource();
                // if(!source.getValueIsAdjusting()) {
                mediaPlayer.setVolume(source.getValue());
                // }
            }
        });

        captureButton.addActionListener(new ActionListener() {
View Full Code Here

    }

    @Override
    public void stateChanged(ChangeEvent e) {
        if(e.getSource() instanceof JSlider) {
            JSlider slider = (JSlider)e.getSource();

            Integer index = (Integer)slider.getClientProperty(BAND_INDEX_PROPERTY);
            int value = slider.getValue();
            // Band...
            if(index != null) {
                equalizer.setAmp(index, value / 100f); // FIXME
            }
            // Preamp...
View Full Code Here

        modelValue = Math.min(modelValue, modelMax);
        modelValue = Math.max(modelValue, modelMin);

//        System.out.printf("min max value -> %d %d %d%n", modelMin, modelMax, modelValue);

        slider = new JSlider(JSlider.VERTICAL, modelMin, modelMax, modelValue);
        valueLabel = new JLabel() {
            @Override
            public Dimension getPreferredSize() {
                FontMetrics fm = getFontMetrics(getFont());
                return new Dimension(fm.stringWidth("-20.00dB"), fm.getHeight());
View Full Code Here

    private void createControls() {
        enableVideoAdjustCheckBox = new JCheckBox("Video Adjust");

        contrastLabel = new JLabel("Contrast");
        contrastSlider = new JSlider();
        contrastSlider.setOrientation(JSlider.HORIZONTAL);
        contrastSlider.setMinimum(Math.round(LibVlcConst.MIN_CONTRAST * 100.0f));
        contrastSlider.setMaximum(Math.round(LibVlcConst.MAX_CONTRAST * 100.0f));
        contrastSlider.setPreferredSize(new Dimension(100, 40));
        contrastSlider.setToolTipText("Change Contrast");
        contrastSlider.setEnabled(false);
        contrastSlider.setPaintLabels(true);
        contrastSlider.setPaintTicks(true);

        brightnessLabel = new JLabel("Brightness");
        brightnessSlider = new JSlider();
        brightnessSlider.setOrientation(JSlider.HORIZONTAL);
        brightnessSlider.setMinimum(Math.round(LibVlcConst.MIN_BRIGHTNESS * 100.0f));
        brightnessSlider.setMaximum(Math.round(LibVlcConst.MAX_BRIGHTNESS * 100.0f));
        brightnessSlider.setPreferredSize(new Dimension(100, 40));
        brightnessSlider.setToolTipText("Change Brightness");
        brightnessSlider.setEnabled(false);

        hueLabel = new JLabel("Hue");
        hueSlider = new JSlider();
        hueSlider.setOrientation(JSlider.HORIZONTAL);
        hueSlider.setMinimum(LibVlcConst.MIN_HUE);
        hueSlider.setMaximum(LibVlcConst.MAX_HUE);
        hueSlider.setPreferredSize(new Dimension(100, 40));
        hueSlider.setToolTipText("Change ");
        hueSlider.setEnabled(false);

        saturationLabel = new JLabel("Saturation");
        saturationSlider = new JSlider();
        saturationSlider.setOrientation(JSlider.HORIZONTAL);
        saturationSlider.setMinimum(Math.round(LibVlcConst.MIN_SATURATION * 100.0f));
        saturationSlider.setMaximum(Math.round(LibVlcConst.MAX_SATURATION * 100.0f));
        saturationSlider.setPreferredSize(new Dimension(100, 40));
        saturationSlider.setToolTipText("Change ");
        saturationSlider.setEnabled(false);

        gammaLabel = new JLabel("Gamma");
        gammaSlider = new JSlider();
        gammaSlider.setOrientation(JSlider.HORIZONTAL);
        gammaSlider.setMinimum(Math.round(LibVlcConst.MIN_GAMMA * 100.0f));
        gammaSlider.setMaximum(Math.round(LibVlcConst.MAX_GAMMA * 100.0f));
        gammaSlider.setPreferredSize(new Dimension(100, 40));
        gammaSlider.setToolTipText("Change ");
View Full Code Here

        });

        contrastSlider.addChangeListener(new ChangeListener() {
            @Override
            public void stateChanged(ChangeEvent e) {
                JSlider source = (JSlider)e.getSource();
                // if(!source.getValueIsAdjusting()) {
                mediaPlayer.setContrast(source.getValue() / 100.0f);
                // }
            }
        });

        brightnessSlider.addChangeListener(new ChangeListener() {
            @Override
            public void stateChanged(ChangeEvent e) {
                JSlider source = (JSlider)e.getSource();
                // if(!source.getValueIsAdjusting()) {
                mediaPlayer.setBrightness(source.getValue() / 100.0f);
                // }
            }
        });

        hueSlider.addChangeListener(new ChangeListener() {
            @Override
            public void stateChanged(ChangeEvent e) {
                JSlider source = (JSlider)e.getSource();
                // if(!source.getValueIsAdjusting()) {
                mediaPlayer.setHue(source.getValue());
                // }
            }
        });

        saturationSlider.addChangeListener(new ChangeListener() {
            @Override
            public void stateChanged(ChangeEvent e) {
                JSlider source = (JSlider)e.getSource();
                // if(!source.getValueIsAdjusting()) {
                mediaPlayer.setSaturation(source.getValue() / 100.0f);
                // }
            }
        });

        gammaSlider.addChangeListener(new ChangeListener() {
            @Override
            public void stateChanged(ChangeEvent e) {
                JSlider source = (JSlider)e.getSource();
                // if(!source.getValueIsAdjusting()) {
                mediaPlayer.setGamma(source.getValue() / 100.0f);
                // }
            }
        });
    }
View Full Code Here

TOP

Related Classes of javax.swing.JSlider$AccessibleJSlider

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.