void OnGUI()
    {
        if (currentDiagramRoot == null) {
            string msg = GetNullDiagramRootMessage ();
            GUI.Label (new Rect (20, 20, 300, 100), msg);
            return;
        }

        //Diagram Tool
        currentDiagramTool = currentDiagramRoot.GetTool(diagramContext);

        if (currentDiagramTool == null) {
            currentDiagramTool = new DiagramDefaultTool ();
        }

        if (currentDiagramTool.OnGUI (diagramContext)) {
            //Update Anchors  position
            foreach (DiagramNode node in currentDiagramRoot.nodes) {
                foreach (DiagramEdge edge in node.edges) {
                    edge.UpdateAnchor (diagramContext);
                }
            }

            // Draw DiagramRoot and children
            currentDiagramRoot.Draw (diagramContext);

            //Draw Selected Element handles
            List<DiagramElement> elements = diagramContext.GetSelection ().GetElements ();
            foreach (DiagramElement elm in elements) {
                elm.DrawHandle (diagramContext);
            }

            //Draw Tools

        }

        //OnGUIimpl();
    }
 public DiagramToolElement(DiagramToolBar bar, Texture2D texNormal, Texture2D texActive, DiagramTool tool)
 {
     this.bar = bar;
     this.index = index;
     this.texActive = texActive;
     this.texNormal = texNormal;
     this.tool = tool;
 }
예제 #3
0
 public DiagramerPropertyEditor(Type type, IModelMemberViewItem viewItem) : base(type, viewItem)
 {
     line   = new ConnectorTool();
     select = new PointerTool();
 }
예제 #4
0
 public DiagramerPropertyEditor(Type type, IModelMemberViewItem viewItem)
     : base(type, viewItem)
 {
     line = new ConnectorTool();
     select = new PointerTool();
 }