Search in sources :

Example 11 with DocumentEditorTreeFolderClass

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;
    }
}
Also used : SimulationContext(cbit.vcell.mapping.SimulationContext) DocumentEditorTreeFolderClass(cbit.vcell.client.desktop.biomodel.DocumentEditorTreeModel.DocumentEditorTreeFolderClass)

Example 12 with DocumentEditorTreeFolderClass

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;
    }
}
Also used : DocumentEditorTreeFolderNode(cbit.vcell.client.desktop.biomodel.DocumentEditorTreeModel.DocumentEditorTreeFolderNode) CSGObject(cbit.vcell.geometry.CSGObject) BioModelNode(cbit.vcell.desktop.BioModelNode) DocumentEditorTreeFolderClass(cbit.vcell.client.desktop.biomodel.DocumentEditorTreeModel.DocumentEditorTreeFolderClass)

Aggregations

DocumentEditorTreeFolderClass (cbit.vcell.client.desktop.biomodel.DocumentEditorTreeModel.DocumentEditorTreeFolderClass)12 DocumentEditorTreeFolderNode (cbit.vcell.client.desktop.biomodel.DocumentEditorTreeModel.DocumentEditorTreeFolderNode)9 SimulationContext (cbit.vcell.mapping.SimulationContext)8 BioModelNode (cbit.vcell.desktop.BioModelNode)6 BioModel (cbit.vcell.biomodel.BioModel)5 CSGObject (cbit.vcell.geometry.CSGObject)3 Model (cbit.vcell.model.Model)3 Component (java.awt.Component)3 JComponent (javax.swing.JComponent)3 ListSelectionModel (javax.swing.ListSelectionModel)3 VCMetaData (cbit.vcell.biomodel.meta.VCMetaData)2 SpatialObject (cbit.vcell.mapping.spatial.SpatialObject)2 MathModel (cbit.vcell.mathmodel.MathModel)2 RbmObservable (cbit.vcell.model.RbmObservable)2 MolecularType (org.vcell.model.rbm.MolecularType)2 BioPaxObject (org.vcell.pathway.BioPaxObject)2 MiriamResource (cbit.vcell.biomodel.meta.MiriamManager.MiriamResource)1 ApplicationActionCommand (cbit.vcell.client.constants.ApplicationActionCommand)1 PathwayData (cbit.vcell.client.desktop.biomodel.BioModelEditorPathwayCommonsPanel.PathwayData)1 ActiveView (cbit.vcell.client.desktop.biomodel.SelectionManager.ActiveView)1