From fdbffc4a43d1ce84b5d232fa4f0301d1ab3bf444 Mon Sep 17 00:00:00 2001 From: "honfika@gmail.com" Date: Sat, 18 Apr 2015 20:45:29 +0200 Subject: [PATCH] cleanup --- .../action/model/SetPropertyActionItem.java | 4 +- .../action/model/clauses/ForInActionItem.java | 8 +- .../flash/tags/DoInitActionTag.java | 1 - .../flash/treeitems/FolderItem.java | 2 +- .../flash/gui/AdvancedSettingsDialog.java | 137 +++++++++--------- .../decompiler/flash/gui/ErrorLogFrame.java | 2 +- .../flash/gui/FolderPreviewPanel.java | 5 +- .../decompiler/flash/gui/HeaderLabel.java | 19 +-- .../gui/MyRibbonApplicationMenuButtonUI.java | 129 ++++++++--------- .../decompiler/flash/gui/OceanicSkin.java | 13 +- .../flash/gui/dumpview/DumpTree.java | 4 +- 11 files changed, 158 insertions(+), 166 deletions(-) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/SetPropertyActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/SetPropertyActionItem.java index f9f827049..320dc546a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/SetPropertyActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/SetPropertyActionItem.java @@ -106,8 +106,8 @@ public class SetPropertyActionItem extends ActionItem implements SetTypeActionIt @Override public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException { ActionSourceGenerator asGenerator = (ActionSourceGenerator) generator; - int tmpReg=asGenerator.getTempRegister(localData); - try{ + int tmpReg = asGenerator.getTempRegister(localData); + try { return toSourceMerge(localData, generator, target, new ActionPush((Long) (long) propertyIndex), value, new ActionStoreRegister(tmpReg), new ActionSetProperty(), new ActionPush(new RegisterNumber(tmpReg))); } finally { asGenerator.releaseTempRegister(localData, tmpReg); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/clauses/ForInActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/clauses/ForInActionItem.java index 062ab13da..527acaa5c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/clauses/ForInActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/clauses/ForInActionItem.java @@ -21,12 +21,9 @@ import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.Action; import com.jpexs.decompiler.flash.action.model.DirectValueActionItem; import com.jpexs.decompiler.flash.action.parser.script.ActionSourceGenerator; -import com.jpexs.decompiler.flash.action.parser.script.VariableActionItem; import com.jpexs.decompiler.flash.action.swf4.ActionIf; import com.jpexs.decompiler.flash.action.swf4.ActionJump; -import com.jpexs.decompiler.flash.action.swf4.ActionPop; import com.jpexs.decompiler.flash.action.swf4.ActionPush; -import com.jpexs.decompiler.flash.action.swf4.ActionSetVariable; import com.jpexs.decompiler.flash.action.swf4.RegisterNumber; import com.jpexs.decompiler.flash.action.swf5.ActionEquals2; import com.jpexs.decompiler.flash.action.swf5.ActionStoreRegister; @@ -41,7 +38,6 @@ import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.Loop; import com.jpexs.decompiler.graph.SourceGenerator; -import com.jpexs.decompiler.graph.TypeItem; import com.jpexs.decompiler.graph.model.ContinueItem; import com.jpexs.decompiler.graph.model.LocalData; import java.util.ArrayList; @@ -134,7 +130,7 @@ public class ForInActionItem extends LoopActionItem implements Block { List loopExpr = new ArrayList<>(); int exprReg = asGenerator.getTempRegister(localData); - + loopExpr.add(new ActionStoreRegister(exprReg)); loopExpr.add(new ActionPush(new Null())); loopExpr.add(new ActionEquals2()); @@ -142,7 +138,7 @@ public class ForInActionItem extends LoopActionItem implements Block { loopExpr.add(forInEndIf); List loopBody = new ArrayList<>(); loopBody.add(new ActionPush(new RegisterNumber(exprReg))); - loopBody.addAll(asGenerator.toActionList(variableName.toSourceIgnoreReturnValue(localData, generator))); + loopBody.addAll(asGenerator.toActionList(variableName.toSourceIgnoreReturnValue(localData, generator))); int oldForIn = asGenerator.getForInLevel(localData); asGenerator.setForInLevel(localData, oldForIn + 1); loopBody.addAll(asGenerator.toActionList(asGenerator.generate(localData, commands))); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java index 66757baca..66f1ff68b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java @@ -250,5 +250,4 @@ public class DoInitActionTag extends Tag implements CharacterIdTag, ASMSource { public void setCharacterId(int characterId) { this.spriteId = characterId; } - } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/treeitems/FolderItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/treeitems/FolderItem.java index cd1d8e1fb..34c693586 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/treeitems/FolderItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/treeitems/FolderItem.java @@ -59,7 +59,7 @@ public class FolderItem implements TreeItem { if (subItems == null) { return false; } - + for (TreeItem ti : subItems) { if (ti.isModified()) { return true; diff --git a/src/com/jpexs/decompiler/flash/gui/AdvancedSettingsDialog.java b/src/com/jpexs/decompiler/flash/gui/AdvancedSettingsDialog.java index e14f1fc56..790785944 100644 --- a/src/com/jpexs/decompiler/flash/gui/AdvancedSettingsDialog.java +++ b/src/com/jpexs/decompiler/flash/gui/AdvancedSettingsDialog.java @@ -26,7 +26,6 @@ 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; @@ -56,7 +55,6 @@ 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; @@ -114,9 +112,11 @@ public class AdvancedSettingsDialog extends AppDialog implements ActionListener } }; } - + private static class SkinSelect { + private String name; + private String className; public SkinSelect(String name, String className) { @@ -132,8 +132,6 @@ public class AdvancedSettingsDialog extends AppDialog implements ActionListener public String toString() { return name; } - - } private void initComponents() { @@ -195,65 +193,65 @@ public class AdvancedSettingsDialog extends AppDialog implements ActionListener JTabbedPane tabPane = new JTabbedPane(); Map tabs = new HashMap<>(); - - JComboBox 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() { + JComboBox skinComboBox = new JComboBox<>(); + skinComboBox.setRenderer(new SubstanceDefaultListCellRenderer() { - @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 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 int getIconWidth() { - return 16; - } + @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); - @Override - public int getIconHeight() { - return 16; - } - }); - return cmp; - } - - }); - skinComboBox.addItem(new SkinSelect(OceanicSkin.NAME, OceanicSkin.class.getName())); - Map 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); - } + } 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 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()) { @@ -267,33 +265,33 @@ public class AdvancedSettingsDialog extends AppDialog implements ActionListener ParameterizedType listType = (ParameterizedType) field.getGenericType(); Class itemType = (Class) listType.getActualTypeArguments()[0]; - + String description = translate("config.description." + name); Object defaultValue = Configuration.getDefaultValue(field); - if(name.equals("gui.skin")){ + if (name.equals("gui.skin")) { Class c; try { - c = Class.forName((String)defaultValue); + 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 + ")"; } - + JLabel l = new JLabel(locName, JLabel.TRAILING); l.setToolTipText(description); configPanel.add(l); Component c = null; - if(name.equals("gui.skin")){ + 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)) { + } 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) { @@ -403,10 +401,9 @@ public class AdvancedSettingsDialog extends AppDialog implements ActionListener ParameterizedType listType = (ParameterizedType) fields.get(name).getGenericType(); Class itemType = (Class) listType.getActualTypeArguments()[0]; - if(name.equals("gui.skin")){ - value = ((SkinSelect)((JComboBox)c).getSelectedItem()).className; - } - else if (itemType == String.class) { + if (name.equals("gui.skin")) { + value = ((SkinSelect) ((JComboBox) c).getSelectedItem()).className; + } else if (itemType == String.class) { value = ((JTextField) c).getText(); } if (itemType == Boolean.class) { diff --git a/src/com/jpexs/decompiler/flash/gui/ErrorLogFrame.java b/src/com/jpexs/decompiler/flash/gui/ErrorLogFrame.java index 596e1a5dd..d4a92442a 100644 --- a/src/com/jpexs/decompiler/flash/gui/ErrorLogFrame.java +++ b/src/com/jpexs/decompiler/flash/gui/ErrorLogFrame.java @@ -81,7 +81,7 @@ public class ErrorLogFrame extends AppFrame { public static boolean hasInstance() { return instance != null; } - + public static ErrorLogFrame getInstance() { if (instance == null) { instance = new ErrorLogFrame(); diff --git a/src/com/jpexs/decompiler/flash/gui/FolderPreviewPanel.java b/src/com/jpexs/decompiler/flash/gui/FolderPreviewPanel.java index f33601a1e..367d6ee52 100644 --- a/src/com/jpexs/decompiler/flash/gui/FolderPreviewPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/FolderPreviewPanel.java @@ -196,9 +196,8 @@ public class FolderPreviewPanel extends JPanel { 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; @@ -235,7 +234,7 @@ public class FolderPreviewPanel extends JPanel { 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); - + } } } diff --git a/src/com/jpexs/decompiler/flash/gui/HeaderLabel.java b/src/com/jpexs/decompiler/flash/gui/HeaderLabel.java index 66f2aa6f2..b2a07fb21 100644 --- a/src/com/jpexs/decompiler/flash/gui/HeaderLabel.java +++ b/src/com/jpexs/decompiler/flash/gui/HeaderLabel.java @@ -1,22 +1,21 @@ /* * Copyright (C) 2010-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 . */ package com.jpexs.decompiler.flash.gui; -import java.awt.Color; import java.awt.Graphics; import java.awt.geom.GeneralPath; import java.util.EnumSet; @@ -25,11 +24,9 @@ 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; /** @@ -69,7 +66,7 @@ public class HeaderLabel extends JLabel { @Override public void paint(Graphics g) { - g.setColor(SubstanceLookAndFeel.getCurrentSkin().getColorScheme(DecorationAreaType.HEADER, ColorSchemeAssociationKind.FILL,ComponentState.ENABLED).getBackgroundFillColor()); + g.setColor(SubstanceLookAndFeel.getCurrentSkin().getColorScheme(DecorationAreaType.HEADER, ColorSchemeAssociationKind.FILL, ComponentState.ENABLED).getBackgroundFillColor()); g.fillRect(0, 0, getWidth(), getHeight()); StandardBorderPainter borderPainter = new StandardBorderPainter(); @@ -84,12 +81,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,SubstanceLookAndFeel.getCurrentSkin().getColorScheme(DecorationAreaType.HEADER, ColorSchemeAssociationKind.BORDER,ComponentState.ENABLED)); - g.setColor(SubstanceLookAndFeel.getCurrentSkin().getColorScheme(DecorationAreaType.HEADER, ColorSchemeAssociationKind.FILL,ComponentState.ENABLED).getForegroundColor()); + 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); + lab.paint(g); } } diff --git a/src/com/jpexs/decompiler/flash/gui/MyRibbonApplicationMenuButtonUI.java b/src/com/jpexs/decompiler/flash/gui/MyRibbonApplicationMenuButtonUI.java index f052116f0..475226a93 100644 --- a/src/com/jpexs/decompiler/flash/gui/MyRibbonApplicationMenuButtonUI.java +++ b/src/com/jpexs/decompiler/flash/gui/MyRibbonApplicationMenuButtonUI.java @@ -16,7 +16,6 @@ */ package com.jpexs.decompiler.flash.gui; -import java.awt.BasicStroke; import java.awt.Color; import java.awt.Component; import java.awt.Dimension; @@ -62,6 +61,7 @@ public class MyRibbonApplicationMenuButtonUI extends BasicRibbonApplicationMenuB private MyResizableIcon clickIcon = null; private MyResizableIcon normalIcon = null; + private MyResizableIcon clearIcon = null; private final boolean buttonResized = false; @@ -70,89 +70,88 @@ public class MyRibbonApplicationMenuButtonUI extends BasicRibbonApplicationMenuB return clickIcon; } - - public static MyResizableIcon[] getIcons(){ + 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); - } - }, + @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.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); + @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(); - MyResizableIcon[] icons=getIcons(); + MyResizableIcon[] icons = getIcons(); clearIcon = icons[0]; normalIcon = icons[1]; hoverIcon = icons[2]; clickIcon = icons[3]; - + } /** diff --git a/src/com/jpexs/decompiler/flash/gui/OceanicSkin.java b/src/com/jpexs/decompiler/flash/gui/OceanicSkin.java index 5a2e3d986..b889441e0 100644 --- a/src/com/jpexs/decompiler/flash/gui/OceanicSkin.java +++ b/src/com/jpexs/decompiler/flash/gui/OceanicSkin.java @@ -17,8 +17,14 @@ package com.jpexs.decompiler.flash.gui; import java.awt.Color; - -import org.pushingpixels.substance.api.*; +import org.pushingpixels.substance.api.ColorSchemeAssociationKind; +import org.pushingpixels.substance.api.ColorSchemeSingleColorQuery; +import org.pushingpixels.substance.api.ColorSchemeTransform; +import org.pushingpixels.substance.api.ComponentState; +import org.pushingpixels.substance.api.DecorationAreaType; +import org.pushingpixels.substance.api.SubstanceColorScheme; +import org.pushingpixels.substance.api.SubstanceColorSchemeBundle; +import org.pushingpixels.substance.api.SubstanceSkin; import org.pushingpixels.substance.api.painter.border.CompositeBorderPainter; import org.pushingpixels.substance.api.painter.border.DelegateFractionBasedBorderPainter; import org.pushingpixels.substance.api.painter.border.FractionBasedBorderPainter; @@ -229,12 +235,11 @@ public class OceanicSkin extends SubstanceSkin { /* * (non-Javadoc) - * + * * @see org.pushingpixels.substance.skin.SubstanceSkin#getDisplayName() */ @Override public String getDisplayName() { return NAME; } - } diff --git a/src/com/jpexs/decompiler/flash/gui/dumpview/DumpTree.java b/src/com/jpexs/decompiler/flash/gui/dumpview/DumpTree.java index 5cbbe326a..91009ac23 100644 --- a/src/com/jpexs/decompiler/flash/gui/dumpview/DumpTree.java +++ b/src/com/jpexs/decompiler/flash/gui/dumpview/DumpTree.java @@ -290,13 +290,13 @@ public class DumpTree extends JTree implements ActionListener { public DumpTreeModel getModel() { return (DumpTreeModel) super.getModel(); } - + public void expandRoot() { DumpTreeModel dtm = getModel(); DumpInfo root = dtm.getRoot(); expandPath(new TreePath(new Object[]{root})); } - + public void expandFirstLevelNodes() { DumpTreeModel dtm = getModel(); DumpInfo root = dtm.getRoot();