Beispiel #1
0
        public void highlightTree(object tree)
        {
            var t = tree as GeneticTree;

            if (t == null)
            {
                return;
            }

            var g = new BidirectionalGraph <object, IEdge <object> >();
            var l = new GraphLayout();

            addNodesToGraph(t._root, null, g);

            var slp = new GraphSharp.Algorithms.Layout.Simple.Tree.SimpleTreeLayoutParameters();

            slp.Direction = GraphSharp.Algorithms.Layout.LayoutDirection.TopToBottom;
            slp.LayerGap  = 100.0;
            slp.VertexGap = 100.0;

            l.LayoutAlgorithmType = "Tree";
            l.Graph            = g;
            l.LayoutMode       = LayoutMode.Automatic;
            l.LayoutParameters = slp;
            _mutationLayout    = l;
            OnPropertyChanged("_mutationLayout");
        }
Beispiel #2
0
        public void highlightTrees(object treePair)
        {
            var pair = treePair as TreePair;

            if (pair == null)
            {
                return;
            }

            var g = new BidirectionalGraph <object, IEdge <object> >();
            var l = new GraphLayout();

            addNodesToGraph(pair._first._root, null, g);
            addNodesToGraph(pair._second._root, null, g);

            var slp = new GraphSharp.Algorithms.Layout.Simple.Tree.SimpleTreeLayoutParameters();

            slp.Direction = GraphSharp.Algorithms.Layout.LayoutDirection.TopToBottom;
            slp.LayerGap  = 100.0;
            slp.VertexGap = 100.0;

            l.LayoutAlgorithmType = "Tree";
            l.Graph            = g;
            l.LayoutMode       = LayoutMode.Automatic;
            l.LayoutParameters = slp;
            _layout            = l;

            OnPropertyChanged("_layout");
        }
        /*********************************************************************/
        /// <summary>
        /// Konstruktor, Initialisierung der Komponenten
        /// </summary>
        public MainWindow()
        {
            InitializeComponent();
            mBusinessLogic = CBusinessLogic.getInstance();
            mBusinessLogic.init();
            mBusinessLogic.registerWindow(this);

            mTableEntryList = mBusinessLogic.getAllTableData();

            graph.DataContext = this;
            mGraph = mBusinessLogic.getGraph();
            
                
            GraphSharp.Algorithms.Layout.Simple.Tree.SimpleTreeLayoutParameters layoutParameter = new GraphSharp.Algorithms.Layout.Simple.Tree.SimpleTreeLayoutParameters();
            layoutParameter.LayerGap = 50;
            layoutParameter.VertexGap = 50;
            layoutParameter.Direction = LayoutDirection.TopToBottom;
                   
            LayoutAlgorithmType = "LinLog";
            graph.LayoutParameters = layoutParameter;
               
            DataContext = this;

            setTreeViewsEnabled(false);
            setViewVisibility(E_VIEW.E_TABLE_VIEW);
        }
        public ProcessGraph(string processHistory)
        {
            vm = new MainWindowViewModel(processHistory);
            GraphSharp.Algorithms.Layout.Simple.Tree.SimpleTreeLayoutParameters dds =
                new GraphSharp.Algorithms.Layout.Simple.Tree.SimpleTreeLayoutParameters();

            this.DataContext = vm;

            InitializeComponent();
        }
        private void setProperties()
        {
            var g = new BidirectionalGraph <object, IEdge <object> >();
            var l = new GraphLayout();

            addNodesToGraph(_tree._root, null, g);


            var slp = new GraphSharp.Algorithms.Layout.Simple.Tree.SimpleTreeLayoutParameters();

            slp.Direction         = GraphSharp.Algorithms.Layout.LayoutDirection.TopToBottom;
            slp.LayerGap          = 100.0;
            slp.VertexGap         = 100.0;
            l.LayoutAlgorithmType = "Tree";
            l.Graph            = g;
            l.LayoutMode       = LayoutMode.Automatic;
            l.LayoutParameters = slp;
            _layout            = l;


            _promotionSquare  = -1;
            _pickerVisibility = Visibility.Hidden;
            COLORS            = new string[] { "White", "Black" };
            DEPTHS            = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
            _board            = new Board(Board.DEFAULT_POSITION);
            _playerColor      = COLORS[0];
            _color            = true;
            playerMove        = true;
            OnPropertyChanged("_playerColor");
            _pieces  = new PieceIndex[Board.BOARD_EDGE * Board.BOARD_EDGE];
            _buttons = new SquareTypeIndex[Board.BOARD_EDGE * Board.BOARD_EDGE];

            colorChanged = new RelayCommand(x => changeColor(), x => true);
            clickEmpty   = new RelayCommand(x => resetChessboardButtons(), x => true);
            clickAllied  = new RelayCommand(x => highlightTargetSquares(x), x => true);
            clickCurrent = new RelayCommand(x => resetChessboardButtons(), x => true);
            clickTarget  = new RelayCommand(x => moveToTargetSquare(x), x => true);

            promoteQueen  = new RelayCommand(x => promoteQ(), x => true);
            promoteRook   = new RelayCommand(x => promoteR(), x => true);
            promoteBishop = new RelayCommand(x => promoteB(), x => true);
            promoteKnight = new RelayCommand(x => promoteN(), x => true);

            for (int i = 0; i < _pieces.Length; i++)
            {
                _pieces[i]  = new PieceIndex(_board._indices[i], (byte)i);
                _buttons[i] = new SquareTypeIndex(0, (byte)i);
            }
            resetChessboardButtons();
        }
Beispiel #6
0
 public App()
 {
     algs = new GraphSharp.Algorithms.Layout.Simple.Tree.SimpleTreeLayoutParameters();
 }