use of cbit.vcell.client.desktop.biomodel.DocumentEditorTreeModel.DocumentEditorTreeFolderClass in project vcell by virtualcell.
the class MathModelEditor method setRightTopPanel.
private void setRightTopPanel(Object selectedObject) {
JComponent newTopPanel = emptyPanel;
int dividerLocation = rightSplitPane.getDividerLocation();
if (selectedObject == mathModel) {
newTopPanel = mathModelPropertiesPanel;
mathModelPropertiesPanel.setMathModel(mathModel);
} else if (selectedObject instanceof DocumentEditorTreeFolderNode) {
DocumentEditorTreeFolderNode folderNode = (DocumentEditorTreeFolderNode) selectedObject;
DocumentEditorTreeFolderClass folderClass = folderNode.getFolderClass();
if (folderClass == DocumentEditorTreeFolderClass.MATH_ANNOTATION_NODE) {
newTopPanel = mathModelPropertiesPanel;
} else if (folderClass == DocumentEditorTreeFolderClass.MATH_VCML_NODE) {
newTopPanel = vcmlEditorPanel;
} else if (folderClass == DocumentEditorTreeFolderClass.MATH_GEOMETRY_NODE) {
newTopPanel = geometryViewer;
} else if (folderClass == DocumentEditorTreeFolderClass.MATH_SIMULATIONS_NODE) {
newTopPanel = simulationListPanel;
} else if (folderClass == DocumentEditorTreeFolderClass.MATH_OUTPUT_FUNCTIONS_NODE) {
newTopPanel = outputFunctionsPanel;
outputFunctionsPanel.setSimulationWorkspace(mathModelWindowManager.getSimulationWorkspace());
}
}
Component rightTopComponent = rightSplitPane.getTopComponent();
if (rightTopComponent != newTopPanel) {
newTopPanel.setBorder(GuiConstants.TAB_PANEL_BORDER);
rightSplitPane.setTopComponent(newTopPanel);
}
rightSplitPane.setDividerLocation(dividerLocation);
}
use of cbit.vcell.client.desktop.biomodel.DocumentEditorTreeModel.DocumentEditorTreeFolderClass in project vcell by virtualcell.
the class MathModelEditorTreeCellRenderer method getTreeCellRendererComponent.
// public void setMathModel(MathModel mm) {
// mathModel = mm;
// }
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) {
super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus);
if (regularFont == null) {
regularFont = getFont();
boldFont = regularFont.deriveFont(Font.BOLD);
}
Font font = regularFont;
Icon icon = null;
String labelText = null;
String toolTipPrefix = "";
String toolTipSuffix = "";
if (value instanceof BioModelNode) {
BioModelNode node = (BioModelNode) value;
if (node.getChildCount() > 0) {
icon = getIcon();
}
Object userObj = node.getUserObject();
if (userObj instanceof MathModel) {
font = boldFont;
icon = VCellIcons.documentIcon;
labelText = ((MathModel) userObj).getName();
toolTipPrefix = "MathModel: ";
} else if (userObj instanceof DocumentEditorTreeFolderNode) {
// --- 1st level folders
DocumentEditorTreeFolderNode folder = (DocumentEditorTreeFolderNode) userObj;
labelText = folder.getName();
if (folder.isBold()) {
font = boldFont;
}
DocumentEditorTreeFolderClass folderClass = folder.getFolderClass();
switch(folderClass) {
case MATH_VCML_NODE:
icon = VCellIcons.textNotesIcon;
break;
case MATH_GEOMETRY_NODE:
icon = VCellIcons.geometryIcon;
break;
case MATH_SIMULATIONS_NODE:
icon = VCellIcons.simulationIcon;
break;
case MATH_OUTPUT_FUNCTIONS_NODE:
icon = VCellIcons.getOutputFunctionIcon();
break;
}
}
}
setIcon(icon);
setFont(font);
setText(labelText);
if (toolTipSuffix.length() == 0) {
toolTipSuffix = labelText;
}
setToolTipText(toolTipPrefix + toolTipSuffix);
return this;
}
use of cbit.vcell.client.desktop.biomodel.DocumentEditorTreeModel.DocumentEditorTreeFolderClass in project vcell by virtualcell.
the class BioModelEditor method setRightBottomPanelOnSelection.
@Override
protected void setRightBottomPanelOnSelection(Object[] selections) {
if (selections == null) {
return;
}
// TODO: here
JComponent bottomComponent = rightBottomEmptyPanel;
JComponent annotationComponent = rightBottomEmptyAnnotationsPanel;
// properties panel
int destComponentIndex = DocumentEditorTabID.object_properties.ordinal();
// annotations panel
int annComponentIndex = DocumentEditorTabID.annotations.ordinal();
boolean bShowInDatabaseProperties = false;
boolean bShowPathway = false;
if (selections.length == 1) {
annotationComponent = getAnnotationsPanel();
Object singleSelection = selections[0];
if (singleSelection instanceof ReactionStep) {
bottomComponent = getReactionPropertiesPanel();
} else if (singleSelection instanceof ReactionRule) {
bottomComponent = getReactionRulePropertiesPanel();
} else if (singleSelection instanceof SpeciesContext) {
bottomComponent = getSpeciesPropertiesPanel();
} else if (singleSelection instanceof MolecularType) {
bottomComponent = getMolecularTypePropertiesPanel();
} else if (singleSelection instanceof RbmObservable) {
bottomComponent = getObservablePropertiesPanel();
} else if (singleSelection instanceof Structure) {
bottomComponent = getStructurePropertiesPanel();
getStructurePropertiesPanel().setModel(bioModel.getModel());
} else if (singleSelection instanceof Parameter) {
bottomComponent = getParameterPropertiesPanel();
} else if (singleSelection instanceof SimulationContext) {
bottomComponent = getApplicationPropertiesPanel();
} else if (singleSelection instanceof ParameterEstimationTask) {
bottomComponent = parameterEstimationTaskPropertiesPanel;
} else if (singleSelection instanceof Product || singleSelection instanceof Reactant) {
bottomComponent = getReactionParticipantPropertiesPanel();
} else if (singleSelection instanceof BioModelNode.PublicationInfoNode) {
bShowInDatabaseProperties = true;
bottomComponent = bioModelMetaDataPanel;
} else if (singleSelection instanceof BioModelInfo) {
bShowInDatabaseProperties = true;
bottomComponent = bioModelMetaDataPanel;
} else if (singleSelection instanceof MathModelInfo) {
bShowInDatabaseProperties = true;
bottomComponent = mathModelMetaDataPanel;
} else if (singleSelection instanceof GeometryInfo) {
bShowInDatabaseProperties = true;
bottomComponent = geometryMetaDataPanel;
} else if (singleSelection instanceof SpeciesContextSpec) {
bottomComponent = getSpeciesContextSpecPanel();
} else if (singleSelection instanceof ReactionSpec) {
bottomComponent = getKineticsTypeTemplatePanel();
} else if (singleSelection instanceof ReactionRuleSpec) {
//
bottomComponent = getReactionRuleSpecPropertiesPanel();
} else if (singleSelection instanceof BioModelsNetModelInfo) {
bShowInDatabaseProperties = true;
bottomComponent = getBioModelsNetPropertiesPanel();
} else if (singleSelection instanceof Simulation) {
bottomComponent = getSimulationSummaryPanel();
} else if (singleSelection instanceof DataSymbol) {
bottomComponent = getDataSymbolsSpecPanel();
} else if (singleSelection instanceof BioEvent) {
bottomComponent = getEventPanel();
} else if (singleSelection instanceof SpatialObject) {
bottomComponent = getSpatialObjectPropertyPanel();
} else if (singleSelection instanceof SpatialProcess) {
bottomComponent = getSpatialProcessPropertyPanel();
} else if (singleSelection instanceof BioPaxObject) {
bottomComponent = bioPaxObjectPropertiesPanel;
} else if (singleSelection instanceof BioModel) {
// only contains Notes, is displayed in the Object Properties Panel
bottomComponent = bioModelEditorAnnotationPanel;
} else if (singleSelection instanceof VCMetaData) {
bottomComponent = bioModelEditorAnnotationPanel;
} else if (singleSelection instanceof PathwayData) {
bShowPathway = true;
bottomComponent = getBioModelEditorPathwayPanel();
} else if (singleSelection instanceof Model) {
} else if (singleSelection instanceof RuleParticipantSignature) {
bottomComponent = getReactionRuleParticipantSignaturePropertiesPanel();
} else if (singleSelection instanceof CSGObject) {
bottomComponent = csgObjectPropertiesPanel;
csgObjectPropertiesPanel.setSimulationContext(getSelectedSimulationContext());
} else if (singleSelection instanceof DocumentEditorTreeFolderNode) {
DocumentEditorTreeFolderClass folderClass = ((DocumentEditorTreeFolderNode) singleSelection).getFolderClass();
if ((folderClass == DocumentEditorTreeFolderClass.REACTIONS_NODE) && !(singleSelection instanceof ReactionRule)) {
bottomComponent = getReactionPropertiesPanel();
} else if ((folderClass == DocumentEditorTreeFolderClass.REACTIONS_NODE) && (singleSelection instanceof ReactionRule)) {
bottomComponent = getReactionRulePropertiesPanel();
} else if (folderClass == DocumentEditorTreeFolderClass.STRUCTURES_NODE) {
bottomComponent = getStructurePropertiesPanel();
} else if (folderClass == DocumentEditorTreeFolderClass.SPECIES_NODE) {
bottomComponent = getSpeciesPropertiesPanel();
} else if (folderClass == DocumentEditorTreeFolderClass.MOLECULAR_TYPES_NODE) {
bottomComponent = getMolecularTypePropertiesPanel();
} else if (folderClass == DocumentEditorTreeFolderClass.OBSERVABLES_NODE) {
bottomComponent = getObservablePropertiesPanel();
} else if (folderClass == DocumentEditorTreeFolderClass.APPLICATIONS_NODE) {
bottomComponent = getApplicationsPropertiesPanel();
getApplicationsPropertiesPanel().setBioModel(bioModel);
} else if (folderClass == DocumentEditorTreeFolderClass.PARAMETER_ESTIMATION_NODE) {
bottomComponent = parameterEstimationTaskPropertiesPanel;
}
} else if (singleSelection instanceof SelectionManager.AnnotationNavigator) {
Object entity = ((SelectionManager.AnnotationNavigator) singleSelection).getEntity();
if (entity instanceof ReactionStep) {
bottomComponent = getReactionPropertiesPanel();
} else if (entity instanceof SpeciesContext) {
bottomComponent = getSpeciesPropertiesPanel();
} else if (entity instanceof Structure) {
// Observables. MolecularType, Structures
bottomComponent = getStructurePropertiesPanel();
} else if (entity instanceof MolecularType) {
bottomComponent = getMolecularTypePropertiesPanel();
} else if (entity instanceof RbmObservable) {
bottomComponent = getObservablePropertiesPanel();
} else {
bottomComponent = bioModelEditorAnnotationPanel;
}
}
}
if (bShowPathway) {
int numTabs = rightBottomTabbedPane.getTabCount();
for (destComponentIndex = 0; destComponentIndex < numTabs; destComponentIndex++) {
Component current = rightBottomTabbedPane.getComponentAt(destComponentIndex);
if (current == bottomComponent) {
break;
}
}
String tabTitle = "Pathway Preview";
if (rightBottomTabbedPane.getTabCount() == destComponentIndex) {
rightBottomTabbedPane.addTab(tabTitle, new TabCloseIcon(), bottomComponent);
}
} else if (bShowInDatabaseProperties) {
for (destComponentIndex = 0; destComponentIndex < rightBottomTabbedPane.getTabCount(); destComponentIndex++) {
Component c = rightBottomTabbedPane.getComponentAt(destComponentIndex);
if (c == bioModelMetaDataPanel || c == mathModelMetaDataPanel || c == geometryMetaDataPanel || c == getBioModelsNetPropertiesPanel()) {
break;
}
}
if (rightBottomTabbedPane.getTabCount() == destComponentIndex) {
rightBottomTabbedPane.addTab(DATABASE_PROPERTIES_TAB_TITLE, new TabCloseIcon(), bottomComponent);
}
}
if (rightBottomTabbedPane.getComponentAt(destComponentIndex) != bottomComponent) {
bottomComponent.setBorder(GuiConstants.TAB_PANEL_BORDER);
annotationComponent.setBorder(GuiConstants.TAB_PANEL_BORDER);
rightBottomTabbedPane.setComponentAt(destComponentIndex, bottomComponent);
rightBottomTabbedPane.setComponentAt(annComponentIndex, annotationComponent);
rightSplitPane.repaint();
}
Component selectedComponent = rightBottomTabbedPane.getSelectedComponent();
if (selections.length == 1 && selections[0] instanceof BioModel && bottomComponent instanceof BioModelEditorAnnotationPanel) {
// if the biomodel name is selected in the upper left tree, we select the Annotations tab
rightBottomTabbedPane.setSelectedComponent(annotationComponent);
} else if (selections.length == 1 && selections[0] instanceof SelectionManager.AnnotationNavigator && selections[0] instanceof SelectionManager.AnnotationNavigator) {
// we want to navigate to the AnnotationPanel
rightBottomTabbedPane.setSelectedComponent(annotationComponent);
// } else if(selections.length == 1 && selections[0] instanceof SelectionManager.AnnotationNavigator && bottomComponent instanceof BioModelEditorAnnotationPanel) {
// // we want to navigate to the AnnotationPanel (old way)
// rightBottomTabbedPane.setSelectedComponent(annotationComponent);
} else if (selectedComponent != bottomComponent) /* && rightBottomTabbedPane.getSelectedComponent() != annotationComponent */
{
rightBottomTabbedPane.setSelectedComponent(bottomComponent);
}
}
use of cbit.vcell.client.desktop.biomodel.DocumentEditorTreeModel.DocumentEditorTreeFolderClass in project vcell by virtualcell.
the class BioModelEditor method popupMenuActionPerformed.
@Override
protected void popupMenuActionPerformed(DocumentEditorPopupMenuAction action, String actionCommand) {
Model model = bioModel.getModel();
final SimulationContext selectedSimulationContext = getSelectedSimulationContext();
switch(action) {
case add_new:
try {
Object obj = documentEditorTree.getLastSelectedPathComponent();
if (obj == null || !(obj instanceof BioModelNode)) {
return;
}
BioModelNode selectedNode = (BioModelNode) obj;
Object userObject = selectedNode.getUserObject();
if (userObject instanceof DocumentEditorTreeFolderNode) {
DocumentEditorTreeFolderClass folderClass = ((DocumentEditorTreeFolderNode) userObject).getFolderClass();
Object newObject = null;
switch(folderClass) {
case REACTIONS_NODE:
// TODO: should add a Add New Rule menu item
newObject = model.createSimpleReaction(model.getStructure(0));
break;
case STRUCTURES_NODE:
newObject = model.createFeature();
break;
case SPECIES_NODE:
newObject = model.createSpeciesContext(model.getStructure(0));
break;
case MOLECULAR_TYPES_NODE:
MolecularType mt = model.getRbmModelContainer().createMolecularType();
model.getRbmModelContainer().addMolecularType(mt, true);
newObject = mt;
break;
case OBSERVABLES_NODE:
if (bioModel.getModel().getRbmModelContainer().getMolecularTypeList().isEmpty()) {
PopupGenerator.showInfoDialog(this, VCellErrorMessages.MustBeRuleBased);
return;
}
RbmObservable o = model.getRbmModelContainer().createObservable(RbmObservable.ObservableType.Molecules);
model.getRbmModelContainer().addObservable(o);
SpeciesPattern sp = new SpeciesPattern();
o.addSpeciesPattern(sp);
newObject = o;
break;
case SIMULATIONS_NODE:
if (selectedSimulationContext != null) {
AsynchClientTask task1 = new AsynchClientTask("new simulation", AsynchClientTask.TASKTYPE_NONSWING_BLOCKING) {
@Override
public void run(Hashtable<String, Object> hashTable) throws Exception {
MathMappingCallback callback = new MathMappingCallbackTaskAdapter(getClientTaskStatusSupport());
selectedSimulationContext.refreshMathDescription(callback, NetworkGenerationRequirements.AllowTruncatedStandardTimeout);
}
};
AsynchClientTask task2 = new AsynchClientTask("new simulation", AsynchClientTask.TASKTYPE_SWING_BLOCKING) {
@Override
public void run(Hashtable<String, Object> hashTable) throws Exception {
MathMappingCallback callback = new MathMappingCallbackTaskAdapter(getClientTaskStatusSupport());
Object newsim = selectedSimulationContext.addNewSimulation(SimulationOwner.DEFAULT_SIM_NAME_PREFIX, callback, NetworkGenerationRequirements.AllowTruncatedStandardTimeout);
selectionManager.setSelectedObjects(new Object[] { newsim });
}
};
ClientTaskDispatcher.dispatch(this, new Hashtable<String, Object>(), new AsynchClientTask[] { task1, task2 });
}
break;
default:
break;
}
if (newObject != null) {
selectionManager.setSelectedObjects(new Object[] { newObject });
}
}
} catch (Exception ex) {
DialogUtils.showErrorDialog(this, ex.getMessage());
}
break;
case add_new_app_deterministic:
newApplication(Application.NETWORK_DETERMINISTIC);
break;
case add_new_app_stochastic:
newApplication(Application.NETWORK_STOCHASTIC);
break;
case add_new_app_rulebased:
{
// if(model.getStructures().length > 1) {
// DialogUtils.showErrorDialog(this, VCellErrorMessages.NFSimAppNotAllowedForMultipleStructures);
// return;
// }
newApplication(Application.RULE_BASED_STOCHASTIC);
break;
}
case copyName:
String name = bioModel.getName();
StringSelection data = new StringSelection(name);
Clipboard c = Toolkit.getDefaultToolkit().getSystemClipboard();
c.setContents(data, data);
break;
case copy_app:
ApplicationActionCommand acc = ApplicationActionCommand.lookup(actionCommand);
switch(acc.actionType()) {
case COPY_AS_IS:
copyApplication();
break;
case COPY_CHANGE:
boolean bothSpatial = acc.isSourceSpatial() && acc.isDestSpatial();
// if(acc.getAppType().equals(SimulationContext.Application.RULE_BASED_STOCHASTIC) && model.getStructures().length > 1) {
// DialogUtils.showErrorDialog(this, VCellErrorMessages.NFSimAppNotAllowedForMultipleStructures);
// return;
// }
copyApplication(bothSpatial, acc.getAppType());
break;
case CREATE:
// not used in this menu
throw new UnsupportedOperationException();
}
break;
case app_new_biomodel:
if (actionCommand.equals(GuiConstants.MENU_TEXT_APP_NEWBIOMODEL)) {
createNewBiomodelFromApp();
}
break;
case delete:
try {
if (selectedSimulationContext != null) {
String confirm = PopupGenerator.showOKCancelWarningDialog(this, "Deleting application", "You are going to delete the Application '" + selectedSimulationContext.getName() + "'. Continue?");
if (confirm.equals(UserMessage.OPTION_CANCEL)) {
return;
}
deleteSimulationcontexts(new SimulationContext[] { selectedSimulationContext });
}
} catch (Exception ex) {
DialogUtils.showErrorDialog(this, ex.getMessage());
}
break;
case deleteChoose:
try {
SimulationContext[] allSimContexts = Arrays.copyOf(getBioModelWindowManager().getVCDocument().getSimulationContexts(), getBioModelWindowManager().getVCDocument().getSimulationContexts().length);
Arrays.sort(allSimContexts, new Comparator<SimulationContext>() {
@Override
public int compare(SimulationContext o1, SimulationContext o2) {
return o1.getName().compareToIgnoreCase(o2.getName());
}
});
String[][] rowDataOrig = new String[allSimContexts.length][2];
for (int i = 0; i < allSimContexts.length; i++) {
rowDataOrig[i][0] = allSimContexts[i].getName();
rowDataOrig[i][1] = allSimContexts[i].getSimulations().length + "";
}
final String DELETE = "Delete";
final String CANCEL = "Cancel";
TableListResult result = DialogUtils.showComponentOptionsTableList(this, "Select Applications (and associated Simulations) to delete.", new String[] { "Application", "# of Sims" }, rowDataOrig, ListSelectionModel.MULTIPLE_INTERVAL_SELECTION, null, new String[] { DELETE, CANCEL }, CANCEL, null);
if (result != null && result.selectedOption != null && result.selectedOption.equals(DELETE) && result.selectedTableRows != null && result.selectedTableRows.length > 0) {
ArrayList<SimulationContext> deleteTheseSimcontexts = new ArrayList<SimulationContext>();
for (int i = 0; i < result.selectedTableRows.length; i++) {
deleteTheseSimcontexts.add(allSimContexts[result.selectedTableRows[i]]);
}
deleteSimulationcontexts(deleteTheseSimcontexts.toArray(new SimulationContext[0]));
}
} catch (Exception ex) {
DialogUtils.showErrorDialog(this, ex.getMessage());
}
break;
default:
break;
}
}
use of cbit.vcell.client.desktop.biomodel.DocumentEditorTreeModel.DocumentEditorTreeFolderClass in project vcell by virtualcell.
the class BioModelEditor method setRightTopPanel.
private void setRightTopPanel(Object selectedObject, SimulationContext simulationContext) {
JComponent newTopPanel = emptyPanel;
// DEFAULT_DIVIDER_LOCATION;
int dividerLocation = rightSplitPane.getDividerLocation();
if (selectedObject instanceof Model) {
newTopPanel = bioModelEditorModelPanel;
} else if (selectedObject instanceof BioModel || selectedObject instanceof VCMetaData || selectedObject instanceof MiriamResource) {
newTopPanel = bioModelPropertiesPanel;
bioModelPropertiesPanel.setBioModel(bioModel);
} else if (selectedObject instanceof SimulationContext) {
newTopPanel = bioModelEditorApplicationPanel;
bioModelEditorApplicationPanel.setSimulationContext(simulationContext);
} else if (selectedObject instanceof DocumentEditorTreeFolderNode) {
DocumentEditorTreeFolderNode folderNode = (DocumentEditorTreeFolderNode) selectedObject;
DocumentEditorTreeFolderClass folderClass = folderNode.getFolderClass();
if (folderClass == DocumentEditorTreeFolderClass.MODEL_NODE) {
newTopPanel = bioModelEditorModelPanel;
} else if (folderClass == DocumentEditorTreeFolderClass.STRUCTURES_NODE || folderClass == DocumentEditorTreeFolderClass.SPECIES_NODE || folderClass == DocumentEditorTreeFolderClass.MOLECULAR_TYPES_NODE || folderClass == DocumentEditorTreeFolderClass.OBSERVABLES_NODE || folderClass == DocumentEditorTreeFolderClass.REACTIONS_NODE || folderClass == DocumentEditorTreeFolderClass.REACTION_DIAGRAM_NODE) // || folderClass == DocumentEditorTreeFolderClass.STRUCTURE_DIAGRAM_NODE
{
newTopPanel = bioModelEditorModelPanel;
} else if (folderClass == DocumentEditorTreeFolderClass.PATHWAY_DIAGRAM_NODE || folderClass == DocumentEditorTreeFolderClass.PATHWAY_OBJECTS_NODE || folderClass == DocumentEditorTreeFolderClass.BIOPAX_SUMMARY_NODE || folderClass == DocumentEditorTreeFolderClass.BIOPAX_TREE_NODE) {
newTopPanel = bioModelEditorPathwayDiagramPanel;
} else if (folderClass == DocumentEditorTreeFolderClass.PATHWAY_NODE) {
newTopPanel = getBioModelEditorPathwayDiagramPanel();
getBioModelEditorPathwayDiagramPanel().setBioModel(bioModel);
} else if (folderClass == DocumentEditorTreeFolderClass.BIOMODEL_PARAMETERS_NODE) {
newTopPanel = bioModelParametersPanel;
} else if (folderClass == DocumentEditorTreeFolderClass.APPLICATIONS_NODE) {
newTopPanel = bioModelEditorApplicationsPanel;
// } else if (folderClass == DocumentEditorTreeFolderClass.DATA_NODE) {
// newTopPanel = dataSymbolsPanel;
} else if (folderClass == DocumentEditorTreeFolderClass.SCRIPTING_NODE) {
newTopPanel = getScriptingPanel();
} else if (folderClass == DocumentEditorTreeFolderClass.SPECIFICATIONS_NODE || folderClass == DocumentEditorTreeFolderClass.PROTOCOLS_NODE || folderClass == DocumentEditorTreeFolderClass.SIMULATIONS_NODE || folderClass == DocumentEditorTreeFolderClass.GEOMETRY_NODE || folderClass == DocumentEditorTreeFolderClass.PARAMETER_ESTIMATION_NODE) {
newTopPanel = bioModelEditorApplicationPanel;
bioModelEditorApplicationPanel.setSimulationContext(simulationContext);
}
}
Component rightTopComponent = rightSplitPane.getTopComponent();
if (rightTopComponent != newTopPanel) {
rightSplitPane.setTopComponent(newTopPanel);
}
rightSplitPane.setDividerLocation(dividerLocation);
getSimulationConsolePanel().setSimulationContext(simulationContext);
if (simulationContext == null) {
rightBottomTabbedPane.remove(getSimulationConsolePanel());
} else {
// show the console only for bionetgen deterministic applications (flattened network)
if (simulationContext.getApplicationType() == Application.RULE_BASED_STOCHASTIC) {
// if(simulationContext.isRuleBased() || simulationContext.isStoch()) {
// if(simulationContext.isStoch()) {
rightBottomTabbedPane.remove(getSimulationConsolePanel());
return;
}
boolean bHasRules = simulationContext.getModel().getRbmModelContainer().hasRules();
if (!bHasRules) {
rightBottomTabbedPane.remove(getSimulationConsolePanel());
return;
}
// rightBottomTabbedPane.addTab("Network Console", new TabCloseIcon(), getSimulationConsolePanel());
rightBottomTabbedPane.addTab("Network Generation Status", getSimulationConsolePanel());
}
}
Aggregations