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

void javazoom::jlgui::player::amp::skin::Skin::loadSkin ( SkinLoader  skl  )  throws Exception [inline]

Loads a skin from a SkinLoader.

Parameters:
skl 
Exceptions:
Exception 

Definition at line 339 of file Skin.java.

References readPanel(), setAnalyzerPanel(), setButtonsPanel(), setEPSRButtonsPanel(), setExitPanel(), setMinimizePanel(), setMonoStereoPanel(), setOnOffAutoPanel(), setPlaylistPanel(), setPosBarPanel(), setPresetsPanel(), setSliderPanel(), setSplinePanel(), setTitleBarPanel(), and setVolumeBalancePanel().

    {
        skl.loadImages();
        imMain = skl.getImage(theMain);
        imButtons = skl.getImage(theButtons);
        imTitleBar = skl.getImage(theTitleBar);
        imText = skl.getImage(theText);
        imMode = skl.getImage(theMode);
        imNumbers = skl.getImage(theNumbers);
        // add by John Yang
        if (imNumbers == null)
        {
            log.debug("Try load nums_ex.bmp !");
            imNumbers = skl.getImage(theNumEx);
        }
        imVolume = skl.getImage(theVolume);
        imBalance = skl.getImage(theBalance);
        imIcons = skl.getImage(theIcons);
        imPosBar = skl.getImage(thePosBar);
        imEPSRButtons = skl.getImage(theEPSRButtons);
        viscolor = (String) skl.getContent(theViscolor);
        String readmeStr = theReadme;
        readme = (String) skl.getContent(readmeStr);
        if (readme == null)
        {
            readmeStr = readmeStr.toUpperCase();
            readme = (String) skl.getContent(readmeStr);
        }
        if (readme == null)
        {
            readmeStr = readmeStr.substring(0, 1) + theReadme.substring(1, theReadme.length());
            readme = (String) skl.getContent(readmeStr);
        }
        // Computes volume slider height :
        int vh = (imVolume.getHeight(null) - 422);
        if (vh > 0)
        {
            releasedVolumePanel0[3] = vh;
            pressedVolumePanel0[3] = vh;
            releasedVolumePanel1[3] = vh;
            pressedVolumePanel1[3] = vh;
        }
        // Computes balance slider height :
        if (imBalance == null) imBalance = imVolume;
        int bh = (imBalance.getHeight(null) - 422);
        if (bh > 0)
        {
            releasedBalancePanel0[3] = bh;
            pressedBalancePanel0[3] = bh;
            releasedBalancePanel1[3] = bh;
            pressedBalancePanel1[3] = bh;
        }
        // Compute posbar height.
        int ph = imPosBar.getHeight(null);
        if (ph > 0)
        {
            releasedPosPanel[3] = ph;
            pressedPosPanel[3] = ph;
        }
        WinHeight = imMain.getHeight(null); // 116
        WinWidth = imMain.getWidth(null); // 275
        /*-- Text --*/
        acFont = new ActiveFont(imText, fontIndex, fontWidth, fontHeight);
        acTitleLabel = new ActiveJLabel();
        acTitleLabel.setAcFont(acFont);
        acTitleLabel.setCropRectangle(new Rectangle(0, 0, 155, 6));
        acTitleLabel.setConstraints(new AbsoluteConstraints(titleLocation[0], titleLocation[1], 155, 6));
        acTitleLabel.setAcText(TITLETEXT.toUpperCase());
        acSampleRateLabel = new ActiveJLabel();
        acSampleRateLabel.setAcFont(acFont);
        acSampleRateLabel.setConstraints(new AbsoluteConstraints(sampleRateLocation[0], sampleRateLocation[1]));
        acSampleRateLabel.setAcText(sampleRateClearText);
        acBitRateLabel = new ActiveJLabel();
        acBitRateLabel.setAcFont(acFont);
        acBitRateLabel.setConstraints(new AbsoluteConstraints(bitsRateLocation[0], bitsRateLocation[1]));
        acBitRateLabel.setAcText(bitsRateClearText);
        /*-- Buttons --*/
        readPanel(releasedImage, releasedPanel, pressedImage, pressedPanel, imButtons);
        setButtonsPanel();
        /*-- Volume/Balance --*/
        if (skinVersion.equals("1"))
        {
            readPanel(releasedVolumeImage, releasedVolumePanel0, pressedVolumeImage, pressedVolumePanel0, imVolume);
            readPanel(releasedBalanceImage, releasedBalancePanel0, pressedBalanceImage, pressedBalancePanel0, imBalance);
        }
        else
        {
            readPanel(releasedVolumeImage, releasedVolumePanel1, pressedVolumeImage, pressedVolumePanel1, imVolume);
            readPanel(releasedBalanceImage, releasedBalancePanel1, pressedBalanceImage, pressedBalancePanel1, imBalance);
        }
        setVolumeBalancePanel(vh, bh);
        /*-- Title Bar --*/
        readPanel(releasedTitleIm, releasedTitlePanel, pressedTitleIm, pressedTitlePanel, imTitleBar);
        setTitleBarPanel();
        /*-- Exit --*/
        readPanel(releasedExitIm, releasedExitPanel, pressedExitIm, pressedExitPanel, imTitleBar);
        setExitPanel();
        /*-- Minimize --*/
        readPanel(releasedMinimizeIm, releasedMinimizePanel, pressedMinimizeIm, pressedMinimizePanel, imTitleBar);
        setMinimizePanel();
        /*-- Mode --*/
        readPanel(activeModeImage, activeModePanel, passiveModeImage, passiveModePanel, imMode);
        setMonoStereoPanel();
        /*-- Numbers --*/
        ImageIcon[] numbers = new ImageIcon[numberIndex.length()];
        for (int h = 0; h < numberIndex.length(); h++)
        {
            numbers[h] = new ImageIcon((new Taftb(numberIndex, imNumbers, numberWidth, numberHeight, 0, "" + numberIndex.charAt(h))).getBanner());
        }
        acMinuteH = new ActiveJNumberLabel();
        acMinuteH.setNumbers(numbers);
        acMinuteH.setConstraints(new AbsoluteConstraints(minuteHLocation[0], minuteHLocation[1]));
        acMinuteH.setAcText(" ");
        acMinuteL = new ActiveJNumberLabel();
        acMinuteL.setNumbers(numbers);
        acMinuteL.setConstraints(new AbsoluteConstraints(minuteLLocation[0], minuteLLocation[1]));
        acMinuteL.setAcText(" ");
        acSecondH = new ActiveJNumberLabel();
        acSecondH.setNumbers(numbers);
        acSecondH.setConstraints(new AbsoluteConstraints(secondHLocation[0], secondHLocation[1]));
        acSecondH.setAcText(" ");
        acSecondL = new ActiveJNumberLabel();
        acSecondL.setNumbers(numbers);
        acSecondL.setConstraints(new AbsoluteConstraints(secondLLocation[0], secondLLocation[1]));
        acSecondL.setAcText(" ");
        /*--  Icons --*/
        readPanel(iconsImage, iconsPanel, null, null, imIcons);
        acPlayIcon = new ActiveJIcon();
        ImageIcon[] playIcons = { new ImageIcon(iconsImage[0]), new ImageIcon(iconsImage[1]), new ImageIcon(iconsImage[2]) };
        acPlayIcon.setIcons(playIcons);
        acPlayIcon.setConstraints(new AbsoluteConstraints(iconsLocation[0], iconsLocation[1]));
        acPlayIcon.setIcon(2);
        acTimeIcon = new ActiveJIcon();
        ImageIcon[] timeIcons = { new ImageIcon(iconsImage[3]), new ImageIcon(iconsImage[4]) };
        acTimeIcon.setIcons(timeIcons);
        acTimeIcon.setConstraints(new AbsoluteConstraints(iconsLocation[2], iconsLocation[3]));
        /*-- DSP --*/
        setAnalyzerPanel();
        /*-- Pos Bar --*/
        readPanel(releasedPosIm, releasedPosPanel, pressedPosIm, pressedPosPanel, imPosBar);
        setPosBarPanel();
        /*-- EqualizerUI/Playlist/Shuffle/Repeat  --*/
        readPanel(releasedEPSRImage, releasedEPSRPanel, pressedEPSRImage, pressedEPSRPanel, imEPSRButtons);
        setEPSRButtonsPanel();
        /*-- EqualizerUI --*/
        imFullEqualizer = skl.getImage("eqmain.bmp");
        imEqualizer = new BufferedImage(WinWidth, WinHeight, BufferedImage.TYPE_INT_RGB);
        imEqualizer.getGraphics().drawImage(imFullEqualizer, 0, 0, null);
        imSliders = new BufferedImage(208, 128, BufferedImage.TYPE_INT_RGB);
        imSliders.getGraphics().drawImage(imFullEqualizer, 0, 0, 208, 128, 13, 164, 13 + 208, 164 + 128, null);
        setSliderPanel();
        setOnOffAutoPanel();
        setPresetsPanel();
        setSplinePanel();
        /*-- Playlist --*/
        imPlaylist = skl.getImage("pledit.bmp");
        plEdit = (String) skl.getContent("pledit.txt");
        setPlaylistPanel();
    }


Generated by  Doxygen 1.6.0   Back to index