Package com.pcmsolutions.gui.smdi

Examples of com.pcmsolutions.gui.smdi.FadeButton


        //mainBox = new Box(BoxLayout.Y_AXIS);
        mainBox = new JPanel(new BorderLayout());
        mainBox.setAlignmentX(Component.LEFT_ALIGNMENT);

        hideButton = new FadeButton(false, 0, 2.0F / 3) {
            public Color getForeground() {
                return Color.white;
            }

            public Color getBackground() {
                return UIColors.getTableFirstSectionBG();
            }
        };
        hideButton.setFocusable(false);
        hideButton.setToolTipText("Hide");

        // TODO !! decide on this
        // com.incors.plaf.alloy.AlloyCommonUtilities.set3DBackground(hideButton, UIColors.getUtilityButtonBG());
        //hideButton.setBackground(new Color(224, 203, 104));
        //hideButton.setBackground(UIColors.getUtilityButtonBG());

        JPanel hideButtonPanel = new JPanel(new BorderLayout());
        hideButtonPanel.setFocusable(false);
        if (showSectionHeader) {
            SectionData[] sd = rhst.getSectionData();
            FadeLabel j;
            Dimension d;
            //int usedSectionWidth = 0;
            for (int i = 0, n = sd.length; i < n; i++) {
                //usedSectionWidth += sd[i].sectionWidth;
                j = new FadeLabel(sd[i].sectionName, JLabel.CENTER);
                //j.setFadingIn(true);
                //j.setOpaque(true);
                j.setBackground(sd[i].sectionBG);
                j.setForeground(sd[i].sectionFG);
                d = new Dimension(sd[i].sectionWidth, (int) j.getPreferredSize().getHeight());
                j.setPreferredSize(d);
                j.setMinimumSize(d);
                j.setMaximumSize(d);
                sectionBox.add(j);
                if (sd[i].ml != null)
                    j.addMouseListener(sd[i].ml);

                // setup the hide button panel to have same background and height as first section
                if (i == 0) {
                    hideButtonPanel.setBackground(sd[0].sectionBG);
                    hideButtonPanel.add(hideButton, BorderLayout.CENTER);
                    hideButtonPanel.setPreferredSize(new Dimension((int) getPreferredSize().getWidth(), (int) j.getPreferredSize().getHeight()));
                }
            }
            sectionBox.add(hideButtonPanel, 0);
            mainBox.add(sectionBox, BorderLayout.NORTH);
        }

        JButton button = new FadeButton(true, 0, 2.0F / 3) {
            public Color getForeground() {
                return Color.white;
            }

            public Color getBackground() {
                return UIColors.getTableFirstSectionBG();
            }
        };

        if (topLeftAction != null) {
            button.setAction(topLeftAction);
            button.setFocusable(false);
            Object o = topLeftAction.getValue("tip");
            if (o != null)
                button.setToolTipText(o.toString());
        }

        // TODO !! decide on this
        //com.incors.plaf.alloy.AlloyCommonUtilities.set3DBackground(button, UIColors.getRefreshButtonBG());
        //button.setBackground(new Color(175, 200, 175));
View Full Code Here

TOP

Related Classes of com.pcmsolutions.gui.smdi.FadeButton

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.