Merge origin/master

This commit is contained in:
Jindra Petřík
2015-05-23 06:44:06 +02:00
22 changed files with 207 additions and 126 deletions
@@ -127,6 +127,8 @@ import java.util.logging.Logger;
*/
public class CommandLineArgumentParser {
private static final Logger logger = Logger.getLogger(CommandLineArgumentParser.class.getName());
private static boolean commandLineMode = false;
private static String stdOut = null;
@@ -827,7 +829,7 @@ public class CommandLineArgumentParser {
swf.swfList = new SWFList();
swf.swfList.sourceInfo = sourceInfo;
} catch (IOException | InterruptedException ex) {
Logger.getLogger(CommandLineArgumentParser.class.getName()).log(Level.SEVERE, null, ex);
logger.log(Level.SEVERE, null, ex);
}
}
break;
@@ -1141,7 +1143,7 @@ public class CommandLineArgumentParser {
}
} catch (OutOfMemoryError | Exception ex) {
System.err.print("FAIL: Exporting Failed on Exception - ");
Logger.getLogger(CommandLineArgumentParser.class.getName()).log(Level.SEVERE, null, ex);
logger.log(Level.SEVERE, null, ex);
System.exit(1);
}
@@ -1174,7 +1176,7 @@ public class CommandLineArgumentParser {
System.err.println("File not found.");
}
} catch (IOException ex) {
Logger.getLogger(CommandLineArgumentParser.class.getName()).log(Level.SEVERE, null, ex);
logger.log(Level.SEVERE, null, ex);
}
System.exit(0);
@@ -1199,7 +1201,7 @@ public class CommandLineArgumentParser {
System.err.println("File not found.");
}
} catch (IOException ex) {
Logger.getLogger(CommandLineArgumentParser.class.getName()).log(Level.SEVERE, null, ex);
logger.log(Level.SEVERE, null, ex);
}
System.exit(0);
@@ -1217,10 +1219,10 @@ public class CommandLineArgumentParser {
} catch (FileNotFoundException ex) {
System.err.println("File not found.");
} catch (InterruptedException ex) {
Logger.getLogger(CommandLineArgumentParser.class.getName()).log(Level.SEVERE, null, ex);
logger.log(Level.SEVERE, null, ex);
}
} catch (IOException ex) {
Logger.getLogger(CommandLineArgumentParser.class.getName()).log(Level.SEVERE, null, ex);
logger.log(Level.SEVERE, null, ex);
}
System.exit(0);
@@ -1239,7 +1241,7 @@ public class CommandLineArgumentParser {
swf.saveTo(new BufferedOutputStream(fos));
}
} catch (IOException ex) {
Logger.getLogger(CommandLineArgumentParser.class.getName()).log(Level.SEVERE, null, ex);
logger.log(Level.SEVERE, null, ex);
}
System.exit(0);
@@ -1325,7 +1327,7 @@ public class CommandLineArgumentParser {
}
}
} catch (IOException ex) {
Logger.getLogger(CommandLineArgumentParser.class.getName()).log(Level.SEVERE, null, ex);
logger.log(Level.SEVERE, null, ex);
}
System.exit(0);
@@ -1365,7 +1367,7 @@ public class CommandLineArgumentParser {
System.err.println("File not found.");
}
} catch (IOException ex) {
Logger.getLogger(CommandLineArgumentParser.class.getName()).log(Level.SEVERE, null, ex);
logger.log(Level.SEVERE, null, ex);
}
System.exit(0);
@@ -1694,7 +1696,7 @@ public class CommandLineArgumentParser {
SWFSourceInfo sourceInfo = new SWFSourceInfo(null, args.pop(), null);
Main.parseSWF(sourceInfo);
} catch (Exception ex) {
Logger.getLogger(CommandLineArgumentParser.class.getName()).log(Level.SEVERE, null, ex);
logger.log(Level.SEVERE, null, ex);
System.exit(1);
}
System.exit(0);
@@ -53,6 +53,7 @@ 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;
/**
*
@@ -199,10 +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);
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();
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++) {
@@ -68,6 +68,8 @@ import javax.swing.SpringLayout;
*/
public class GenericTagPanel extends JPanel implements ChangeListener {
private static final Logger logger = Logger.getLogger(GenericTagPanel.class.getName());
private final JEditorPane genericTagPropertiesEditorPane;
private final JPanel genericTagPropertiesEditPanel;
@@ -270,7 +272,7 @@ public class GenericTagPanel extends JPanel implements ChangeListener {
addButtons.put(name, addButton);
}
} catch (IllegalArgumentException | IllegalAccessException ex) {
Logger.getLogger(GenericTagPanel.class.getName()).log(Level.SEVERE, null, ex);
logger.log(Level.SEVERE, null, ex);
}
}
return propCount;
@@ -311,7 +313,7 @@ public class GenericTagPanel extends JPanel implements ChangeListener {
try {
Thread.sleep(500);
} catch (InterruptedException ex) {
Logger.getLogger(GenericTagPanel.class.getName()).log(Level.SEVERE, null, ex);
logger.log(Level.SEVERE, null, ex);
}
View.execInEventDispatch(() -> {
@@ -358,7 +360,7 @@ public class GenericTagPanel extends JPanel implements ChangeListener {
try {
Thread.sleep(500);
} catch (InterruptedException ex) {
Logger.getLogger(GenericTagPanel.class.getName()).log(Level.SEVERE, null, ex);
logger.log(Level.SEVERE, null, ex);
}
View.execInEventDispatch(() -> {
@@ -411,7 +413,7 @@ public class GenericTagPanel extends JPanel implements ChangeListener {
value = ReflectionTools.newInstanceOf(field.getType());
field.set(obj, value);
} catch (InstantiationException | IllegalAccessException ex) {
Logger.getLogger(GenericTagPanel.class.getName()).log(Level.SEVERE, null, ex);
logger.log(Level.SEVERE, null, ex);
return 0;
}
} else {
@@ -480,7 +482,7 @@ public class GenericTagPanel extends JPanel implements ChangeListener {
try {
f.set(t, f.get(assigned));
} catch (IllegalArgumentException | IllegalAccessException ex) {
Logger.getLogger(GenericTagPanel.class.getName()).log(Level.SEVERE, null, ex);
logger.log(Level.SEVERE, null, ex);
}
}
}
@@ -553,7 +555,7 @@ public class GenericTagPanel extends JPanel implements ChangeListener {
dependentLabel.setVisible(conditionMet);
dependentTypeLabel.setVisible(conditionMet);
} catch (AnnotationParseException ex) {
Logger.getLogger(GenericTagPanel.class.getName()).log(Level.SEVERE, "Invalid condition", ex);
logger.log(Level.SEVERE, "Invalid condition", ex);
}
}
if (!conditionMet) {
@@ -83,6 +83,8 @@ import javax.swing.tree.TreePath;
*/
public class GenericTagTreePanel extends GenericTagPanel {
private static final Logger logger = Logger.getLogger(GenericTagTreePanel.class.getName());
private JTree tree;
private Tag editedTag;
@@ -132,7 +134,7 @@ public class GenericTagTreePanel extends GenericTagPanel {
try {
type = ReflectionTools.getValue(obj, field, index).getClass();
} catch (IllegalArgumentException | IllegalAccessException ex) {
Logger.getLogger(GenericTagTreePanel.class.getName()).log(Level.SEVERE, "Fixing characters order failed, recursion detected.");
logger.log(Level.SEVERE, "Fixing characters order failed, recursion detected.");
return null;
}
SWFType swfType = field.getAnnotation(SWFType.class);
@@ -368,7 +370,7 @@ public class GenericTagTreePanel extends GenericTagPanel {
ReflectionTools.setValue(obj, field, Array.newInstance(field.getType().getComponentType(), 0));
}
} catch (IllegalArgumentException | IllegalAccessException ex) {
Logger.getLogger(GenericTagTreePanel.class.getName()).log(Level.SEVERE, null, ex);
logger.log(Level.SEVERE, null, ex);
}
}
}
@@ -445,7 +447,7 @@ public class GenericTagTreePanel extends GenericTagPanel {
val = ReflectionTools.newInstanceOf(field.getType());
ReflectionTools.setValue(obj, field, index, val);
} catch (InstantiationException | IllegalAccessException ex) {
Logger.getLogger(GenericTagTreePanel.class.getName()).log(Level.SEVERE, null, ex);
logger.log(Level.SEVERE, null, ex);
return null;
}
}
@@ -532,7 +534,7 @@ public class GenericTagTreePanel extends GenericTagPanel {
}
}
} catch (AnnotationParseException ex) {
Logger.getLogger(GenericTagTreePanel.class.getName()).log(Level.SEVERE, null, ex);
logger.log(Level.SEVERE, null, ex);
}
}
}
@@ -667,7 +669,7 @@ public class GenericTagTreePanel extends GenericTagPanel {
editedTag = tag.cloneTag();
} catch (InterruptedException ex) {
} catch (IOException ex) {
Logger.getLogger(GenericTagTreePanel.class.getName()).log(Level.SEVERE, null, ex);
logger.log(Level.SEVERE, null, ex);
}
tree.setEditable(edit);
if (!edit) {
@@ -693,7 +695,7 @@ public class GenericTagTreePanel extends GenericTagPanel {
try {
f.set(t, f.get(assigned));
} catch (IllegalArgumentException | IllegalAccessException ex) {
Logger.getLogger(GenericTagTreePanel.class.getName()).log(Level.SEVERE, null, ex);
logger.log(Level.SEVERE, null, ex);
}
}
}
@@ -811,7 +813,7 @@ public class GenericTagTreePanel extends GenericTagPanel {
continue;
}
} catch (AnnotationParseException | IllegalArgumentException | IllegalAccessException ex) {
Logger.getLogger(GenericTagTreePanel.class.getName()).log(Level.SEVERE, null, ex);
logger.log(Level.SEVERE, null, ex);
}
}
}
@@ -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;
@@ -26,6 +28,7 @@ import org.pushingpixels.substance.api.ComponentState;
import org.pushingpixels.substance.api.DecorationAreaType;
import org.pushingpixels.substance.api.SubstanceConstants;
import org.pushingpixels.substance.api.SubstanceLookAndFeel;
import org.pushingpixels.substance.api.SubstanceSkin;
import org.pushingpixels.substance.api.painter.border.StandardBorderPainter;
import org.pushingpixels.substance.internal.utils.SubstanceOutlineUtilities;
@@ -66,25 +69,36 @@ public class HeaderLabel extends JLabel {
@Override
public void paint(Graphics g) {
g.setColor(SubstanceLookAndFeel.getCurrentSkin().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<SubstanceConstants.Side> 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<SubstanceConstants.Side> 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, 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);
@@ -70,6 +70,8 @@ import javax.swing.JPanel;
public final class ImagePanel extends JPanel implements MediaDisplay {
private static final Logger logger = Logger.getLogger(ImagePanel.class.getName());
private final List<MediaDisplayListener> listeners = new ArrayList<>();
private Timelined timelined;
@@ -516,7 +518,7 @@ public final class ImagePanel extends JPanel implements MediaDisplay {
try {
setImage(new SerializableImage(ImageIO.read(new ByteArrayInputStream(data))));
} catch (IOException ex) {
Logger.getLogger(ImagePanel.class.getName()).log(Level.SEVERE, null, ex);
logger.log(Level.SEVERE, null, ex);
}
}
@@ -561,7 +563,7 @@ public final class ImagePanel extends JPanel implements MediaDisplay {
try {
delayObject.wait(drawWaitLimit);
} catch (InterruptedException ex) {
Logger.getLogger(ImagePanel.class.getName()).log(Level.SEVERE, null, ex);
logger.log(Level.SEVERE, null, ex);
}
}
@@ -900,7 +902,7 @@ public final class ImagePanel extends JPanel implements MediaDisplay {
}
}
} catch (LineUnavailableException | IOException | UnsupportedAudioFileException ex) {
Logger.getLogger(ImagePanel.class.getName()).log(Level.SEVERE, "Error during playing sound", ex);
logger.log(Level.SEVERE, "Error during playing sound", ex);
}
}
@@ -989,7 +991,7 @@ public final class ImagePanel extends JPanel implements MediaDisplay {
nextFrame(thisTimer);
}
} catch (Exception ex) {
Logger.getLogger(ImagePanel.class.getName()).log(Level.SEVERE, null, ex);
logger.log(Level.SEVERE, null, ex);
}
}
};
+2 -2
View File
@@ -289,7 +289,7 @@ public class Main {
try {
result.add(worker.get());
} catch (CancellationException ex) {
Logger.getLogger(Main.class.getName()).log(Level.WARNING, "Loading SWF {0} was cancelled.", streamEntry.getKey());
logger.log(Level.WARNING, "Loading SWF {0} was cancelled.", streamEntry.getKey());
}
}
} else {
@@ -314,7 +314,7 @@ public class Main {
try {
result.add(worker.get());
} catch (CancellationException ex) {
Logger.getLogger(Main.class.getName()).log(Level.WARNING, "Loading SWF {0} was cancelled.", sourceInfo.getFileTitleOrName());
logger.log(Level.WARNING, "Loading SWF {0} was cancelled.", sourceInfo.getFileTitleOrName());
}
}
@@ -39,6 +39,7 @@ 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.flamingo.common.ui.ActionPopupTransitionAwareUI;
import org.pushingpixels.substance.flamingo.utils.CommandButtonVisualStateTracker;
import org.pushingpixels.substance.internal.animation.StateTransitionTracker;
@@ -83,14 +84,15 @@ public class MyRibbonApplicationMenuButtonUI extends BasicRibbonApplicationMenuB
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);
SubstanceSkin skin = SubstanceLookAndFeel.getCurrentSkin();
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()
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(),
skin.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());
g2.setPaint(skin.getEnabledColorScheme(DecorationAreaType.PRIMARY_TITLE_PANE).getMidColor());
super.paintIcon(c, g, x, y);
}
},
@@ -103,10 +105,11 @@ public class MyRibbonApplicationMenuButtonUI extends BasicRibbonApplicationMenuB
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);
SubstanceSkin skin = SubstanceLookAndFeel.getCurrentSkin();
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()
skin.getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.HIGHLIGHT, ComponentState.ROLLOVER_UNSELECTED)/*.shiftBackground(Color.white, 0.8)*/.getUltraLightColor(),
skin.getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.FILL, ComponentState.ROLLOVER_UNSELECTED).getMidColor(),
skin.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);
@@ -122,10 +125,11 @@ public class MyRibbonApplicationMenuButtonUI extends BasicRibbonApplicationMenuB
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);
SubstanceSkin skin = SubstanceLookAndFeel.getCurrentSkin();
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()
skin.getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.FILL, ComponentState.ROLLOVER_SELECTED).getUltraLightColor(),
skin.getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.FILL, ComponentState.ROLLOVER_SELECTED).getMidColor(),
skin.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);
@@ -51,6 +51,8 @@ import javax.swing.text.BadLocationException;
*/
public class TextPanel extends JPanel implements TagEditorPanel {
private static final Logger logger = Logger.getLogger(TextPanel.class.getName());
private final MainPanel mainPanel;
private final SearchPanel<TextTag> textSearchPanel;
@@ -220,7 +222,7 @@ public class TextPanel extends JPanel implements TagEditorPanel {
break;
}
} catch (BadLocationException ex) {
Logger.getLogger(TextPanel.class.getName()).log(Level.SEVERE, null, ex);
logger.log(Level.SEVERE, null, ex);
}
}
}
@@ -244,7 +246,7 @@ public class TextPanel extends JPanel implements TagEditorPanel {
selected.replace(start - selStart, end - selStart, str);
} catch (BadLocationException ex) {
Logger.getLogger(TextPanel.class.getName()).log(Level.SEVERE, null, ex);
logger.log(Level.SEVERE, null, ex);
}
}
}
@@ -344,7 +346,7 @@ public class TextPanel extends JPanel implements TagEditorPanel {
try {
textTag.undo();
} catch (InterruptedException | IOException ex) {
Logger.getLogger(TextPanel.class.getName()).log(Level.SEVERE, null, ex);
logger.log(Level.SEVERE, null, ex);
}
textTag.getSwf().clearImageCache();
@@ -393,7 +395,7 @@ public class TextPanel extends JPanel implements TagEditorPanel {
saveText(false);
updateButtonsVisibility();
} catch (Exception ex) {
Logger.getLogger(TextPanel.class.getName()).log(Level.SEVERE, "Cannot auto-save text tag.", ex);
logger.log(Level.SEVERE, "Cannot auto-save text tag.", ex);
}
}
+31 -11
View File
@@ -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;
@@ -153,6 +159,11 @@ public class View {
try {
UIManager.setLookAndFeel(new SubstanceOfficeBlue2007LookAndFeel());
SubstanceLookAndFeel.setSkin(Configuration.guiSkin.get());
if (SubstanceLookAndFeel.getCurrentSkin() == null) {
Logger.getLogger(View.class.getName()).log(Level.SEVERE, "Current skin is null");
SubstanceLookAndFeel.setSkin("com.jpexs.decompiler.flash.gui.OceanicSkin");
}
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"));
@@ -277,17 +288,26 @@ public class View {
* @param f Frame to set icon in
*/
public static void setWindowIcon(Window f) {
List<Image> 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<Image> 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<Image> 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);
}
/**
@@ -83,7 +83,6 @@ import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutionException;
@@ -779,8 +778,8 @@ public class ABCPanel extends JPanel implements ItemListener, SearchListener<ABC
decompiledTextArea.gotoLine((int) ex.line);
decompiledTextArea.markError();
View.showMessageDialog(this, AppStrings.translate("error.action.save").replace("%error%", ex.text).replace("%line%", Long.toString(ex.line)), AppStrings.translate("error"), JOptionPane.ERROR_MESSAGE);
} catch (IOException | InterruptedException ex) {
//ignore
} catch (Throwable ex) {
Logger.getLogger(ABCPanel.class.getName()).log(Level.SEVERE, null, ex);
}
}
@@ -91,6 +91,8 @@ import jsyntaxpane.actions.ActionUtils;
public class ActionPanel extends JPanel implements SearchListener<ActionSearchResult>, TagEditorPanel {
private static final Logger logger = Logger.getLogger(ActionPanel.class.getName());
private MainPanel mainPanel;
public LineMarkedEditorPane editor;
@@ -327,7 +329,7 @@ public class ActionPanel extends JPanel implements SearchListener<ActionSearchRe
try {
asm.getASMSource(exportMode, writer, lastCode);
} catch (InterruptedException ex) {
Logger.getLogger(ActionPanel.class.getName()).log(Level.SEVERE, null, ex);
logger.log(Level.SEVERE, null, ex);
}
asm.removeDisassemblyListener(listener);
return new HighlightedText(writer);
@@ -749,7 +751,7 @@ public class ActionPanel extends JPanel implements SearchListener<ActionSearchRe
GraphDialog gf = new GraphDialog(mainPanel.getMainFrame().getWindow(), new ActionGraph(lastCode, new HashMap<>(), new HashMap<>(), new HashMap<>(), SWF.DEFAULT_VERSION), "");
gf.setVisible(true);
} catch (InterruptedException ex) {
Logger.getLogger(ActionPanel.class.getName()).log(Level.SEVERE, null, ex);
logger.log(Level.SEVERE, null, ex);
}
}
}
@@ -834,7 +836,7 @@ public class ActionPanel extends JPanel implements SearchListener<ActionSearchRe
src.setActions(actions);
} catch (InterruptedException ex) {
Logger.getLogger(ActionPanel.class.getName()).log(Level.SEVERE, null, ex);
logger.log(Level.SEVERE, null, ex);
}
}
@@ -858,11 +860,13 @@ public class ActionPanel extends JPanel implements SearchListener<ActionSearchRe
View.showMessageDialog(this, AppStrings.translate("message.action.saved"), AppStrings.translate("dialog.message.title"), JOptionPane.INFORMATION_MESSAGE, Configuration.showCodeSavedMessage);
setDecompiledEditMode(false);
} catch (IOException ex) {
Logger.getLogger(ActionPanel.class.getName()).log(Level.SEVERE, "IOException during action compiling", ex);
logger.log(Level.SEVERE, "IOException during action compiling", ex);
} catch (ActionParseException ex) {
View.showMessageDialog(this, AppStrings.translate("error.action.save").replace("%error%", ex.text).replace("%line%", Long.toString(ex.line)), AppStrings.translate("error"), JOptionPane.ERROR_MESSAGE);
} catch (CompilationException ex) {
View.showMessageDialog(this, AppStrings.translate("error.action.save").replace("%error%", ex.text).replace("%line%", Long.toString(ex.line)), AppStrings.translate("error"), JOptionPane.ERROR_MESSAGE);
} catch (Throwable ex) {
logger.log(Level.SEVERE, null, ex);
}
}
@@ -61,6 +61,8 @@ import javax.swing.tree.TreePath;
*/
public class DumpTree extends JTree {
private static final Logger logger = Logger.getLogger(DumpTree.class.getName());
private final MainPanel mainPanel;
public class DumpTreeCellRenderer extends DefaultTreeCellRenderer {
@@ -193,7 +195,7 @@ public class DumpTree extends JTree {
byte[] data = DumpInfoSwfNode.getSwfNode(dumpInfo).getSwf().originalUncompressedData;
fos.write(data, (int) dumpInfo.startByte, (int) (dumpInfo.getEndByte() - dumpInfo.startByte + 1));
} catch (IOException ex) {
Logger.getLogger(DumpTree.class.getName()).log(Level.SEVERE, null, ex);
logger.log(Level.SEVERE, null, ex);
}
}
}
@@ -220,7 +222,7 @@ public class DumpTree extends JTree {
}
repaint();
} catch (IOException | InterruptedException ex) {
Logger.getLogger(DumpTree.class.getName()).log(Level.SEVERE, null, ex);
logger.log(Level.SEVERE, null, ex);
}
}
@@ -236,7 +238,7 @@ public class DumpTree extends JTree {
ais.dumpInfo = dumpInfo;
new ABC(ais, swf, null);
} catch (IOException ex) {
Logger.getLogger(DumpTree.class.getName()).log(Level.SEVERE, null, ex);
logger.log(Level.SEVERE, null, ex);
}
repaint();
}
@@ -253,7 +255,7 @@ public class DumpTree extends JTree {
ais.dumpInfo = dumpInfo;
new AVM2Code(ais);
} catch (IOException ex) {
Logger.getLogger(DumpTree.class.getName()).log(Level.SEVERE, null, ex);
logger.log(Level.SEVERE, null, ex);
}
repaint();
}