From 52e6142fe575ef602d80573ab01d4c6860abb33b Mon Sep 17 00:00:00 2001 From: honfika Date: Wed, 18 Jun 2014 20:53:19 +0200 Subject: [PATCH] organize imports, javadoc --- src/com/jpexs/decompiler/flash/SWF.java | 1 - .../decompiler/flash/SWFInputStream.java | 1 - .../flash/SWFLimitedInputStream.java | 3 - .../abc/usages/ConstVarMultinameUsage.java | 164 +++--- .../flash/action/swf4/ActionPush.java | 1 - .../flash/configuration/Configuration.java | 1 - .../flash/exporters/MovieExporter.java | 1 - .../flash/exporters/SoundExporter.java | 1 - .../decompiler/flash/gui/MainFrameRibbon.java | 458 ++++++++------- .../flash/gui/MainFrameRibbonMenu.java | 1 - .../decompiler/flash/gui/PreviewPanel.java | 1 - .../decompiler/flash/gui/QuickFindPanel.java | 530 +++++++++--------- .../flash/gui/SearchResultsDialog.java | 245 ++++---- .../decompiler/flash/gui/abc/ABCPanel.java | 13 - .../decompiler/flash/gui/abc/UsageFrame.java | 373 ++++++------ .../flash/gui/abc/UsageListModel.java | 87 ++- .../flash/tags/CSMTextSettingsTag.java | 1 + .../decompiler/flash/tags/DebugIDTag.java | 1 + .../flash/tags/DefineBitsJPEG4Tag.java | 1 + .../flash/tags/DefineButton2Tag.java | 1 + .../flash/tags/DefineButtonCxformTag.java | 1 + .../flash/tags/DefineButtonSoundTag.java | 1 + .../flash/tags/DefineButtonTag.java | 1 + .../flash/tags/DefineEditTextTag.java | 1 + .../decompiler/flash/tags/DefineFont2Tag.java | 1 + .../flash/tags/DefineFontInfo2Tag.java | 1 + .../flash/tags/DefineFontInfoTag.java | 1 + .../decompiler/flash/tags/DefineFontTag.java | 1 + .../flash/tags/DefineMorphShape2Tag.java | 1 + .../flash/tags/DefineMorphShapeTag.java | 1 + .../tags/DefineSceneAndFrameLabelDataTag.java | 1 + .../decompiler/flash/tags/DefineSoundTag.java | 1 + .../flash/tags/DefineSpriteTag.java | 1 - .../decompiler/flash/tags/DefineText2Tag.java | 1 + .../decompiler/flash/tags/DefineTextTag.java | 1 + .../flash/tags/DefineVideoStreamTag.java | 1 + .../decompiler/flash/tags/DoABCDefineTag.java | 1 + .../jpexs/decompiler/flash/tags/DoABCTag.java | 1 + .../decompiler/flash/tags/DoActionTag.java | 1 - .../flash/tags/DoInitActionTag.java | 1 + .../flash/tags/EnableDebugger2Tag.java | 1 + .../flash/tags/EnableDebuggerTag.java | 1 + .../flash/tags/EnableTelemetryTag.java | 1 + .../jpexs/decompiler/flash/tags/EndTag.java | 1 + .../flash/tags/ExportAssetsTag.java | 2 - .../flash/tags/FileAttributesTag.java | 2 - .../flash/tags/ImportAssets2Tag.java | 1 + .../flash/tags/ImportAssetsTag.java | 1 + .../flash/tags/PlaceObject2Tag.java | 1 + .../flash/tags/PlaceObject3Tag.java | 1 + .../flash/tags/PlaceObject4Tag.java | 1 + .../decompiler/flash/tags/PlaceObjectTag.java | 1 + .../decompiler/flash/tags/ProtectTag.java | 1 + .../flash/tags/RemoveObjectTag.java | 1 + .../decompiler/flash/tags/SetTabIndexTag.java | 1 + .../decompiler/flash/tags/ShowFrameTag.java | 1 + .../flash/tags/SoundStreamBlockTag.java | 1 + .../flash/tags/SoundStreamHead2Tag.java | 1 + .../flash/tags/SoundStreamHeadTag.java | 1 + .../decompiler/flash/tags/StartSound2Tag.java | 1 + .../decompiler/flash/tags/StartSoundTag.java | 1 + src/com/jpexs/decompiler/flash/tags/Tag.java | 1 - .../jpexs/decompiler/flash/tags/TagStub.java | 6 - .../decompiler/flash/tags/VideoFrameTag.java | 3 - .../flash/tags/base/CharacterTag.java | 1 - .../flash/tags/gfx/DefineCompactedFont.java | 2 - .../tags/gfx/DefineExternalGradient.java | 1 + .../flash/tags/gfx/DefineExternalImage.java | 1 + .../flash/tags/gfx/DefineExternalImage2.java | 1 + .../flash/tags/gfx/DefineExternalSound.java | 1 + .../tags/gfx/DefineExternalStreamSound.java | 1 + .../flash/tags/gfx/DefineGradientMap.java | 1 + .../flash/tags/gfx/DefineSubImage.java | 1 + .../flash/tags/gfx/ExporterInfoTag.java | 1 + .../flash/tags/gfx/FontTextureInfo.java | 1 + .../flash/types/BUTTONCONDACTION.java | 1 - .../flash/types/CLIPACTIONRECORD.java | 1 - .../flash/types/FILLSTYLEARRAY.java | 1 - .../flash/types/filters/Filtering.java | 5 - .../flash/types/sound/AdpcmDecoder.java | 1 - .../flash/types/sound/MP3Decoder.java | 1 - .../flash/types/sound/MP3SOUNDDATA.java | 2 - .../flash/types/sound/NellyMoserDecoder.java | 4 - .../flash/types/sound/NoDecoder.java | 1 - .../flash/types/sound/SoundDecoder.java | 2 - .../flash/types/sound/SoundFormat.java | 2 - .../decompiler/flash/xfl/XFLConverter.java | 1 - .../jpexs/decompiler/flash/SWFStreamTest.java | 1 - 88 files changed, 968 insertions(+), 1005 deletions(-) diff --git a/src/com/jpexs/decompiler/flash/SWF.java b/src/com/jpexs/decompiler/flash/SWF.java index 8c506fe0e..7e66be9de 100644 --- a/src/com/jpexs/decompiler/flash/SWF.java +++ b/src/com/jpexs/decompiler/flash/SWF.java @@ -90,7 +90,6 @@ import com.jpexs.decompiler.flash.tags.SetBackgroundColorTag; import com.jpexs.decompiler.flash.tags.ShowFrameTag; import com.jpexs.decompiler.flash.tags.SymbolClassTag; import com.jpexs.decompiler.flash.tags.Tag; -import com.jpexs.decompiler.flash.tags.TagStub; import com.jpexs.decompiler.flash.tags.VideoFrameTag; import com.jpexs.decompiler.flash.tags.base.ASMSource; import com.jpexs.decompiler.flash.tags.base.BoundedTag; diff --git a/src/com/jpexs/decompiler/flash/SWFInputStream.java b/src/com/jpexs/decompiler/flash/SWFInputStream.java index c64e28281..9bcd950f9 100644 --- a/src/com/jpexs/decompiler/flash/SWFInputStream.java +++ b/src/com/jpexs/decompiler/flash/SWFInputStream.java @@ -269,7 +269,6 @@ import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.EOFException; import java.io.IOException; -import java.io.InputStream; import java.io.PrintStream; import java.util.ArrayList; import java.util.Arrays; diff --git a/src/com/jpexs/decompiler/flash/SWFLimitedInputStream.java b/src/com/jpexs/decompiler/flash/SWFLimitedInputStream.java index 190ae9bba..2cc2db392 100644 --- a/src/com/jpexs/decompiler/flash/SWFLimitedInputStream.java +++ b/src/com/jpexs/decompiler/flash/SWFLimitedInputStream.java @@ -16,9 +16,6 @@ */ package com.jpexs.decompiler.flash; -import com.jpexs.decompiler.flash.tags.DefineButton2Tag; -import com.jpexs.decompiler.flash.tags.DefineSpriteTag; -import com.jpexs.decompiler.flash.tags.PlaceObject2Tag; import com.jpexs.decompiler.flash.tags.Tag; import com.jpexs.decompiler.flash.timeline.Timelined; import com.jpexs.decompiler.flash.types.BUTTONCONDACTION; diff --git a/src/com/jpexs/decompiler/flash/abc/usages/ConstVarMultinameUsage.java b/src/com/jpexs/decompiler/flash/abc/usages/ConstVarMultinameUsage.java index 93920670c..7cd58a207 100644 --- a/src/com/jpexs/decompiler/flash/abc/usages/ConstVarMultinameUsage.java +++ b/src/com/jpexs/decompiler/flash/abc/usages/ConstVarMultinameUsage.java @@ -1,83 +1,81 @@ -/* - * Copyright (C) 2010-2014 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.abc.usages; - -import com.jpexs.decompiler.flash.abc.ABC; -import com.jpexs.decompiler.flash.abc.types.traits.TraitMethodGetterSetter; -import com.jpexs.decompiler.flash.abc.types.traits.TraitSlotConst; -import com.jpexs.decompiler.flash.abc.types.traits.Traits; -import com.jpexs.decompiler.flash.configuration.Configuration; -import com.jpexs.decompiler.flash.exporters.modes.ScriptExportMode; -import com.jpexs.decompiler.flash.helpers.HilightedTextWriter; -import com.jpexs.decompiler.flash.helpers.NulWriter; -import com.jpexs.decompiler.flash.tags.ABCContainerTag; -import java.util.ArrayList; -import java.util.List; -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * - * @author JPEXS - */ -public abstract class ConstVarMultinameUsage extends TraitMultinameUsage { - - public ConstVarMultinameUsage(List abcTags, ABC abc, int multinameIndex, int classIndex, int traitIndex, boolean isStatic, Traits traits, int parentTraitIndex) { - super(abcTags,abc,multinameIndex, classIndex, traitIndex, isStatic, traits, parentTraitIndex); - } - - @Override - public String toString() { - NulWriter nulWriter = new NulWriter(); - if (parentTraitIndex > -1) { - if (isStatic) { - ((TraitMethodGetterSetter) abc.class_info.get(classIndex).static_traits.traits.get(parentTraitIndex)).convertHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, nulWriter, new ArrayList(), false); - } else { - ((TraitMethodGetterSetter) abc.instance_info.get(classIndex).instance_traits.traits.get(parentTraitIndex)).convertHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, nulWriter, new ArrayList(), false); - } - } - try { - ((TraitSlotConst) traits.traits.get(traitIndex)).convertHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, nulWriter, new ArrayList(), false); - } catch (InterruptedException ex) { - //ignore - } - - HilightedTextWriter writer = new HilightedTextWriter(Configuration.getCodeFormatting(), false); - writer.appendNoHilight(super.toString() + " "); - if (parentTraitIndex > -1) { - if (isStatic) { - ((TraitMethodGetterSetter) abc.class_info.get(classIndex).static_traits.traits.get(parentTraitIndex)).toStringHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, writer, new ArrayList(), false); - } else { - ((TraitMethodGetterSetter) abc.instance_info.get(classIndex).instance_traits.traits.get(parentTraitIndex)).toStringHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, writer, new ArrayList(), false); - } - } - try { - ((TraitSlotConst) traits.traits.get(traitIndex)).toStringHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, writer, new ArrayList(), false); - } catch (InterruptedException ex) { - //ignore - } - return writer.toString(); - } - - public int getTraitIndex() { - return traitIndex; - } - - public boolean isStatic() { - return isStatic; - } -} +/* + * Copyright (C) 2010-2014 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.abc.usages; + +import com.jpexs.decompiler.flash.abc.ABC; +import com.jpexs.decompiler.flash.abc.types.traits.TraitMethodGetterSetter; +import com.jpexs.decompiler.flash.abc.types.traits.TraitSlotConst; +import com.jpexs.decompiler.flash.abc.types.traits.Traits; +import com.jpexs.decompiler.flash.configuration.Configuration; +import com.jpexs.decompiler.flash.exporters.modes.ScriptExportMode; +import com.jpexs.decompiler.flash.helpers.HilightedTextWriter; +import com.jpexs.decompiler.flash.helpers.NulWriter; +import com.jpexs.decompiler.flash.tags.ABCContainerTag; +import java.util.ArrayList; +import java.util.List; + +/** + * + * @author JPEXS + */ +public abstract class ConstVarMultinameUsage extends TraitMultinameUsage { + + public ConstVarMultinameUsage(List abcTags, ABC abc, int multinameIndex, int classIndex, int traitIndex, boolean isStatic, Traits traits, int parentTraitIndex) { + super(abcTags,abc,multinameIndex, classIndex, traitIndex, isStatic, traits, parentTraitIndex); + } + + @Override + public String toString() { + NulWriter nulWriter = new NulWriter(); + if (parentTraitIndex > -1) { + if (isStatic) { + ((TraitMethodGetterSetter) abc.class_info.get(classIndex).static_traits.traits.get(parentTraitIndex)).convertHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, nulWriter, new ArrayList(), false); + } else { + ((TraitMethodGetterSetter) abc.instance_info.get(classIndex).instance_traits.traits.get(parentTraitIndex)).convertHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, nulWriter, new ArrayList(), false); + } + } + try { + ((TraitSlotConst) traits.traits.get(traitIndex)).convertHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, nulWriter, new ArrayList(), false); + } catch (InterruptedException ex) { + //ignore + } + + HilightedTextWriter writer = new HilightedTextWriter(Configuration.getCodeFormatting(), false); + writer.appendNoHilight(super.toString() + " "); + if (parentTraitIndex > -1) { + if (isStatic) { + ((TraitMethodGetterSetter) abc.class_info.get(classIndex).static_traits.traits.get(parentTraitIndex)).toStringHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, writer, new ArrayList(), false); + } else { + ((TraitMethodGetterSetter) abc.instance_info.get(classIndex).instance_traits.traits.get(parentTraitIndex)).toStringHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, writer, new ArrayList(), false); + } + } + try { + ((TraitSlotConst) traits.traits.get(traitIndex)).toStringHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, writer, new ArrayList(), false); + } catch (InterruptedException ex) { + //ignore + } + return writer.toString(); + } + + public int getTraitIndex() { + return traitIndex; + } + + public boolean isStatic() { + return isStatic; + } +} diff --git a/src/com/jpexs/decompiler/flash/action/swf4/ActionPush.java b/src/com/jpexs/decompiler/flash/action/swf4/ActionPush.java index ed4f38d8b..05ae8a0e0 100644 --- a/src/com/jpexs/decompiler/flash/action/swf4/ActionPush.java +++ b/src/com/jpexs/decompiler/flash/action/swf4/ActionPush.java @@ -34,7 +34,6 @@ import com.jpexs.decompiler.flash.helpers.HilightedTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.helpers.Helper; -import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.ArrayList; diff --git a/src/com/jpexs/decompiler/flash/configuration/Configuration.java b/src/com/jpexs/decompiler/flash/configuration/Configuration.java index c7735f398..ddb5cbd17 100644 --- a/src/com/jpexs/decompiler/flash/configuration/Configuration.java +++ b/src/com/jpexs/decompiler/flash/configuration/Configuration.java @@ -26,7 +26,6 @@ import java.io.BufferedOutputStream; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; -import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.FilenameFilter; import java.io.IOException; diff --git a/src/com/jpexs/decompiler/flash/exporters/MovieExporter.java b/src/com/jpexs/decompiler/flash/exporters/MovieExporter.java index e5f668791..dee2f5aeb 100644 --- a/src/com/jpexs/decompiler/flash/exporters/MovieExporter.java +++ b/src/com/jpexs/decompiler/flash/exporters/MovieExporter.java @@ -30,7 +30,6 @@ import com.jpexs.decompiler.flash.flv.VIDEODATA; import com.jpexs.decompiler.flash.tags.DefineVideoStreamTag; import com.jpexs.decompiler.flash.tags.Tag; import com.jpexs.decompiler.flash.tags.VideoFrameTag; -import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileOutputStream; diff --git a/src/com/jpexs/decompiler/flash/exporters/SoundExporter.java b/src/com/jpexs/decompiler/flash/exporters/SoundExporter.java index 9c95d31b5..ffc33a24d 100644 --- a/src/com/jpexs/decompiler/flash/exporters/SoundExporter.java +++ b/src/com/jpexs/decompiler/flash/exporters/SoundExporter.java @@ -31,7 +31,6 @@ import com.jpexs.decompiler.flash.tags.base.SoundStreamHeadTypeTag; import com.jpexs.decompiler.flash.tags.base.SoundTag; import com.jpexs.decompiler.flash.types.sound.SoundFormat; import java.io.BufferedOutputStream; -import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileOutputStream; diff --git a/src/com/jpexs/decompiler/flash/gui/MainFrameRibbon.java b/src/com/jpexs/decompiler/flash/gui/MainFrameRibbon.java index ce3da41aa..84695aa67 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainFrameRibbon.java +++ b/src/com/jpexs/decompiler/flash/gui/MainFrameRibbon.java @@ -1,230 +1,228 @@ -/* - * Copyright (C) 2010-2014 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 com.jpexs.decompiler.flash.configuration.Configuration; -import com.jpexs.decompiler.flash.gui.player.FlashPlayerPanel; -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Component; -import java.awt.Container; -import java.awt.Dimension; -import java.awt.Window; -import java.awt.event.ComponentAdapter; -import java.awt.event.ComponentEvent; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.awt.event.WindowStateListener; -import java.util.List; -import javax.swing.JFrame; -import org.pushingpixels.flamingo.api.ribbon.JRibbon; -import org.pushingpixels.flamingo.internal.ui.ribbon.appmenu.JRibbonApplicationMenuButton; - -/** - * - * @author JPEXS - */ -public final class MainFrameRibbon extends AppRibbonFrame implements MainFrame { - - public MainPanel panel; - private MainFrameMenu mainMenu; - - public MainFrameRibbon() { - super(); - - FlashPlayerPanel flashPanel = null; - try { - flashPanel = new FlashPlayerPanel(this); - } catch (FlashUnsupportedException fue) { - } - - Container cnt = getContentPane(); - cnt.setLayout(new BorderLayout()); - JRibbon ribbon = getRibbon(); - cnt.add(ribbon, BorderLayout.NORTH); - - boolean externalFlashPlayerUnavailable = flashPanel == null; - mainMenu = new MainFrameRibbonMenu(this, ribbon, externalFlashPlayerUnavailable); - - panel = new MainPanel(this, mainMenu, flashPanel); - panel.setBackground(Color.yellow); - cnt.add(panel, BorderLayout.CENTER); - - int w = Configuration.guiWindowWidth.get(); - int h = Configuration.guiWindowHeight.get(); - Dimension dim = java.awt.Toolkit.getDefaultToolkit().getScreenSize(); - if (w > dim.width) { - w = dim.width; - } - if (h > dim.height) { - h = dim.height; - } - setSize(w, h); - - boolean maximizedHorizontal = Configuration.guiWindowMaximizedHorizontal.get(); - boolean maximizedVertical = Configuration.guiWindowMaximizedVertical.get(); - - int state = 0; - if (maximizedHorizontal) { - state |= JFrame.MAXIMIZED_HORIZ; - } - if (maximizedVertical) { - state |= JFrame.MAXIMIZED_VERT; - } - setExtendedState(state); - - View.setWindowIcon(this); - addWindowStateListener(new WindowStateListener() { - @Override - public void windowStateChanged(WindowEvent e) { - int state = e.getNewState(); - Configuration.guiWindowMaximizedHorizontal.set((state & JFrame.MAXIMIZED_HORIZ) == JFrame.MAXIMIZED_HORIZ); - Configuration.guiWindowMaximizedVertical.set((state & JFrame.MAXIMIZED_VERT) == JFrame.MAXIMIZED_VERT); - } - }); - addComponentListener(new ComponentAdapter() { - @Override - public void componentResized(ComponentEvent e) { - int state = getExtendedState(); - if ((state & JFrame.MAXIMIZED_HORIZ) == 0) { - Configuration.guiWindowWidth.set(getWidth()); - } - if ((state & JFrame.MAXIMIZED_VERT) == 0) { - Configuration.guiWindowHeight.set(getHeight()); - } - } - }); - addWindowListener(new WindowAdapter() { - @Override - public void windowClosing(WindowEvent e) { - Main.exit(); - } - }); - - View.centerScreen(this); - - - } - - private static void getApplicationMenuButtons(Component comp, List ret) { - if (comp instanceof JRibbonApplicationMenuButton) { - ret.add((JRibbonApplicationMenuButton) comp); - return; - } - if (comp instanceof java.awt.Container) { - java.awt.Container cont = (java.awt.Container) comp; - for (int i = 0; i < cont.getComponentCount(); i++) { - getApplicationMenuButtons(cont.getComponent(i), ret); - } - } - } - - @Override - public void setVisible(boolean b) { - super.setVisible(b); - - /* final MainFrameRibbon t = this; - - //TODO: Handle this better. This is awful :-( - new Timer().schedule(new TimerTask() { - @Override - public void run() { - List mbuttons = new ArrayList<>(); - getApplicationMenuButtons(t, mbuttons); - if (mbuttons.size() < 2) { - //return, task will run again - return; - } - - for (final JRibbonApplicationMenuButton mbutton : mbuttons) { - mbutton.setIcon(View.getResizableIcon("buttonicon_256")); - mbutton.setDisplayState(new CommandButtonDisplayState( - "My Ribbon Application Menu Button", mbutton.getSize().width) { - @Override - public CommandButtonLayoutManager createLayoutManager( - AbstractCommandButton commandButton) { - return new CommandButtonLayoutManager() { - @Override - public int getPreferredIconSize() { - return mbutton.getSize().width; - } - - @Override - public CommandButtonLayoutManager.CommandButtonLayoutInfo getLayoutInfo( - AbstractCommandButton commandButton, Graphics g) { - CommandButtonLayoutManager.CommandButtonLayoutInfo result = new CommandButtonLayoutManager.CommandButtonLayoutInfo(); - result.actionClickArea = new Rectangle(0, 0, 0, 0); - result.popupClickArea = new Rectangle(0, 0, commandButton - .getWidth(), commandButton.getHeight()); - result.popupActionRect = new Rectangle(0, 0, 0, 0); - ResizableIcon icon = commandButton.getIcon(); - icon.setDimension(new Dimension(commandButton.getWidth(), commandButton.getHeight())); - result.iconRect = new Rectangle( - 0, - 0, - commandButton.getWidth(), commandButton.getHeight()); - result.isTextInActionArea = false; - return result; - } - - @Override - public Dimension getPreferredSize( - AbstractCommandButton commandButton) { - return new Dimension(40, 40); - } - - @Override - public void propertyChange(PropertyChangeEvent evt) { - } - - @Override - public Point getKeyTipAnchorCenterPoint( - AbstractCommandButton commandButton) { - // dead center - return new Point(commandButton.getWidth() / 2, - commandButton.getHeight() / 2); - } - }; - } - }); - - MyRibbonApplicationMenuButtonUI mui = (MyRibbonApplicationMenuButtonUI) mbutton.getUI(); - mui.setHoverIcon(View.getResizableIcon("buttonicon_hover_256")); - mui.setNormalIcon(View.getResizableIcon("buttonicon_256")); - mui.setClickIcon(View.getResizableIcon("buttonicon_down_256")); - mbutton.repaint(); - } - cancel(); //cancel task so it does not run again - } - }, 1, 50);*/ - panel.setVisible(b); - } - - @Override - public MainPanel getPanel() { - return panel; - } - - @Override - public Window getWindow() { - return this; - } - - -} +/* + * Copyright (C) 2010-2014 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 com.jpexs.decompiler.flash.configuration.Configuration; +import com.jpexs.decompiler.flash.gui.player.FlashPlayerPanel; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.Container; +import java.awt.Dimension; +import java.awt.Window; +import java.awt.event.ComponentAdapter; +import java.awt.event.ComponentEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.awt.event.WindowStateListener; +import java.util.List; +import javax.swing.JFrame; +import org.pushingpixels.flamingo.api.ribbon.JRibbon; +import org.pushingpixels.flamingo.internal.ui.ribbon.appmenu.JRibbonApplicationMenuButton; + +/** + * + * @author JPEXS + */ +public final class MainFrameRibbon extends AppRibbonFrame implements MainFrame { + + public MainPanel panel; + private MainFrameMenu mainMenu; + + public MainFrameRibbon() { + super(); + + FlashPlayerPanel flashPanel = null; + try { + flashPanel = new FlashPlayerPanel(this); + } catch (FlashUnsupportedException fue) { + } + + Container cnt = getContentPane(); + cnt.setLayout(new BorderLayout()); + JRibbon ribbon = getRibbon(); + cnt.add(ribbon, BorderLayout.NORTH); + + boolean externalFlashPlayerUnavailable = flashPanel == null; + mainMenu = new MainFrameRibbonMenu(this, ribbon, externalFlashPlayerUnavailable); + + panel = new MainPanel(this, mainMenu, flashPanel); + panel.setBackground(Color.yellow); + cnt.add(panel, BorderLayout.CENTER); + + int w = Configuration.guiWindowWidth.get(); + int h = Configuration.guiWindowHeight.get(); + Dimension dim = java.awt.Toolkit.getDefaultToolkit().getScreenSize(); + if (w > dim.width) { + w = dim.width; + } + if (h > dim.height) { + h = dim.height; + } + setSize(w, h); + + boolean maximizedHorizontal = Configuration.guiWindowMaximizedHorizontal.get(); + boolean maximizedVertical = Configuration.guiWindowMaximizedVertical.get(); + + int state = 0; + if (maximizedHorizontal) { + state |= JFrame.MAXIMIZED_HORIZ; + } + if (maximizedVertical) { + state |= JFrame.MAXIMIZED_VERT; + } + setExtendedState(state); + + View.setWindowIcon(this); + addWindowStateListener(new WindowStateListener() { + @Override + public void windowStateChanged(WindowEvent e) { + int state = e.getNewState(); + Configuration.guiWindowMaximizedHorizontal.set((state & JFrame.MAXIMIZED_HORIZ) == JFrame.MAXIMIZED_HORIZ); + Configuration.guiWindowMaximizedVertical.set((state & JFrame.MAXIMIZED_VERT) == JFrame.MAXIMIZED_VERT); + } + }); + addComponentListener(new ComponentAdapter() { + @Override + public void componentResized(ComponentEvent e) { + int state = getExtendedState(); + if ((state & JFrame.MAXIMIZED_HORIZ) == 0) { + Configuration.guiWindowWidth.set(getWidth()); + } + if ((state & JFrame.MAXIMIZED_VERT) == 0) { + Configuration.guiWindowHeight.set(getHeight()); + } + } + }); + addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent e) { + Main.exit(); + } + }); + + View.centerScreen(this); + + + } + + private static void getApplicationMenuButtons(Component comp, List ret) { + if (comp instanceof JRibbonApplicationMenuButton) { + ret.add((JRibbonApplicationMenuButton) comp); + return; + } + if (comp instanceof java.awt.Container) { + java.awt.Container cont = (java.awt.Container) comp; + for (int i = 0; i < cont.getComponentCount(); i++) { + getApplicationMenuButtons(cont.getComponent(i), ret); + } + } + } + + @Override + public void setVisible(boolean b) { + super.setVisible(b); + + /* final MainFrameRibbon t = this; + + //TODO: Handle this better. This is awful :-( + new Timer().schedule(new TimerTask() { + @Override + public void run() { + List mbuttons = new ArrayList<>(); + getApplicationMenuButtons(t, mbuttons); + if (mbuttons.size() < 2) { + //return, task will run again + return; + } + + for (final JRibbonApplicationMenuButton mbutton : mbuttons) { + mbutton.setIcon(View.getResizableIcon("buttonicon_256")); + mbutton.setDisplayState(new CommandButtonDisplayState( + "My Ribbon Application Menu Button", mbutton.getSize().width) { + @Override + public CommandButtonLayoutManager createLayoutManager( + AbstractCommandButton commandButton) { + return new CommandButtonLayoutManager() { + @Override + public int getPreferredIconSize() { + return mbutton.getSize().width; + } + + @Override + public CommandButtonLayoutManager.CommandButtonLayoutInfo getLayoutInfo( + AbstractCommandButton commandButton, Graphics g) { + CommandButtonLayoutManager.CommandButtonLayoutInfo result = new CommandButtonLayoutManager.CommandButtonLayoutInfo(); + result.actionClickArea = new Rectangle(0, 0, 0, 0); + result.popupClickArea = new Rectangle(0, 0, commandButton + .getWidth(), commandButton.getHeight()); + result.popupActionRect = new Rectangle(0, 0, 0, 0); + ResizableIcon icon = commandButton.getIcon(); + icon.setDimension(new Dimension(commandButton.getWidth(), commandButton.getHeight())); + result.iconRect = new Rectangle( + 0, + 0, + commandButton.getWidth(), commandButton.getHeight()); + result.isTextInActionArea = false; + return result; + } + + @Override + public Dimension getPreferredSize( + AbstractCommandButton commandButton) { + return new Dimension(40, 40); + } + + @Override + public void propertyChange(PropertyChangeEvent evt) { + } + + @Override + public Point getKeyTipAnchorCenterPoint( + AbstractCommandButton commandButton) { + // dead center + return new Point(commandButton.getWidth() / 2, + commandButton.getHeight() / 2); + } + }; + } + }); + + MyRibbonApplicationMenuButtonUI mui = (MyRibbonApplicationMenuButtonUI) mbutton.getUI(); + mui.setHoverIcon(View.getResizableIcon("buttonicon_hover_256")); + mui.setNormalIcon(View.getResizableIcon("buttonicon_256")); + mui.setClickIcon(View.getResizableIcon("buttonicon_down_256")); + mbutton.repaint(); + } + cancel(); //cancel task so it does not run again + } + }, 1, 50);*/ + panel.setVisible(b); + } + + @Override + public MainPanel getPanel() { + return panel; + } + + @Override + public Window getWindow() { + return this; + } + + +} diff --git a/src/com/jpexs/decompiler/flash/gui/MainFrameRibbonMenu.java b/src/com/jpexs/decompiler/flash/gui/MainFrameRibbonMenu.java index c90141f7f..b95beb797 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainFrameRibbonMenu.java +++ b/src/com/jpexs/decompiler/flash/gui/MainFrameRibbonMenu.java @@ -23,7 +23,6 @@ import com.jpexs.decompiler.flash.console.ContextMenuTools; import com.jpexs.decompiler.flash.gui.helpers.CheckResources; import com.jpexs.decompiler.flash.gui.treenodes.SWFNode; import com.jpexs.decompiler.flash.tags.ABCContainerTag; -import com.jpexs.decompiler.flash.tags.Tag; import com.jpexs.helpers.Cache; import com.jpexs.helpers.utf8.Utf8Helper; import com.jpexs.process.ProcessTools; diff --git a/src/com/jpexs/decompiler/flash/gui/PreviewPanel.java b/src/com/jpexs/decompiler/flash/gui/PreviewPanel.java index 9f0ad034e..5098d5b76 100644 --- a/src/com/jpexs/decompiler/flash/gui/PreviewPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/PreviewPanel.java @@ -45,7 +45,6 @@ import com.jpexs.decompiler.flash.tags.VideoFrameTag; import com.jpexs.decompiler.flash.tags.base.AloneTag; import com.jpexs.decompiler.flash.tags.base.BoundedTag; import com.jpexs.decompiler.flash.tags.base.CharacterTag; -import com.jpexs.decompiler.flash.tags.base.Container; import com.jpexs.decompiler.flash.tags.base.ContainerItem; import com.jpexs.decompiler.flash.tags.base.FontTag; import com.jpexs.decompiler.flash.tags.base.PlaceObjectTypeTag; diff --git a/src/com/jpexs/decompiler/flash/gui/QuickFindPanel.java b/src/com/jpexs/decompiler/flash/gui/QuickFindPanel.java index 08f918783..288b8b197 100644 --- a/src/com/jpexs/decompiler/flash/gui/QuickFindPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/QuickFindPanel.java @@ -1,271 +1,259 @@ -/* - * Copyright (C) 2014 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.Container; -import java.awt.Dimension; -import java.awt.Event; -import java.awt.Point; -import java.awt.Rectangle; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.FocusAdapter; -import java.awt.event.FocusEvent; -import java.awt.event.FocusListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.lang.ref.WeakReference; -import java.util.regex.Pattern; -import java.util.regex.PatternSyntaxException; -import javax.swing.BorderFactory; -import javax.swing.BoxLayout; -import javax.swing.JButton; -import javax.swing.JCheckBox; -import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JPanel; -import javax.swing.JTextField; -import javax.swing.SwingUtilities; -import javax.swing.border.BevelBorder; -import javax.swing.event.DocumentEvent; -import javax.swing.event.DocumentListener; -import javax.swing.text.BadLocationException; -import javax.swing.text.JTextComponent; -import jsyntaxpane.actions.DocumentSearchData; -import jsyntaxpane.actions.gui.QuickFindDialog; -import jsyntaxpane.components.Markers; - -/** - * - * @author JPEXS - */ -public class QuickFindPanel extends JPanel implements ActionListener, jsyntaxpane.actions.QuickFindHandler { - public JTextField findTextField; - public JButton prevButton,nextButton; - public JCheckBox ignoreCaseCheckbox,regExpCheckbox,wrapCheckbox; - public JLabel statusLabel; - - private Markers.SimpleMarker marker = new Markers.SimpleMarker(Color.PINK); - private WeakReference target; - private WeakReference dsd; - private int oldCaretPosition; - - public QuickFindPanel(){ - setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); - - - setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED)); - - JPanel pan1 = new JPanel(new WrapLayout()); - JPanel pan2 = new JPanel(new WrapLayout()); - pan1.setAlignmentX(0); - pan2.setAlignmentX(0); - pan1.setAlignmentY(0); - pan2.setAlignmentY(0); - - - JLabel jLabel1 = new javax.swing.JLabel(); - findTextField = new javax.swing.JTextField(); - prevButton = new javax.swing.JButton(); - nextButton = new javax.swing.JButton(); - ignoreCaseCheckbox = new javax.swing.JCheckBox(); - regExpCheckbox = new javax.swing.JCheckBox(); - wrapCheckbox = new javax.swing.JCheckBox(); - statusLabel = new javax.swing.JLabel(); - - setName("QuickFindDialog"); // NOI18N - - - jLabel1.setLabelFor(findTextField); - java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("jsyntaxpane/Bundle"); // NOI18N - jLabel1.setText(bundle.getString("QuickFindDialog.jLabel1.text")); // NOI18N - pan1.add(jLabel1); - - findTextField.setColumns(30); - findTextField.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); - findTextField.setMaximumSize(new java.awt.Dimension(200, 24)); - findTextField.setMinimumSize(new java.awt.Dimension(60, 24)); - pan1.add(findTextField); - - prevButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/META-INF/images/small-icons/go-up.png"))); // NOI18N - prevButton.setFocusable(false); - prevButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); - prevButton.setOpaque(false); - prevButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); - prevButton.setActionCommand("PREVIOUS"); - prevButton.addActionListener(this); - pan1.add(prevButton); - - nextButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/META-INF/images/small-icons/go-down.png"))); // NOI18N - nextButton.setFocusable(false); - nextButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); - nextButton.setMargin(new java.awt.Insets(2, 2, 2, 2)); - nextButton.setOpaque(false); - nextButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); - nextButton.setActionCommand("NEXT"); - nextButton.addActionListener(this); - pan1.add(nextButton); - - ignoreCaseCheckbox.setMnemonic('C'); - ignoreCaseCheckbox.setText(bundle.getString("QuickFindDialog.jChkIgnoreCase.text")); // NOI18N - ignoreCaseCheckbox.setFocusable(false); - ignoreCaseCheckbox.setOpaque(false); - ignoreCaseCheckbox.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); - pan2.add(ignoreCaseCheckbox); - ignoreCaseCheckbox.addActionListener(this); - - regExpCheckbox.setMnemonic('R'); - regExpCheckbox.setText(bundle.getString("QuickFindDialog.jChkRegExp.text")); // NOI18N - regExpCheckbox.setFocusable(false); - regExpCheckbox.setOpaque(false); - regExpCheckbox.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); - pan2.add(regExpCheckbox); - regExpCheckbox.addActionListener(this); - - wrapCheckbox.setMnemonic('W'); - wrapCheckbox.setText(bundle.getString("QuickFindDialog.jChkWrap.text")); // NOI18N - wrapCheckbox.setFocusable(false); - wrapCheckbox.setOpaque(false); - wrapCheckbox.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); - pan2.add(wrapCheckbox); - wrapCheckbox.addActionListener(this); - - - statusLabel.setFont(statusLabel.getFont().deriveFont(statusLabel.getFont().getStyle() | java.awt.Font.BOLD, statusLabel.getFont().getSize()-2)); - statusLabel.setForeground(java.awt.Color.red); - pan2.add(statusLabel); - - add(pan1); - add(pan2); - setPreferredSize(getMinimumSize()); - setVisible(false); - } - - @Override - public void actionPerformed(ActionEvent e) { - switch(e.getActionCommand()){ - case "PREVIOUS": - if (dsd.get().doFindPrev(target.get())) { - statusLabel.setText(null); - } else { - statusLabel.setText(java.util.ResourceBundle.getBundle("jsyntaxpane/Bundle").getString("QuickFindDialog.NotFound")); - } - break; - case "NEXT": - if (dsd.get().doFindNext(target.get())) { - statusLabel.setText(null); - } else { - statusLabel.setText(java.util.ResourceBundle.getBundle("jsyntaxpane/Bundle").getString("QuickFindDialog.NotFound")); - } - break; - } - } - - - - @Override - public void showQuickFind(final JTextComponent t,DocumentSearchData ds) { - dsd = new WeakReference(ds); - oldCaretPosition = t.getCaretPosition(); - Container view = t.getParent(); - Dimension wd = getSize(); - wd.width = t.getVisibleRect().width; - Point loc = new Point(0, view.getHeight()); - setSize(wd); - SwingUtilities.convertPointToScreen(loc, view); - setLocation(loc); - findTextField.setFont(t.getFont()); - final DocumentListener dl; - findTextField.getDocument().addDocumentListener(dl = new DocumentListener() { - - @Override - public void insertUpdate(DocumentEvent e) { - updateFind(); - } - - @Override - public void removeUpdate(DocumentEvent e) { - updateFind(); - } - - @Override - public void changedUpdate(DocumentEvent e) { - updateFind(); - } - - private void updateFind() { - JTextComponent t = target.get(); - DocumentSearchData d = dsd.get(); - String toFind = findTextField.getText(); - if (toFind == null || toFind.isEmpty()) { - statusLabel.setText(null); - return; - } - try { - d.setWrap(wrapCheckbox.isSelected()); - d.setPattern(toFind, - regExpCheckbox.isSelected(), - ignoreCaseCheckbox.isSelected()); - // The dsd doFindNext will always find from current pos, - // so we need to relocate to our saved pos before we call doFindNext - statusLabel.setText(null); - t.setCaretPosition(oldCaretPosition); - if (!d.doFindNext(t)) { - statusLabel.setText(java.util.ResourceBundle.getBundle("jsyntaxpane/Bundle").getString("QuickFindDialog.NotFound")); - } else { - statusLabel.setText(null); - } - } catch (PatternSyntaxException e) { - statusLabel.setText(e.getDescription()); - } - } - }); - this.target = new WeakReference<>(t); - Pattern p = dsd.get().getPattern(); - if (p != null) { - findTextField.setText(p.pattern()); - } - wrapCheckbox.setSelected(dsd.get().isWrap()); - - - setVisible(true); - getParent().revalidate(); - getParent().repaint(); - findTextField.requestFocusInWindow(); - } -/* - @Override - public void focusGained(FocusEvent e) { - - } - - @Override - public void focusLost(FocusEvent e) { - removeFocusListener(this); - setVisible(false); - getParent().revalidate(); - getParent().repaint(); - }*/ - - - - -} +/* + * Copyright (C) 2014 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.Container; +import java.awt.Dimension; +import java.awt.Point; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.lang.ref.WeakReference; +import java.util.regex.Pattern; +import java.util.regex.PatternSyntaxException; +import javax.swing.BorderFactory; +import javax.swing.BoxLayout; +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JTextField; +import javax.swing.SwingUtilities; +import javax.swing.border.BevelBorder; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; +import javax.swing.text.JTextComponent; +import jsyntaxpane.actions.DocumentSearchData; +import jsyntaxpane.components.Markers; + +/** + * + * @author JPEXS + */ +public class QuickFindPanel extends JPanel implements ActionListener, jsyntaxpane.actions.QuickFindHandler { + public JTextField findTextField; + public JButton prevButton,nextButton; + public JCheckBox ignoreCaseCheckbox,regExpCheckbox,wrapCheckbox; + public JLabel statusLabel; + + private Markers.SimpleMarker marker = new Markers.SimpleMarker(Color.PINK); + private WeakReference target; + private WeakReference dsd; + private int oldCaretPosition; + + public QuickFindPanel(){ + setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); + + + setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED)); + + JPanel pan1 = new JPanel(new WrapLayout()); + JPanel pan2 = new JPanel(new WrapLayout()); + pan1.setAlignmentX(0); + pan2.setAlignmentX(0); + pan1.setAlignmentY(0); + pan2.setAlignmentY(0); + + + JLabel jLabel1 = new javax.swing.JLabel(); + findTextField = new javax.swing.JTextField(); + prevButton = new javax.swing.JButton(); + nextButton = new javax.swing.JButton(); + ignoreCaseCheckbox = new javax.swing.JCheckBox(); + regExpCheckbox = new javax.swing.JCheckBox(); + wrapCheckbox = new javax.swing.JCheckBox(); + statusLabel = new javax.swing.JLabel(); + + setName("QuickFindDialog"); // NOI18N + + + jLabel1.setLabelFor(findTextField); + java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("jsyntaxpane/Bundle"); // NOI18N + jLabel1.setText(bundle.getString("QuickFindDialog.jLabel1.text")); // NOI18N + pan1.add(jLabel1); + + findTextField.setColumns(30); + findTextField.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); + findTextField.setMaximumSize(new java.awt.Dimension(200, 24)); + findTextField.setMinimumSize(new java.awt.Dimension(60, 24)); + pan1.add(findTextField); + + prevButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/META-INF/images/small-icons/go-up.png"))); // NOI18N + prevButton.setFocusable(false); + prevButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); + prevButton.setOpaque(false); + prevButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); + prevButton.setActionCommand("PREVIOUS"); + prevButton.addActionListener(this); + pan1.add(prevButton); + + nextButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/META-INF/images/small-icons/go-down.png"))); // NOI18N + nextButton.setFocusable(false); + nextButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); + nextButton.setMargin(new java.awt.Insets(2, 2, 2, 2)); + nextButton.setOpaque(false); + nextButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); + nextButton.setActionCommand("NEXT"); + nextButton.addActionListener(this); + pan1.add(nextButton); + + ignoreCaseCheckbox.setMnemonic('C'); + ignoreCaseCheckbox.setText(bundle.getString("QuickFindDialog.jChkIgnoreCase.text")); // NOI18N + ignoreCaseCheckbox.setFocusable(false); + ignoreCaseCheckbox.setOpaque(false); + ignoreCaseCheckbox.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); + pan2.add(ignoreCaseCheckbox); + ignoreCaseCheckbox.addActionListener(this); + + regExpCheckbox.setMnemonic('R'); + regExpCheckbox.setText(bundle.getString("QuickFindDialog.jChkRegExp.text")); // NOI18N + regExpCheckbox.setFocusable(false); + regExpCheckbox.setOpaque(false); + regExpCheckbox.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); + pan2.add(regExpCheckbox); + regExpCheckbox.addActionListener(this); + + wrapCheckbox.setMnemonic('W'); + wrapCheckbox.setText(bundle.getString("QuickFindDialog.jChkWrap.text")); // NOI18N + wrapCheckbox.setFocusable(false); + wrapCheckbox.setOpaque(false); + wrapCheckbox.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); + pan2.add(wrapCheckbox); + wrapCheckbox.addActionListener(this); + + + statusLabel.setFont(statusLabel.getFont().deriveFont(statusLabel.getFont().getStyle() | java.awt.Font.BOLD, statusLabel.getFont().getSize()-2)); + statusLabel.setForeground(java.awt.Color.red); + pan2.add(statusLabel); + + add(pan1); + add(pan2); + setPreferredSize(getMinimumSize()); + setVisible(false); + } + + @Override + public void actionPerformed(ActionEvent e) { + switch(e.getActionCommand()){ + case "PREVIOUS": + if (dsd.get().doFindPrev(target.get())) { + statusLabel.setText(null); + } else { + statusLabel.setText(java.util.ResourceBundle.getBundle("jsyntaxpane/Bundle").getString("QuickFindDialog.NotFound")); + } + break; + case "NEXT": + if (dsd.get().doFindNext(target.get())) { + statusLabel.setText(null); + } else { + statusLabel.setText(java.util.ResourceBundle.getBundle("jsyntaxpane/Bundle").getString("QuickFindDialog.NotFound")); + } + break; + } + } + + + + @Override + public void showQuickFind(final JTextComponent t,DocumentSearchData ds) { + dsd = new WeakReference(ds); + oldCaretPosition = t.getCaretPosition(); + Container view = t.getParent(); + Dimension wd = getSize(); + wd.width = t.getVisibleRect().width; + Point loc = new Point(0, view.getHeight()); + setSize(wd); + SwingUtilities.convertPointToScreen(loc, view); + setLocation(loc); + findTextField.setFont(t.getFont()); + final DocumentListener dl; + findTextField.getDocument().addDocumentListener(dl = new DocumentListener() { + + @Override + public void insertUpdate(DocumentEvent e) { + updateFind(); + } + + @Override + public void removeUpdate(DocumentEvent e) { + updateFind(); + } + + @Override + public void changedUpdate(DocumentEvent e) { + updateFind(); + } + + private void updateFind() { + JTextComponent t = target.get(); + DocumentSearchData d = dsd.get(); + String toFind = findTextField.getText(); + if (toFind == null || toFind.isEmpty()) { + statusLabel.setText(null); + return; + } + try { + d.setWrap(wrapCheckbox.isSelected()); + d.setPattern(toFind, + regExpCheckbox.isSelected(), + ignoreCaseCheckbox.isSelected()); + // The dsd doFindNext will always find from current pos, + // so we need to relocate to our saved pos before we call doFindNext + statusLabel.setText(null); + t.setCaretPosition(oldCaretPosition); + if (!d.doFindNext(t)) { + statusLabel.setText(java.util.ResourceBundle.getBundle("jsyntaxpane/Bundle").getString("QuickFindDialog.NotFound")); + } else { + statusLabel.setText(null); + } + } catch (PatternSyntaxException e) { + statusLabel.setText(e.getDescription()); + } + } + }); + this.target = new WeakReference<>(t); + Pattern p = dsd.get().getPattern(); + if (p != null) { + findTextField.setText(p.pattern()); + } + wrapCheckbox.setSelected(dsd.get().isWrap()); + + + setVisible(true); + getParent().revalidate(); + getParent().repaint(); + findTextField.requestFocusInWindow(); + } +/* + @Override + public void focusGained(FocusEvent e) { + + } + + @Override + public void focusLost(FocusEvent e) { + removeFocusListener(this); + setVisible(false); + getParent().revalidate(); + getParent().repaint(); + }*/ + + + + +} diff --git a/src/com/jpexs/decompiler/flash/gui/SearchResultsDialog.java b/src/com/jpexs/decompiler/flash/gui/SearchResultsDialog.java index be67492b8..56ce1b0b7 100644 --- a/src/com/jpexs/decompiler/flash/gui/SearchResultsDialog.java +++ b/src/com/jpexs/decompiler/flash/gui/SearchResultsDialog.java @@ -1,122 +1,123 @@ -/* - * Copyright (C) 2014 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.BorderLayout; -import java.awt.Container; -import java.awt.Dimension; -import java.awt.FlowLayout; -import java.awt.Window; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.util.List; -import javax.swing.DefaultListModel; -import javax.swing.JButton; -import javax.swing.JList; -import javax.swing.JPanel; -import javax.swing.JScrollPane; -import javax.swing.SwingUtilities; - -/** - * - * @author JPEXS - */ -public class SearchResultsDialog extends AppDialog implements ActionListener{ - private final JList resultsList; - private final DefaultListModel model; - private final SearchListener listener; - - static final String ACTION_GOTO = "GOTO"; - static final String ACTION_CANCEL = "CLOSE"; - - private final JButton gotoButton = new JButton(translate("button.goto")); - private final JButton closeButton = new JButton(translate("button.close")); - - public SearchResultsDialog(Window owner,String text,SearchListener listener) { - super(owner); - setTitle(translate("dialog.title").replace("%text%", text)); - Container cnt=getContentPane(); - model = new DefaultListModel<>(); - resultsList = new JList<>(model); - this.listener = listener; - - gotoButton.setActionCommand(ACTION_GOTO); - gotoButton.addActionListener(this); - closeButton.setActionCommand(ACTION_CANCEL); - closeButton.addActionListener(this); - JPanel buttonsPanel = new JPanel(); - buttonsPanel.setLayout(new FlowLayout()); - buttonsPanel.add(gotoButton); - buttonsPanel.add(closeButton); - resultsList.addMouseListener(new MouseAdapter() { - - @Override - public void mouseClicked(MouseEvent e) { - if (e.getClickCount() == 2) { - gotoElement(); - } - } - - }); - - cnt.setLayout(new BorderLayout()); - JScrollPane sp = new JScrollPane(resultsList); - sp.setPreferredSize(new Dimension(300,300)); - cnt.add(sp,BorderLayout.CENTER); - cnt.add(buttonsPanel,BorderLayout.SOUTH); - pack(); - View.centerScreen(this); - View.setWindowIcon(this); - } - - public void setResults(List results){ - model.clear(); - for(E e:results){ - model.addElement(e); - } - } - - @Override - public void actionPerformed(ActionEvent e) { - switch (e.getActionCommand()) { - case ACTION_GOTO: - gotoElement(); - setVisible(false); - break; - case ACTION_CANCEL: - setVisible(false); - break; - } - } - - private void gotoElement(){ - if (resultsList.getSelectedIndex() != -1) { - SwingUtilities.invokeLater(new Runnable() { - - @Override - public void run() { - listener.updateSearchPos(resultsList.getSelectedValue()); - } - - }); - } - } - -} +/* + * Copyright (C) 2014 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.BorderLayout; +import java.awt.Container; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Window; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.util.List; +import javax.swing.DefaultListModel; +import javax.swing.JButton; +import javax.swing.JList; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.SwingUtilities; + +/** + * + * @author JPEXS + * @param + */ +public class SearchResultsDialog extends AppDialog implements ActionListener{ + private final JList resultsList; + private final DefaultListModel model; + private final SearchListener listener; + + static final String ACTION_GOTO = "GOTO"; + static final String ACTION_CANCEL = "CLOSE"; + + private final JButton gotoButton = new JButton(translate("button.goto")); + private final JButton closeButton = new JButton(translate("button.close")); + + public SearchResultsDialog(Window owner,String text,SearchListener listener) { + super(owner); + setTitle(translate("dialog.title").replace("%text%", text)); + Container cnt=getContentPane(); + model = new DefaultListModel<>(); + resultsList = new JList<>(model); + this.listener = listener; + + gotoButton.setActionCommand(ACTION_GOTO); + gotoButton.addActionListener(this); + closeButton.setActionCommand(ACTION_CANCEL); + closeButton.addActionListener(this); + JPanel buttonsPanel = new JPanel(); + buttonsPanel.setLayout(new FlowLayout()); + buttonsPanel.add(gotoButton); + buttonsPanel.add(closeButton); + resultsList.addMouseListener(new MouseAdapter() { + + @Override + public void mouseClicked(MouseEvent e) { + if (e.getClickCount() == 2) { + gotoElement(); + } + } + + }); + + cnt.setLayout(new BorderLayout()); + JScrollPane sp = new JScrollPane(resultsList); + sp.setPreferredSize(new Dimension(300,300)); + cnt.add(sp,BorderLayout.CENTER); + cnt.add(buttonsPanel,BorderLayout.SOUTH); + pack(); + View.centerScreen(this); + View.setWindowIcon(this); + } + + public void setResults(List results){ + model.clear(); + for(E e:results){ + model.addElement(e); + } + } + + @Override + public void actionPerformed(ActionEvent e) { + switch (e.getActionCommand()) { + case ACTION_GOTO: + gotoElement(); + setVisible(false); + break; + case ACTION_CANCEL: + setVisible(false); + break; + } + } + + private void gotoElement(){ + if (resultsList.getSelectedIndex() != -1) { + SwingUtilities.invokeLater(new Runnable() { + + @Override + public void run() { + listener.updateSearchPos(resultsList.getSelectedValue()); + } + + }); + } + } + +} diff --git a/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java b/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java index 555297300..017a21654 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java @@ -43,7 +43,6 @@ import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.gui.HeaderLabel; import com.jpexs.decompiler.flash.gui.Main; import com.jpexs.decompiler.flash.gui.MainPanel; -import com.jpexs.decompiler.flash.gui.QuickFindPanel; import com.jpexs.decompiler.flash.gui.SearchListener; import com.jpexs.decompiler.flash.gui.SearchPanel; import com.jpexs.decompiler.flash.gui.SearchResultsDialog; @@ -94,24 +93,17 @@ import java.util.logging.Level; import java.util.logging.Logger; import java.util.regex.Pattern; import javax.swing.AbstractAction; -import javax.swing.Action; -import javax.swing.ActionMap; import javax.swing.BoxLayout; -import javax.swing.InputMap; import javax.swing.JButton; import javax.swing.JComboBox; -import javax.swing.JEditorPane; import javax.swing.JLabel; -import javax.swing.JMenuItem; import javax.swing.JOptionPane; import javax.swing.JPanel; -import javax.swing.JPopupMenu; import javax.swing.JScrollPane; import javax.swing.JSplitPane; import javax.swing.JTabbedPane; import javax.swing.JTable; import javax.swing.JToggleButton; -import javax.swing.KeyStroke; import javax.swing.SwingConstants; import javax.swing.SwingUtilities; import javax.swing.border.BevelBorder; @@ -121,13 +113,8 @@ import javax.swing.table.DefaultTableModel; import javax.swing.table.TableCellRenderer; import javax.swing.table.TableColumn; import javax.swing.table.TableModel; -import javax.swing.text.DefaultEditorKit; -import javax.swing.text.JTextComponent; import javax.swing.tree.TreePath; import jsyntaxpane.DefaultSyntaxKit; -import jsyntaxpane.actions.DocumentSearchData; -import jsyntaxpane.actions.QuickFindAction; -import jsyntaxpane.actions.SyntaxAction; public class ABCPanel extends JPanel implements ItemListener, ActionListener, SearchListener, Freed { diff --git a/src/com/jpexs/decompiler/flash/gui/abc/UsageFrame.java b/src/com/jpexs/decompiler/flash/gui/abc/UsageFrame.java index c79ffe2ec..60977b51f 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/UsageFrame.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/UsageFrame.java @@ -1,187 +1,186 @@ -/* - * Copyright (C) 2010-2014 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.abc; - -import com.jpexs.decompiler.flash.abc.ABC; -import com.jpexs.decompiler.flash.abc.types.Multiname; -import com.jpexs.decompiler.flash.abc.types.Namespace; -import com.jpexs.decompiler.flash.abc.usages.InsideClassMultinameUsage; -import com.jpexs.decompiler.flash.abc.usages.MethodMultinameUsage; -import com.jpexs.decompiler.flash.abc.usages.MultinameUsage; -import com.jpexs.decompiler.flash.abc.usages.TraitMultinameUsage; -import com.jpexs.decompiler.flash.gui.AppDialog; -import com.jpexs.decompiler.flash.gui.AppFrame; -import com.jpexs.decompiler.flash.gui.View; -import com.jpexs.decompiler.flash.tags.ABCContainerTag; -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Container; -import java.awt.FlowLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; -import java.util.List; -import javax.swing.JButton; -import javax.swing.JList; -import javax.swing.JPanel; -import javax.swing.JScrollPane; - -/** - * - * @author JPEXS - */ -public class UsageFrame extends AppDialog implements ActionListener, MouseListener { - - static final String ACTION_GOTO = "GOTO"; - static final String ACTION_CANCEL = "CANCEL"; - - private final JButton gotoButton = new JButton(translate("button.goto")); - private final JButton cancelButton = new JButton(translate("button.cancel")); - private final JList usageList; - private final UsageListModel usageListModel; - private final ABCPanel abcPanel; - - public UsageFrame(List abcTags, ABC abc, int multinameIndex, ABCPanel abcPanel, boolean definitions) { - super(abcPanel.getMainPanel().getMainFrame().getWindow()); - this.abcPanel = abcPanel; - List usages = definitions?abc.findMultinameDefinition(abcTags,multinameIndex):abc.findMultinameUsage(abcTags,multinameIndex); - Multiname m = abc.constants.constant_multiname.get(multinameIndex); - if(m.namespace_index>0 && abc.constants.constant_namespace.get(m.namespace_index).kind != Namespace.KIND_PRIVATE) - { - for(ABCContainerTag at:abcTags){ - ABC a = at.getABC(); - if(a == abc){ - continue; - } - int mid=a.constants.getMultinameId(m,false); - if(mid>0){ - usages.addAll(definitions?a.findMultinameDefinition(abcTags, mid):a.findMultinameUsage(abcTags, mid)); - } - } - } - usageListModel = new UsageListModel(); - for (MultinameUsage u : usages) { - usageListModel.addElement(u); - } - usageList = new JList<>(usageListModel); - usageList.setBackground(Color.white); - gotoButton.setActionCommand(ACTION_GOTO); - gotoButton.addActionListener(this); - cancelButton.setActionCommand(ACTION_CANCEL); - cancelButton.addActionListener(this); - JPanel buttonsPanel = new JPanel(); - buttonsPanel.setLayout(new FlowLayout()); - buttonsPanel.add(gotoButton); - buttonsPanel.add(cancelButton); - - usageList.addMouseListener(this); - Container cont = getContentPane(); - cont.setLayout(new BorderLayout()); - cont.add(new JScrollPane(usageList), BorderLayout.CENTER); - cont.add(buttonsPanel, BorderLayout.SOUTH); - setSize(400, 300); - setTitle((definitions?translate("dialog.title.declaration"):translate("dialog.title")) + abc.constants.getMultiname(multinameIndex).getNameWithNamespace(abc.constants)); - View.centerScreen(this); - View.setWindowIcon(this); - } - - public static void gotoUsage(final ABCPanel abcPanel,final MultinameUsage usage){ - if (usage instanceof InsideClassMultinameUsage) { - final InsideClassMultinameUsage icu = (InsideClassMultinameUsage) usage; - - Runnable settrait = new Runnable() { - - @Override - public void run() { - abcPanel.decompiledTextArea.removeScriptListener(this); - abcPanel.decompiledTextArea.setClassIndex(icu.classIndex); - if (usage instanceof TraitMultinameUsage) { - TraitMultinameUsage tmu = (TraitMultinameUsage) usage; - int traitIndex; - if (tmu.parentTraitIndex > -1) { - traitIndex = tmu.parentTraitIndex; - } else { - traitIndex = tmu.traitIndex; - } - if (!tmu.isStatic) { - traitIndex += abcPanel.abc.class_info.get(tmu.classIndex).static_traits.traits.size(); - } - if (tmu instanceof MethodMultinameUsage) { - MethodMultinameUsage mmu = (MethodMultinameUsage) usage; - if (mmu.isInitializer == true) { - traitIndex = abcPanel.abc.class_info.get(mmu.classIndex).static_traits.traits.size() + abcPanel.abc.instance_info.get(mmu.classIndex).instance_traits.traits.size() + (mmu.isStatic ? 1 : 0); - } - } - abcPanel.decompiledTextArea.gotoTrait(traitIndex); - } - } - }; - - - if(abcPanel.decompiledTextArea.getClassIndex() == icu.classIndex && abcPanel.abc == icu.abc){ - settrait.run(); - }else{ - abcPanel.decompiledTextArea.addScriptListener(settrait); - abcPanel.hilightScript(abcPanel.swf, abcPanel.abc.instance_info.get(icu.classIndex).getName(abcPanel.abc.constants).getNameWithNamespace(abcPanel.abc.constants)); - } - } - } - - private void gotoUsage() { - if (usageList.getSelectedIndex() != -1) { - MultinameUsage usage = usageListModel.getUsage(usageList.getSelectedIndex()); - gotoUsage(abcPanel,usage); - } - } - - @Override - public void actionPerformed(ActionEvent e) { - switch (e.getActionCommand()) { - case ACTION_GOTO: - gotoUsage(); - setVisible(false); - break; - case ACTION_CANCEL: - setVisible(false); - break; - } - } - - @Override - public void mouseClicked(MouseEvent e) { - if (e.getClickCount() == 2) { - gotoUsage(); - } - } - - @Override - public void mousePressed(MouseEvent e) { - } - - @Override - public void mouseReleased(MouseEvent e) { - } - - @Override - public void mouseEntered(MouseEvent e) { - } - - @Override - public void mouseExited(MouseEvent e) { - } -} +/* + * Copyright (C) 2010-2014 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.abc; + +import com.jpexs.decompiler.flash.abc.ABC; +import com.jpexs.decompiler.flash.abc.types.Multiname; +import com.jpexs.decompiler.flash.abc.types.Namespace; +import com.jpexs.decompiler.flash.abc.usages.InsideClassMultinameUsage; +import com.jpexs.decompiler.flash.abc.usages.MethodMultinameUsage; +import com.jpexs.decompiler.flash.abc.usages.MultinameUsage; +import com.jpexs.decompiler.flash.abc.usages.TraitMultinameUsage; +import com.jpexs.decompiler.flash.gui.AppDialog; +import com.jpexs.decompiler.flash.gui.View; +import com.jpexs.decompiler.flash.tags.ABCContainerTag; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Container; +import java.awt.FlowLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.util.List; +import javax.swing.JButton; +import javax.swing.JList; +import javax.swing.JPanel; +import javax.swing.JScrollPane; + +/** + * + * @author JPEXS + */ +public class UsageFrame extends AppDialog implements ActionListener, MouseListener { + + static final String ACTION_GOTO = "GOTO"; + static final String ACTION_CANCEL = "CANCEL"; + + private final JButton gotoButton = new JButton(translate("button.goto")); + private final JButton cancelButton = new JButton(translate("button.cancel")); + private final JList usageList; + private final UsageListModel usageListModel; + private final ABCPanel abcPanel; + + public UsageFrame(List abcTags, ABC abc, int multinameIndex, ABCPanel abcPanel, boolean definitions) { + super(abcPanel.getMainPanel().getMainFrame().getWindow()); + this.abcPanel = abcPanel; + List usages = definitions?abc.findMultinameDefinition(abcTags,multinameIndex):abc.findMultinameUsage(abcTags,multinameIndex); + Multiname m = abc.constants.constant_multiname.get(multinameIndex); + if(m.namespace_index>0 && abc.constants.constant_namespace.get(m.namespace_index).kind != Namespace.KIND_PRIVATE) + { + for(ABCContainerTag at:abcTags){ + ABC a = at.getABC(); + if(a == abc){ + continue; + } + int mid=a.constants.getMultinameId(m,false); + if(mid>0){ + usages.addAll(definitions?a.findMultinameDefinition(abcTags, mid):a.findMultinameUsage(abcTags, mid)); + } + } + } + usageListModel = new UsageListModel(); + for (MultinameUsage u : usages) { + usageListModel.addElement(u); + } + usageList = new JList<>(usageListModel); + usageList.setBackground(Color.white); + gotoButton.setActionCommand(ACTION_GOTO); + gotoButton.addActionListener(this); + cancelButton.setActionCommand(ACTION_CANCEL); + cancelButton.addActionListener(this); + JPanel buttonsPanel = new JPanel(); + buttonsPanel.setLayout(new FlowLayout()); + buttonsPanel.add(gotoButton); + buttonsPanel.add(cancelButton); + + usageList.addMouseListener(this); + Container cont = getContentPane(); + cont.setLayout(new BorderLayout()); + cont.add(new JScrollPane(usageList), BorderLayout.CENTER); + cont.add(buttonsPanel, BorderLayout.SOUTH); + setSize(400, 300); + setTitle((definitions?translate("dialog.title.declaration"):translate("dialog.title")) + abc.constants.getMultiname(multinameIndex).getNameWithNamespace(abc.constants)); + View.centerScreen(this); + View.setWindowIcon(this); + } + + public static void gotoUsage(final ABCPanel abcPanel,final MultinameUsage usage){ + if (usage instanceof InsideClassMultinameUsage) { + final InsideClassMultinameUsage icu = (InsideClassMultinameUsage) usage; + + Runnable settrait = new Runnable() { + + @Override + public void run() { + abcPanel.decompiledTextArea.removeScriptListener(this); + abcPanel.decompiledTextArea.setClassIndex(icu.classIndex); + if (usage instanceof TraitMultinameUsage) { + TraitMultinameUsage tmu = (TraitMultinameUsage) usage; + int traitIndex; + if (tmu.parentTraitIndex > -1) { + traitIndex = tmu.parentTraitIndex; + } else { + traitIndex = tmu.traitIndex; + } + if (!tmu.isStatic) { + traitIndex += abcPanel.abc.class_info.get(tmu.classIndex).static_traits.traits.size(); + } + if (tmu instanceof MethodMultinameUsage) { + MethodMultinameUsage mmu = (MethodMultinameUsage) usage; + if (mmu.isInitializer == true) { + traitIndex = abcPanel.abc.class_info.get(mmu.classIndex).static_traits.traits.size() + abcPanel.abc.instance_info.get(mmu.classIndex).instance_traits.traits.size() + (mmu.isStatic ? 1 : 0); + } + } + abcPanel.decompiledTextArea.gotoTrait(traitIndex); + } + } + }; + + + if(abcPanel.decompiledTextArea.getClassIndex() == icu.classIndex && abcPanel.abc == icu.abc){ + settrait.run(); + }else{ + abcPanel.decompiledTextArea.addScriptListener(settrait); + abcPanel.hilightScript(abcPanel.swf, abcPanel.abc.instance_info.get(icu.classIndex).getName(abcPanel.abc.constants).getNameWithNamespace(abcPanel.abc.constants)); + } + } + } + + private void gotoUsage() { + if (usageList.getSelectedIndex() != -1) { + MultinameUsage usage = usageListModel.getUsage(usageList.getSelectedIndex()); + gotoUsage(abcPanel,usage); + } + } + + @Override + public void actionPerformed(ActionEvent e) { + switch (e.getActionCommand()) { + case ACTION_GOTO: + gotoUsage(); + setVisible(false); + break; + case ACTION_CANCEL: + setVisible(false); + break; + } + } + + @Override + public void mouseClicked(MouseEvent e) { + if (e.getClickCount() == 2) { + gotoUsage(); + } + } + + @Override + public void mousePressed(MouseEvent e) { + } + + @Override + public void mouseReleased(MouseEvent e) { + } + + @Override + public void mouseEntered(MouseEvent e) { + } + + @Override + public void mouseExited(MouseEvent e) { + } +} diff --git a/src/com/jpexs/decompiler/flash/gui/abc/UsageListModel.java b/src/com/jpexs/decompiler/flash/gui/abc/UsageListModel.java index 439cfe145..3912d52aa 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/UsageListModel.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/UsageListModel.java @@ -1,46 +1,41 @@ -/* - * Copyright (C) 2010-2014 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.abc; - -import com.jpexs.decompiler.flash.abc.ABC; -import com.jpexs.decompiler.flash.abc.usages.MultinameUsage; -import com.jpexs.decompiler.flash.tags.ABCContainerTag; -import java.util.List; -import java.util.logging.Level; -import java.util.logging.Logger; -import javax.swing.DefaultListModel; - -/** - * - * @author JPEXS - */ -public class UsageListModel extends DefaultListModel { - - @Override - public Object get(int index) { - return ((MultinameUsage) super.get(index)).toString(); - } - - @Override - public Object getElementAt(int index) { - return ((MultinameUsage) super.getElementAt(index)).toString(); - } - - public MultinameUsage getUsage(int index) { - return ((MultinameUsage) super.getElementAt(index)); - } -} +/* + * Copyright (C) 2010-2014 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.abc; + +import com.jpexs.decompiler.flash.abc.usages.MultinameUsage; +import javax.swing.DefaultListModel; + +/** + * + * @author JPEXS + */ +public class UsageListModel extends DefaultListModel { + + @Override + public Object get(int index) { + return ((MultinameUsage) super.get(index)).toString(); + } + + @Override + public Object getElementAt(int index) { + return ((MultinameUsage) super.getElementAt(index)).toString(); + } + + public MultinameUsage getUsage(int index) { + return ((MultinameUsage) super.getElementAt(index)); + } +} diff --git a/src/com/jpexs/decompiler/flash/tags/CSMTextSettingsTag.java b/src/com/jpexs/decompiler/flash/tags/CSMTextSettingsTag.java index cca2bd1ab..a2e7069ad 100644 --- a/src/com/jpexs/decompiler/flash/tags/CSMTextSettingsTag.java +++ b/src/com/jpexs/decompiler/flash/tags/CSMTextSettingsTag.java @@ -85,6 +85,7 @@ public class CSMTextSettingsTag extends Tag { * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/tags/DebugIDTag.java b/src/com/jpexs/decompiler/flash/tags/DebugIDTag.java index 8fe8e7bea..662e12987 100644 --- a/src/com/jpexs/decompiler/flash/tags/DebugIDTag.java +++ b/src/com/jpexs/decompiler/flash/tags/DebugIDTag.java @@ -58,6 +58,7 @@ public class DebugIDTag extends Tag { * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG4Tag.java b/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG4Tag.java index 2291cd549..1d6e35e83 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG4Tag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG4Tag.java @@ -134,6 +134,7 @@ public class DefineBitsJPEG4Tag extends ImageTag implements AloneTag { * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/tags/DefineButton2Tag.java b/src/com/jpexs/decompiler/flash/tags/DefineButton2Tag.java index ad7304965..877bb81b7 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineButton2Tag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineButton2Tag.java @@ -98,6 +98,7 @@ public class DefineButton2Tag extends ButtonTag implements Container { * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/tags/DefineButtonCxformTag.java b/src/com/jpexs/decompiler/flash/tags/DefineButtonCxformTag.java index b0ed57631..489444c89 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineButtonCxformTag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineButtonCxformTag.java @@ -60,6 +60,7 @@ public class DefineButtonCxformTag extends Tag { * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/tags/DefineButtonSoundTag.java b/src/com/jpexs/decompiler/flash/tags/DefineButtonSoundTag.java index 852234181..c21bd7c9b 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineButtonSoundTag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineButtonSoundTag.java @@ -100,6 +100,7 @@ public class DefineButtonSoundTag extends CharacterIdTag { * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/tags/DefineButtonTag.java b/src/com/jpexs/decompiler/flash/tags/DefineButtonTag.java index c676e7d7c..f88b82396 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineButtonTag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineButtonTag.java @@ -97,6 +97,7 @@ public class DefineButtonTag extends ButtonTag implements ASMSource { * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/tags/DefineEditTextTag.java b/src/com/jpexs/decompiler/flash/tags/DefineEditTextTag.java index 6b89958ae..bc3444f5d 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineEditTextTag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineEditTextTag.java @@ -696,6 +696,7 @@ public class DefineEditTextTag extends TextTag { * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/tags/DefineFont2Tag.java b/src/com/jpexs/decompiler/flash/tags/DefineFont2Tag.java index 4adb7203c..d6860282e 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineFont2Tag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineFont2Tag.java @@ -193,6 +193,7 @@ public class DefineFont2Tag extends FontTag { * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/tags/DefineFontInfo2Tag.java b/src/com/jpexs/decompiler/flash/tags/DefineFontInfo2Tag.java index 028d831b0..8351fcfca 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineFontInfo2Tag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineFontInfo2Tag.java @@ -89,6 +89,7 @@ public class DefineFontInfo2Tag extends Tag { * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/tags/DefineFontInfoTag.java b/src/com/jpexs/decompiler/flash/tags/DefineFontInfoTag.java index d35c953c6..059a95bf8 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineFontInfoTag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineFontInfoTag.java @@ -90,6 +90,7 @@ public class DefineFontInfoTag extends Tag { * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/tags/DefineFontTag.java b/src/com/jpexs/decompiler/flash/tags/DefineFontTag.java index e59496638..ab72132ee 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineFontTag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineFontTag.java @@ -137,6 +137,7 @@ public class DefineFontTag extends FontTag { * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/tags/DefineMorphShape2Tag.java b/src/com/jpexs/decompiler/flash/tags/DefineMorphShape2Tag.java index a2d81f6e5..c9798dd48 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineMorphShape2Tag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineMorphShape2Tag.java @@ -149,6 +149,7 @@ public class DefineMorphShape2Tag extends CharacterTag implements MorphShapeTag * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/tags/DefineMorphShapeTag.java b/src/com/jpexs/decompiler/flash/tags/DefineMorphShapeTag.java index 938c85fac..97ca9307f 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineMorphShapeTag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineMorphShapeTag.java @@ -127,6 +127,7 @@ public class DefineMorphShapeTag extends CharacterTag implements MorphShapeTag { * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/tags/DefineSceneAndFrameLabelDataTag.java b/src/com/jpexs/decompiler/flash/tags/DefineSceneAndFrameLabelDataTag.java index b5dac57b5..ac2a51a95 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineSceneAndFrameLabelDataTag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineSceneAndFrameLabelDataTag.java @@ -79,6 +79,7 @@ public class DefineSceneAndFrameLabelDataTag extends Tag { * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/tags/DefineSoundTag.java b/src/com/jpexs/decompiler/flash/tags/DefineSoundTag.java index 7d08fe8be..717721a21 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineSoundTag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineSoundTag.java @@ -97,6 +97,7 @@ public class DefineSoundTag extends CharacterTag implements SoundTag { * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/tags/DefineSpriteTag.java b/src/com/jpexs/decompiler/flash/tags/DefineSpriteTag.java index 786e17945..3ea919a0b 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineSpriteTag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineSpriteTag.java @@ -17,7 +17,6 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWF; -import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFLimitedInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; import com.jpexs.decompiler.flash.abc.CopyOutputStream; diff --git a/src/com/jpexs/decompiler/flash/tags/DefineText2Tag.java b/src/com/jpexs/decompiler/flash/tags/DefineText2Tag.java index c0ab3af7c..0ffc588ec 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineText2Tag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineText2Tag.java @@ -461,6 +461,7 @@ public class DefineText2Tag extends TextTag { * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/tags/DefineTextTag.java b/src/com/jpexs/decompiler/flash/tags/DefineTextTag.java index 6646e8289..bb8d348f4 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineTextTag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineTextTag.java @@ -472,6 +472,7 @@ public class DefineTextTag extends TextTag { * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/tags/DefineVideoStreamTag.java b/src/com/jpexs/decompiler/flash/tags/DefineVideoStreamTag.java index 719d6a9cb..0307fcb07 100644 --- a/src/com/jpexs/decompiler/flash/tags/DefineVideoStreamTag.java +++ b/src/com/jpexs/decompiler/flash/tags/DefineVideoStreamTag.java @@ -100,6 +100,7 @@ public class DefineVideoStreamTag extends CharacterTag implements BoundedTag { * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/tags/DoABCDefineTag.java b/src/com/jpexs/decompiler/flash/tags/DoABCDefineTag.java index 8e506a36f..48dd30461 100644 --- a/src/com/jpexs/decompiler/flash/tags/DoABCDefineTag.java +++ b/src/com/jpexs/decompiler/flash/tags/DoABCDefineTag.java @@ -67,6 +67,7 @@ public class DoABCDefineTag extends Tag implements ABCContainerTag { * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/tags/DoABCTag.java b/src/com/jpexs/decompiler/flash/tags/DoABCTag.java index cadf45609..93b7d7824 100644 --- a/src/com/jpexs/decompiler/flash/tags/DoABCTag.java +++ b/src/com/jpexs/decompiler/flash/tags/DoABCTag.java @@ -54,6 +54,7 @@ public class DoABCTag extends Tag implements ABCContainerTag { * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/tags/DoActionTag.java b/src/com/jpexs/decompiler/flash/tags/DoActionTag.java index f37d9120a..659e866c3 100644 --- a/src/com/jpexs/decompiler/flash/tags/DoActionTag.java +++ b/src/com/jpexs/decompiler/flash/tags/DoActionTag.java @@ -27,7 +27,6 @@ import com.jpexs.decompiler.flash.tags.base.ASMSource; import com.jpexs.decompiler.flash.types.annotations.Internal; import com.jpexs.helpers.Helper; import com.jpexs.helpers.MemoryInputStream; -import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.ArrayList; import java.util.List; diff --git a/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java b/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java index 3838159bc..dee0415a4 100644 --- a/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java +++ b/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java @@ -57,6 +57,7 @@ public class DoInitActionTag extends CharacterIdTag implements ASMSource { * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/tags/EnableDebugger2Tag.java b/src/com/jpexs/decompiler/flash/tags/EnableDebugger2Tag.java index d564c4b5f..7c7023de4 100644 --- a/src/com/jpexs/decompiler/flash/tags/EnableDebugger2Tag.java +++ b/src/com/jpexs/decompiler/flash/tags/EnableDebugger2Tag.java @@ -65,6 +65,7 @@ public class EnableDebugger2Tag extends Tag { * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/tags/EnableDebuggerTag.java b/src/com/jpexs/decompiler/flash/tags/EnableDebuggerTag.java index 0ed952516..cdf2f4e63 100644 --- a/src/com/jpexs/decompiler/flash/tags/EnableDebuggerTag.java +++ b/src/com/jpexs/decompiler/flash/tags/EnableDebuggerTag.java @@ -59,6 +59,7 @@ public class EnableDebuggerTag extends Tag { * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/tags/EnableTelemetryTag.java b/src/com/jpexs/decompiler/flash/tags/EnableTelemetryTag.java index 40700d585..fae9cfa61 100644 --- a/src/com/jpexs/decompiler/flash/tags/EnableTelemetryTag.java +++ b/src/com/jpexs/decompiler/flash/tags/EnableTelemetryTag.java @@ -68,6 +68,7 @@ public class EnableTelemetryTag extends Tag { * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/tags/EndTag.java b/src/com/jpexs/decompiler/flash/tags/EndTag.java index 2a4e6ac5b..c2d81f890 100644 --- a/src/com/jpexs/decompiler/flash/tags/EndTag.java +++ b/src/com/jpexs/decompiler/flash/tags/EndTag.java @@ -42,6 +42,7 @@ public class EndTag extends Tag { * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/tags/ExportAssetsTag.java b/src/com/jpexs/decompiler/flash/tags/ExportAssetsTag.java index 3bbd1f7c2..4b0d309b1 100644 --- a/src/com/jpexs/decompiler/flash/tags/ExportAssetsTag.java +++ b/src/com/jpexs/decompiler/flash/tags/ExportAssetsTag.java @@ -17,13 +17,11 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWF; -import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFLimitedInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; import com.jpexs.decompiler.flash.types.BasicType; import com.jpexs.decompiler.flash.types.annotations.SWFArray; import com.jpexs.decompiler.flash.types.annotations.SWFType; -import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.OutputStream; diff --git a/src/com/jpexs/decompiler/flash/tags/FileAttributesTag.java b/src/com/jpexs/decompiler/flash/tags/FileAttributesTag.java index a03d8a37d..35fd66ff7 100644 --- a/src/com/jpexs/decompiler/flash/tags/FileAttributesTag.java +++ b/src/com/jpexs/decompiler/flash/tags/FileAttributesTag.java @@ -17,13 +17,11 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWF; -import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFLimitedInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; import com.jpexs.decompiler.flash.types.BasicType; import com.jpexs.decompiler.flash.types.annotations.Reserved; import com.jpexs.decompiler.flash.types.annotations.SWFType; -import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.OutputStream; diff --git a/src/com/jpexs/decompiler/flash/tags/ImportAssets2Tag.java b/src/com/jpexs/decompiler/flash/tags/ImportAssets2Tag.java index a12132c0b..7be353412 100644 --- a/src/com/jpexs/decompiler/flash/tags/ImportAssets2Tag.java +++ b/src/com/jpexs/decompiler/flash/tags/ImportAssets2Tag.java @@ -60,6 +60,7 @@ public class ImportAssets2Tag extends Tag implements ImportTag { * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/tags/ImportAssetsTag.java b/src/com/jpexs/decompiler/flash/tags/ImportAssetsTag.java index 77955b691..7e356a559 100644 --- a/src/com/jpexs/decompiler/flash/tags/ImportAssetsTag.java +++ b/src/com/jpexs/decompiler/flash/tags/ImportAssetsTag.java @@ -53,6 +53,7 @@ public class ImportAssetsTag extends Tag implements ImportTag { * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/tags/PlaceObject2Tag.java b/src/com/jpexs/decompiler/flash/tags/PlaceObject2Tag.java index 3c5251159..babdfcca3 100644 --- a/src/com/jpexs/decompiler/flash/tags/PlaceObject2Tag.java +++ b/src/com/jpexs/decompiler/flash/tags/PlaceObject2Tag.java @@ -215,6 +215,7 @@ public class PlaceObject2Tag extends CharacterIdTag implements Container, PlaceO * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/tags/PlaceObject3Tag.java b/src/com/jpexs/decompiler/flash/tags/PlaceObject3Tag.java index 52bd37090..0d006d169 100644 --- a/src/com/jpexs/decompiler/flash/tags/PlaceObject3Tag.java +++ b/src/com/jpexs/decompiler/flash/tags/PlaceObject3Tag.java @@ -299,6 +299,7 @@ public class PlaceObject3Tag extends CharacterIdTag implements Container, PlaceO * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/tags/PlaceObject4Tag.java b/src/com/jpexs/decompiler/flash/tags/PlaceObject4Tag.java index afddc8371..d7678240b 100644 --- a/src/com/jpexs/decompiler/flash/tags/PlaceObject4Tag.java +++ b/src/com/jpexs/decompiler/flash/tags/PlaceObject4Tag.java @@ -300,6 +300,7 @@ public class PlaceObject4Tag extends CharacterIdTag implements Container, PlaceO * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/tags/PlaceObjectTag.java b/src/com/jpexs/decompiler/flash/tags/PlaceObjectTag.java index 209a09c10..1e4c70355 100644 --- a/src/com/jpexs/decompiler/flash/tags/PlaceObjectTag.java +++ b/src/com/jpexs/decompiler/flash/tags/PlaceObjectTag.java @@ -101,6 +101,7 @@ public class PlaceObjectTag extends CharacterIdTag implements PlaceObjectTypeTag * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/tags/ProtectTag.java b/src/com/jpexs/decompiler/flash/tags/ProtectTag.java index 80298f94a..de19bb115 100644 --- a/src/com/jpexs/decompiler/flash/tags/ProtectTag.java +++ b/src/com/jpexs/decompiler/flash/tags/ProtectTag.java @@ -59,6 +59,7 @@ public class ProtectTag extends Tag { * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/tags/RemoveObjectTag.java b/src/com/jpexs/decompiler/flash/tags/RemoveObjectTag.java index 31fa2d79e..c44a26a28 100644 --- a/src/com/jpexs/decompiler/flash/tags/RemoveObjectTag.java +++ b/src/com/jpexs/decompiler/flash/tags/RemoveObjectTag.java @@ -68,6 +68,7 @@ public class RemoveObjectTag extends CharacterIdTag implements RemoveTag { * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/tags/SetTabIndexTag.java b/src/com/jpexs/decompiler/flash/tags/SetTabIndexTag.java index 0692f5c27..002dc455d 100644 --- a/src/com/jpexs/decompiler/flash/tags/SetTabIndexTag.java +++ b/src/com/jpexs/decompiler/flash/tags/SetTabIndexTag.java @@ -66,6 +66,7 @@ public class SetTabIndexTag extends Tag { * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/tags/ShowFrameTag.java b/src/com/jpexs/decompiler/flash/tags/ShowFrameTag.java index d00540668..ab8b7c4bc 100644 --- a/src/com/jpexs/decompiler/flash/tags/ShowFrameTag.java +++ b/src/com/jpexs/decompiler/flash/tags/ShowFrameTag.java @@ -52,6 +52,7 @@ public class ShowFrameTag extends Tag { * * @param swf * @param headerData + * @param length * @param pos * @param data */ diff --git a/src/com/jpexs/decompiler/flash/tags/SoundStreamBlockTag.java b/src/com/jpexs/decompiler/flash/tags/SoundStreamBlockTag.java index 3736b4f4f..5f821e88f 100644 --- a/src/com/jpexs/decompiler/flash/tags/SoundStreamBlockTag.java +++ b/src/com/jpexs/decompiler/flash/tags/SoundStreamBlockTag.java @@ -37,6 +37,7 @@ public class SoundStreamBlockTag extends Tag { * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/tags/SoundStreamHead2Tag.java b/src/com/jpexs/decompiler/flash/tags/SoundStreamHead2Tag.java index bbdfac051..5baa19cb7 100644 --- a/src/com/jpexs/decompiler/flash/tags/SoundStreamHead2Tag.java +++ b/src/com/jpexs/decompiler/flash/tags/SoundStreamHead2Tag.java @@ -138,6 +138,7 @@ public class SoundStreamHead2Tag extends CharacterIdTag implements SoundStreamHe * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/tags/SoundStreamHeadTag.java b/src/com/jpexs/decompiler/flash/tags/SoundStreamHeadTag.java index 2a4020164..d045cefd4 100644 --- a/src/com/jpexs/decompiler/flash/tags/SoundStreamHeadTag.java +++ b/src/com/jpexs/decompiler/flash/tags/SoundStreamHeadTag.java @@ -131,6 +131,7 @@ public class SoundStreamHeadTag extends CharacterIdTag implements SoundStreamHea * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/tags/StartSound2Tag.java b/src/com/jpexs/decompiler/flash/tags/StartSound2Tag.java index b00e0dd6e..35e0cd4bc 100644 --- a/src/com/jpexs/decompiler/flash/tags/StartSound2Tag.java +++ b/src/com/jpexs/decompiler/flash/tags/StartSound2Tag.java @@ -56,6 +56,7 @@ public class StartSound2Tag extends Tag { * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/tags/StartSoundTag.java b/src/com/jpexs/decompiler/flash/tags/StartSoundTag.java index e83e0c55f..6078d3a40 100644 --- a/src/com/jpexs/decompiler/flash/tags/StartSoundTag.java +++ b/src/com/jpexs/decompiler/flash/tags/StartSoundTag.java @@ -60,6 +60,7 @@ public class StartSoundTag extends Tag { * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/tags/Tag.java b/src/com/jpexs/decompiler/flash/tags/Tag.java index 507fa0a3d..5c5370329 100644 --- a/src/com/jpexs/decompiler/flash/tags/Tag.java +++ b/src/com/jpexs/decompiler/flash/tags/Tag.java @@ -17,7 +17,6 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWF; -import com.jpexs.decompiler.flash.SWFLimitedInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; import com.jpexs.decompiler.flash.tags.base.ContainerItem; import com.jpexs.decompiler.flash.tags.base.Exportable; diff --git a/src/com/jpexs/decompiler/flash/tags/TagStub.java b/src/com/jpexs/decompiler/flash/tags/TagStub.java index 819816a3c..d7ec611e7 100644 --- a/src/com/jpexs/decompiler/flash/tags/TagStub.java +++ b/src/com/jpexs/decompiler/flash/tags/TagStub.java @@ -17,13 +17,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWF; -import com.jpexs.decompiler.flash.SWFInputStream; -import com.jpexs.decompiler.flash.SWFLimitedInputStream; -import com.jpexs.decompiler.flash.SWFOutputStream; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; import java.io.IOException; -import java.io.OutputStream; /** * diff --git a/src/com/jpexs/decompiler/flash/tags/VideoFrameTag.java b/src/com/jpexs/decompiler/flash/tags/VideoFrameTag.java index 5f820b92a..58029eaed 100644 --- a/src/com/jpexs/decompiler/flash/tags/VideoFrameTag.java +++ b/src/com/jpexs/decompiler/flash/tags/VideoFrameTag.java @@ -16,13 +16,10 @@ */ package com.jpexs.decompiler.flash.tags; -import com.jpexs.decompiler.flash.SWF; -import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFLimitedInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; import com.jpexs.decompiler.flash.types.BasicType; import com.jpexs.decompiler.flash.types.annotations.SWFType; -import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.OutputStream; diff --git a/src/com/jpexs/decompiler/flash/tags/base/CharacterTag.java b/src/com/jpexs/decompiler/flash/tags/base/CharacterTag.java index 790668d8b..fc5b96bce 100644 --- a/src/com/jpexs/decompiler/flash/tags/base/CharacterTag.java +++ b/src/com/jpexs/decompiler/flash/tags/base/CharacterTag.java @@ -17,7 +17,6 @@ package com.jpexs.decompiler.flash.tags.base; import com.jpexs.decompiler.flash.SWF; -import com.jpexs.decompiler.flash.SWFLimitedInputStream; /** * diff --git a/src/com/jpexs/decompiler/flash/tags/gfx/DefineCompactedFont.java b/src/com/jpexs/decompiler/flash/tags/gfx/DefineCompactedFont.java index f4b1ae8df..efdc387a9 100644 --- a/src/com/jpexs/decompiler/flash/tags/gfx/DefineCompactedFont.java +++ b/src/com/jpexs/decompiler/flash/tags/gfx/DefineCompactedFont.java @@ -17,7 +17,6 @@ package com.jpexs.decompiler.flash.tags.gfx; import com.jpexs.decompiler.flash.SWF; -import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFLimitedInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; import com.jpexs.decompiler.flash.tags.DefineFont2Tag; @@ -40,7 +39,6 @@ import com.jpexs.decompiler.flash.types.shaperecords.StraightEdgeRecord; import com.jpexs.decompiler.flash.types.shaperecords.StyleChangeRecord; import com.jpexs.helpers.Helper; import java.awt.Font; -import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.OutputStream; diff --git a/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalGradient.java b/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalGradient.java index 511c55629..ab4057a12 100644 --- a/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalGradient.java +++ b/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalGradient.java @@ -66,6 +66,7 @@ public class DefineExternalGradient extends Tag { * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage.java b/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage.java index d68971d4c..93bb5599c 100644 --- a/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage.java +++ b/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage.java @@ -68,6 +68,7 @@ public class DefineExternalImage extends Tag { * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage2.java b/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage2.java index 2f461e114..6cb1f0079 100644 --- a/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage2.java +++ b/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage2.java @@ -76,6 +76,7 @@ public class DefineExternalImage2 extends Tag { * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalSound.java b/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalSound.java index 887c6f1ae..21f416a01 100644 --- a/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalSound.java +++ b/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalSound.java @@ -76,6 +76,7 @@ public class DefineExternalSound extends Tag { * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalStreamSound.java b/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalStreamSound.java index 8041250f7..bd64b535e 100644 --- a/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalStreamSound.java +++ b/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalStreamSound.java @@ -74,6 +74,7 @@ public class DefineExternalStreamSound extends Tag { * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/tags/gfx/DefineGradientMap.java b/src/com/jpexs/decompiler/flash/tags/gfx/DefineGradientMap.java index b9576f325..c26559ea0 100644 --- a/src/com/jpexs/decompiler/flash/tags/gfx/DefineGradientMap.java +++ b/src/com/jpexs/decompiler/flash/tags/gfx/DefineGradientMap.java @@ -58,6 +58,7 @@ public class DefineGradientMap extends Tag { * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/tags/gfx/DefineSubImage.java b/src/com/jpexs/decompiler/flash/tags/gfx/DefineSubImage.java index e7cf00b7f..ddb0ed78d 100644 --- a/src/com/jpexs/decompiler/flash/tags/gfx/DefineSubImage.java +++ b/src/com/jpexs/decompiler/flash/tags/gfx/DefineSubImage.java @@ -65,6 +65,7 @@ public class DefineSubImage extends Tag { * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/tags/gfx/ExporterInfoTag.java b/src/com/jpexs/decompiler/flash/tags/gfx/ExporterInfoTag.java index 8831fab39..dc2fed7e3 100644 --- a/src/com/jpexs/decompiler/flash/tags/gfx/ExporterInfoTag.java +++ b/src/com/jpexs/decompiler/flash/tags/gfx/ExporterInfoTag.java @@ -84,6 +84,7 @@ public class ExporterInfoTag extends Tag { * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/tags/gfx/FontTextureInfo.java b/src/com/jpexs/decompiler/flash/tags/gfx/FontTextureInfo.java index f7b634686..c1cbe6f66 100644 --- a/src/com/jpexs/decompiler/flash/tags/gfx/FontTextureInfo.java +++ b/src/com/jpexs/decompiler/flash/tags/gfx/FontTextureInfo.java @@ -86,6 +86,7 @@ public class FontTextureInfo extends Tag { * * @param swf * @param headerData + * @param length * @param data Data bytes * @param pos * @throws IOException diff --git a/src/com/jpexs/decompiler/flash/types/BUTTONCONDACTION.java b/src/com/jpexs/decompiler/flash/types/BUTTONCONDACTION.java index c1d039f5f..99342c399 100644 --- a/src/com/jpexs/decompiler/flash/types/BUTTONCONDACTION.java +++ b/src/com/jpexs/decompiler/flash/types/BUTTONCONDACTION.java @@ -33,7 +33,6 @@ import com.jpexs.decompiler.flash.types.annotations.SWFType; import com.jpexs.helpers.Helper; import com.jpexs.helpers.MemoryInputStream; import java.io.IOException; -import java.io.InputStream; import java.io.Serializable; import java.util.ArrayList; import java.util.List; diff --git a/src/com/jpexs/decompiler/flash/types/CLIPACTIONRECORD.java b/src/com/jpexs/decompiler/flash/types/CLIPACTIONRECORD.java index bf9765847..7abcf2099 100644 --- a/src/com/jpexs/decompiler/flash/types/CLIPACTIONRECORD.java +++ b/src/com/jpexs/decompiler/flash/types/CLIPACTIONRECORD.java @@ -32,7 +32,6 @@ import com.jpexs.decompiler.flash.types.annotations.Internal; import com.jpexs.helpers.Helper; import com.jpexs.helpers.MemoryInputStream; import java.io.IOException; -import java.io.InputStream; import java.io.Serializable; import java.util.ArrayList; import java.util.List; diff --git a/src/com/jpexs/decompiler/flash/types/FILLSTYLEARRAY.java b/src/com/jpexs/decompiler/flash/types/FILLSTYLEARRAY.java index d197068b7..1c68d5a98 100644 --- a/src/com/jpexs/decompiler/flash/types/FILLSTYLEARRAY.java +++ b/src/com/jpexs/decompiler/flash/types/FILLSTYLEARRAY.java @@ -18,7 +18,6 @@ package com.jpexs.decompiler.flash.types; import com.jpexs.decompiler.flash.tags.base.NeedsCharacters; import java.io.Serializable; -import java.util.HashSet; import java.util.Set; /** diff --git a/src/com/jpexs/decompiler/flash/types/filters/Filtering.java b/src/com/jpexs/decompiler/flash/types/filters/Filtering.java index 63db64b16..bf014e318 100644 --- a/src/com/jpexs/decompiler/flash/types/filters/Filtering.java +++ b/src/com/jpexs/decompiler/flash/types/filters/Filtering.java @@ -32,11 +32,6 @@ import java.awt.image.ConvolveOp; import java.awt.image.Kernel; import java.awt.image.Raster; import java.awt.image.WritableRaster; -import java.io.File; -import java.io.IOException; -import java.util.logging.Level; -import java.util.logging.Logger; -import javax.imageio.ImageIO; /** * diff --git a/src/com/jpexs/decompiler/flash/types/sound/AdpcmDecoder.java b/src/com/jpexs/decompiler/flash/types/sound/AdpcmDecoder.java index c2d23039e..a4cc77a0c 100644 --- a/src/com/jpexs/decompiler/flash/types/sound/AdpcmDecoder.java +++ b/src/com/jpexs/decompiler/flash/types/sound/AdpcmDecoder.java @@ -21,7 +21,6 @@ import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; import java.io.IOException; -import java.io.InputStream; import java.io.OutputStream; /** diff --git a/src/com/jpexs/decompiler/flash/types/sound/MP3Decoder.java b/src/com/jpexs/decompiler/flash/types/sound/MP3Decoder.java index 2bdaa955d..996d610d2 100644 --- a/src/com/jpexs/decompiler/flash/types/sound/MP3Decoder.java +++ b/src/com/jpexs/decompiler/flash/types/sound/MP3Decoder.java @@ -18,7 +18,6 @@ package com.jpexs.decompiler.flash.types.sound; import java.io.ByteArrayInputStream; import java.io.IOException; -import java.io.InputStream; import java.io.OutputStream; import javazoom.jl.decoder.Bitstream; import javazoom.jl.decoder.BitstreamException; diff --git a/src/com/jpexs/decompiler/flash/types/sound/MP3SOUNDDATA.java b/src/com/jpexs/decompiler/flash/types/sound/MP3SOUNDDATA.java index 998fb888a..fef368f45 100644 --- a/src/com/jpexs/decompiler/flash/types/sound/MP3SOUNDDATA.java +++ b/src/com/jpexs/decompiler/flash/types/sound/MP3SOUNDDATA.java @@ -16,11 +16,9 @@ */ package com.jpexs.decompiler.flash.types.sound; -import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import java.io.ByteArrayInputStream; import java.io.IOException; -import java.io.InputStream; import java.util.ArrayList; import java.util.List; import javazoom.jl.decoder.Bitstream; diff --git a/src/com/jpexs/decompiler/flash/types/sound/NellyMoserDecoder.java b/src/com/jpexs/decompiler/flash/types/sound/NellyMoserDecoder.java index 2c4216dcf..6f739007a 100644 --- a/src/com/jpexs/decompiler/flash/types/sound/NellyMoserDecoder.java +++ b/src/com/jpexs/decompiler/flash/types/sound/NellyMoserDecoder.java @@ -16,12 +16,8 @@ */ package com.jpexs.decompiler.flash.types.sound; -import com.jpexs.decompiler.flash.SWF; -import com.jpexs.decompiler.flash.SWFInputStream; import java.io.IOException; -import java.io.InputStream; import java.io.OutputStream; -import java.util.Arrays; import lt.dkd.nellymoser.CodecImpl; /** diff --git a/src/com/jpexs/decompiler/flash/types/sound/NoDecoder.java b/src/com/jpexs/decompiler/flash/types/sound/NoDecoder.java index ecda60986..3bc78ce10 100644 --- a/src/com/jpexs/decompiler/flash/types/sound/NoDecoder.java +++ b/src/com/jpexs/decompiler/flash/types/sound/NoDecoder.java @@ -18,7 +18,6 @@ package com.jpexs.decompiler.flash.types.sound; import java.io.IOException; -import java.io.InputStream; import java.io.OutputStream; /** diff --git a/src/com/jpexs/decompiler/flash/types/sound/SoundDecoder.java b/src/com/jpexs/decompiler/flash/types/sound/SoundDecoder.java index 16d81e990..36d1534f8 100644 --- a/src/com/jpexs/decompiler/flash/types/sound/SoundDecoder.java +++ b/src/com/jpexs/decompiler/flash/types/sound/SoundDecoder.java @@ -16,10 +16,8 @@ */ package com.jpexs.decompiler.flash.types.sound; -import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; -import java.io.InputStream; import java.io.OutputStream; /** diff --git a/src/com/jpexs/decompiler/flash/types/sound/SoundFormat.java b/src/com/jpexs/decompiler/flash/types/sound/SoundFormat.java index 36ab7f30e..680493890 100644 --- a/src/com/jpexs/decompiler/flash/types/sound/SoundFormat.java +++ b/src/com/jpexs/decompiler/flash/types/sound/SoundFormat.java @@ -17,10 +17,8 @@ package com.jpexs.decompiler.flash.types.sound; import com.jpexs.helpers.utf8.Utf8Helper; -import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; -import java.io.InputStream; import java.io.OutputStream; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioSystem; diff --git a/src/com/jpexs/decompiler/flash/xfl/XFLConverter.java b/src/com/jpexs/decompiler/flash/xfl/XFLConverter.java index d692a5f35..4d6bb209a 100644 --- a/src/com/jpexs/decompiler/flash/xfl/XFLConverter.java +++ b/src/com/jpexs/decompiler/flash/xfl/XFLConverter.java @@ -105,7 +105,6 @@ import com.jpexs.helpers.SerializableImage; import com.jpexs.helpers.utf8.Utf8Helper; import java.awt.Font; import java.awt.Point; -import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileOutputStream; diff --git a/test/com/jpexs/decompiler/flash/SWFStreamTest.java b/test/com/jpexs/decompiler/flash/SWFStreamTest.java index 0db33a5e3..3e5bc951a 100644 --- a/test/com/jpexs/decompiler/flash/SWFStreamTest.java +++ b/test/com/jpexs/decompiler/flash/SWFStreamTest.java @@ -18,7 +18,6 @@ package com.jpexs.decompiler.flash; import com.jpexs.decompiler.flash.gui.Main; import com.jpexs.decompiler.flash.types.RECT; -import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import static org.testng.Assert.assertEquals;