예제 #1
0
 public TreeNodeLook(IVisualItem vi)
     : base(vi)
 {
     _scheme     = TreeNodeVisualTableScheme.Get(vi.Table);
     _dataNode   = _scheme.GetDataGraph().GetNode(vi.Row);
     _dataScheme = TreeNodeScheme.Get(_dataNode.Table);
 }
예제 #2
0
        public TreeVisualization(List <ITree> trees, string[] keywords = null)
        {
            _trees           = trees;
            _dataNodeSchemes = trees.ConvertAll(tree => TreeNodeScheme.Get(tree.Graph.NodeTable));

            if (keywords == null)
            {
                keywords = new string[0];
            }
            _keywords = keywords;

            _vecGen = new VectorGenerator(new TokenizeConfig(TokenizerType.Standard, StopWordsFile.EN));

            _window  = new TreeWindow();
            _display = _window.TreeDisplay;
            _vis     = new Visualization(_display);

            int treeIndex = 0;

            _visNodeTables  = new List <IVisualTable>();
            _visEdgeTables  = new List <IVisualTable>();
            _visNodeSchemes = new List <TreeNodeVisualTableScheme>();
            foreach (var tree in _trees)
            {
                var visNodeTable = _vis.BuildVisualTable("VisNodeTable" + treeIndex, tree.Graph.NodeTable, _display);
                var visEdgeTable = _vis.BuildVisualTable("VisEdgeTable" + treeIndex, tree.Graph.EdgeTable, _display);

                var visNodeScheme = new TreeNodeVisualTableScheme(visNodeTable, tree.Graph, keywords);

                visEdgeTable.EnsureStyles(Styles.X1, Styles.X2, Styles.Y1, Styles.Y2, Styles.Visible, Styles.Layer);
                visEdgeTable.AddConstantColumn <IRender>(Styles.Render, new SimpleEdgeRender());

                _visNodeTables.Add(visNodeTable);
                _visEdgeTables.Add(visEdgeTable);
                _visNodeSchemes.Add(visNodeScheme);

                treeIndex++;
            }

            Show();
        }