001 package nl.cwi.sen1.gui.plugin; 002 003 import java.util.Iterator; 004 005 import prefuse.action.layout.Layout; 006 import prefuse.data.Graph; 007 import prefuse.visual.VisualItem; 008 009 public class GraphDotLayout extends Layout { 010 public static final String CURVE_POINTS = "curve-points"; 011 012 public static final String DOT_X = "dotX"; 013 014 public static final String DOT_Y = "dotY"; 015 016 public static final String DOT_WIDTH = "dotWidth"; 017 018 public static final String DOT_HEIGHT = "dotHeight"; 019 020 public GraphDotLayout(String group) { 021 super(group); 022 } 023 024 public void run(double frac) { 025 Graph g = (Graph) m_vis.getGroup(m_group); 026 if (g != null) { 027 Iterator<?> nodeIter = g.nodes(); 028 while (nodeIter.hasNext()) { 029 VisualItem node = (VisualItem) nodeIter.next(); 030 double x = node.getInt(DOT_X); 031 double y = node.getInt(DOT_Y); 032 033 setX(node, null, x); 034 setY(node, null, y); 035 } 036 } 037 } 038 }