Esempio n. 1
0
        public m0ContextMenu(IPlatformClass pc)
        {
            root = MinusZero.Instance.Root;

            PlatformClass = pc;

            AddOpen();

            AddSeparator();

            AddOpenTop();

            AddSeparator();

            AddOpenVisualiserItems();

            AddSeparator();

            AddNewDiagram();

            AddSeparator();

            AddNew();

            AddSeparator();

            AddZeroMenuItems();

            AddSeparator();

            AddCutCopyPasteItems();

            this.Opened += m0ContextMenu_Opened;
        }
        public override void VertexSetedUp()
        {
            if (Vertex.Get("VisualiserClass:") != null)
            {
                ContentVisualiser = PlatformClass.CreatePlatformObject(Vertex.Get("VisualiserClass:"));

                GraphUtil.ReplaceEdge(ContentVisualiser.Vertex, "BaseEdge", Vertex.Get("BaseEdge:"));

                Grid.SetRow((UIElement)ContentVisualiser, 2);

                TheGrid.Children.Add((UIElement)ContentVisualiser);
            }
            else
            {
                InternalFrame.BorderThickness = new Thickness(0);
                ContentVisualiser             = null;
            }

            //VisualiserUpdate(); done in base.VertexSetedUp();

            if (Vertex.Get("VisualiserVertex:") != null && ContentVisualiser != null)
            {
                Diagram.AddEdgesFromDefintion(ContentVisualiser.Vertex, Vertex.Get("VisualiserVertex:"));
            }

            base.VertexSetedUp();
        }
        public void SetContent(IPlatformClass pc)
        {
            Content = pc;

            FrameworkElement fe = (FrameworkElement)pc;

            if (fe is IOwnScrolling)
            {
                this.ParentCont.Children.Add(fe);
            }
            else
            {
                this.Cont.Content = fe;
            }

            DockPanel.SetDock(fe, Dock.Bottom);

            WrapVisualiser w = new WrapVisualiser();

            w.Scale = 0.6;

            GraphUtil.ReplaceEdge(w.Vertex.Get("BaseEdge:"), "To", pc.Vertex);

            this.expander.Content = w;
        }
Esempio n. 4
0
        public static IVertex OpenVisualiserSelectedBase(IVertex baseVertex, IVertex inputVertex)
        {
            IPlatformClass pc = (IPlatformClass)PlatformClass.CreatePlatformObject(inputVertex.Get("VisualiserClass:"));

            GraphUtil.ReplaceEdge(pc.Vertex.Get("BaseEdge:"), "Meta", baseVertex.Get("Meta:"));

            GraphUtil.ReplaceEdge(pc.Vertex.Get("BaseEdge:"), "To", baseVertex.Get("To:"));

            IVertex synchronisedVisualiser = inputVertex.Get("SynchronisedVisualiser:");

            BaseSelectedSynchronisedHelper helper = new BaseSelectedSynchronisedHelper(pc.Vertex, synchronisedVisualiser);

            PlatformClass.RegisterVertexChangeListeners(synchronisedVisualiser, new VertexChange(helper.SynchronisedVisualiserChange), new string[] { "BaseEdge", "SelectedEdges" });

            IVertex firstSelectedVertex = synchronisedVisualiser.Get(@"SelectedEdges:\");

            if (firstSelectedVertex != null)
            {
                GraphUtil.ReplaceEdge(pc.Vertex, "BaseEdge", firstSelectedVertex);
            }

            MinusZero.Instance.DefaultShow.ShowContent(pc);

            return(null);
        }
Esempio n. 5
0
        protected LayoutAnchorable _ShowContent(object obj)
        {
            LayoutAnchorable a = new LayoutAnchorable();

            if (obj is IPlatformClass)
            {
                IPlatformClass pc = (IPlatformClass)obj;

                if (pc.Vertex.Get(@"BaseEdge:\To:") != null && pc.Vertex.Get(@"BaseEdge:\To:").Value != null && (!GeneralUtil.CompareStrings(pc.Vertex.Get(@"BaseEdge:\To:").Value, "")))
                {
                    a.Title = pc.Vertex.Get(@"BaseEdge:\To:").Value.ToString();
                }
                else
                {
                    a.Title = (string)pc.Vertex.Value;
                }

                PlatformClassSimpleWrapper pcsw = new PlatformClassSimpleWrapper();

                pcsw.SetContent(pc);

                a.Content = pcsw;

                a.IsVisibleChanged += pcsw.HideEventHandler;

                //a.Closing +=pcsw.ClosedEventHandler;
                a.Closed += pcsw.ClosedEventHandler;

                // not work - to focus
                //System.Windows.Input.Keyboard.Focus((IInputElement)pc);

                this.Pane.Children.Add(a);

                pcsw.IsIntialising = true;

                a.Hide(); // this works
                a.Show(); // for getting focus

                pcsw.IsIntialising = false;
            }
            else
            {
                a.Title   = obj.ToString();
                a.Content = obj;

                this.Pane.Children.Add(a);

                a.Hide(); // this works
                a.Show(); // for getting focus
            }

            //a.AddToLayout(this.dockingManager, AnchorableShowStrategy.Most);
            // maybe for later use

            return(a);
        }
Esempio n. 6
0
        public static IVertex OpenMetaVisualiser(IVertex baseVertex, IVertex inputVertex)
        {
            IPlatformClass sv = (IPlatformClass)PlatformClass.CreatePlatformObject(inputVertex);

            GraphUtil.ReplaceEdge(sv.Vertex.Get("BaseEdge:"), "To", baseVertex.Get("Meta:"));

            MinusZero.Instance.DefaultShow.ShowContent(sv);

            return(null);
        }
Esempio n. 7
0
        public static IVertex OpenDiagram(IVertex baseVertex, IVertex inputVertex)
        {
            IPlatformClass sv = (IPlatformClass)PlatformClass.CreatePlatformObject(baseVertex.Get("To:"));

            //GraphUtil.ReplaceEdge(sv.Vertex, "BaseEdge", baseVertex);

            MinusZero.Instance.DefaultShow.ShowContent(sv);

            return(null);
        }
Esempio n. 8
0
        public static IVertex OpenVisualiser(IVertex baseVertex, IVertex inputVertex)
        {
            IPlatformClass sv = (IPlatformClass)PlatformClass.CreatePlatformObject(inputVertex);

            //GraphUtil.ReplaceEdge(sv.Vertex, "BaseEdge", baseVertex); very wrong, will not work with GraphVisualiser becouse of changing its BaseEdge
            Edge.CopyAndReplaceEdge(sv.Vertex, "BaseEdge", baseVertex);

            MinusZero.Instance.DefaultShow.ShowContent(sv);

            return(null);
        }
Esempio n. 9
0
        public static IVertex OpenVisualiserSelectedSelected(IVertex baseVertex, IVertex inputVertex)
        {
            IPlatformClass pc = (IPlatformClass)PlatformClass.CreatePlatformObject(inputVertex.Get("VisualiserClass:"));

            GraphUtil.ReplaceEdge(pc.Vertex, "BaseEdge", baseVertex);

            GraphUtil.ReplaceEdge(pc.Vertex, "SelectedEdges", inputVertex.Get(@"SynchronisedVisualiser:\SelectedEdges:"));

            MinusZero.Instance.DefaultShow.ShowContent(pc);

            return(null);
        }
Esempio n. 10
0
        public static IVertex OpenVisualiserFloating(IVertex baseVertex, IVertex inputVertex)
        {
            IPlatformClass pc = (IPlatformClass)PlatformClass.CreatePlatformObject(inputVertex);

            //GraphUtil.ReplaceEdge(pc.Vertex, "BaseEdge", baseVertex);

            Edge.CopyAndReplaceEdge(pc.Vertex, "BaseEdge", baseVertex);

            MinusZero.Instance.DefaultShow.ShowContentFloating(pc);

            return(null);
        }
Esempio n. 11
0
        public static IPlatformClass CreatePlatformObject(IVertex Vertex)
        {
            if (Vertex.Get("$Is:Class") != null)
            {
                String classname = (string)Vertex.Get("$PlatformClassName:").Value;

                return((IPlatformClass)Activator.CreateInstance(Type.GetType(classname), null));
            }
            else
            {
                String classname = (string)Vertex.Get(@"$Is:{$Inherits:$PlatformClass}\$PlatformClassName:").Value;

                IPlatformClass pc = (IPlatformClass)Activator.CreateInstance(Type.GetType(classname), null);

                pc.Vertex = Vertex;

                return(pc);
            }
        }
Esempio n. 12
0
        void OnCopy(object sender, System.Windows.RoutedEventArgs e)
        {
            BaseCommands.Copy(this.Edge, PlatformClass.Vertex);

            FromCopyPlatformClass = PlatformClass;
        }