tag tree nodes refactored, faster building of tag tree, some redundant logic (export and view in gui) simplified

This commit is contained in:
2014-11-04 18:39:48 +01:00
parent b4aeb0f80f
commit 7a8d952107
83 changed files with 1699 additions and 2244 deletions
@@ -12,32 +12,34 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. */
* License along with this library.
*/
package com.jpexs.decompiler.flash.treeitems;
import com.jpexs.decompiler.flash.SWF;
/**
*
* @author JPEXS
*/
public class AS2PackageNodeItem implements TreeItem {
public abstract class AS3ClassTreeItem implements TreeItem {
private final String name;
private final String path;
private final SWF swf;
public String packageName;
public AS2PackageNodeItem(String packageName, SWF swf) {
this.swf = swf;
this.packageName = packageName;
public AS3ClassTreeItem(String name, String path) {
this.name = name;
this.path = path;
}
@Override
public SWF getSwf() {
return swf;
public String getName() {
return name;
}
public String getPath() {
return path;
}
@Override
public String toString() {
return packageName;
return name;
}
}
@@ -1,43 +0,0 @@
/*
* Copyright (C) 2010-2014 JPEXS, All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.␍ */
package com.jpexs.decompiler.flash.treeitems;
import com.jpexs.decompiler.flash.SWF;
/**
*
* @author JPEXS
*/
public class AS3PackageNodeItem implements TreeElementItem {
private final SWF swf;
public String packageName;
public AS3PackageNodeItem(String packageName, SWF swf) {
this.swf = swf;
this.packageName = packageName;
}
@Override
public SWF getSwf() {
return swf;
}
@Override
public String toString() {
return packageName;
}
}
@@ -12,25 +12,29 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. */
* License along with this library.
*/
package com.jpexs.decompiler.flash.treeitems;
import com.jpexs.decompiler.flash.SWF;
import java.util.List;
/**
*
* @author JPEXS
*/
public class StringItem implements TreeItem {
public class FolderItem implements TreeItem {
public SWF swf;
private final String str;
private final String name;
public final List<TreeItem> subItems;
public StringItem(String str, String name, SWF swf) {
public FolderItem(String str, String name, SWF swf, List<TreeItem> subItems) {
this.swf = swf;
this.str = str;
this.name = name;
this.subItems = subItems;
}
public String getName() {
@@ -1,62 +0,0 @@
/*
* Copyright (C) 2010-2014 JPEXS, All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.
*/
package com.jpexs.decompiler.flash.treeitems;
import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.timeline.Timelined;
/**
*
* @author JPEXS
*/
public class FrameNodeItem implements TreeItem {
private final SWF swf;
private final int frame;
private final Timelined parent;
private final boolean display;
public FrameNodeItem(SWF swf, int frame, Timelined parent, boolean display) {
this.swf = swf;
this.frame = frame;
this.parent = parent;
this.display = display;
}
@Override
public SWF getSwf() {
return swf;
}
public boolean isDisplayed() {
return display;
}
@Override
public String toString() {
return "frame " + (frame + 1);
}
public int getFrame() {
return frame;
}
public Timelined getParent() {
return parent;
}
}
@@ -41,5 +41,4 @@ public class HeaderItem implements TreeItem {
public String toString() {
return name;
}
}
@@ -12,10 +12,12 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.␍ */
* License along with this library.
*/
package com.jpexs.decompiler.flash.treeitems;
import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.SWFContainerItem;
import com.jpexs.decompiler.flash.SWFSourceInfo;
import java.util.ArrayList;
import java.util.Collection;
@@ -27,7 +29,7 @@ import java.util.ListIterator;
*
* @author JPEXS
*/
public class SWFList implements List<SWF>, TreeItem {
public class SWFList implements List<SWF>, SWFContainerItem {
public String name;
public boolean isBundle;
@@ -39,6 +41,11 @@ public class SWFList implements List<SWF>, TreeItem {
throw new UnsupportedOperationException("Not supported.");
}
@Override
public String toString() {
return name;
}
@Override
public Iterator<SWF> iterator() {
return swfs.iterator();
@@ -0,0 +1,18 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.jpexs.decompiler.flash.treeitems;
import java.util.Map;
/**
*
* @author JPEXS
*/
public interface ScriptContainer {
public Map<String, TreeItem> getInnerScripts();
}
@@ -1,24 +0,0 @@
/*
* Copyright (C) 2010-2014 JPEXS, All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.␍ */
package com.jpexs.decompiler.flash.treeitems;
/**
*
* @author JPEXS
*/
public interface TreeElementItem extends TreeItem {
}
@@ -12,7 +12,8 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.␍ */
* License along with this library.
*/
package com.jpexs.decompiler.flash.treeitems;
import com.jpexs.decompiler.flash.SWF;