public IMView(Graph <T, P> graph, IViewParent <T, P> parent) { this.graph = graph; this.parent = parent; entityDrawerBounds = new Dictionary <T, Rect>(); edgeMarkerBounds = new Dictionary <Relation <T, P>, Rect>(); entitySelection = new HashSet <T>(); dragEdgeSource = new HashSet <T>(); // draw the targets last drawOrdered = new LinkedList <T>(graph.Vertices); foreach (var target in graph.Vertices.Where(parent.IsSeed)) { drawOrdered.Remove(target); drawOrdered.AddLast(target); } // initialize the drawers tagDrawer = new BasicRelationDrawer <T, P>(); entityWidgetType = (EntityWidgetType)GUIUtil.GetPrefsInt(PrefsKeyLayout, (int)defaultWidgetType); InitEntityWidget(); // make the graph fill the view transform = GetOptimalTransform(); }
public void OnToolbarGUI() { EditorGUI.BeginChangeCheck(); entityWidgetType = (EntityWidgetType)GUIUtil.EnumToolbar("", entityWidgetType, EditorStyles.miniButton); if (EditorGUI.EndChangeCheck()) { GUIUtil.SetPrefsInt(PrefsKeyLayout, (int)entityWidgetType); // init entity widget and edge placement provider InitEntityWidget(); parent.RepaintView(); } }