Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #724 transporter UI #736

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ public interface IIndividualMoleculeExpressionsPresenter : IEditParameterPresent
ISimulationSubject SimulationSubject { get; set; }
void ActivateMolecule(IndividualMolecule molecule);
void SetRelativeExpression(ExpressionContainerDTO expressionContainerDTO, double value);
void RefreshView();
}

public interface IIndividualProteinExpressionsPresenter : IIndividualMoleculeExpressionsPresenter
Expand All @@ -37,7 +36,7 @@ public interface IIndividualProteinExpressionsPresenter : IIndividualMoleculeExp
}

public abstract class IndividualProteinExpressionsPresenter<TProtein, TSimulationSubject> : EditParameterPresenter<IIndividualProteinExpressionsView, IIndividualProteinExpressionsPresenter>, IIndividualProteinExpressionsPresenter
where TProtein : IndividualProtein
where TProtein : IndividualProtein
where TSimulationSubject : ISimulationSubject
{
protected readonly IMoleculeExpressionTask<TSimulationSubject> _moleculeExpressionTask;
Expand Down Expand Up @@ -89,11 +88,6 @@ public void SetRelativeExpression(ExpressionContainerDTO expressionContainerDTO,
AddCommand(_moleculeExpressionTask.SetRelativeExpressionFor(_protein, expressionContainerDTO.ContainerName, value));
}

public void RefreshView()
{
_moleculePropertiesPresenter.RefreshView();
}

private void updateLocationSelectionVisibility()
{
_view.IntracellularVascularEndoLocationVisible = (_protein.TissueLocation == TissueLocation.Intracellular);
Expand Down Expand Up @@ -148,7 +142,7 @@ protected virtual void Activate(TProtein protein)
_view.BindTo(_proteinExpressionDTO);
_moleculePropertiesPresenter.Edit(protein, SimulationSubject.DowncastTo<TSimulationSubject>());
_protein.Changed += _updateLocationVisibilityHandler;
RefreshView();
_moleculePropertiesPresenter.RefreshView();
}

private void clearReferences()
Expand All @@ -158,10 +152,5 @@ private void clearReferences()

_proteinExpressionDTO?.ClearReferences();
}

public void ClearSelection()
{
View.Clear();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ public void ActivateMolecule(IndividualMolecule molecule)
_view.HideWarning();
_view.BindTo(_transporterExpressionDTOMapper.MapFrom(_transporter));
_moleculePropertiesPresenter.Edit(molecule,SimulationSubject.DowncastTo<TSimulationSubject>());
RefreshView();
}

public void SetRelativeExpression(ExpressionContainerDTO expressionContainerDTO, double value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,7 @@ public void ShowContextMenu(ITreeNode nodeRequestingPopup, Point popupLocation)
contextMenu.Show(_view, popupLocation);
}

public bool QueryConfigurationEnabled
{
get { return _moleculeExpressionTask.CanQueryProteinExpressionsFor(_simulationSubject); }
}
public bool QueryConfigurationEnabled => _moleculeExpressionTask.CanQueryProteinExpressionsFor(_simulationSubject);

public bool EditConfigurationEnabledFor(IndividualMolecule molecule)
{
Expand Down Expand Up @@ -185,8 +182,6 @@ public void ActivateNode(ITreeNode node)
_activePresenter.OntogenyVisible = _simulationSubject.IsAgeDependent;
_activePresenter.MoleculeParametersVisible = _simulationSubject.IsAnImplementationOf<Individual>();
_activePresenter.ActivateMolecule(moleculeFrom(node));

// _activePresenter.RefreshView();
}

public void NodeDoubleClicked(ITreeNode node)
Expand Down