mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-16 11:00:18 +00:00
version apha 9
AS3: Included new undocumented instructions, new Multiname kind - Typename AS3: Export PCode AS3: Implemented code for executing some instructions Many bugfixes
This commit is contained in:
80
trunk/src/com/jpexs/asdec/abc/gui/GraphTreeFrame.java
Normal file
80
trunk/src/com/jpexs/asdec/abc/gui/GraphTreeFrame.java
Normal file
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
* Copyright (C) 2010-2011 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 2
|
||||
* 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, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
package com.jpexs.asdec.abc.gui;
|
||||
|
||||
import com.jpexs.asdec.abc.avm2.flowgraph.Graph;
|
||||
import com.jpexs.asdec.abc.avm2.flowgraph.GraphPart;
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Container;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JTree;
|
||||
import javax.swing.event.TreeModelListener;
|
||||
import javax.swing.tree.TreeModel;
|
||||
import javax.swing.tree.TreePath;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class GraphTreeFrame extends JFrame {
|
||||
public JTree graphTree;
|
||||
|
||||
|
||||
|
||||
public GraphTreeFrame(final Graph graph){
|
||||
setSize(400,400);
|
||||
graphTree=new JTree(new TreeModel(){
|
||||
public Object getRoot() {
|
||||
return graph.head;
|
||||
}
|
||||
|
||||
public Object getChild(Object parent, int index) {
|
||||
return ((GraphPart)parent).nextParts.get(index);
|
||||
}
|
||||
|
||||
public int getChildCount(Object parent) {
|
||||
return ((GraphPart)parent).nextParts.size();
|
||||
}
|
||||
|
||||
public boolean isLeaf(Object node) {
|
||||
return getChildCount(node)==0;
|
||||
}
|
||||
|
||||
public void valueForPathChanged(TreePath path, Object newValue) {
|
||||
|
||||
}
|
||||
|
||||
public int getIndexOfChild(Object parent, Object child) {
|
||||
return ((GraphPart)parent).nextParts.indexOf(child);
|
||||
}
|
||||
|
||||
public void addTreeModelListener(TreeModelListener l) {
|
||||
|
||||
}
|
||||
|
||||
public void removeTreeModelListener(TreeModelListener l) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
Container cnt=getContentPane();
|
||||
cnt.setLayout(new BorderLayout());
|
||||
cnt.add(graphTree,BorderLayout.CENTER);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user