Beispiel #1
0
        public static void FillSystemMeta()
        {
            MinusZero z = MinusZero.Instance;

            IVertex mfs = z.Root.Get(@"System\Meta\Store").AddVertex(null, "FileSystem");

            mfs.AddVertex(null, "Drive");

            mfs.AddVertex(null, "File");

            mfs.AddVertex(null, "Directory");

            mfs.AddVertex(null, "Filename");

            mfs.AddVertex(null, "Extension");

            mfs.AddVertex(null, "FullFilename");

            mfs.AddVertex(null, "Size");

            mfs.AddVertex(null, "FileAttribute");

            mfs.AddVertex(null, "CreationDateTime");

            mfs.AddVertex(null, "UpdateDateTime");

            mfs.AddVertex(null, "ReadDateTime");

            mfs.AddVertex(null, "Content");
        }
Beispiel #2
0
        public CodeVisualiser()
        {
            MinusZero mz = MinusZero.Instance;

            if (mz != null && mz.IsInitialized)
            {
                Vertex = mz.CreateTempVertex();

                Vertex.Value = "CodeVisualiser" + this.GetHashCode();

                ClassVertex.AddIsClassAndAllAttributesAndAssociations(Vertex, mz.Root.Get(@"System\Meta\Visualiser\Code"));

                ClassVertex.AddIsClassAndAllAttributesAndAssociations(Vertex.Get("BaseEdge:"), mz.Root.Get(@"System\Meta\ZeroTypes\Edge"));

                SetVertexDefaultValues();

                // no dnd here
                // this.PreviewMouseLeftButtonDown += dndPreviewMouseLeftButtonDown;
                // this.PreviewMouseMove += dndPreviewMouseMove;
                //this.Drop+=dndDrop;
                // this.AllowDrop = true;

                // this.MouseEnter += dndMouseEnter;

                this.Loaded += new RoutedEventHandler(OnLoad);

                this.KeyDown += CodeVisualiser_KeyDown;

                editSetup();

                UpdateEditView();
            }
        }
Beispiel #3
0
        public void Dispose()
        {
            if (IsDisposed == false)
            {
                IsDisposed = true;
                MinusZero mz = MinusZero.Instance;

                //GraphUtil.DeleteEdgeByToVertex(mz.Root.Get(@"System\Session\Visualisers"), Vertex);

                foreach (UIElement e in DisplayedVertexesUIElements.Values)
                {
                    if (e is IDisposable)
                    {
                        ((IDisposable)e).Dispose();
                    }
                }

                PlatformClass.RemoveVertexChangeListeners(this.Vertex, new VertexChange(VertexChange));

                if (Vertex is IDisposable)
                {
                    ((IDisposable)Vertex).Dispose();
                }
            }
        }
Beispiel #4
0
        public StringVisualiser()
        {
            MinusZero mz = MinusZero.Instance;            

            if (mz != null && mz.IsInitialized)
            {                
                this.AcceptsReturn = true;

                Vertex = mz.CreateTempVertex();
                
                Vertex.Value="StringVisualiser" + this.GetHashCode();

                ClassVertex.AddIsClassAndAllAttributesAndAssociations(Vertex, mz.Root.Get(@"System\Meta\Visualiser\String"));

                ClassVertex.AddIsClassAndAllAttributesAndAssociations(Vertex.Get("BaseEdge:"), mz.Root.Get(@"System\Meta\ZeroTypes\Edge"));

                this.Loaded += new RoutedEventHandler(OnLoad);

                this.PreviewMouseLeftButtonDown += dndPreviewMouseLeftButtonDown;
                this.PreviewMouseMove += dndPreviewMouseMove;
                this.Drop += dndDrop;
                this.AllowDrop = true;

                this.MouseEnter += dndMouseEnter;
            }            
        }
Beispiel #5
0
        public FormVisualiser()
        {
            MinusZero mz = MinusZero.Instance;

            if (mz != null && mz.IsInitialized)
            {
                Vertex = mz.CreateTempVertex();

                Vertex.Value = "FormVisualiser" + this.GetHashCode();

                ClassVertex.AddIsClassAndAllAttributesAndAssociations(Vertex, mz.Root.Get(@"System\Meta\Visualiser\Form"));

                ClassVertex.AddIsClassAndAllAttributesAndAssociations(Vertex.Get("BaseEdge:"), mz.Root.Get(@"System\Meta\ZeroTypes\Edge"));

                SetVertexDefaultValues();

                this.Loaded += new RoutedEventHandler(OnLoad);

                // DO NOT WANT CONTEXTMENU HERE
                // this.ContextMenu = new m0ContextMenu(this);


                // this.Drop += dndDrop; // only drop. no drag start from here
                // this.AllowDrop = true;
            }
        }
Beispiel #6
0
        }                                  // do not want to expose those as PlatformClass.Vertex

        public WrapVisualiser()
        {
            Scale = 1.0;

            Margin = 5;

            this.Background = (Brush)FindResource("0BackgroundBrush");

            this.Orientation = Orientation.Horizontal;

            MinusZero mz = MinusZero.Instance;

            if (mz != null && mz.IsInitialized)
            {
                //Vertex = mz.Root.Get(@"System\Session\Visualisers").AddVertex(null, "WrapVisualiser" + this.GetHashCode());

                Vertex = mz.CreateTempVertex();

                Vertex.Value = "WrapVisualiser" + this.GetHashCode();

                ClassVertex.AddIsClassAndAllAttributesAndAssociations(Vertex, mz.Root.Get(@"System\Meta\Visualiser\Wrap"));

                ClassVertex.AddIsClassAndAllAttributesAndAssociations(Vertex.Get("BaseEdge:"), mz.Root.Get(@"System\Meta\ZeroTypes\Edge"));

                // DO NOT WANT CONTEXTMENU HERE
                // this.ContextMenu = new m0ContextMenu(this);
            }
        }
Beispiel #7
0
        public EdgeVisualiser()
        {
            MinusZero mz = MinusZero.Instance;

            if (mz != null && mz.IsInitialized)
            {
                Vertex = mz.CreateTempVertex();

                Vertex.Value = "EdgeVisualiser" + this.GetHashCode();

                ClassVertex.AddIsClassAndAllAttributesAndAssociations(Vertex, mz.Root.Get(@"System\Meta\Visualiser\Edge"));

                ClassVertex.AddIsClassAndAllAttributesAndAssociations(Vertex.Get("BaseEdge:"), mz.Root.Get(@"System\Meta\ZeroTypes\Edge"));

                this.Background = (Brush)FindResource("0LightGrayBrush");

                this.Loaded += new RoutedEventHandler(OnLoad);

                this.PreviewMouseLeftButtonDown += dndPreviewMouseLeftButtonDown;
                this.PreviewMouseMove           += dndPreviewMouseMove;
                this.Drop     += dndDrop;
                this.AllowDrop = true;

                this.MouseEnter += dndMouseEnter;
            }
        }
Beispiel #8
0
        public GraphVisualiser()
        {
            MinusZero mz = MinusZero.Instance;

            DisplayedVertexesUIElements = new Dictionary <IVertex, SimpleVisualiserWrapper>();

            this.Background = (Brush)FindResource("0BackgroundBrush");

            this.AllowDrop = true;

            if (mz != null && mz.IsInitialized)
            {
                //Vertex = mz.Root.Get(@"System\Session\Visualisers").AddVertex(null, "GraphVisualiser" + this.GetHashCode());

                Vertex       = mz.CreateTempVertex();
                Vertex.Value = "GraphVisualiser" + this.GetHashCode();

                ClassVertex.AddIsClassAndAllAttributesAndAssociations(Vertex, mz.Root.Get(@"System\Meta\Visualiser\Graph"));

                ClassVertex.AddIsClassAndAllAttributesAndAssociations(Vertex.Get("BaseEdge:"), mz.Root.Get(@"System\Meta\ZeroTypes\Edge"));

                SetVertexDefaultValues();

                this.ContextMenu = new m0.UIWpf.Controls.m0ContextMenu(this);

                this.PreviewMouseLeftButtonDown += dndPreviewMouseLeftButtonDown;
                this.PreviewMouseMove           += dndPreviewMouseMove;
                this.Drop       += dndDrop;
                this.MouseEnter += dndMouseEnter;
            }

            this.Loaded += new RoutedEventHandler(OnLoad);
        }
Beispiel #9
0
        private void Copy_Click(object sender, RoutedEventArgs e)
        {
            MinusZero z = MinusZero.Instance;

            if (Content.Text != "")
            {
                z.Root.Get(@"User\CurrentUser:\Queries").AddVertex(null, Content.Text);
            }
        }
Beispiel #10
0
        public static IVertex ParseAndExcute(IVertex baseVertex, IVertex inputVertex, string expressionAsString)
        {
            MinusZero z = MinusZero.Instance;

            IVertex expressionAsVertex = MinusZero.Instance.CreateTempVertex();

            z.DefaultParser.Parse(expressionAsVertex, expressionAsString);

            return(z.DefaultExecuter.Execute(baseVertex, inputVertex, expressionAsVertex));
        }
Beispiel #11
0
        protected virtual void PlatformClassInitialize()
        {
            MinusZero mz = MinusZero.Instance;

            //Vertex = mz.Root.Get(@"System\Session\Visualisers").AddVertex(null, "ListVisualiser" + this.GetHashCode());

            Vertex       = mz.CreateTempVertex();
            Vertex.Value = "ListVisualiser" + this.GetHashCode();

            ClassVertex.AddIsClassAndAllAttributesAndAssociations(Vertex, mz.Root.Get(@"System\Meta\Visualiser\List"));

            ClassVertex.AddIsClassAndAllAttributesAndAssociations(Vertex.Get("BaseEdge:"), mz.Root.Get(@"System\Meta\ZeroTypes\Edge"));
        }
Beispiel #12
0
        public Window1()
        {
            MinusZero.Instance.Initialize();

            InitializeComponent();

            MinusZero m = MinusZero.Instance;


            IVertex r = m.Root.AddVertex(null, "0");

            GeneralUtil.ParseAndExcute(r, null, "{\"meta1\"{test1{test11,test12}},meta2{test2},meta3{test3}}");



            for (int zzz = 0; zzz < 50; zzz++)
            {
                for (int x = 1; x <= 200; x++)
                {
                    IVertex rr = r.AddVertex(null, "node " + x);

                    for (int xx = 1; xx <= 10; xx++)
                    {
                        IVertex rrr = rr.AddVertex(null, "2node " + xx);

                        for (int xxx = 1; xxx <= 2; xxx++)
                        {
                            rrr.AddVertex(null, "3node " + zzz);
                        }
                        //rrr.AddVertex(GraphUtil.DeepFindOneByValue(r, "meta" + xxx), "a");
                    }
                }
            }


            FileSystemStore fss = new FileSystemStore("c:\\", m, new AccessLevelEnum[] { AccessLevelEnum.NoRestrictions });



            m.Root.AddEdge(null, fss.Root);



            IVertex w = m.Root.GetAll("\"C:\"\\File:");

            GraphUtil.ReplaceEdge(this.TreeVisualiser1.Vertex, "BaseVertex", m.Root);



            GraphUtil.ReplaceEdge(this.TreeVisualiser1.Vertex, "SelectedVertexes", w);
        }
Beispiel #13
0
        public QueryDialog(IVertex baseVertex)
        {
            InitializeComponent();

            MinusZero z = MinusZero.Instance;

            this.baseVertex = baseVertex;

            GraphUtil.ReplaceEdge(this.Queries.Vertex.Get("BaseEdge:"), "To", z.Root.Get(@"User\CurrentUser:\Queries:"));

            PlatformClass.RegisterVertexChangeListeners(Queries.Vertex, QueriesVertexChange, new string[] { "BaseEdge", "SelectedEdges" });

            this.Loaded += new RoutedEventHandler(OnLoad);
        }
Beispiel #14
0
        private void Run_Click(object sender, RoutedEventArgs e)
        {
            e.Handled = true;

            MinusZero z = MinusZero.Instance;

            GraphUtil.ReplaceEdge(this.Resoult.Vertex.Get("BaseEdge:"), "To", z.Empty);

            IVertex res = baseVertex.GetAll(Content.Text);

            if (res != null)
            {
                this.Resoult.UnselectAllSelectedEdges();

                GraphUtil.ReplaceEdge(this.Resoult.Vertex.Get("BaseEdge:"), "To", res);
            }
        }
        public SimpleTreeVisualiser()
        {
            MinusZero mz = MinusZero.Instance;

            this.BorderThickness = new Thickness(0);

            VirtualizingStackPanel.SetIsVirtualizing(this, true);
            VirtualizingStackPanel.SetVirtualizationMode(this, VirtualizationMode.Recycling);

            if (mz != null && mz.IsInitialized)
            {
                Vertex = mz.Root.Get(@"System\Session\Visualisers").AddVertex(null, "SimpleTreeVisualiser" + this.GetHashCode());

                ClassVertex.AddClassAttributes(Vertex, mz.Root.Get(@"System\Meta\Visualiser\SimpleListVisualiser"));

                PlatformClass.RegisterVertexChangeListeners(Vertex, new VertexChange(VertexChange));
            }
        }
Beispiel #16
0
        public override IVertex Execute(IVertex inputVertex, IVertex expression)
        {
            //
            MinusZero m0 = MinusZero.Instance;
            //m0.Log(2,"Execute", "\"" + expression + "\"");
            bool prevDoLog = m0.DoLog;

            m0.DoLog = false;
            //

            IVertex ret = MinusZero.Instance.DefaultExecuter.Execute(this, inputVertex, expression);

            //
            m0.DoLog = prevDoLog;
            //

            return(ret);
        }
Beispiel #17
0
        public ListVisualiser()
        {
            ThisDataGrid = new DataGrid();

            this.Children.Add(ThisDataGrid);

            AddFooter();



            ThisDataGrid.AllowDrop = true;

            ThisDataGrid.AutoGenerateColumns = false;

            ThisDataGrid.RowBackground            = (Brush)FindResource("0BackgroundBrush");
            ThisDataGrid.Background               = (Brush)FindResource("0BackgroundBrush");
            ThisDataGrid.HorizontalGridLinesBrush = (Brush)FindResource("0ForegroundBrush");
            ThisDataGrid.VerticalGridLinesBrush   = (Brush)FindResource("0ForegroundBrush");

            ThisDataGrid.HeadersVisibility = DataGridHeadersVisibility.Column;

            ThisDataGrid.SelectedValuePath = "To";
            VirtualizingStackPanel.SetIsVirtualizing(ThisDataGrid, false);
            MinusZero mz = MinusZero.Instance;

            if (mz != null && mz.IsInitialized)
            {
                PlatformClassInitialize();

                SetVertexDefaultValues();

                CreateView();

                ThisDataGrid.ContextMenu = new m0ContextMenu(this);

                ThisDataGrid.PreviewMouseLeftButtonDown += dndPreviewMouseLeftButtonDown;
                ThisDataGrid.MouseMove += dndPreviewMouseMove; // !!!!!!!!!!!!!!!!!! otherwise sliders do not work
                ThisDataGrid.Drop      += dndDrop;

                ThisDataGrid.MouseEnter += dndMouseEnter;

                ThisDataGrid.SelectionChanged += _OnSelectionChanged;
            }
        }
        public SimpleListVisualiser()
        {
            this.AutoGenerateColumns = false;
            this.BorderThickness     = new System.Windows.Thickness(0);
            this.HeadersVisibility   = DataGridHeadersVisibility.Column;
            this.GridLinesVisibility = DataGridGridLinesVisibility.None;

            AddColumns();
            this.SelectedValuePath = "To";

            MinusZero mz = MinusZero.Instance;

            if (mz != null && mz.IsInitialized)
            {
                Vertex = mz.Root.Get(@"System\Session\Visualisers").AddVertex(null, "SimpleListVisualiser" + this.GetHashCode());

                ClassVertex.AddClassAttributes(Vertex, mz.Root.Get(@"System\Meta\Visualiser\SimpleListVisualiser"));

                PlatformClass.RegisterVertexChangeListeners(Vertex, new VertexChange(VertexChange));
            }
        }
Beispiel #19
0
        public override IVertex GetAll(string query)
        {
            //
            MinusZero m0 = MinusZero.Instance;
            //m0.Log(2, "GetAll", "\"" + query + "\"");
            bool prevDoLog = m0.DoLog;

            m0.DoLog = false;
            //

            IVertex queryVertex = null;
            IVertex parseError  = null;

            if (ParseChache.ContainsKey(query))
            {
                queryVertex = ParseChache[query];
            }
            else
            {
                queryVertex = MinusZero.Instance.CreateTempVertex();

                parseError = MinusZero.Instance.DefaultParser.Parse(queryVertex, query);

                if (parseError == null)
                {
                    ParseChache.Add(query, queryVertex);
                }
            }

            //
            m0.DoLog = prevDoLog;
            //

            if (parseError != null)
            {
                return(null);
            }

            return(MinusZero.Instance.DefaultExecuter.GetAll(this, queryVertex));
        }
Beispiel #20
0
        public Window2()
        {
            InitializeComponent();


            MinusZero m = MinusZero.Instance;

            IVertex r = m.Root.AddVertex(null, "0");

            GeneralUtil.ParseAndExcute(r, null, "{\"meta1\"{test1{test11,test12}},meta2{test2},meta3{test3}}");



            for (int zzz = 0; zzz < 5; zzz++)
            {
                for (int x = 1; x <= 10; x++)
                {
                    IVertex rr = r.AddVertex(null, "node " + x);

                    for (int xx = 1; xx <= 5; xx++)
                    {
                        IVertex rrr = rr.AddVertex(null, "2node " + xx);

                        for (int xxx = 1; xxx <= 3; xxx++)
                        {
                            rrr.AddVertex(null, "3node " + zzz);
                        }
                        //rrr.AddVertex(GraphUtil.DeepFindOneByValue(r, "meta" + xxx), "a");
                    }
                }
            }

            IVertex tmp = m.GetTempVertex();

            GraphUtil.CopyEdges(r, tmp);

            GraphUtil.ReplaceEdge(this.simpleListVisualiser1.Vertex, "BaseVertex", r);

            GraphUtil.ReplaceEdge(this.simpleListVisualiser1.Vertex, "SelectedVertexes", tmp);
        }
Beispiel #21
0
        public ClassVisualiser()
        {
            MinusZero mz = MinusZero.Instance;

            if (mz != null && mz.IsInitialized)
            {
                Padding = new Thickness(3);

                Vertex = mz.CreateTempVertex();

                Vertex.Value = "ClassVisualiser" + this.GetHashCode();

                ClassVertex.AddIsClassAndAllAttributesAndAssociations(Vertex, mz.Root.Get(@"System\Meta\Visualiser\Class"));

                ClassVertex.AddIsClassAndAllAttributesAndAssociations(Vertex.Get("BaseEdge:"), mz.Root.Get(@"System\Meta\ZeroTypes\Edge"));


                this.AllowDrop = false;


                this.Loaded += new RoutedEventHandler(OnLoad);
            }
        }
Beispiel #22
0
        public TreeVisualiser()
        {
            MinusZero mz = MinusZero.Instance;

            this.Foreground = (Brush)FindResource("0ForegroundBrush");
            this.Background = (Brush)FindResource("0BackgroundBrush");

            this.BorderThickness = new Thickness(0);
            this.Padding         = new Thickness(0);
            this.AllowDrop       = true;

            // THIS REDUCES PERFORMANCE ON LARGE TREES SO commented out
            //VirtualizingStackPanel.SetIsVirtualizing(this, true);
            //VirtualizingStackPanel.SetVirtualizationMode(this, VirtualizationMode.Recycling);

            if (mz != null && mz.IsInitialized)
            {
                //Vertex = mz.Root.Get(@"System\Session\Visualisers").AddVertex(null, "TreeVisualiser" + this.GetHashCode());

                Vertex       = mz.CreateTempVertex();
                Vertex.Value = "TreeVisualiser" + this.GetHashCode();

                ClassVertex.AddIsClassAndAllAttributesAndAssociations(Vertex, mz.Root.Get(@"System\Meta\Visualiser\Tree"));

                ClassVertex.AddIsClassAndAllAttributesAndAssociations(Vertex.Get("BaseEdge:"), mz.Root.Get(@"System\Meta\ZeroTypes\Edge"));

                SetVertexDefaultValues();

                this.ContextMenu = new m0ContextMenu(this);

                this.PreviewMouseLeftButtonDown += dndPreviewMouseLeftButtonDown;
                this.PreviewMouseMove           += dndPreviewMouseMove;
                this.Drop += dndDrop;

                this.MouseEnter += dndMouseEnter;
            }
        }
Beispiel #23
0
        public void Dispose()
        {
            if (IsDisposed == false)
            {
                IsDisposed = true;
                MinusZero mz = MinusZero.Instance;

                //GraphUtil.DeleteEdgeByToVertex(mz.Root.Get(@"System\Session\Visualisers"), Vertex);

                foreach (UIElement e in Children)
                {
                    if (e is StackPanel)
                    {
                        foreach (UIElement ee in ((StackPanel)e).Children)
                        {
                            if (ee is IDisposable)
                            {
                                ((IDisposable)ee).Dispose();
                            }
                        }
                    }
                }
            }
        }
Beispiel #24
0
        public VertexVisualiser()
        {
            SetUpGrid();

            MinusZero mz = MinusZero.Instance;

            TextBlock = new TextBlock();

            Grid.SetColumn(TextBlock, 0);

            this.Children.Add(TextBlock);

            ButtonSetUp();

            if (mz != null && mz.IsInitialized)
            {
                Vertex = mz.CreateTempVertex();

                Vertex.Value = "VertexVisualiser" + this.GetHashCode();

                ClassVertex.AddIsClassAndAllAttributesAndAssociations(Vertex, mz.Root.Get(@"System\Meta\Visualiser\Vertex"));

                ClassVertex.AddIsClassAndAllAttributesAndAssociations(Vertex.Get("BaseEdge:"), mz.Root.Get(@"System\Meta\ZeroTypes\Edge"));

                TextBlock.Background = (Brush)FindResource("0LightGrayBrush");

                TextBlock.Loaded += new RoutedEventHandler(OnLoad);

                TextBlock.PreviewMouseLeftButtonDown += dndPreviewMouseLeftButtonDown;
                TextBlock.PreviewMouseMove           += dndPreviewMouseMove;
                TextBlock.Drop     += dndDrop;
                TextBlock.AllowDrop = true;

                TextBlock.MouseEnter += dndMouseEnter;
            }
        }