mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-08-02 15:32:15 +00:00
Color skins
Basic skin set to new Oceanic Error log Frame now skinned
This commit is contained in:
@@ -6,7 +6,8 @@
|
||||
|
||||
<property name="DISTLIBRARIESFULLDIR" value="${DISTRIBUTIONDIR}/${DISTLIBRARIESDIRNAME}"/>
|
||||
<patternset id="compiler.resources">
|
||||
<include name="**/?*.properties"/>
|
||||
<include name="**/?*.properties"/>
|
||||
<include name="**/?*.colorschemes"/>
|
||||
<include name="**/?*.bin"/>
|
||||
<include name="**/?*.xml"/>
|
||||
<include name="**/?*.txt"/>
|
||||
|
||||
@@ -266,6 +266,11 @@ public class Configuration {
|
||||
@ConfigurationName("gui.splitPane2.dividerLocation")
|
||||
public static final ConfigurationItem<Integer> guiSplitPane2DividerLocation = null;
|
||||
|
||||
@ConfigurationDefaultString("com.jpexs.decompiler.flash.gui.OceanicSkin")
|
||||
@ConfigurationName("gui.skin")
|
||||
@ConfigurationCategory("ui")
|
||||
public static final ConfigurationItem<String> guiSkin = null;
|
||||
|
||||
@ConfigurationDefaultInt(3)
|
||||
@ConfigurationCategory("export")
|
||||
public static final ConfigurationItem<Integer> saveAsExeScaleMode = null;
|
||||
|
||||
@@ -21,10 +21,15 @@ import com.jpexs.decompiler.flash.configuration.ConfigurationCategory;
|
||||
import com.jpexs.decompiler.flash.configuration.ConfigurationItem;
|
||||
import com.jpexs.decompiler.flash.gui.helpers.SpringUtilities;
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
import java.awt.Container;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.FlowLayout;
|
||||
import java.awt.FontMetrics;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.RenderingHints;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.lang.reflect.Field;
|
||||
@@ -39,17 +44,27 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import javax.swing.Icon;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JCheckBox;
|
||||
import javax.swing.JComboBox;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JList;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JScrollPane;
|
||||
import javax.swing.JTabbedPane;
|
||||
import javax.swing.JTextField;
|
||||
import javax.swing.SpringLayout;
|
||||
import javax.swing.SwingConstants;
|
||||
import javax.swing.table.DefaultTableModel;
|
||||
import org.pushingpixels.substance.api.ColorSchemeAssociationKind;
|
||||
import org.pushingpixels.substance.api.ComponentState;
|
||||
import org.pushingpixels.substance.api.DecorationAreaType;
|
||||
import org.pushingpixels.substance.api.SubstanceLookAndFeel;
|
||||
import org.pushingpixels.substance.api.SubstanceSkin;
|
||||
import org.pushingpixels.substance.api.renderers.SubstanceDefaultListCellRenderer;
|
||||
import org.pushingpixels.substance.api.skin.SkinInfo;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -99,6 +114,27 @@ public class AdvancedSettingsDialog extends AppDialog implements ActionListener
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private static class SkinSelect {
|
||||
private String name;
|
||||
private String className;
|
||||
|
||||
public SkinSelect(String name, String className) {
|
||||
this.name = name;
|
||||
this.className = className;
|
||||
}
|
||||
|
||||
public String getClassName() {
|
||||
return className;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void initComponents() {
|
||||
okButton = new JButton();
|
||||
@@ -159,6 +195,65 @@ public class AdvancedSettingsDialog extends AppDialog implements ActionListener
|
||||
|
||||
JTabbedPane tabPane = new JTabbedPane();
|
||||
Map<String, Component> tabs = new HashMap<>();
|
||||
|
||||
JComboBox<SkinSelect> skinComboBox=new JComboBox<>();
|
||||
skinComboBox.setRenderer(new SubstanceDefaultListCellRenderer(){
|
||||
|
||||
@Override
|
||||
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
|
||||
SubstanceDefaultListCellRenderer cmp= (SubstanceDefaultListCellRenderer)super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); //To change body of generated methods, choose Tools | Templates.
|
||||
final SkinSelect ss=(SkinSelect)value;
|
||||
cmp.setIcon(new Icon() {
|
||||
|
||||
@Override
|
||||
public void paintIcon(Component c, Graphics g, int x, int y) {
|
||||
Graphics2D g2 = (Graphics2D) g;
|
||||
g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
|
||||
g2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
|
||||
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
|
||||
try {
|
||||
Class<?> act = Class.forName(ss.getClassName());
|
||||
SubstanceSkin skin = (SubstanceSkin)act.newInstance();
|
||||
Color fill = skin.getColorScheme(DecorationAreaType.GENERAL,ColorSchemeAssociationKind.FILL,ComponentState.ENABLED).getBackgroundFillColor();
|
||||
Color hilight=skin.getColorScheme(DecorationAreaType.GENERAL,ColorSchemeAssociationKind.FILL,ComponentState.ROLLOVER_SELECTED).getBackgroundFillColor();
|
||||
Color border = skin.getColorScheme(DecorationAreaType.GENERAL,ColorSchemeAssociationKind.BORDER,ComponentState.ENABLED).getDarkColor();
|
||||
g2.setColor(fill);
|
||||
g2.fillOval(0, 0, 16, 16);
|
||||
g2.setColor(hilight);
|
||||
g2.fillArc(0, 0, 16, 16, -45, 90);
|
||||
g2.setColor(border);
|
||||
g2.drawOval(0, 0, 16, 16);
|
||||
|
||||
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException ex) {
|
||||
//no icon
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIconWidth() {
|
||||
return 16;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIconHeight() {
|
||||
return 16;
|
||||
}
|
||||
});
|
||||
return cmp;
|
||||
}
|
||||
|
||||
});
|
||||
skinComboBox.addItem(new SkinSelect(OceanicSkin.NAME, OceanicSkin.class.getName()));
|
||||
Map<String,SkinInfo> skins = SubstanceLookAndFeel.getAllSkins();
|
||||
for(String skinKey:skins.keySet()){
|
||||
SkinInfo skin=skins.get(skinKey);
|
||||
skinComboBox.addItem(new SkinSelect(skin.getDisplayName(), skin.getClassName()));
|
||||
if(skin.getClassName().equals(Configuration.guiSkin.get())){
|
||||
skinComboBox.setSelectedIndex(skinComboBox.getItemCount()-1);
|
||||
}
|
||||
}
|
||||
|
||||
for (String cat : categorized.keySet()) {
|
||||
JPanel configPanel = new JPanel(new SpringLayout());
|
||||
for (String name : categorized.get(cat).keySet()) {
|
||||
@@ -172,23 +267,33 @@ public class AdvancedSettingsDialog extends AppDialog implements ActionListener
|
||||
|
||||
ParameterizedType listType = (ParameterizedType) field.getGenericType();
|
||||
Class itemType = (Class<?>) listType.getActualTypeArguments()[0];
|
||||
/*String description = Configuration.getDescription(field);
|
||||
if (description == null) {
|
||||
description = "";
|
||||
}*/
|
||||
|
||||
String description = translate("config.description." + name);
|
||||
|
||||
Object defaultValue = Configuration.getDefaultValue(field);
|
||||
if(name.equals("gui.skin")){
|
||||
Class c;
|
||||
try {
|
||||
c = Class.forName((String)defaultValue);
|
||||
defaultValue = c.getField("NAME").get(c);
|
||||
} catch (ClassNotFoundException | NoSuchFieldException | SecurityException ex) {
|
||||
Logger.getLogger(AdvancedSettingsDialog.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
|
||||
}
|
||||
if (defaultValue != null) {
|
||||
description += " (" + translate("default") + ": " + defaultValue + ")";
|
||||
}
|
||||
//model.addRow(new Object[]{locName, item.get(), description});
|
||||
|
||||
|
||||
JLabel l = new JLabel(locName, JLabel.TRAILING);
|
||||
l.setToolTipText(description);
|
||||
configPanel.add(l);
|
||||
Component c = null;
|
||||
if ((itemType == String.class) || (itemType == Integer.class) || (itemType == Long.class) || (itemType == Double.class) || (itemType == Float.class) || (itemType == Calendar.class)) {
|
||||
if(name.equals("gui.skin")){
|
||||
skinComboBox.setToolTipText(description);
|
||||
skinComboBox.setMaximumSize(new Dimension(Integer.MAX_VALUE, skinComboBox.getPreferredSize().height));
|
||||
c = skinComboBox;
|
||||
} else if ((itemType == String.class) || (itemType == Integer.class) || (itemType == Long.class) || (itemType == Double.class) || (itemType == Float.class) || (itemType == Calendar.class)) {
|
||||
JTextField tf = new JTextField();
|
||||
Object val = item.get();
|
||||
if (val == null) {
|
||||
@@ -298,7 +403,10 @@ public class AdvancedSettingsDialog extends AppDialog implements ActionListener
|
||||
|
||||
ParameterizedType listType = (ParameterizedType) fields.get(name).getGenericType();
|
||||
Class itemType = (Class<?>) listType.getActualTypeArguments()[0];
|
||||
if (itemType == String.class) {
|
||||
if(name.equals("gui.skin")){
|
||||
value = ((SkinSelect)((JComboBox<SkinSelect>)c).getSelectedItem()).className;
|
||||
}
|
||||
else if (itemType == String.class) {
|
||||
value = ((JTextField) c).getText();
|
||||
}
|
||||
if (itemType == Boolean.class) {
|
||||
|
||||
@@ -78,6 +78,10 @@ public class ErrorLogFrame extends AppFrame {
|
||||
return handler;
|
||||
}
|
||||
|
||||
public static boolean hasInstance() {
|
||||
return instance != null;
|
||||
}
|
||||
|
||||
public static ErrorLogFrame getInstance() {
|
||||
if (instance == null) {
|
||||
instance = new ErrorLogFrame();
|
||||
|
||||
@@ -50,6 +50,10 @@ import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import org.pushingpixels.substance.api.ColorSchemeAssociationKind;
|
||||
import org.pushingpixels.substance.api.ComponentState;
|
||||
import org.pushingpixels.substance.api.DecorationAreaType;
|
||||
import org.pushingpixels.substance.api.SubstanceLookAndFeel;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -188,9 +192,13 @@ 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);
|
||||
g.setColor(Color.black);
|
||||
Color color = new Color(0xd9, 0xe8, 0xfb);
|
||||
Color selectedColor = new Color(0xfe, 0xca, 0x81);
|
||||
Color color = SubstanceLookAndFeel.getCurrentSkin().getColorScheme(DecorationAreaType.GENERAL, ColorSchemeAssociationKind.FILL, ComponentState.ENABLED).getBackgroundFillColor();
|
||||
Color selectedColor = SubstanceLookAndFeel.getCurrentSkin().getColorScheme(DecorationAreaType.GENERAL, ColorSchemeAssociationKind.FILL, ComponentState.ROLLOVER_SELECTED).getBackgroundFillColor();
|
||||
Color borderColor = SubstanceLookAndFeel.getCurrentSkin().getColorScheme(DecorationAreaType.GENERAL, ColorSchemeAssociationKind.BORDER, ComponentState.ROLLOVER_SELECTED).getUltraDarkColor();
|
||||
Color textColor = SubstanceLookAndFeel.getCurrentSkin().getColorScheme(DecorationAreaType.GENERAL, ColorSchemeAssociationKind.FILL, ComponentState.ROLLOVER_SELECTED).getForegroundColor();
|
||||
|
||||
//g.setColor(SubstanceLookAndFeel.getCurrentSkin().getColorScheme(DecorationAreaType.GENERAL, ColorSchemeAssociationKind.FILL, ComponentState.ENABLED));
|
||||
|
||||
for (int y = start_y; y <= finish_y; y++) {
|
||||
for (int x = 0; x < cols; x++) {
|
||||
int index = y * cols + x;
|
||||
@@ -222,10 +230,12 @@ public class FolderPreviewPanel extends JPanel {
|
||||
s = treeItem.toString();
|
||||
}
|
||||
g.setFont(f);
|
||||
g.setColor(Color.black);
|
||||
g.setColor(borderColor);
|
||||
g.drawLine(x * CELL_WIDTH, y * CELL_HEIGHT + BORDER_SIZE + PREVIEW_SIZE, x * CELL_WIDTH + CELL_WIDTH, y * CELL_HEIGHT + BORDER_SIZE + PREVIEW_SIZE);
|
||||
g.drawString(s, x * CELL_WIDTH + BORDER_SIZE, y * CELL_HEIGHT + BORDER_SIZE + PREVIEW_SIZE + LABEL_HEIGHT);
|
||||
g.drawRect(x * CELL_WIDTH, y * CELL_HEIGHT, CELL_WIDTH, CELL_HEIGHT);
|
||||
g.setColor(textColor);
|
||||
g.drawString(s, x * CELL_WIDTH + BORDER_SIZE, y * CELL_HEIGHT + BORDER_SIZE + PREVIEW_SIZE + LABEL_HEIGHT);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,8 +22,12 @@ import java.awt.geom.GeneralPath;
|
||||
import java.util.EnumSet;
|
||||
import java.util.Set;
|
||||
import javax.swing.JLabel;
|
||||
import org.pushingpixels.substance.api.ColorSchemeAssociationKind;
|
||||
import org.pushingpixels.substance.api.ComponentState;
|
||||
import org.pushingpixels.substance.api.DecorationAreaType;
|
||||
import org.pushingpixels.substance.api.SubstanceColorScheme;
|
||||
import org.pushingpixels.substance.api.SubstanceConstants;
|
||||
import org.pushingpixels.substance.api.SubstanceLookAndFeel;
|
||||
import org.pushingpixels.substance.api.painter.border.StandardBorderPainter;
|
||||
import org.pushingpixels.substance.api.skin.OfficeBlue2007Skin;
|
||||
import org.pushingpixels.substance.internal.utils.SubstanceOutlineUtilities;
|
||||
@@ -65,7 +69,7 @@ public class HeaderLabel extends JLabel {
|
||||
|
||||
@Override
|
||||
public void paint(Graphics g) {
|
||||
g.setColor(new Color(217, 232, 251));
|
||||
g.setColor(SubstanceLookAndFeel.getCurrentSkin().getColorScheme(DecorationAreaType.HEADER, ColorSchemeAssociationKind.FILL,ComponentState.ENABLED).getBackgroundFillColor());
|
||||
g.fillRect(0, 0, getWidth(), getHeight());
|
||||
StandardBorderPainter borderPainter = new StandardBorderPainter();
|
||||
|
||||
@@ -80,12 +84,12 @@ public class HeaderLabel extends JLabel {
|
||||
|
||||
GeneralPath contour = SubstanceOutlineUtilities.getBaseOutline(getWidth(),
|
||||
getHeight() + dy, cornerRadius, straightSides, borderInsets);
|
||||
|
||||
borderPainter.paintBorder(g, this, getWidth(), getHeight() + dy,
|
||||
contour, contourInner, new OfficeBlue2007Skin().getActiveColorScheme(DecorationAreaType.HEADER));
|
||||
g.setColor(Color.black);
|
||||
contour, contourInner,SubstanceLookAndFeel.getCurrentSkin().getColorScheme(DecorationAreaType.HEADER, ColorSchemeAssociationKind.BORDER,ComponentState.ENABLED));
|
||||
g.setColor(SubstanceLookAndFeel.getCurrentSkin().getColorScheme(DecorationAreaType.HEADER, ColorSchemeAssociationKind.FILL,ComponentState.ENABLED).getForegroundColor());
|
||||
JLabel lab = new JLabel(getText(), JLabel.CENTER);
|
||||
lab.setSize(getSize());
|
||||
lab.paint(g);
|
||||
//g.drawString(getText(), getWidth()/2-getFontMetrics(getFont()).stringWidth(getText())/2, getFont().getSize());
|
||||
lab.paint(g);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -207,7 +207,7 @@ public final class ImagePanel extends JPanel implements ActionListener, MediaDis
|
||||
g2d.setPaint(View.transparentPaint);
|
||||
g2d.fill(new Rectangle(0, 0, getWidth(), getHeight()));
|
||||
g2d.setComposite(AlphaComposite.SrcOver);
|
||||
g2d.setPaint(View.swfBackgroundColor);
|
||||
g2d.setPaint(View.getSwfBackgroundColor());
|
||||
g2d.fill(new Rectangle(0, 0, getWidth(), getHeight()));
|
||||
if (img != null) {
|
||||
calcRect();
|
||||
@@ -342,7 +342,7 @@ public final class ImagePanel extends JPanel implements ActionListener, MediaDis
|
||||
super(new BorderLayout());
|
||||
//iconPanel.setHorizontalAlignment(JLabel.CENTER);
|
||||
setOpaque(true);
|
||||
setBackground(View.DEFAULT_BACKGROUND_COLOR);
|
||||
setBackground(View.getDefaultBackgroundColor());
|
||||
|
||||
iconPanel = new IconPanel();
|
||||
//labelPan.add(label, new GridBagConstraints());
|
||||
@@ -554,7 +554,7 @@ public final class ImagePanel extends JPanel implements ActionListener, MediaDis
|
||||
}
|
||||
|
||||
public synchronized void setImage(SerializableImage image) {
|
||||
setBackground(View.swfBackgroundColor);
|
||||
setBackground(View.getSwfBackgroundColor());
|
||||
clear();
|
||||
|
||||
timelined = null;
|
||||
@@ -567,7 +567,7 @@ public final class ImagePanel extends JPanel implements ActionListener, MediaDis
|
||||
}
|
||||
|
||||
public synchronized void setText(TextTag textTag, TextTag newTextTag) {
|
||||
setBackground(View.swfBackgroundColor);
|
||||
setBackground(View.getSwfBackgroundColor());
|
||||
clear();
|
||||
|
||||
timelined = null;
|
||||
|
||||
@@ -791,6 +791,14 @@ public class Main {
|
||||
logger.log(Level.SEVERE, null, ex);
|
||||
}
|
||||
}
|
||||
View.execInEventDispatch(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
ErrorLogFrame.createNewInstance();
|
||||
}
|
||||
});
|
||||
|
||||
autoCheckForUpdates();
|
||||
offerAssociation();
|
||||
View.execInEventDispatch(new Runnable() {
|
||||
@@ -867,8 +875,7 @@ public class Main {
|
||||
}
|
||||
}
|
||||
Locale.setDefault(Locale.forLanguageTag(Configuration.locale.get()));
|
||||
AppStrings.updateLanguage();
|
||||
ErrorLogFrame.createNewInstance();
|
||||
AppStrings.updateLanguage();
|
||||
|
||||
try {
|
||||
Class<?> cl = Class.forName("org.pushingpixels.substance.api.SubstanceLookAndFeel");
|
||||
@@ -1357,7 +1364,7 @@ public class Main {
|
||||
fileTxt.setFormatter(formatterTxt);
|
||||
logger.addHandler(fileTxt);
|
||||
|
||||
if (!GraphicsEnvironment.isHeadless()) {
|
||||
if (!GraphicsEnvironment.isHeadless() && ErrorLogFrame.hasInstance()) {
|
||||
ErrorLogFrame.getInstance().clearErrorState();
|
||||
}
|
||||
|
||||
|
||||
@@ -2147,9 +2147,9 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
switch (e.getActionCommand()) {
|
||||
case ACTION_SELECT_BKCOLOR:
|
||||
Color newColor = JColorChooser.showDialog(null, AppStrings.translate("dialog.selectbkcolor.title"), View.swfBackgroundColor);
|
||||
Color newColor = JColorChooser.showDialog(null, AppStrings.translate("dialog.selectbkcolor.title"), View.getSwfBackgroundColor());
|
||||
if (newColor != null) {
|
||||
View.swfBackgroundColor = newColor;
|
||||
View.setSwfBackgroundColor(newColor);
|
||||
reload(true);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -19,6 +19,8 @@ package com.jpexs.decompiler.flash.gui;
|
||||
import java.awt.Component;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.geom.Point2D;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -16,10 +16,19 @@
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.gui;
|
||||
|
||||
import java.awt.BasicStroke;
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.MultipleGradientPaint;
|
||||
import java.awt.RadialGradientPaint;
|
||||
import java.awt.RenderingHints;
|
||||
import java.awt.Shape;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.geom.AffineTransform;
|
||||
import java.awt.geom.Ellipse2D;
|
||||
import javax.swing.Icon;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
@@ -27,6 +36,10 @@ import org.pushingpixels.flamingo.api.common.model.PopupButtonModel;
|
||||
import org.pushingpixels.flamingo.internal.ui.ribbon.appmenu.BasicRibbonApplicationMenuButtonUI;
|
||||
import org.pushingpixels.flamingo.internal.ui.ribbon.appmenu.JRibbonApplicationMenuButton;
|
||||
import org.pushingpixels.lafwidget.animation.effects.GhostingListener;
|
||||
import org.pushingpixels.substance.api.ColorSchemeAssociationKind;
|
||||
import org.pushingpixels.substance.api.ComponentState;
|
||||
import org.pushingpixels.substance.api.DecorationAreaType;
|
||||
import org.pushingpixels.substance.api.SubstanceLookAndFeel;
|
||||
import org.pushingpixels.substance.flamingo.common.ui.ActionPopupTransitionAwareUI;
|
||||
import org.pushingpixels.substance.flamingo.utils.CommandButtonVisualStateTracker;
|
||||
import org.pushingpixels.substance.internal.animation.StateTransitionTracker;
|
||||
@@ -49,6 +62,7 @@ public class MyRibbonApplicationMenuButtonUI extends BasicRibbonApplicationMenuB
|
||||
private MyResizableIcon clickIcon = null;
|
||||
|
||||
private MyResizableIcon normalIcon = null;
|
||||
private MyResizableIcon clearIcon = null;
|
||||
|
||||
private final boolean buttonResized = false;
|
||||
|
||||
@@ -56,11 +70,89 @@ public class MyRibbonApplicationMenuButtonUI extends BasicRibbonApplicationMenuB
|
||||
return clickIcon;
|
||||
}
|
||||
|
||||
|
||||
public static MyResizableIcon[] getIcons(){
|
||||
MyResizableIcon clearIcon = View.getMyResizableIcon("buttonicon_clear_256");
|
||||
return new MyResizableIcon[]{
|
||||
clearIcon,
|
||||
//normal
|
||||
new MyResizableIcon(clearIcon.originalImage) {
|
||||
|
||||
@Override
|
||||
public void paintIcon(Component c, Graphics g, int x, int y) {
|
||||
Graphics2D g2 = (Graphics2D) g;
|
||||
g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
|
||||
g2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
|
||||
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
|
||||
g2.setPaint(new RadialGradientPaint(getIconWidth() / 2, getIconHeight() / 2, getIconWidth() / 2, new float[]{0.32f, 0.84f, 1f}, new Color[]{
|
||||
SubstanceLookAndFeel.getCurrentSkin().getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.HIGHLIGHT, ComponentState.ENABLED).shiftBackground(Color.white, 0.5).getUltraLightColor(),
|
||||
SubstanceLookAndFeel.getCurrentSkin().getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.FILL, ComponentState.ENABLED).getMidColor(),
|
||||
SubstanceLookAndFeel.getCurrentSkin().getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.BORDER, ComponentState.ENABLED).getUltraDarkColor()
|
||||
}, MultipleGradientPaint.CycleMethod.NO_CYCLE));
|
||||
Shape s = new Ellipse2D.Double(x, y, getIconWidth(), getIconHeight());
|
||||
g2.fill(s);
|
||||
g2.setPaint(SubstanceLookAndFeel.getCurrentSkin().getEnabledColorScheme(DecorationAreaType.PRIMARY_TITLE_PANE).getMidColor());
|
||||
super.paintIcon(c, g, x, y);
|
||||
}
|
||||
},
|
||||
//hover
|
||||
new MyResizableIcon(clearIcon.originalImage) {
|
||||
|
||||
@Override
|
||||
public void paintIcon(Component c, Graphics g, int x, int y) {
|
||||
Graphics2D g2 = (Graphics2D) g;
|
||||
g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
|
||||
g2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
|
||||
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
|
||||
g2.setPaint(new RadialGradientPaint(getIconWidth() / 2, getIconHeight() / 2, getIconWidth() / 2, new float[]{0.32f, 0.84f, 1f}, new Color[]{
|
||||
SubstanceLookAndFeel.getCurrentSkin().getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.HIGHLIGHT, ComponentState.ROLLOVER_UNSELECTED)/*.shiftBackground(Color.white, 0.8)*/.getUltraLightColor(),
|
||||
SubstanceLookAndFeel.getCurrentSkin().getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.FILL, ComponentState.ROLLOVER_UNSELECTED).getMidColor(),
|
||||
SubstanceLookAndFeel.getCurrentSkin().getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.BORDER, ComponentState.ROLLOVER_UNSELECTED)/*.shiftBackground(new Color(0x7c, 0x7c, 0x7c), 0.8)*/.getUltraDarkColor()
|
||||
}, MultipleGradientPaint.CycleMethod.NO_CYCLE));
|
||||
Shape s = new Ellipse2D.Double(x, y, getIconWidth(), getIconHeight());
|
||||
g2.fill(s);
|
||||
super.paintIcon(c, g, x, y);
|
||||
}
|
||||
},
|
||||
//click
|
||||
new MyResizableIcon(clearIcon.originalImage) {
|
||||
|
||||
@Override
|
||||
public void paintIcon(Component c, Graphics g, int x, int y) {
|
||||
Graphics2D g2 = (Graphics2D) g;
|
||||
g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
|
||||
g2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
|
||||
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
|
||||
g2.setPaint(new RadialGradientPaint(getIconWidth() / 2, getIconHeight() / 2, getIconWidth() / 2, new float[]{0.2f, 0.5f, 0.8f}, new Color[]{
|
||||
SubstanceLookAndFeel.getCurrentSkin().getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.FILL, ComponentState.ROLLOVER_SELECTED).getUltraLightColor(),
|
||||
SubstanceLookAndFeel.getCurrentSkin().getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.FILL, ComponentState.ROLLOVER_SELECTED).getMidColor(),
|
||||
SubstanceLookAndFeel.getCurrentSkin().getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.FILL, ComponentState.ROLLOVER_SELECTED).shiftBackground(Color.black, 0.7).getUltraDarkColor()
|
||||
}, MultipleGradientPaint.CycleMethod.NO_CYCLE));
|
||||
Shape s = new Ellipse2D.Double(x, y, getIconWidth(), getIconHeight());
|
||||
g2.fill(s);
|
||||
AffineTransform origt = g2.getTransform();
|
||||
AffineTransform t = (AffineTransform) origt.clone();
|
||||
t.translate(-getIconWidth() / 2, -getIconHeight() / 2);
|
||||
t.scale(0.8, 0.8);
|
||||
t.translate(getIconWidth() / 2 + getIconWidth() / 4, getIconHeight() / 2 + getIconHeight() / 4);
|
||||
g2.setTransform(t);
|
||||
g2.setPaint(Color.BLACK);
|
||||
super.paintIcon(c, g, x, y);
|
||||
g2.setTransform(origt);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
public MyRibbonApplicationMenuButtonUI() {
|
||||
super();
|
||||
hoverIcon = View.getMyResizableIcon("buttonicon_hover_256");
|
||||
normalIcon = View.getMyResizableIcon("buttonicon_256");
|
||||
clickIcon = View.getMyResizableIcon("buttonicon_down_256");
|
||||
MyResizableIcon[] icons=getIcons();
|
||||
clearIcon = icons[0];
|
||||
normalIcon = icons[1];
|
||||
hoverIcon = icons[2];
|
||||
clickIcon = icons[3];
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -177,6 +269,7 @@ public class MyRibbonApplicationMenuButtonUI extends BasicRibbonApplicationMenuB
|
||||
if (regular == null) {
|
||||
return;
|
||||
}
|
||||
//SubstanceLookAndFeel.getCurrentSkin().getActiveColorScheme(DecorationAreaType.GENERAL);
|
||||
|
||||
Graphics2D g2d = (Graphics2D) g.create();
|
||||
regular.paintIcon(this.applicationMenuButton, g2d, 0, 0);
|
||||
|
||||
240
src/com/jpexs/decompiler/flash/gui/OceanicSkin.java
Normal file
240
src/com/jpexs/decompiler/flash/gui/OceanicSkin.java
Normal file
@@ -0,0 +1,240 @@
|
||||
/*
|
||||
* Copyright (C) 2015 JPEXS
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.gui;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
import org.pushingpixels.substance.api.*;
|
||||
import org.pushingpixels.substance.api.painter.border.CompositeBorderPainter;
|
||||
import org.pushingpixels.substance.api.painter.border.DelegateFractionBasedBorderPainter;
|
||||
import org.pushingpixels.substance.api.painter.border.FractionBasedBorderPainter;
|
||||
import org.pushingpixels.substance.api.painter.border.SubstanceBorderPainter;
|
||||
import org.pushingpixels.substance.api.painter.decoration.FractionBasedDecorationPainter;
|
||||
import org.pushingpixels.substance.api.painter.fill.FractionBasedFillPainter;
|
||||
import org.pushingpixels.substance.api.painter.highlight.ClassicHighlightPainter;
|
||||
import org.pushingpixels.substance.api.painter.overlay.BottomLineOverlayPainter;
|
||||
import org.pushingpixels.substance.api.shaper.ClassicButtonShaper;
|
||||
|
||||
public class OceanicSkin extends SubstanceSkin {
|
||||
|
||||
/**
|
||||
* Display name for <code>this</code> skin.
|
||||
*/
|
||||
public static final String NAME = "Oceanic";
|
||||
|
||||
/**
|
||||
* Creates a new <code>Oceanic</code> skin.
|
||||
*/
|
||||
public OceanicSkin() {
|
||||
SubstanceSkin.ColorSchemes colorSchemes = SubstanceSkin
|
||||
.getColorSchemes("com/jpexs/decompiler/flash/gui/graphics/oceanic.colorschemes");
|
||||
|
||||
SubstanceColorScheme activeScheme = colorSchemes
|
||||
.get("Oceanic Active");
|
||||
SubstanceColorScheme enabledScheme = colorSchemes
|
||||
.get("Oceanic Enabled");
|
||||
|
||||
SubstanceColorSchemeBundle defaultSchemeBundle = new SubstanceColorSchemeBundle(
|
||||
activeScheme, enabledScheme, enabledScheme);
|
||||
defaultSchemeBundle.registerColorScheme(enabledScheme, 0.5f,
|
||||
ComponentState.DISABLED_UNSELECTED);
|
||||
defaultSchemeBundle.registerColorScheme(activeScheme, 0.5f,
|
||||
ComponentState.DISABLED_SELECTED);
|
||||
|
||||
SubstanceColorScheme rolloverScheme = colorSchemes
|
||||
.get("Oceanic Rollover");
|
||||
SubstanceColorScheme rolloverSelectedScheme = colorSchemes
|
||||
.get("Oceanic Rollover Selected");
|
||||
SubstanceColorScheme selectedScheme = colorSchemes
|
||||
.get("Oceanic Selected");
|
||||
SubstanceColorScheme pressedScheme = colorSchemes
|
||||
.get("Oceanic Pressed");
|
||||
SubstanceColorScheme pressedSelectedScheme = colorSchemes
|
||||
.get("Oceanic Pressed Selected");
|
||||
|
||||
// register state-specific color schemes on rollovers and selections
|
||||
defaultSchemeBundle.registerColorScheme(rolloverScheme,
|
||||
ComponentState.ROLLOVER_UNSELECTED);
|
||||
defaultSchemeBundle.registerColorScheme(rolloverSelectedScheme,
|
||||
ComponentState.ROLLOVER_SELECTED);
|
||||
defaultSchemeBundle.registerColorScheme(selectedScheme,
|
||||
ComponentState.SELECTED);
|
||||
defaultSchemeBundle.registerColorScheme(pressedScheme,
|
||||
ComponentState.PRESSED_UNSELECTED);
|
||||
defaultSchemeBundle.registerColorScheme(pressedSelectedScheme,
|
||||
ComponentState.PRESSED_SELECTED);
|
||||
|
||||
// register state-specific highlight color schemes on rollover and
|
||||
// selections
|
||||
defaultSchemeBundle.registerHighlightColorScheme(rolloverScheme, 0.8f,
|
||||
ComponentState.ROLLOVER_UNSELECTED);
|
||||
defaultSchemeBundle.registerHighlightColorScheme(selectedScheme, 0.8f,
|
||||
ComponentState.SELECTED);
|
||||
defaultSchemeBundle.registerHighlightColorScheme(
|
||||
rolloverSelectedScheme, 0.8f, ComponentState.ROLLOVER_SELECTED);
|
||||
defaultSchemeBundle.registerHighlightColorScheme(selectedScheme, 0.8f,
|
||||
ComponentState.ARMED, ComponentState.ROLLOVER_ARMED);
|
||||
|
||||
// borders and marks
|
||||
SubstanceColorScheme borderEnabledScheme = colorSchemes
|
||||
.get("Oceanic Border Enabled");
|
||||
SubstanceColorScheme borderActiveScheme = colorSchemes
|
||||
.get("Oceanic Border Active");
|
||||
SubstanceColorScheme borderRolloverScheme = colorSchemes
|
||||
.get("Oceanic Border Rollover");
|
||||
SubstanceColorScheme borderRolloverSelectedScheme = colorSchemes
|
||||
.get("Oceanic Border Rollover Selected");
|
||||
SubstanceColorScheme borderSelectedScheme = colorSchemes
|
||||
.get("Oceanic Border Selected");
|
||||
SubstanceColorScheme borderPressedScheme = colorSchemes
|
||||
.get("Oceanic Border Pressed");
|
||||
|
||||
defaultSchemeBundle.registerColorScheme(borderEnabledScheme,
|
||||
ColorSchemeAssociationKind.BORDER, ComponentState.ENABLED);
|
||||
defaultSchemeBundle.registerColorScheme(borderEnabledScheme,
|
||||
ColorSchemeAssociationKind.BORDER,
|
||||
ComponentState.DISABLED_SELECTED,
|
||||
ComponentState.DISABLED_UNSELECTED);
|
||||
defaultSchemeBundle.registerColorScheme(borderActiveScheme,
|
||||
ColorSchemeAssociationKind.BORDER, ComponentState.DEFAULT);
|
||||
defaultSchemeBundle.registerColorScheme(borderRolloverScheme,
|
||||
ColorSchemeAssociationKind.BORDER,
|
||||
ComponentState.ROLLOVER_UNSELECTED);
|
||||
defaultSchemeBundle.registerColorScheme(borderRolloverSelectedScheme,
|
||||
ColorSchemeAssociationKind.BORDER,
|
||||
ComponentState.ROLLOVER_SELECTED, ComponentState.ARMED,
|
||||
ComponentState.ROLLOVER_ARMED);
|
||||
defaultSchemeBundle.registerColorScheme(borderSelectedScheme,
|
||||
ColorSchemeAssociationKind.BORDER, ComponentState.SELECTED);
|
||||
defaultSchemeBundle.registerColorScheme(borderPressedScheme,
|
||||
ColorSchemeAssociationKind.BORDER,
|
||||
ComponentState.PRESSED_SELECTED,
|
||||
ComponentState.PRESSED_UNSELECTED);
|
||||
|
||||
// tabs and tab borders
|
||||
SubstanceColorScheme tabSelectedScheme = colorSchemes
|
||||
.get("Oceanic Tab Selected");
|
||||
SubstanceColorScheme tabRolloverScheme = colorSchemes
|
||||
.get("Oceanic Tab Rollover");
|
||||
defaultSchemeBundle.registerColorScheme(tabSelectedScheme,
|
||||
ColorSchemeAssociationKind.TAB, ComponentState.SELECTED,
|
||||
ComponentState.ROLLOVER_SELECTED,
|
||||
ComponentState.PRESSED_SELECTED,
|
||||
ComponentState.PRESSED_UNSELECTED);
|
||||
defaultSchemeBundle.registerColorScheme(tabRolloverScheme,
|
||||
ColorSchemeAssociationKind.TAB,
|
||||
ComponentState.ROLLOVER_UNSELECTED);
|
||||
defaultSchemeBundle.registerColorScheme(borderEnabledScheme,
|
||||
ColorSchemeAssociationKind.TAB_BORDER, ComponentState.SELECTED,
|
||||
ComponentState.ROLLOVER_UNSELECTED);
|
||||
defaultSchemeBundle.registerColorScheme(rolloverSelectedScheme,
|
||||
ColorSchemeAssociationKind.TAB_BORDER,
|
||||
ComponentState.ROLLOVER_SELECTED);
|
||||
|
||||
// separator
|
||||
SubstanceColorScheme separatorScheme = colorSchemes
|
||||
.get("Oceanic Separator");
|
||||
defaultSchemeBundle.registerColorScheme(separatorScheme,
|
||||
ColorSchemeAssociationKind.SEPARATOR);
|
||||
|
||||
this.registerDecorationAreaSchemeBundle(defaultSchemeBundle,
|
||||
DecorationAreaType.NONE);
|
||||
|
||||
this.watermarkScheme = colorSchemes.get("Oceanic Watermark");
|
||||
|
||||
SubstanceColorScheme generalWatermarkScheme = colorSchemes
|
||||
.get("Oceanic Header Watermark");
|
||||
|
||||
this.registerAsDecorationArea(generalWatermarkScheme,
|
||||
DecorationAreaType.FOOTER, DecorationAreaType.HEADER,
|
||||
DecorationAreaType.TOOLBAR);
|
||||
|
||||
SubstanceColorScheme titleWatermarkScheme = colorSchemes
|
||||
.get("Oceanic Title Watermark");
|
||||
|
||||
this.registerAsDecorationArea(titleWatermarkScheme,
|
||||
DecorationAreaType.GENERAL,
|
||||
DecorationAreaType.PRIMARY_TITLE_PANE,
|
||||
DecorationAreaType.SECONDARY_TITLE_PANE);
|
||||
|
||||
setSelectedTabFadeStart(0.7);
|
||||
setSelectedTabFadeEnd(0.9);
|
||||
|
||||
this.addOverlayPainter(new BottomLineOverlayPainter(
|
||||
new ColorSchemeSingleColorQuery() {
|
||||
@Override
|
||||
public Color query(SubstanceColorScheme scheme) {
|
||||
Color fg = scheme.getForegroundColor();
|
||||
return new Color(fg.getRed(), fg.getGreen(), fg
|
||||
.getBlue(), 72);
|
||||
}
|
||||
}), DecorationAreaType.PRIMARY_TITLE_PANE,
|
||||
DecorationAreaType.SECONDARY_TITLE_PANE);
|
||||
|
||||
this.buttonShaper = new ClassicButtonShaper();
|
||||
this.watermark = null;
|
||||
|
||||
this.fillPainter = new FractionBasedFillPainter("Oceanic",
|
||||
new float[]{0.0f, 0.49999f, 0.5f, 1.0f},
|
||||
new ColorSchemeSingleColorQuery[]{
|
||||
ColorSchemeSingleColorQuery.ULTRALIGHT,
|
||||
ColorSchemeSingleColorQuery.LIGHT,
|
||||
ColorSchemeSingleColorQuery.ULTRADARK,
|
||||
ColorSchemeSingleColorQuery.EXTRALIGHT});
|
||||
|
||||
FractionBasedBorderPainter outerBorderPainter = new FractionBasedBorderPainter(
|
||||
"Oceanic Outer", new float[]{0.0f, 0.5f, 1.0f},
|
||||
new ColorSchemeSingleColorQuery[]{
|
||||
ColorSchemeSingleColorQuery.EXTRALIGHT,
|
||||
ColorSchemeSingleColorQuery.DARK,
|
||||
ColorSchemeSingleColorQuery.MID});
|
||||
SubstanceBorderPainter innerBorderPainter = new DelegateFractionBasedBorderPainter(
|
||||
"Oceanic Inner", outerBorderPainter, new int[]{
|
||||
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF},
|
||||
new ColorSchemeTransform() {
|
||||
@Override
|
||||
public SubstanceColorScheme transform(
|
||||
SubstanceColorScheme scheme) {
|
||||
return scheme.tint(0.8f);
|
||||
}
|
||||
});
|
||||
this.borderPainter = new CompositeBorderPainter("Oceanic",
|
||||
outerBorderPainter, innerBorderPainter);
|
||||
|
||||
this.decorationPainter = new FractionBasedDecorationPainter(
|
||||
"Oceanic", new float[]{0.0f, 0.1199999f, 0.12f,
|
||||
0.5f, 0.9f, 1.0f}, new ColorSchemeSingleColorQuery[]{
|
||||
ColorSchemeSingleColorQuery.LIGHT,
|
||||
ColorSchemeSingleColorQuery.LIGHT,
|
||||
ColorSchemeSingleColorQuery.ULTRADARK,
|
||||
ColorSchemeSingleColorQuery.MID,
|
||||
ColorSchemeSingleColorQuery.ULTRALIGHT,
|
||||
ColorSchemeSingleColorQuery.LIGHT});
|
||||
this.highlightPainter = new ClassicHighlightPainter();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.pushingpixels.substance.skin.SubstanceSkin#getDisplayName()
|
||||
*/
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
return NAME;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -381,7 +381,7 @@ public class PreviewPanel extends JSplitPane implements ActionListener {
|
||||
} else {
|
||||
JPanel swtPanel = new JPanel(new BorderLayout());
|
||||
swtPanel.add(new JLabel("<html><center>" + mainPanel.translate("notavailonthisplatform") + "</center></html>", JLabel.CENTER), BorderLayout.CENTER);
|
||||
swtPanel.setBackground(View.DEFAULT_BACKGROUND_COLOR);
|
||||
swtPanel.setBackground(View.getDefaultBackgroundColor());
|
||||
leftComponent = swtPanel;
|
||||
}
|
||||
|
||||
@@ -654,10 +654,10 @@ public class PreviewPanel extends JSplitPane implements ActionListener {
|
||||
tempFile = File.createTempFile("ffdec_view_", ".swf");
|
||||
tempFile.deleteOnExit();
|
||||
|
||||
Color backgroundColor = View.swfBackgroundColor;
|
||||
Color backgroundColor = View.getSwfBackgroundColor();
|
||||
|
||||
if (tagObj instanceof FontTag) { //Fonts are always black on white
|
||||
backgroundColor = View.DEFAULT_BACKGROUND_COLOR;
|
||||
backgroundColor = View.getDefaultBackgroundColor();
|
||||
}
|
||||
|
||||
if (tagObj instanceof Frame) {
|
||||
@@ -1112,7 +1112,7 @@ public class PreviewPanel extends JSplitPane implements ActionListener {
|
||||
}
|
||||
|
||||
public void showSwf(SWF swf) {
|
||||
Color backgroundColor = View.DEFAULT_BACKGROUND_COLOR;
|
||||
Color backgroundColor = View.getDefaultBackgroundColor();
|
||||
for (Tag t : swf.tags) {
|
||||
if (t instanceof SetBackgroundColorTag) {
|
||||
backgroundColor = ((SetBackgroundColorTag) t).backgroundColor.toColor();
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.gui;
|
||||
|
||||
import com.jpexs.decompiler.flash.configuration.Configuration;
|
||||
import com.jpexs.decompiler.flash.configuration.ConfigurationItem;
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Color;
|
||||
@@ -81,7 +82,9 @@ import javax.swing.text.JTextComponent;
|
||||
import javax.swing.tree.TreeModel;
|
||||
import javax.swing.tree.TreePath;
|
||||
import org.pushingpixels.flamingo.api.common.icon.ImageWrapperResizableIcon;
|
||||
import org.pushingpixels.substance.api.ColorSchemeAssociationKind;
|
||||
import org.pushingpixels.substance.api.ComponentState;
|
||||
import org.pushingpixels.substance.api.DecorationAreaType;
|
||||
import org.pushingpixels.substance.api.SubstanceColorScheme;
|
||||
import org.pushingpixels.substance.api.SubstanceConstants;
|
||||
import org.pushingpixels.substance.api.SubstanceLookAndFeel;
|
||||
@@ -96,10 +99,25 @@ import org.pushingpixels.substance.internal.utils.SubstanceColorSchemeUtilities;
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class View {
|
||||
|
||||
public static Color getDefaultBackgroundColor() {
|
||||
return SubstanceLookAndFeel.getCurrentSkin().getColorScheme(DecorationAreaType.GENERAL, ColorSchemeAssociationKind.FILL, ComponentState.ENABLED).getBackgroundFillColor();
|
||||
}
|
||||
|
||||
private static Color swfBackgroundColor = null;
|
||||
|
||||
public static final Color DEFAULT_BACKGROUND_COLOR = new Color(217, 231, 250);
|
||||
public static void setSwfBackgroundColor(Color swfBackgroundColor) {
|
||||
View.swfBackgroundColor = swfBackgroundColor;
|
||||
}
|
||||
|
||||
public static Color swfBackgroundColor = DEFAULT_BACKGROUND_COLOR;
|
||||
public static Color getSwfBackgroundColor() {
|
||||
if(swfBackgroundColor == null){
|
||||
return getDefaultBackgroundColor();
|
||||
}
|
||||
return swfBackgroundColor;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static final BufferedImage transparentTexture;
|
||||
|
||||
@@ -140,6 +158,7 @@ public class View {
|
||||
|
||||
try {
|
||||
UIManager.setLookAndFeel(new SubstanceOfficeBlue2007LookAndFeel());
|
||||
SubstanceLookAndFeel.setSkin(Configuration.guiSkin.get());
|
||||
UIManager.put(SubstanceLookAndFeel.COLORIZATION_FACTOR, 0.999);//This works for not changing labels color and not changing Dialogs title
|
||||
UIManager.put("Tree.expandedIcon", getIcon("expand16"));
|
||||
UIManager.put("Tree.collapsedIcon", getIcon("collapse16"));
|
||||
@@ -267,10 +286,15 @@ public class View {
|
||||
*/
|
||||
public static void setWindowIcon(Window f) {
|
||||
List<Image> images = new ArrayList<>();
|
||||
images.add(loadImage("icon16"));
|
||||
images.add(loadImage("icon32"));
|
||||
images.add(loadImage("icon48"));
|
||||
images.add(loadImage("icon256"));
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
210
src/com/jpexs/decompiler/flash/gui/graphics/oceanic.colorschemes
Normal file
210
src/com/jpexs/decompiler/flash/gui/graphics/oceanic.colorschemes
Normal file
@@ -0,0 +1,210 @@
|
||||
Oceanic Watermark {
|
||||
kind=Light
|
||||
colorUltraLight=#DEE8F5
|
||||
colorExtraLight=#D2DFF0
|
||||
colorLight=#D0E0F0
|
||||
colorMid=#CAD9ED
|
||||
colorDark=#BACAD9
|
||||
colorUltraDark=#AEC2D5
|
||||
colorForeground=#15428B
|
||||
}
|
||||
|
||||
Oceanic Header Watermark {
|
||||
kind=Light
|
||||
colorUltraLight=#ceebfd
|
||||
colorExtraLight=#b2e0fd
|
||||
colorLight=#95d4fd
|
||||
colorMid=#6ec4fb
|
||||
colorDark=#59beff
|
||||
colorUltraDark=#42b4fc
|
||||
colorForeground=#000000
|
||||
}
|
||||
|
||||
Oceanic Active {
|
||||
kind=Light
|
||||
colorUltraLight=#9DBDE7
|
||||
colorExtraLight=#BBD5F8
|
||||
colorLight=#ABCCF6
|
||||
colorMid=#AACBF6
|
||||
colorDark=#8CB8F3
|
||||
colorUltraDark=#79ADF1
|
||||
colorForeground=#15428B
|
||||
}
|
||||
|
||||
Oceanic Title Watermark {
|
||||
kind=Light
|
||||
colorUltraLight=#ceebfd
|
||||
colorExtraLight=#b2e0fd
|
||||
colorLight=#95d4fd
|
||||
colorMid=#6ec4fb
|
||||
colorDark=#59beff
|
||||
colorUltraDark=#42b4fc
|
||||
colorForeground=#005e8e
|
||||
}
|
||||
|
||||
Oceanic Border Active {
|
||||
kind=Light
|
||||
colorUltraLight=#7F96BA
|
||||
colorExtraLight=#63779E
|
||||
colorLight=#576890
|
||||
colorMid=#596991
|
||||
colorDark=#576890
|
||||
colorUltraDark=#566890
|
||||
colorForeground=#15428B
|
||||
}
|
||||
|
||||
Oceanic Enabled {
|
||||
kind=Light
|
||||
colorUltraLight=#C2E1F9
|
||||
colorExtraLight=#B1DDFF
|
||||
colorLight=#72c2ff
|
||||
colorMid=#49adfa
|
||||
colorDark=#3ba8fb
|
||||
colorUltraDark=#2ba3ff
|
||||
colorForeground=#053E6A
|
||||
}
|
||||
|
||||
|
||||
Oceanic Border Enabled {
|
||||
kind=Light
|
||||
colorUltraLight=#9EBAE1
|
||||
colorExtraLight=#8AADDB
|
||||
colorLight=#84A8D7
|
||||
colorMid=#81A3D0
|
||||
colorDark=#6E90B8
|
||||
colorUltraDark=#537BAE
|
||||
colorForeground=#15428B
|
||||
}
|
||||
|
||||
Oceanic Pressed {
|
||||
kind=Light
|
||||
colorUltraLight=#FDA661
|
||||
colorExtraLight=#FC963C
|
||||
colorLight=#FD9D3E
|
||||
colorMid=#FC923C
|
||||
colorDark=#FC8F3C
|
||||
colorUltraDark=#FC923D
|
||||
colorForeground=#15428B
|
||||
}
|
||||
|
||||
Oceanic Pressed Selected {
|
||||
kind=Light
|
||||
colorUltraLight=#FEB96C
|
||||
colorExtraLight=#FC963C
|
||||
colorLight=#FDA962
|
||||
colorMid=#FD953C
|
||||
colorDark=#FC923D
|
||||
colorUltraDark=#FC8F3D
|
||||
colorForeground=#15428B
|
||||
}
|
||||
|
||||
Oceanic Rollover {
|
||||
kind=Light
|
||||
colorUltraLight=#fef512
|
||||
colorExtraLight=#feee0d
|
||||
colorLight=#fcdf0a
|
||||
colorMid=#fad008
|
||||
colorDark=#f9c006
|
||||
colorUltraDark=#f7b203
|
||||
colorForeground=#000000
|
||||
}
|
||||
|
||||
Oceanic Rollover Selected {
|
||||
kind=Light
|
||||
colorUltraLight=#febd12
|
||||
colorExtraLight=#feb60d
|
||||
colorLight=#fca60a
|
||||
colorMid=#fa9808
|
||||
colorDark=#f98706
|
||||
colorUltraDark=#f77903
|
||||
colorForeground=#15428B
|
||||
}
|
||||
|
||||
Oceanic Selected {
|
||||
kind=Light
|
||||
colorUltraLight=#FBDBB5
|
||||
colorExtraLight=#FDEB9F
|
||||
colorLight=#FEC778
|
||||
colorMid=#FDD07C
|
||||
colorDark=#FDB759
|
||||
colorUltraDark=#FEB456
|
||||
colorForeground=#15428B
|
||||
}
|
||||
|
||||
Oceanic Separator {
|
||||
kind=Light
|
||||
colorUltraLight=#D5E3F1
|
||||
colorExtraLight=#D0E1F7
|
||||
colorLight=#C2D5ED
|
||||
colorMid=#C1D3EC
|
||||
colorDark=#8DACD3
|
||||
colorUltraDark=#7797C1
|
||||
colorForeground=#F8FAFC
|
||||
}
|
||||
|
||||
Oceanic Tab Rollover {
|
||||
kind=Light
|
||||
colorUltraLight=#E0E3DC
|
||||
colorExtraLight=#E4E6E0
|
||||
colorLight=#D8DBD0
|
||||
colorMid=#E0D4A8
|
||||
colorDark=#E2D19E
|
||||
colorUltraDark=#E3D198
|
||||
colorForeground=#15428B
|
||||
}
|
||||
|
||||
Oceanic Tab Selected {
|
||||
kind=Light
|
||||
colorUltraLight=#F5FAFF
|
||||
colorExtraLight=#EBF3FE
|
||||
colorLight=#EAF2FD
|
||||
colorMid=#E9F1FA
|
||||
colorDark=#E8F0F9
|
||||
colorUltraDark=#E1EAF6
|
||||
colorForeground=#15428B
|
||||
}
|
||||
|
||||
|
||||
Oceanic Border Selected {
|
||||
kind=Light
|
||||
colorUltraLight=#C6C0B1
|
||||
colorExtraLight=#AEA590
|
||||
colorLight=#8E8165
|
||||
colorMid=#8E8064
|
||||
colorDark=#9A7057
|
||||
colorUltraDark=#9F7559
|
||||
colorForeground=#FCE59C
|
||||
}
|
||||
|
||||
Oceanic Border Pressed {
|
||||
kind=Light
|
||||
colorUltraLight=#C8BAA4
|
||||
colorExtraLight=#BDB19E
|
||||
colorLight=#A6957B
|
||||
colorMid=#8B7654
|
||||
colorDark=#8B7654
|
||||
colorUltraDark=#8B7654
|
||||
colorForeground=#FEBE64
|
||||
}
|
||||
|
||||
Oceanic Border Rollover {
|
||||
kind=Light
|
||||
colorUltraLight=#DAC378
|
||||
colorExtraLight=#D9C176
|
||||
colorLight=#D8BB6D
|
||||
colorMid=#D6B664
|
||||
colorDark=#D7B867
|
||||
colorUltraDark=#CFBA73
|
||||
colorForeground=#FFE798
|
||||
}
|
||||
|
||||
Oceanic Border Rollover Selected {
|
||||
kind=Light
|
||||
colorUltraLight=#B1A389
|
||||
colorExtraLight=#AE9F7D
|
||||
colorLight=#A19476
|
||||
colorMid=#9C8F73
|
||||
colorDark=#9C8864
|
||||
colorUltraDark=#8E8165
|
||||
colorForeground=#F7C05B
|
||||
}
|
||||
@@ -338,3 +338,7 @@ config.description.scriptExportSingleFile = Exporting texts to one file instead
|
||||
|
||||
config.name.setFFDecVersionInExportedFont = Set FFDec version number in exported font
|
||||
config.description.setFFDecVersionInExportedFont = When this setting is disabled, FFDec won't add the current FFDec version number to the exported font.
|
||||
|
||||
|
||||
config.name.gui.skin = User Interface Skin
|
||||
config.description.gui.skin = Look and feel skin
|
||||
@@ -508,9 +508,9 @@ public class PlayerControls extends JPanel implements ActionListener {
|
||||
View.execInEventDispatch(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Color newColor = JColorChooser.showDialog(null, AppStrings.translate("dialog.selectbkcolor.title"), View.swfBackgroundColor);
|
||||
Color newColor = JColorChooser.showDialog(null, AppStrings.translate("dialog.selectbkcolor.title"), View.getSwfBackgroundColor());
|
||||
if (newColor != null) {
|
||||
View.swfBackgroundColor = newColor;
|
||||
View.setSwfBackgroundColor(newColor);
|
||||
display.setBackground(newColor);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user