Improved nonribbon interface (menu, colors)

This commit is contained in:
Jindra Petřík
2015-05-23 10:26:04 +02:00
parent 3fdc0ec946
commit dd888dd326
9 changed files with 1500 additions and 1138 deletions

View File

@@ -29,6 +29,7 @@ import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.Image;
import java.awt.Rectangle;
import java.awt.SystemColor;
import java.awt.TexturePaint;
import java.awt.Window;
import java.awt.event.ActionEvent;
@@ -100,13 +101,11 @@ import org.pushingpixels.substance.internal.utils.SubstanceColorSchemeUtilities;
*/
public class View {
private static final Color DEFAULT_BACKGROUND_COLOR = new Color(217, 231, 250);
public static Color getDefaultBackgroundColor() {
if (Configuration.useRibbonInterface.get()) {
return SubstanceLookAndFeel.getCurrentSkin().getColorScheme(DecorationAreaType.GENERAL, ColorSchemeAssociationKind.FILL, ComponentState.ENABLED).getBackgroundFillColor();
} else {
return DEFAULT_BACKGROUND_COLOR;
return SystemColor.control;
}
}
@@ -345,6 +344,14 @@ public class View {
f.setLocation(windowPosX, windowPosY);
}
public static ImageIcon getIcon(String name, int size) {
ImageIcon icon = getIcon(name);
icon.getImage();
BufferedImage bi = new BufferedImage(size, size, BufferedImage.TYPE_INT_ARGB);
bi.createGraphics().drawImage(icon.getImage(), 0, 0, size, size, null, null);
return new ImageIcon(bi);
}
public static ImageIcon getIcon(String name) {
return new ImageIcon(View.class.getClassLoader().getResource("com/jpexs/decompiler/flash/gui/graphics/" + name + ".png"));
}