Logo Search packages:      
Sourcecode: jlgui version File versions  Download package

void javazoom::jlgui::player::amp::skin::Skin::setVolumeBalancePanel ( int  vheight,
int  bheight 
) [inline, private]

Instantiate Volume/Balance Panel with ActiveComponent.

Parameters:
vheight 
bheight 

Definition at line 589 of file Skin.java.

References getResource(), and javazoom::jlgui::player::amp::util::Config::getVolume().

Referenced by loadSkin().

    {
        // Volume.
        acVolume = new ActiveJSlider();
        acVolume.setMinimum(0);
        acVolume.setMaximum(VOLUMEMAX);
        int volumeValue = config.getVolume();
        if (volumeValue < 0) volumeValue = (int) VOLUMEMAX / 2;
        acVolume.setValue(volumeValue);
        acVolume.setToolTipText(getResource("slider.volume"));
        int l = 0;
        for (int k = 0; k < volumeImage.length; k++)
        {
            //volumeImage[k] = (new Taftb(fakeIndex, imVolume, 68, 13, 2, "" + fakeIndex.charAt(k))).getBanner();
            volumeImage[k] = (new Taftb(fakeIndex, imVolume, imVolume.getWidth(null), 13, 2, "" + fakeIndex.charAt(k))).getBanner();
        }
        if (volumeImage[0].getHeight(null) > releasedVolumeImage[0].getHeight(null))
        {
            acVolume.setConstraints(new AbsoluteConstraints(volumeBarLocation[l++], volumeBarLocation[l++], volumeImage[0].getWidth(null), volumeImage[0].getHeight(null)));
        }
        else
        {
            acVolume.setConstraints(new AbsoluteConstraints(volumeBarLocation[l++], volumeBarLocation[l++], volumeImage[0].getWidth(null), releasedVolumeImage[0].getHeight(null)));
        }
        ActiveSliderUI sUI = new ActiveSliderUI(acVolume);
        sUI.setThumbImage(releasedVolumeImage[0]);
        sUI.setThumbPressedImage(pressedVolumeImage[0]);
        sUI.setBackgroundImages(volumeImage);
        if (vheight < 0) vheight = 0;
        sUI.forceThumbHeight(vheight);
        sUI.setThumbXOffset(0);
        sUI.setThumbYOffset(1);
        acVolume.setUI(sUI);
        // Balance
        acBalance = new ActiveJSlider();
        acBalance.setMinimum(-BALANCEMAX);
        acBalance.setMaximum(BALANCEMAX);
        acBalance.setValue(0);
        acBalance.setToolTipText(getResource("slider.balance"));
        Image cropBalance = new BufferedImage(38, 418, BufferedImage.TYPE_INT_RGB);
        Graphics g = cropBalance.getGraphics();
        g.drawImage(imBalance, 0, 0, 38, 418, 9, 0, 9 + 38, 0 + 418, null);
        for (int k = 0; k < balanceImage.length; k++)
        {
            balanceImage[k] = (new Taftb(fakeIndex, cropBalance, 38, 13, 2, "" + fakeIndex.charAt(k))).getBanner();
        }
        l = 0;
        if (balanceImage[0].getHeight(null) > releasedBalanceImage[0].getHeight(null))
        {
            acBalance.setConstraints(new AbsoluteConstraints(balanceBarLocation[l++], balanceBarLocation[l++], balanceImage[0].getWidth(null), balanceImage[0].getHeight(null)));
        }
        else
        {
            acBalance.setConstraints(new AbsoluteConstraints(balanceBarLocation[l++], balanceBarLocation[l++], balanceImage[0].getWidth(null), releasedBalanceImage[0].getHeight(null)));
        }
        sUI = new ActiveSliderUI(acBalance);
        sUI.setThumbImage(releasedBalanceImage[0]);
        sUI.setThumbPressedImage(pressedBalanceImage[0]);
        sUI.setBackgroundImages(balanceImage);
        if (bheight < 0) bheight = 0;
        sUI.forceThumbHeight(bheight);
        sUI.setThumbXOffset(1);
        sUI.setThumbYOffset(1);
        acBalance.setUI(sUI);
    }


Generated by  Doxygen 1.6.0   Back to index