Exemplo n.º 1
0
        protected override void Context()
        {
            _treeNodeFactory  = A.Fake <ITreeNodeFactory>();
            _projectRetriever = A.Fake <IProjectRetriever>();
            _observedDataTask = A.Fake <IObservedDataTask>();
            sut = new ObservedDataInExplorerPresenter(_projectRetriever, _treeNodeFactory, _observedDataTask);

            _explorerPresenter       = A.Fake <IExplorerPresenter>();
            _classificationPresenter = A.Fake <IClassificationPresenter>();
            _explorerView            = A.Fake <IExplorerView>();

            A.CallTo(() => _explorerPresenter.BaseView).Returns(_explorerView);

            _rootNodeObservedDataFolder = new RootNodeType("ObservedData", ApplicationIcons.ObservedDataFolder, ClassificationType.ObservedData);
            _rootNodeIndividualFolder   = new RootNodeType("Individual", ApplicationIcons.IndividualFolder);
            _observationRootNode        = new RootNode(_rootNodeObservedDataFolder);
            _individualRootNode         = new RootNode(_rootNodeIndividualFolder);

            sut.InitializeWith(_explorerPresenter, _classificationPresenter, _rootNodeObservedDataFolder);
            _project = A.Fake <IProject>();

            A.CallTo(() => _explorerPresenter.NodeByType(_rootNodeObservedDataFolder)).Returns(_observationRootNode);
            A.CallTo(() => _explorerView.TreeView.NodeById(_rootNodeObservedDataFolder.Id)).Returns(_observationRootNode);
            A.CallTo(() => _explorerView.AddNode(A <ITreeNode> ._)).ReturnsLazily(s => s.Arguments[0].DowncastTo <ITreeNode>());
        }
			public RootNode(string text, RootNodeType type)
				:
				base(text)
			{
				RootNodeType = type;
				this.Tag = type;
			}
Exemplo n.º 3
0
 public RootNode(string text, RootNodeType type)
     :
     base(text)
 {
     RootNodeType = type;
     this.Tag     = type;
 }
        public virtual ITreeNode AddClassifiableToTree <T>(T classifiable, RootNodeType rootNodeType, Func <ITreeNode <IClassification>, T, ITreeNode> addClassifiableToTree) where T : IClassifiable
        {
            var parent     = classifiable.Parent ?? rootNodeType;
            var parentNode = NodeFor(parent).DowncastTo <ITreeNode <IClassification> >();

            return(addClassifiableToTree(parentNode, classifiable));
        }
        private RootNode createRootNode(RootNodeType rootNodeType, ClassificationType classificationType)
        {
            var node = new RootNode(rootNodeType);

            A.CallTo(() => _rootNodeTypeMapper.MapFrom(classificationType)).Returns(rootNodeType);
            A.CallTo(() => _explorerPresenter.NodeByType(rootNodeType)).Returns(node);
            return(node);
        }
        private ITreeNode <RootNodeType> setupNode(RootNodeType rootNodeType)
        {
            var nodeFolder = A.Fake <ITreeNode <RootNodeType> >();

            A.CallTo(() => _treeNodeFactory.CreateFor(rootNodeType)).Returns(nodeFolder);
            A.CallTo(() => _view.TreeView.NodeById(rootNodeType.Id)).Returns(nodeFolder);
            return(nodeFolder);
        }
        public override IContextMenu InitializeWith(RootNodeType rootNodeType, IExplorerPresenter presenter)
        {
            var sensitivityAnalysisRootNode = presenter.NodeByType(rootNodeType);

            _allMenuItems.Add(SensitivityAnalysisContextMenuItems.CreateSensitivityAnalysis());
            _allMenuItems.Add(ClassificationCommonContextMenuItems.CreateClassificationUnderMenu(sensitivityAnalysisRootNode, presenter).AsGroupStarter());
            _allMenuItems.Add(ClassificationCommonContextMenuItems.RemoveClassificationFolderMainMenu(sensitivityAnalysisRootNode, presenter));
            return(this);
        }
Exemplo n.º 8
0
        public override IContextMenu InitializeWith(RootNodeType rootNodeType, IExplorerPresenter presenter)
        {
            var parameterIdentificationRootNode = presenter.NodeByType(rootNodeType);

            _allMenuItems.Add(ParameterIdentificationContextMenuItems.CreateParameterIdentification());
            _allMenuItems.Add(ClassificationCommonContextMenuItems.CreateClassificationUnderMenu(parameterIdentificationRootNode, presenter).AsGroupStarter());
            _allMenuItems.Add(ClassificationCommonContextMenuItems.RemoveClassificationFolderMainMenu(parameterIdentificationRootNode, presenter));
            return(this);
        }
Exemplo n.º 9
0
        private void addIndividualProteins <TMolecule>(RootNodeType proteinContainerType, ApplicationIcon icon) where TMolecule : IndividualMolecule
        {
            var proteinContainerNode = _view.NodeByType(proteinContainerType);

            _simulationSubject.AllMolecules <TMolecule>()
            .Each(protein => _view.AddNode(_treeNodeFactory.CreateFor(protein)
                                           .WithIcon(icon)
                                           .Under(proteinContainerNode)));
        }
Exemplo n.º 10
0
        public override IContextMenu InitializeWith(RootNodeType rootNodeType, IExplorerPresenter presenter)
        {
            var simulationFolderNode = presenter.NodeByType(rootNodeType);

            _allMenuItems.Add(createNewSimulationMenuBarItem());
            _allMenuItems.Add(createAddExistingSimulationMenuBarItem());
            _allMenuItems.Add(ClassificationCommonContextMenuItems.CreateClassificationUnderMenu(simulationFolderNode, presenter).AsGroupStarter());
            _allMenuItems.Add(SimulationClassificationCommonContextMenuItems.RemoveSimulationFolderMainMenu(simulationFolderNode, presenter).AsGroupStarter());
            _allMenuItems.Add(deleteAllSimulationResults().AsGroupStarter());
            return(this);
        }
Exemplo n.º 11
0
        private void addPartialProcessToView(PartialProcess partialProcess, RootNodeType parentNodeType)
        {
            var partialProcessesNode = _view.NodeByType(parentNodeType);
            var moleculeNode         = _partialProcessNodeMapper.MapFrom(partialProcess);
            var existingMoleculeNode = _view.NodeById(moleculeNode.Id);

            //a node for the molecule was already added, promote the children
            if (existingMoleculeNode != null)
            {
                moleculeNode.Children.Each(existingMoleculeNode.AddChild);
            }
            else
            {
                partialProcessesNode.AddChild(moleculeNode);
            }

            //this refreshed whole process node
            _view.AddNode(partialProcessesNode);
        }
    /*
     * =================================
     * RESET
     * Called when script component
     * is reset in Editor
     * =================================
     */
    void Reset()
    {
        AttractionDistance = 10f;
        KillDistance       = .5f;
        SegmentLength      = .5f;

        EnableCanalization = true;
        MinimumRadius      = .005f;
        MaximumRadius      = .15f;
        RadiusIncrement    = .001f;
        ConstantRadius     = .01f;

        attractorsType = AttractorsType.GRID;

        GridDimensions   = new Vector3(20f, 20f, 20f);
        GridResolution   = new Vector3Int(5, 5, 5);
        GridJitterAmount = 1f;

        AttractorSphereRadius = 10f;
        AttractorSphereCount  = 1000;

        AttractorRaycastAttempts = 200000;
        attractorRaycastingType  = AttractorRaycastingType.INWARDS;
        AttractorSurfaceOffset   = .01f;
        AttractorGizmoRadius     = .05f;

        rootNodeType = RootNodeType.INPUT;
        NumRootNodes = 3;

        EnableBounds    = false;
        EnableObstacles = false;

        Obstacles = new List <GameObject>();

        IterationsToRun = 10;

        ExportFilename = "veins.obj";
    }
Exemplo n.º 13
0
 protected IndividualMoleculesContextMenuContextMenuFactory(RootNodeType rootNodeType, IMenuBarItemRepository repository)
     : base(rootNodeType, repository)
 {
 }
 public virtual RootNode NodeByType(RootNodeType rootNodeType)
 {
     return(_view.NodeByType(rootNodeType).DowncastTo <RootNode>());
 }
Exemplo n.º 15
0
 public static ITreeNode NodeByType(this IExplorerView explorerView, RootNodeType rootNodeType)
 {
     return(NodeById(explorerView, rootNodeType.Id));
 }
Exemplo n.º 16
0
 public ITreeNode <RootNodeType> CreateFor(RootNodeType rootNode) => new RootNode(rootNode);
Exemplo n.º 17
0
 public virtual IContextMenu InitializeWith(RootNodeType rootNodeType, IExplorerPresenter presenter)
 {
     return(InitializeWith(presenter));
 }
        private ITreeNode addBuildingBlockToTree <TBuildingBlock>(TBuildingBlock buildingBlock, RootNodeType buildingBlockFolderType) where TBuildingBlock : IBuildingBlock
        {
            var buildingBockFolderNode = _view.NodeByType(buildingBlockFolderType);

            return(_view.AddNode(_treeNodeFactory.CreateFor(buildingBlock)
                                 .Under(buildingBockFolderNode)));
        }
Exemplo n.º 19
0
 public RootNodeInfo(RootNodeType rootType, string uniqueId)
     : base(uniqueId)
 {
     _name = Language.strConnections;
     Type  = rootType;
 }
        public void RootNodeHasCorrectTreeNodeType(RootNodeType rootNodeType, TreeNodeType expectedTreeNodeType)
        {
            var rootNode = new RootNodeInfo(rootNodeType);

            Assert.That(rootNode.GetTreeNodeType(), Is.EqualTo(expectedTreeNodeType));
        }
Exemplo n.º 21
0
 private void addPartialProcessesToView <TPartialProcess>(RootNodeType parentNodeType) where TPartialProcess : PartialProcess
 {
     _compound.AllProcesses <TPartialProcess>().Each(p => addPartialProcessToView(p, parentNodeType));
 }
Exemplo n.º 22
0
 protected RootNodeContextMenuFactoryFor(RootNodeType rootNodeType)
 {
     _rootNodeType = rootNodeType;
 }
Exemplo n.º 23
0
 protected RootNodeContextMenuFactory(RootNodeType rootNodeType, IMenuBarItemRepository repository)
 {
     _rootNodeType = rootNodeType;
     _repository   = repository;
 }
Exemplo n.º 24
0
 public ITreeNode <RootNodeType> CreateFor(RootNodeType rootNode)
 {
     return(new RootNode(rootNode));
 }
Exemplo n.º 25
0
 public RootNodeInfo(RootNodeType rootType)
     : this(rootType, Guid.NewGuid().ToString())
 {
 }
Exemplo n.º 26
0
 public RootNodeInfo(RootNodeType rootType)
 {
     _name = Language.strConnections;
     Type  = rootType;
 }
Exemplo n.º 27
0
 protected override void Context()
 {
     base.Context();
     _rootNodeType = PKSimRootNodeTypes.IndividualFolder;
 }
Exemplo n.º 28
0
 protected CompoundProcessFolderTreeNodeContextMenuFactory(RootNodeType rootNodeType, IMenuBarItemRepository repository)
     : base(rootNodeType, repository)
 {
 }
Exemplo n.º 29
0
        private ITreeNode addBuildingBlockToTree <TBuildingBlock>(TBuildingBlock buildingBlock, RootNodeType buildingBlockFolderType, ApplicationIcon icon) where TBuildingBlock : class, IPKSimBuildingBlock
        {
            var buildingBockFolderNode = _view.NodeByType(buildingBlockFolderType);

            return(_view.AddNode(_treeNodeFactory.CreateFor(buildingBlock)
                                 .WithIcon(icon)
                                 .Under(buildingBockFolderNode)));
        }
 public void InitializeWith(IExplorerPresenter explorerPresenter, IClassificationPresenter classificationPresenter, RootNodeType observedDataFolder)
 {
     _explorerPresenter       = explorerPresenter;
     _classificationPresenter = classificationPresenter;
     _observedDataFolder      = observedDataFolder;
 }