Esempio n. 1
0
 public ApplicationDiagramPluginFactory(
     ILayoutPriorityProvider layoutPriorityProvider,
     IDiagramShapeFactory diagramShapeFactory,
     INodeLayoutAlgorithm nodeLayoutAlgorithm,
     IHostUiServices hostUiServices)
     : base(layoutPriorityProvider, diagramShapeFactory, nodeLayoutAlgorithm)
 {
     _hostUiServices = hostUiServices;
 }
Esempio n. 2
0
        public BufferingAutoLayoutDiagramPlugin(INodeLayoutAlgorithm layoutAlgorithm)
        {
            _layoutAlgorithm          = layoutAlgorithm;
            _cancellationToken        = new CancellationTokenSource();
            _diagramEventQueue        = new Queue <DiagramEventBase>();
            _diagramEventArrivedEvent = new AutoResetEvent(false);

            new Thread(() => ProcessDiagramShapeActions(_cancellationToken.Token)).Start();
        }
Esempio n. 3
0
 public DiagramPluginFactory(
     ILayoutPriorityProvider layoutPriorityProvider,
     IDiagramShapeFactory diagramShapeFactory,
     INodeLayoutAlgorithm nodeLayoutAlgorithm)
 {
     _layoutPriorityProvider = layoutPriorityProvider;
     _diagramShapeFactory    = diagramShapeFactory;
     _nodeLayoutAlgorithm    = nodeLayoutAlgorithm;
 }
Esempio n. 4
0
        private void OnLayoutChanged(Layout newValue)
        {
            if (_algorithm != null)
            {
                _algorithm.Dispose();
                _algorithm = null;
            }

            if (_isLoaded)
            {
                CreateLayoutAlgorithm(newValue);
            }
        }
Esempio n. 5
0
        /// <summary>
        ///     Creates a new solver for the given algorithm.
        /// </summary>
        /// <param name="algorithm"></param>
        public SolvingNodeLayoutAlgorithm(INodeLayoutAlgorithm algorithm)
        {
            if (algorithm == null)
            {
                throw new ArgumentNullException("algorithm");
            }

            _algorithm      = algorithm;
            _pendingActions = new ConcurrentQueue <AlgorithmAction>();
            _maxIterations  = 100000;

            _cancellationTokenSource = new CancellationTokenSource();
            _currentResult           = AlgorithmResult.Empty;
            _solver = Task.FromResult(_currentResult);
        }
Esempio n. 6
0
        private void CreateLayoutAlgorithm(Layout layout)
        {
            Layout actualLayout = layout ?? new ForceDirectedLayout();

            _algorithm = actualLayout.CreateAlgorithm();
        }
Esempio n. 7
0
 public DiagramPluginFactory(INodeLayoutAlgorithm nodeLayoutAlgorithm)
 {
     _nodeLayoutAlgorithm = nodeLayoutAlgorithm;
 }