Graph refactoring

This commit is contained in:
Jindra Petk
2013-02-10 14:19:53 +01:00
parent 92b02e3b56
commit c8f8fbc177
11 changed files with 208 additions and 231 deletions

View File

@@ -16,8 +16,8 @@
*/
package com.jpexs.asdec.abc.gui;
import com.jpexs.asdec.abc.avm2.flowgraph.Graph;
import com.jpexs.asdec.abc.avm2.flowgraph.GraphPart;
import com.jpexs.asdec.abc.avm2.graph.AVM2Graph;
import com.jpexs.asdec.graph.GraphPart;
import com.jpexs.asdec.gui.View;
import java.awt.*;
import java.util.ArrayList;
@@ -41,9 +41,9 @@ public class GraphFrame extends JFrame {
private static final int SPACE_HORIZONTAL = 10;
private static final int BLOCK_WIDTH = 200;
private static final int BLOCK_HEIGHT = 20;
private Graph graph;
private AVM2Graph graph;
public GraphPanel(Graph graph) {
public GraphPanel(AVM2Graph graph) {
this.graph = graph;
setPreferredSize(new Dimension((BLOCK_WIDTH + SPACE_HORIZONTAL) * getPartWidth(graph.heads.get(0), new HashSet<GraphPart>()), (BLOCK_HEIGHT + SPACE_VERTICAL) * getPartHeight(graph.heads.get(0), new ArrayList<GraphPart>())));
}
@@ -121,7 +121,7 @@ public class GraphFrame extends JFrame {
}
}
public GraphFrame(Graph graph, String name) {
public GraphFrame(AVM2Graph graph, String name) {
setSize(500, 500);
Container cnt = getContentPane();
cnt.setLayout(new BorderLayout());