forked from External/mage
I used Intellij IDEA to automatically refactor code to achive 3 goals. 1) get rid of anonymouse classes, and replace the with lamba to get more readeable and clean code (like in TableWaitingDialog). 2) make effectively final variables actually final to avoid inadvertent changes on it in further releases and keep objects as immutable, as possible. 3) Get rid of unused imports (most of the changes) in whole project classes.
40 lines
1.1 KiB
Java
40 lines
1.1 KiB
Java
package mage.client.components;
|
|
|
|
//import com.sun.java.swing.Painter;
|
|
|
|
import java.awt.Color;
|
|
import java.awt.Graphics2D;
|
|
|
|
import javax.swing.JDesktopPane;
|
|
import javax.swing.UIDefaults;
|
|
import javax.swing.UIManager;
|
|
|
|
import org.jdesktop.swingx.painter.Painter;
|
|
|
|
/**
|
|
* Overrides JDesktopPane settings for Nimbus LAF.
|
|
*
|
|
* @author nantuko
|
|
*/
|
|
public class MageJDesktop extends JDesktopPane {
|
|
|
|
@Override
|
|
public void updateUI() {
|
|
if ("Nimbus".equals(UIManager.getLookAndFeel().getName())) {
|
|
UIDefaults map = new UIDefaults();
|
|
Painter painter = new Painter() {
|
|
|
|
final Color color = null;
|
|
|
|
@Override
|
|
public void paint(Graphics2D g, Object c, int w, int h) {
|
|
g.setColor(color == null ? UIManager.getDefaults().getColor("desktop") : color);
|
|
g.fillRect(0,0,w,h);
|
|
}
|
|
};
|
|
map.put("DesktopPane[Enabled].backgroundPainter", painter);
|
|
putClientProperty("Nimbus.Overrides", map);
|
|
}
|
|
super.updateUI();
|
|
}
|
|
}
|