mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-12 12:48:07 +00:00
organize imports, javadoc
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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<ABCContainerTag> 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<String>(), 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<String>(), false);
|
||||
}
|
||||
}
|
||||
try {
|
||||
((TraitSlotConst) traits.traits.get(traitIndex)).convertHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, nulWriter, new ArrayList<String>(), 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<String>(), 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<String>(), false);
|
||||
}
|
||||
}
|
||||
try {
|
||||
((TraitSlotConst) traits.traits.get(traitIndex)).toStringHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, writer, new ArrayList<String>(), 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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<ABCContainerTag> 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<String>(), 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<String>(), false);
|
||||
}
|
||||
}
|
||||
try {
|
||||
((TraitSlotConst) traits.traits.get(traitIndex)).convertHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, nulWriter, new ArrayList<String>(), 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<String>(), 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<String>(), false);
|
||||
}
|
||||
}
|
||||
try {
|
||||
((TraitSlotConst) traits.traits.get(traitIndex)).toStringHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, writer, new ArrayList<String>(), false);
|
||||
} catch (InterruptedException ex) {
|
||||
//ignore
|
||||
}
|
||||
return writer.toString();
|
||||
}
|
||||
|
||||
public int getTraitIndex() {
|
||||
return traitIndex;
|
||||
}
|
||||
|
||||
public boolean isStatic() {
|
||||
return isStatic;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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<JRibbonApplicationMenuButton> 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<JRibbonApplicationMenuButton> 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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<JRibbonApplicationMenuButton> 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<JRibbonApplicationMenuButton> 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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
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<JTextComponent> target;
|
||||
private WeakReference<DocumentSearchData> 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<DocumentSearchData>(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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
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<JTextComponent> target;
|
||||
private WeakReference<DocumentSearchData> 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<DocumentSearchData>(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();
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
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<E> extends AppDialog implements ActionListener{
|
||||
private final JList<E> resultsList;
|
||||
private final DefaultListModel<E> model;
|
||||
private final SearchListener<E> 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<E> 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<E> 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
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 <E>
|
||||
*/
|
||||
public class SearchResultsDialog<E> extends AppDialog implements ActionListener{
|
||||
private final JList<E> resultsList;
|
||||
private final DefaultListModel<E> model;
|
||||
private final SearchListener<E> 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<E> 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<E> 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());
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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<ABCPanelSearchResult>, Freed {
|
||||
|
||||
|
||||
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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<ABCContainerTag> abcTags, ABC abc, int multinameIndex, ABCPanel abcPanel, boolean definitions) {
|
||||
super(abcPanel.getMainPanel().getMainFrame().getWindow());
|
||||
this.abcPanel = abcPanel;
|
||||
List<MultinameUsage> 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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<ABCContainerTag> abcTags, ABC abc, int multinameIndex, ABCPanel abcPanel, boolean definitions) {
|
||||
super(abcPanel.getMainPanel().getMainFrame().getWindow());
|
||||
this.abcPanel = abcPanel;
|
||||
List<MultinameUsage> 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) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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<Object> {
|
||||
|
||||
@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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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<Object> {
|
||||
|
||||
@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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,6 +85,7 @@ public class CSMTextSettingsTag extends Tag {
|
||||
*
|
||||
* @param swf
|
||||
* @param headerData
|
||||
* @param length
|
||||
* @param data Data bytes
|
||||
* @param pos
|
||||
* @throws IOException
|
||||
|
||||
@@ -58,6 +58,7 @@ public class DebugIDTag extends Tag {
|
||||
*
|
||||
* @param swf
|
||||
* @param headerData
|
||||
* @param length
|
||||
* @param data Data bytes
|
||||
* @param pos
|
||||
* @throws IOException
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -60,6 +60,7 @@ public class DefineButtonCxformTag extends Tag {
|
||||
*
|
||||
* @param swf
|
||||
* @param headerData
|
||||
* @param length
|
||||
* @param data Data bytes
|
||||
* @param pos
|
||||
* @throws IOException
|
||||
|
||||
@@ -100,6 +100,7 @@ public class DefineButtonSoundTag extends CharacterIdTag {
|
||||
*
|
||||
* @param swf
|
||||
* @param headerData
|
||||
* @param length
|
||||
* @param data Data bytes
|
||||
* @param pos
|
||||
* @throws IOException
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -696,6 +696,7 @@ public class DefineEditTextTag extends TextTag {
|
||||
*
|
||||
* @param swf
|
||||
* @param headerData
|
||||
* @param length
|
||||
* @param data Data bytes
|
||||
* @param pos
|
||||
* @throws IOException
|
||||
|
||||
@@ -193,6 +193,7 @@ public class DefineFont2Tag extends FontTag {
|
||||
*
|
||||
* @param swf
|
||||
* @param headerData
|
||||
* @param length
|
||||
* @param data Data bytes
|
||||
* @param pos
|
||||
* @throws IOException
|
||||
|
||||
@@ -89,6 +89,7 @@ public class DefineFontInfo2Tag extends Tag {
|
||||
*
|
||||
* @param swf
|
||||
* @param headerData
|
||||
* @param length
|
||||
* @param data Data bytes
|
||||
* @param pos
|
||||
* @throws IOException
|
||||
|
||||
@@ -90,6 +90,7 @@ public class DefineFontInfoTag extends Tag {
|
||||
*
|
||||
* @param swf
|
||||
* @param headerData
|
||||
* @param length
|
||||
* @param data Data bytes
|
||||
* @param pos
|
||||
* @throws IOException
|
||||
|
||||
@@ -137,6 +137,7 @@ public class DefineFontTag extends FontTag {
|
||||
*
|
||||
* @param swf
|
||||
* @param headerData
|
||||
* @param length
|
||||
* @param data Data bytes
|
||||
* @param pos
|
||||
* @throws IOException
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -79,6 +79,7 @@ public class DefineSceneAndFrameLabelDataTag extends Tag {
|
||||
*
|
||||
* @param swf
|
||||
* @param headerData
|
||||
* @param length
|
||||
* @param data Data bytes
|
||||
* @param pos
|
||||
* @throws IOException
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -461,6 +461,7 @@ public class DefineText2Tag extends TextTag {
|
||||
*
|
||||
* @param swf
|
||||
* @param headerData
|
||||
* @param length
|
||||
* @param data Data bytes
|
||||
* @param pos
|
||||
* @throws IOException
|
||||
|
||||
@@ -472,6 +472,7 @@ public class DefineTextTag extends TextTag {
|
||||
*
|
||||
* @param swf
|
||||
* @param headerData
|
||||
* @param length
|
||||
* @param data Data bytes
|
||||
* @param pos
|
||||
* @throws IOException
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -65,6 +65,7 @@ public class EnableDebugger2Tag extends Tag {
|
||||
*
|
||||
* @param swf
|
||||
* @param headerData
|
||||
* @param length
|
||||
* @param data Data bytes
|
||||
* @param pos
|
||||
* @throws IOException
|
||||
|
||||
@@ -59,6 +59,7 @@ public class EnableDebuggerTag extends Tag {
|
||||
*
|
||||
* @param swf
|
||||
* @param headerData
|
||||
* @param length
|
||||
* @param data Data bytes
|
||||
* @param pos
|
||||
* @throws IOException
|
||||
|
||||
@@ -68,6 +68,7 @@ public class EnableTelemetryTag extends Tag {
|
||||
*
|
||||
* @param swf
|
||||
* @param headerData
|
||||
* @param length
|
||||
* @param data Data bytes
|
||||
* @param pos
|
||||
* @throws IOException
|
||||
|
||||
@@ -42,6 +42,7 @@ public class EndTag extends Tag {
|
||||
*
|
||||
* @param swf
|
||||
* @param headerData
|
||||
* @param length
|
||||
* @param data Data bytes
|
||||
* @param pos
|
||||
* @throws IOException
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -59,6 +59,7 @@ public class ProtectTag extends Tag {
|
||||
*
|
||||
* @param swf
|
||||
* @param headerData
|
||||
* @param length
|
||||
* @param data Data bytes
|
||||
* @param pos
|
||||
* @throws IOException
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -66,6 +66,7 @@ public class SetTabIndexTag extends Tag {
|
||||
*
|
||||
* @param swf
|
||||
* @param headerData
|
||||
* @param length
|
||||
* @param data Data bytes
|
||||
* @param pos
|
||||
* @throws IOException
|
||||
|
||||
@@ -52,6 +52,7 @@ public class ShowFrameTag extends Tag {
|
||||
*
|
||||
* @param swf
|
||||
* @param headerData
|
||||
* @param length
|
||||
* @param pos
|
||||
* @param data
|
||||
*/
|
||||
|
||||
@@ -37,6 +37,7 @@ public class SoundStreamBlockTag extends Tag {
|
||||
*
|
||||
* @param swf
|
||||
* @param headerData
|
||||
* @param length
|
||||
* @param data Data bytes
|
||||
* @param pos
|
||||
* @throws IOException
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -56,6 +56,7 @@ public class StartSound2Tag extends Tag {
|
||||
*
|
||||
* @param swf
|
||||
* @param headerData
|
||||
* @param length
|
||||
* @param data Data bytes
|
||||
* @param pos
|
||||
* @throws IOException
|
||||
|
||||
@@ -60,6 +60,7 @@ public class StartSoundTag extends Tag {
|
||||
*
|
||||
* @param swf
|
||||
* @param headerData
|
||||
* @param length
|
||||
* @param data Data bytes
|
||||
* @param pos
|
||||
* @throws IOException
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
package com.jpexs.decompiler.flash.tags.base;
|
||||
|
||||
import com.jpexs.decompiler.flash.SWF;
|
||||
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -66,6 +66,7 @@ public class DefineExternalGradient extends Tag {
|
||||
*
|
||||
* @param swf
|
||||
* @param headerData
|
||||
* @param length
|
||||
* @param data Data bytes
|
||||
* @param pos
|
||||
* @throws IOException
|
||||
|
||||
@@ -68,6 +68,7 @@ public class DefineExternalImage extends Tag {
|
||||
*
|
||||
* @param swf
|
||||
* @param headerData
|
||||
* @param length
|
||||
* @param data Data bytes
|
||||
* @param pos
|
||||
* @throws IOException
|
||||
|
||||
@@ -76,6 +76,7 @@ public class DefineExternalImage2 extends Tag {
|
||||
*
|
||||
* @param swf
|
||||
* @param headerData
|
||||
* @param length
|
||||
* @param data Data bytes
|
||||
* @param pos
|
||||
* @throws IOException
|
||||
|
||||
@@ -76,6 +76,7 @@ public class DefineExternalSound extends Tag {
|
||||
*
|
||||
* @param swf
|
||||
* @param headerData
|
||||
* @param length
|
||||
* @param data Data bytes
|
||||
* @param pos
|
||||
* @throws IOException
|
||||
|
||||
@@ -74,6 +74,7 @@ public class DefineExternalStreamSound extends Tag {
|
||||
*
|
||||
* @param swf
|
||||
* @param headerData
|
||||
* @param length
|
||||
* @param data Data bytes
|
||||
* @param pos
|
||||
* @throws IOException
|
||||
|
||||
@@ -58,6 +58,7 @@ public class DefineGradientMap extends Tag {
|
||||
*
|
||||
* @param swf
|
||||
* @param headerData
|
||||
* @param length
|
||||
* @param data Data bytes
|
||||
* @param pos
|
||||
* @throws IOException
|
||||
|
||||
@@ -65,6 +65,7 @@ public class DefineSubImage extends Tag {
|
||||
*
|
||||
* @param swf
|
||||
* @param headerData
|
||||
* @param length
|
||||
* @param data Data bytes
|
||||
* @param pos
|
||||
* @throws IOException
|
||||
|
||||
@@ -84,6 +84,7 @@ public class ExporterInfoTag extends Tag {
|
||||
*
|
||||
* @param swf
|
||||
* @param headerData
|
||||
* @param length
|
||||
* @param data Data bytes
|
||||
* @param pos
|
||||
* @throws IOException
|
||||
|
||||
@@ -86,6 +86,7 @@ public class FontTextureInfo extends Tag {
|
||||
*
|
||||
* @param swf
|
||||
* @param headerData
|
||||
* @param length
|
||||
* @param data Data bytes
|
||||
* @param pos
|
||||
* @throws IOException
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
package com.jpexs.decompiler.flash.types.sound;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user