use of cbit.vcell.client.desktop.biomodel.DocumentEditorTreeModel.DocumentEditorTreeFolderClass in project vcell by virtualcell.
the class BioModelEditorModelPanel method onActiveViewChange.
@Override
protected void onActiveViewChange(ActiveView activeView) {
super.onActiveViewChange(activeView);
SimulationContext selectedSimContext = activeView.getSimulationContext();
DocumentEditorTreeFolderClass folderClass = activeView.getDocumentEditorTreeFolderClass();
if (selectedSimContext != null || folderClass == null) {
return;
}
switch(folderClass) {
case REACTIONS_NODE:
selectTab(ModelPanelTabID.reaction_table);
break;
case STRUCTURES_NODE:
selectTab(ModelPanelTabID.structure_table);
break;
case SPECIES_NODE:
selectTab(ModelPanelTabID.species_table);
break;
case MOLECULAR_TYPES_NODE:
selectTab(ModelPanelTabID.species_definitions_table);
break;
case OBSERVABLES_NODE:
selectTab(ModelPanelTabID.observables_table);
break;
case REACTION_DIAGRAM_NODE:
selectTab(ModelPanelTabID.reaction_diagram);
break;
}
}
use of cbit.vcell.client.desktop.biomodel.DocumentEditorTreeModel.DocumentEditorTreeFolderClass in project vcell by virtualcell.
the class MathModelEditor method popupMenuActionPerformed.
@Override
protected void popupMenuActionPerformed(DocumentEditorPopupMenuAction action, String actionCommand) {
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();
switch(folderClass) {
case MATH_SIMULATIONS_NODE:
Object newsim = mathModel.addNewSimulation(SimulationOwner.DEFAULT_SIM_NAME_PREFIX);
selectionManager.setSelectedObjects(new Object[] { newsim });
break;
case MATH_OUTPUT_FUNCTIONS_NODE:
break;
}
}
} catch (Exception ex) {
DialogUtils.showErrorDialog(this, ex.getMessage());
}
break;
}
}
Aggregations