Package mage.client.components

Source Code of mage.client.components.MageSynthStyleFactory

package mage.client.components;

import javax.swing.JComponent;
import javax.swing.plaf.synth.Region;
import javax.swing.plaf.synth.SynthStyle;
import javax.swing.plaf.synth.SynthStyleFactory;

/**
* Class makes {@link JInternalFrame} translucent background possible.
* This class provides fix that makes setOpaque(false) and setBackgroundColor(any color) working,
* especially for Nimbus LAF that has great problems with it.
*
* @version 0.1 16.11.2010
* @author nantuko
*/
public class MageSynthStyleFactory extends SynthStyleFactory {
    private SynthStyleFactory wrappedFactory;

    public MageSynthStyleFactory(SynthStyleFactory factory) {
        this.wrappedFactory = factory;
    }

    public SynthStyle getStyle(JComponent c, Region id) {
        SynthStyle s = wrappedFactory.getStyle(c, id);
        if (id == Region.INTERNAL_FRAME) {
            s = new TranslucentSynthSytle(s);
        }
        return s;
    }
}
TOP

Related Classes of mage.client.components.MageSynthStyleFactory

TOP
Copyright © 2018 www.massapi.com. 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.