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

void javazoom::jlgui::player::amp::skin::Skin::setPlaylistPanel (  )  [inline]

Instantiate playlist panel.

Definition at line 926 of file Skin.java.

References createPLButton(), and parsePlEditColor().

Referenced by loadSkin().

    {
        playlist = new PlaylistUIDelegate();
        Image titleCenter = new BufferedImage(100, 20, BufferedImage.TYPE_INT_RGB);
        titleCenter.getGraphics().drawImage(imPlaylist, 0, 0, 100, 20, 26, 0, 126, 20, null);
        playlist.setTitleCenterImage(titleCenter);
        Image titleLeft = new BufferedImage(25, 20, BufferedImage.TYPE_INT_RGB);
        titleLeft.getGraphics().drawImage(imPlaylist, 0, 0, 25, 20, 0, 0, 25, 20, null);
        playlist.setTitleLeftImage(titleLeft);
        Image titleStretch = new BufferedImage(25, 20, BufferedImage.TYPE_INT_RGB);
        titleStretch.getGraphics().drawImage(imPlaylist, 0, 0, 25, 20, 127, 0, 152, 20, null);
        playlist.setTitleStretchImage(titleStretch);
        Image titleRight = new BufferedImage(25, 20, BufferedImage.TYPE_INT_RGB);
        titleRight.getGraphics().drawImage(imPlaylist, 0, 0, 25, 20, 153, 0, 178, 20, null);
        playlist.setTitleRightImage(titleRight);
        Image btmLeft = new BufferedImage(125, 38, BufferedImage.TYPE_INT_RGB);
        btmLeft.getGraphics().drawImage(imPlaylist, 0, 0, 125, 38, 0, 72, 125, 110, null);
        playlist.setBottomLeftImage(btmLeft);
        Image btmRight = new BufferedImage(150, 38, BufferedImage.TYPE_INT_RGB);
        btmRight.getGraphics().drawImage(imPlaylist, 0, 0, 150, 38, 126, 72, 276, 110, null);
        playlist.setBottomRightImage(btmRight);
        Image bodyLeft = new BufferedImage(12, 28, BufferedImage.TYPE_INT_RGB);
        bodyLeft.getGraphics().drawImage(imPlaylist, 0, 0, 12, 28, 0, 42, 12, 70, null);
        playlist.setLeftImage(bodyLeft);
        Image bodyRight = new BufferedImage(20, 28, BufferedImage.TYPE_INT_RGB);
        bodyRight.getGraphics().drawImage(imPlaylist, 0, 0, 20, 28, 31, 42, 51, 70, null);
        playlist.setRightImage(bodyRight);
        // Parse color
        plEdit = plEdit.toLowerCase();
        ByteArrayInputStream in = new ByteArrayInputStream(plEdit.getBytes());
        BufferedReader lin = new BufferedReader(new InputStreamReader(in));
        try
        {
            for (;;)
            {
                String line = lin.readLine();
                if (line == null) break;
                if ((line.toLowerCase()).startsWith("normalbg")) playlist.setBackgroundColor(parsePlEditColor(line));
                else if ((line.toLowerCase()).startsWith("normal")) playlist.setNormalColor(parsePlEditColor(line));
                else if ((line.toLowerCase()).startsWith("current")) playlist.setCurrentColor(parsePlEditColor(line));
                else if ((line.toLowerCase()).startsWith("selectedbg")) playlist.setSelectedBackgroundColor(parsePlEditColor(line));
            }
        }
        catch (Exception e)
        {
            log.debug(e);
        }
        finally
        {
            try
            {
                if (in != null) in.close();
            }
            catch (IOException e)
            {
            }
        }
        // Playlist slider.
        acPlSlider = new ActiveJSlider();
        acPlSlider.setOrientation(JSlider.VERTICAL);
        acPlSlider.setMinimum(0);
        acPlSlider.setMaximum(100);
        acPlSlider.setValue(100);
        ActiveSliderUI sUI = new ActiveSliderUI(acPlSlider);
        Image scrollBarReleased = new BufferedImage(8, 18, BufferedImage.TYPE_INT_RGB);
        scrollBarReleased.getGraphics().drawImage(imPlaylist, 0, 0, 8, 18, 52, 53, 52 + 8, 53 + 18, null);
        sUI.setThumbImage(scrollBarReleased);
        Image scrollBarClicked = new BufferedImage(8, 18, BufferedImage.TYPE_INT_RGB);
        scrollBarClicked.getGraphics().drawImage(imPlaylist, 0, 0, 8, 18, 61, 53, 61 + 8, 53 + 18, null);
        sUI.setThumbPressedImage(scrollBarClicked);
        Image sliderBackground = new BufferedImage(20, 58, BufferedImage.TYPE_INT_RGB);        
        sliderBackground.getGraphics().drawImage(bodyRight, 0, 0, null);
        sliderBackground.getGraphics().drawImage(bodyRight, 0, 28, null);
        sliderBackground.getGraphics().drawImage(bodyRight, 0, 30, null);
        Image[] background = { sliderBackground };
        sUI.setBackgroundImages(background);
        sUI.setThumbXOffset(5);
        acPlSlider.setUI(sUI);
        acPlSlider.setConstraints(new AbsoluteConstraints(plSliderLocation[0], plSliderLocation[1], 20, 58));
        // Up/Down scroll buttons
        acPlUp = new ActiveJButton();
        Image upScrollButton = new BufferedImage(8, 4, BufferedImage.TYPE_INT_RGB);
        upScrollButton.getGraphics().drawImage(imPlaylist, 0, 0, 8, 4, 261, 75, 269, 79, null);
        acPlUp.setIcon(new ImageIcon(upScrollButton));
        acPlUp.setPressedIcon(new ImageIcon(upScrollButton));
        acPlUp.setConstraints(new AbsoluteConstraints(WinWidth - 15, WinHeight - 35, 8, 4));
        acPlUp.setActionCommand(PlayerActionEvent.ACPLUP);
        acPlDown = new ActiveJButton();
        Image downScrollButton = new BufferedImage(8, 4, BufferedImage.TYPE_INT_RGB);
        downScrollButton.getGraphics().drawImage(imPlaylist, 0, 0, 8, 4, 261, 80, 269, 84, null);
        acPlDown.setIcon(new ImageIcon(downScrollButton));
        acPlDown.setPressedIcon(new ImageIcon(downScrollButton));
        acPlDown.setConstraints(new AbsoluteConstraints(WinWidth - 15, WinHeight - 30, 8, 4));
        acPlDown.setActionCommand(PlayerActionEvent.ACPLDOWN);
        // Playlist AddFile/AddDir/AddURL buttons
        int w = 22;
        int h = 18;
        Image addButtonImage = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
        addButtonImage.getGraphics().drawImage(imPlaylist, 0, 0, w, h, 14, 80, 14 + w, 80 + h, null);
        acPlAdd = new ActiveJButton();
        acPlAdd.setIcon(new ImageIcon(addButtonImage));
        acPlAdd.setPressedIcon(new ImageIcon(addButtonImage));
        acPlAdd.setActionCommand(PlayerActionEvent.ACPLADDPOPUP);
        acPlAdd.setConstraints(new AbsoluteConstraints(plAddLocation[0], plAddLocation[1], w, h));
        ActiveJButton acPlAddFile = createPLButton(0, 149);
        acPlAddFile.setActionCommand(PlayerActionEvent.ACPLADDFILE);
        ActiveJButton acPlAddDir = createPLButton(0, 130);
        acPlAddDir.setActionCommand(PlayerActionEvent.ACPLADDDIR);
        ActiveJButton acPlAddURL = createPLButton(0, 111);
        acPlAddURL.setActionCommand(PlayerActionEvent.ACPLADDURL);
        acPlAddPopup = new ActiveJPopup();
        ActiveJButton[] addbuttons = { acPlAddURL, acPlAddDir, acPlAddFile };
        acPlAddPopup.setItems(addbuttons);
        acPlAddPopup.setConstraints(new AbsoluteConstraints(plAddPopupArea[0], plAddPopupArea[1], plAddPopupArea[2], plAddPopupArea[3]));
        // Playlist RemoveMisc/RemoveSelection/Crop/RemoveAll buttons
        Image removeButtonImage = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
        removeButtonImage.getGraphics().drawImage(imPlaylist, 0, 0, w, h, 14 + 30, 80, 14 + 30 + w, 80 + h, null);
        acPlRemove = new ActiveJButton();
        acPlRemove.setIcon(new ImageIcon(removeButtonImage));
        acPlRemove.setPressedIcon(new ImageIcon(removeButtonImage));
        acPlRemove.setActionCommand(PlayerActionEvent.ACPLREMOVEPOPUP);
        acPlRemove.setConstraints(new AbsoluteConstraints(plRemoveLocation[0], plRemoveLocation[1], w, h));
        ActiveJButton acPlRemoveMisc = createPLButton(54, 168);
        acPlRemoveMisc.setActionCommand(PlayerActionEvent.ACPLREMOVEMISC);
        ActiveJButton acPlRemoveSel = createPLButton(54, 149);
        acPlRemoveSel.setActionCommand(PlayerActionEvent.ACPLREMOVESEL);
        ActiveJButton acPlRemoveCrop = createPLButton(54, 130);
        acPlRemoveCrop.setActionCommand(PlayerActionEvent.ACPLREMOVECROP);
        ActiveJButton acPlRemoveAll = createPLButton(54, 111);
        acPlRemoveAll.setActionCommand(PlayerActionEvent.ACPLREMOVEALL);
        acPlRemovePopup = new ActiveJPopup();
        ActiveJButton[] rembuttons = { acPlRemoveMisc, acPlRemoveAll, acPlRemoveCrop, acPlRemoveSel };
        acPlRemovePopup.setItems(rembuttons);
        acPlRemovePopup.setConstraints(new AbsoluteConstraints(plRemovePopupArea[0], plRemovePopupArea[1], plRemovePopupArea[2], plRemovePopupArea[3]));
        // Playlist SelAll/SelZero/SelInv buttons
        Image selButtonImage = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
        selButtonImage.getGraphics().drawImage(imPlaylist, 0, 0, w, h, 14 + 60, 80, 14 + 60 + w, 80 + h, null);
        acPlSelect = new ActiveJButton();
        acPlSelect.setIcon(new ImageIcon(selButtonImage));
        acPlSelect.setPressedIcon(new ImageIcon(selButtonImage));
        acPlSelect.setActionCommand(PlayerActionEvent.ACPLSELPOPUP);
        acPlSelect.setConstraints(new AbsoluteConstraints(plSelectLocation[0], plSelectLocation[1], w, h));
        ActiveJButton acPlSelectAll = createPLButton(104, 149);
        acPlSelectAll.setActionCommand(PlayerActionEvent.ACPLSELALL);
        ActiveJButton acPlSelectZero = createPLButton(104, 130);
        acPlSelectZero.setActionCommand(PlayerActionEvent.ACPLSELZERO);
        ActiveJButton acPlSelectInv = createPLButton(104, 111);
        acPlSelectInv.setActionCommand(PlayerActionEvent.ACPLSELINV);
        acPlSelectPopup = new ActiveJPopup();
        ActiveJButton[] selbuttons = { acPlSelectInv, acPlSelectZero, acPlSelectAll };
        acPlSelectPopup.setItems(selbuttons);
        acPlSelectPopup.setConstraints(new AbsoluteConstraints(plSelectPopupArea[0], plSelectPopupArea[1], plSelectPopupArea[2], plSelectPopupArea[3]));
        // Playlist MiscOpts/MiscFile/MiscSort buttons
        Image miscButtonImage = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
        miscButtonImage.getGraphics().drawImage(imPlaylist, 0, 0, w, h, 14 + 89, 80, 14 + 89 + w, 80 + h, null);
        acPlMisc = new ActiveJButton();
        acPlMisc.setIcon(new ImageIcon(miscButtonImage));
        acPlMisc.setPressedIcon(new ImageIcon(miscButtonImage));
        acPlMisc.setActionCommand(PlayerActionEvent.ACPLMISCPOPUP);
        acPlMisc.setConstraints(new AbsoluteConstraints(plMiscLocation[0], plMiscLocation[1], w, h));
        ActiveJButton acPlMiscOpts = createPLButton(154, 149);
        acPlMiscOpts.setActionCommand(PlayerActionEvent.ACPLMISCOPTS);
        ActiveJButton acPlMiscFile = createPLButton(154, 130);
        acPlMiscFile.setActionCommand(PlayerActionEvent.ACPLMISCFILE);
        ActiveJButton acPlMiscSort = createPLButton(154, 111);
        acPlMiscSort.setActionCommand(PlayerActionEvent.ACPLMISCSORT);
        acPlMiscPopup = new ActiveJPopup();
        ActiveJButton[] miscbuttons = { acPlMiscSort, acPlMiscFile, acPlMiscOpts };
        acPlMiscPopup.setItems(miscbuttons);
        acPlMiscPopup.setConstraints(new AbsoluteConstraints(plMiscPopupArea[0], plMiscPopupArea[1], plMiscPopupArea[2], plMiscPopupArea[3]));
        // Playlist ListLoad/ListSave/ListNew buttons
        Image listButtonImage = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
        listButtonImage.getGraphics().drawImage(imPlaylist, 0, 0, w, h, 14 + 215, 80, 14 + 215 + w, 80 + h, null);
        acPlList = new ActiveJButton();
        acPlList.setIcon(new ImageIcon(listButtonImage));
        acPlList.setPressedIcon(new ImageIcon(listButtonImage));
        acPlList.setActionCommand(PlayerActionEvent.ACPLLISTPOPUP);
        acPlList.setConstraints(new AbsoluteConstraints(plListLocation[0], plListLocation[1], w, h));
        ActiveJButton acPlListLoad = createPLButton(204, 149);
        acPlListLoad.setActionCommand(PlayerActionEvent.ACPLLISTLOAD);
        ActiveJButton acPlListSave = createPLButton(204, 130);
        acPlListSave.setActionCommand(PlayerActionEvent.ACPLLISTSAVE);
        ActiveJButton acPlListNew = createPLButton(204, 111);
        acPlListNew.setActionCommand(PlayerActionEvent.ACPLLISTNEW);
        acPlListPopup = new ActiveJPopup();
        ActiveJButton[] listbuttons = { acPlListNew, acPlListSave, acPlListLoad };
        acPlListPopup.setItems(listbuttons);
        acPlListPopup.setConstraints(new AbsoluteConstraints(plListPopupArea[0], plListPopupArea[1], plListPopupArea[2], plListPopupArea[3]));
    }


Generated by  Doxygen 1.6.0   Back to index