diff --git a/src/com/jpexs/decompiler/flash/gui/FolderPreviewPanel.java b/src/com/jpexs/decompiler/flash/gui/FolderPreviewPanel.java index 2da94c0ec..e97f11988 100644 --- a/src/com/jpexs/decompiler/flash/gui/FolderPreviewPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/FolderPreviewPanel.java @@ -200,11 +200,22 @@ public class FolderPreviewPanel extends JPanel { JLabel l = new JLabel(); Font f = l.getFont().deriveFont(AffineTransform.getScaleInstance(0.8, 0.8)); int finish_y = (int) Math.ceil((r.y + r.height) / (float) CELL_HEIGHT); - SubstanceSkin skin = SubstanceLookAndFeel.getCurrentSkin(); - Color color = skin.getColorScheme(DecorationAreaType.GENERAL, ColorSchemeAssociationKind.FILL, ComponentState.ENABLED).getBackgroundFillColor(); - Color selectedColor = skin.getColorScheme(DecorationAreaType.GENERAL, ColorSchemeAssociationKind.FILL, ComponentState.ROLLOVER_SELECTED).getBackgroundFillColor(); - Color borderColor = skin.getColorScheme(DecorationAreaType.GENERAL, ColorSchemeAssociationKind.BORDER, ComponentState.ROLLOVER_SELECTED).getUltraDarkColor(); - Color textColor = skin.getColorScheme(DecorationAreaType.GENERAL, ColorSchemeAssociationKind.FILL, ComponentState.ROLLOVER_SELECTED).getForegroundColor(); + Color color; + Color selectedColor; + Color borderColor; + Color textColor; + if (Configuration.useRibbonInterface.get()) { + SubstanceSkin skin = SubstanceLookAndFeel.getCurrentSkin(); + color = skin.getColorScheme(DecorationAreaType.GENERAL, ColorSchemeAssociationKind.FILL, ComponentState.ENABLED).getBackgroundFillColor(); + selectedColor = skin.getColorScheme(DecorationAreaType.GENERAL, ColorSchemeAssociationKind.FILL, ComponentState.ROLLOVER_SELECTED).getBackgroundFillColor(); + borderColor = skin.getColorScheme(DecorationAreaType.GENERAL, ColorSchemeAssociationKind.BORDER, ComponentState.ROLLOVER_SELECTED).getUltraDarkColor(); + textColor = skin.getColorScheme(DecorationAreaType.GENERAL, ColorSchemeAssociationKind.FILL, ComponentState.ROLLOVER_SELECTED).getForegroundColor(); + } else { + color = new Color(0xd9, 0xe8, 0xfb); + selectedColor = new Color(0xfe, 0xca, 0x81); + borderColor = Color.BLACK; + textColor = Color.BLACK; + } //g.setColor(SubstanceLookAndFeel.getCurrentSkin().getColorScheme(DecorationAreaType.GENERAL, ColorSchemeAssociationKind.FILL, ComponentState.ENABLED)); for (int y = start_y; y <= finish_y; y++) { diff --git a/src/com/jpexs/decompiler/flash/gui/HeaderLabel.java b/src/com/jpexs/decompiler/flash/gui/HeaderLabel.java index 550a8208f..c98c4936d 100644 --- a/src/com/jpexs/decompiler/flash/gui/HeaderLabel.java +++ b/src/com/jpexs/decompiler/flash/gui/HeaderLabel.java @@ -16,6 +16,8 @@ */ package com.jpexs.decompiler.flash.gui; +import com.jpexs.decompiler.flash.configuration.Configuration; +import java.awt.Color; import java.awt.Graphics; import java.awt.geom.GeneralPath; import java.util.EnumSet; @@ -67,26 +69,36 @@ public class HeaderLabel extends JLabel { @Override public void paint(Graphics g) { - SubstanceSkin skin = SubstanceLookAndFeel.getCurrentSkin(); - g.setColor(skin.getColorScheme(DecorationAreaType.HEADER, ColorSchemeAssociationKind.FILL, ComponentState.ENABLED).getBackgroundFillColor()); + if (Configuration.useRibbonInterface.get()) { + SubstanceSkin skin = SubstanceLookAndFeel.getCurrentSkin(); + g.setColor(skin.getColorScheme(DecorationAreaType.HEADER, ColorSchemeAssociationKind.FILL, ComponentState.ENABLED).getBackgroundFillColor()); + } else { + g.setColor(new Color(217, 232, 251)); + } g.fillRect(0, 0, getWidth(), getHeight()); - StandardBorderPainter borderPainter = new StandardBorderPainter(); + if (Configuration.useRibbonInterface.get()) { + StandardBorderPainter borderPainter = new StandardBorderPainter(); - Set straightSides = EnumSet.of(SubstanceConstants.Side.BOTTOM); - int dy = 0; - float cornerRadius = 5f; - int borderThickness = 1; - int borderInsets = 0; - GeneralPath contourInner = borderPainter.isPaintingInnerContour() ? SubstanceOutlineUtilities.getBaseOutline(getWidth(), getHeight() + dy, - cornerRadius - borderThickness, straightSides, borderThickness + borderInsets) - : null; + Set straightSides = EnumSet.of(SubstanceConstants.Side.BOTTOM); + int dy = 0; + float cornerRadius = 5f; + int borderThickness = 1; + int borderInsets = 0; + GeneralPath contourInner = borderPainter.isPaintingInnerContour() ? SubstanceOutlineUtilities.getBaseOutline(getWidth(), getHeight() + dy, + cornerRadius - borderThickness, straightSides, borderThickness + borderInsets) + : null; - GeneralPath contour = SubstanceOutlineUtilities.getBaseOutline(getWidth(), - getHeight() + dy, cornerRadius, straightSides, borderInsets); + GeneralPath contour = SubstanceOutlineUtilities.getBaseOutline(getWidth(), + getHeight() + dy, cornerRadius, straightSides, borderInsets); + + SubstanceSkin skin = SubstanceLookAndFeel.getCurrentSkin(); + borderPainter.paintBorder(g, this, getWidth(), getHeight() + dy, + contour, contourInner, skin.getColorScheme(DecorationAreaType.HEADER, ColorSchemeAssociationKind.BORDER, ComponentState.ENABLED)); + g.setColor(skin.getColorScheme(DecorationAreaType.HEADER, ColorSchemeAssociationKind.FILL, ComponentState.ENABLED).getForegroundColor()); + } else { + g.setColor(Color.BLACK); + } - borderPainter.paintBorder(g, this, getWidth(), getHeight() + dy, - contour, contourInner, skin.getColorScheme(DecorationAreaType.HEADER, ColorSchemeAssociationKind.BORDER, ComponentState.ENABLED)); - g.setColor(skin.getColorScheme(DecorationAreaType.HEADER, ColorSchemeAssociationKind.FILL, ComponentState.ENABLED).getForegroundColor()); JLabel lab = new JLabel(getText(), JLabel.CENTER); lab.setSize(getSize()); lab.paint(g); diff --git a/src/com/jpexs/decompiler/flash/gui/MyRibbonApplicationMenuButtonUI.java b/src/com/jpexs/decompiler/flash/gui/MyRibbonApplicationMenuButtonUI.java index f21251f59..69b4a6c9c 100644 --- a/src/com/jpexs/decompiler/flash/gui/MyRibbonApplicationMenuButtonUI.java +++ b/src/com/jpexs/decompiler/flash/gui/MyRibbonApplicationMenuButtonUI.java @@ -85,22 +85,6 @@ public class MyRibbonApplicationMenuButtonUI extends BasicRibbonApplicationMenuB g2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); SubstanceSkin skin = SubstanceLookAndFeel.getCurrentSkin(); - // todo honfika: remove, added only for testing issue #897 - if (skin == null) { - throw new Error("skin"); - } - if (skin.getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.HIGHLIGHT, ComponentState.ENABLED) == null) { - throw new Error("skin.getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.HIGHLIGHT, ComponentState.ENABLED)"); - } - if (skin.getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.HIGHLIGHT, ComponentState.ENABLED).shiftBackground(Color.white, 0.5) == null) { - throw new Error("skin.getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.HIGHLIGHT, ComponentState.ENABLED).shiftBackground(Color.white, 0.5)"); - } - if (skin.getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.FILL, ComponentState.ENABLED) == null) { - throw new Error("skin.getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.FILL, ComponentState.ENABLED)"); - } - if (skin.getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.BORDER, ComponentState.ENABLED) == null) { - throw new Error("skin.getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.BORDER, ComponentState.ENABLED)"); - } g2.setPaint(new RadialGradientPaint(getIconWidth() / 2, getIconHeight() / 2, getIconWidth() / 2, new float[]{0.32f, 0.84f, 1f}, new Color[]{ skin.getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.HIGHLIGHT, ComponentState.ENABLED).shiftBackground(Color.white, 0.5).getUltraLightColor(), skin.getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.FILL, ComponentState.ENABLED).getMidColor(), diff --git a/src/com/jpexs/decompiler/flash/gui/View.java b/src/com/jpexs/decompiler/flash/gui/View.java index 305d35b94..3444fa4ee 100644 --- a/src/com/jpexs/decompiler/flash/gui/View.java +++ b/src/com/jpexs/decompiler/flash/gui/View.java @@ -100,8 +100,14 @@ 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() { - return SubstanceLookAndFeel.getCurrentSkin().getColorScheme(DecorationAreaType.GENERAL, ColorSchemeAssociationKind.FILL, ComponentState.ENABLED).getBackgroundFillColor(); + if (Configuration.useRibbonInterface.get()) { + return SubstanceLookAndFeel.getCurrentSkin().getColorScheme(DecorationAreaType.GENERAL, ColorSchemeAssociationKind.FILL, ComponentState.ENABLED).getBackgroundFillColor(); + } else { + return DEFAULT_BACKGROUND_COLOR; + } } private static Color swfBackgroundColor = null; @@ -282,17 +288,26 @@ public class View { * @param f Frame to set icon in */ public static void setWindowIcon(Window f) { - List images = new ArrayList<>(); - MyResizableIcon[] icons = MyRibbonApplicationMenuButtonUI.getIcons(); - MyResizableIcon icon = icons[1]; - int sizes[] = new int[]{16, 32, 48, 256}; - for (int size : sizes) { - icon.setIconSize(size, size); - BufferedImage bi = new BufferedImage(size, size, BufferedImage.TYPE_4BYTE_ABGR); - icon.paintIcon(f, bi.getGraphics(), 0, 0); - images.add(bi); + if (Configuration.useRibbonInterface.get()) { + List images = new ArrayList<>(); + MyResizableIcon[] icons = MyRibbonApplicationMenuButtonUI.getIcons(); + MyResizableIcon icon = icons[1]; + int sizes[] = new int[]{16, 32, 48, 256}; + for (int size : sizes) { + icon.setIconSize(size, size); + BufferedImage bi = new BufferedImage(size, size, BufferedImage.TYPE_4BYTE_ABGR); + icon.paintIcon(f, bi.getGraphics(), 0, 0); + images.add(bi); + } + f.setIconImages(images); + } else { + List images = new ArrayList<>(); + images.add(loadImage("icon16")); + images.add(loadImage("icon32")); + images.add(loadImage("icon48")); + images.add(loadImage("icon256")); + f.setIconImages(images); } - f.setIconImages(images); } /**