Search in sources :

Example 6 with ActiveView

use of cbit.vcell.client.desktop.biomodel.SelectionManager.ActiveView in project vcell by virtualcell.

the class SpeciesPropertiesPanel method listLinkedPathwayObjects.

// wei's code
private String listLinkedPathwayObjects() {
    if (getSpeciesContext() == null) {
        return "no selected species";
    }
    if (bioModel == null || bioModel.getModel() == null) {
        return "no biomodel";
    }
    JPanel panel = new JPanel();
    panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
    String linkedPOlist = "";
    for (RelationshipObject relObject : bioModel.getRelationshipModel().getRelationshipObjects(getSpeciesContext())) {
        final BioPaxObject bpObject = relObject.getBioPaxObject();
        if (bpObject instanceof Entity) {
            JLabel label = new JLabel("<html><u>" + ((Entity) bpObject).getName().get(0) + "</u></html>");
            label.setForeground(Color.blue);
            label.addMouseListener(new MouseAdapter() {

                public void mouseClicked(MouseEvent e) {
                    if (e.getClickCount() == 2) {
                        selectionManager.followHyperlink(new ActiveView(null, DocumentEditorTreeFolderClass.PATHWAY_DIAGRAM_NODE, ActiveViewID.pathway_diagram), new Object[] { bpObject });
                    }
                }
            });
            panel.add(label);
        }
    }
    linkedPOScrollPane.setViewportView(panel);
    return linkedPOlist;
}
Also used : JPanel(javax.swing.JPanel) Entity(org.vcell.pathway.Entity) MouseEvent(java.awt.event.MouseEvent) BioPaxObject(org.vcell.pathway.BioPaxObject) BoxLayout(javax.swing.BoxLayout) MouseAdapter(java.awt.event.MouseAdapter) JLabel(javax.swing.JLabel) RelationshipObject(org.vcell.relationship.RelationshipObject) BioPaxObject(org.vcell.pathway.BioPaxObject) ActiveView(cbit.vcell.client.desktop.biomodel.SelectionManager.ActiveView) RelationshipObject(org.vcell.relationship.RelationshipObject)

Example 7 with ActiveView

use of cbit.vcell.client.desktop.biomodel.SelectionManager.ActiveView in project vcell by virtualcell.

the class BioModelEditorApplicationPanel method tabbedPaneSelectionChanged.

public void tabbedPaneSelectionChanged() {
    int selectedIndex = tabbedPane.getSelectedIndex();
    ActiveView activeView = null;
    if (selectedIndex == ApplicationPanelTabID.geometry.ordinal()) {
        activeView = applicationGeometryPanel.getActiveView();
    } else if (selectedIndex == ApplicationPanelTabID.settings.ordinal()) {
        activeView = applicationSpecificationsPanel.getActiveView();
    } else if (selectedIndex == ApplicationPanelTabID.protocols.ordinal()) {
        activeView = applicationProtocolsPanel.getActiveView();
    } else if (selectedIndex == ApplicationPanelTabID.simulations.ordinal()) {
        activeView = applicationSimulationsPanel.getActiveView();
    } else if (selectedIndex == ApplicationPanelTabID.parameterEstimation.ordinal()) {
        activeView = parameterEstimationPanel.getActiveView();
    }
    if (activeView != null) {
        setActiveView(activeView);
    }
}
Also used : ActiveView(cbit.vcell.client.desktop.biomodel.SelectionManager.ActiveView)

Example 8 with ActiveView

use of cbit.vcell.client.desktop.biomodel.SelectionManager.ActiveView in project vcell by virtualcell.

the class BioModelEditorModelPanel method tabbedPaneSelectionChanged.

public void tabbedPaneSelectionChanged() {
    textFieldSearch.setText(null);
    reactionTableModel.setSearchText(null);
    structureTableModel.setSearchText(null);
    speciesTableModel.setSearchText(null);
    molecularTypeTableModel.setSearchText(null);
    observableTableModel.setSearchText(null);
    int selectedIndex = tabbedPane.getSelectedIndex();
    ActiveView activeView = null;
    if (selectedIndex == ModelPanelTabID.reaction_table.ordinal()) {
        activeView = new ActiveView(null, DocumentEditorTreeFolderClass.REACTIONS_NODE, ActiveViewID.reactions);
    } else if (selectedIndex == ModelPanelTabID.structure_table.ordinal()) {
        activeView = new ActiveView(null, DocumentEditorTreeFolderClass.STRUCTURES_NODE, ActiveViewID.structures);
    } else if (selectedIndex == ModelPanelTabID.species_table.ordinal()) {
        activeView = new ActiveView(null, DocumentEditorTreeFolderClass.SPECIES_NODE, ActiveViewID.species);
    } else if (selectedIndex == ModelPanelTabID.species_definitions_table.ordinal()) {
        activeView = new ActiveView(null, DocumentEditorTreeFolderClass.MOLECULAR_TYPES_NODE, ActiveViewID.species_definitions);
    } else if (selectedIndex == ModelPanelTabID.observables_table.ordinal()) {
        activeView = new ActiveView(null, DocumentEditorTreeFolderClass.OBSERVABLES_NODE, ActiveViewID.observables);
    } else if (selectedIndex == ModelPanelTabID.reaction_diagram.ordinal()) {
        activeView = new ActiveView(null, DocumentEditorTreeFolderClass.REACTION_DIAGRAM_NODE, ActiveViewID.reaction_diagram);
    // } else if (selectedIndex == ModelPanelTabID.structure_diagram.ordinal()) {
    // activeView = new ActiveView(null, DocumentEditorTreeFolderClass.STRUCTURE_DIAGRAM_NODE, ActiveViewID.structure_diagram);
    }
    if (activeView != null) {
        setActiveView(activeView);
    }
    refreshButtons();
}
Also used : ActiveView(cbit.vcell.client.desktop.biomodel.SelectionManager.ActiveView)

Example 9 with ActiveView

use of cbit.vcell.client.desktop.biomodel.SelectionManager.ActiveView in project vcell by virtualcell.

the class BioModelEditorPathwayDiagramPanel method tabbedPaneSelectionChanged.

public void tabbedPaneSelectionChanged() {
    searchTextField.setText(null);
    searchTextField.setEditable(tabbedPane.getSelectedComponent() != sourceTabPanel);
    refreshButtons();
    int selectedIndex = tabbedPane.getSelectedIndex();
    ActiveView activeView = null;
    if (selectedIndex == PathwayPanelTabID.pathway_diagram.ordinal()) {
        activeView = new ActiveView(null, DocumentEditorTreeFolderClass.PATHWAY_DIAGRAM_NODE, ActiveViewID.pathway_diagram);
    } else if (selectedIndex == PathwayPanelTabID.pathway_objects.ordinal()) {
        activeView = new ActiveView(null, DocumentEditorTreeFolderClass.PATHWAY_OBJECTS_NODE, ActiveViewID.pathway_objects);
    } else if (selectedIndex == PathwayPanelTabID.biopax_summary.ordinal()) {
        activeView = new ActiveView(null, DocumentEditorTreeFolderClass.BIOPAX_SUMMARY_NODE, ActiveViewID.biopax_summary);
    } else if (selectedIndex == PathwayPanelTabID.biopax_tree.ordinal()) {
        activeView = new ActiveView(null, DocumentEditorTreeFolderClass.BIOPAX_TREE_NODE, ActiveViewID.biopax_tree);
    }
    if (activeView != null) {
        setActiveView(activeView);
    }
}
Also used : ActiveView(cbit.vcell.client.desktop.biomodel.SelectionManager.ActiveView)

Example 10 with ActiveView

use of cbit.vcell.client.desktop.biomodel.SelectionManager.ActiveView in project vcell by virtualcell.

the class BioModelEditorPathwayDiagramPanel method showPhysiologyLinks.

private void showPhysiologyLinks() {
    BioPaxObject selectedBioPaxObject = getSelectedBioPaxObject();
    if (selectedBioPaxObject != null) {
        Set<RelationshipObject> relationshipSet = bioModel.getRelationshipModel().getRelationshipObjects(selectedBioPaxObject);
        if (relationshipSet.size() > 0) {
            ArrayList<BioModelEntityObject> selectedBioModelEntityObjects = new ArrayList<BioModelEntityObject>();
            for (RelationshipObject re : relationshipSet) {
                BioModelEntityObject bioModelEntityObject = re.getBioModelEntityObject();
                selectedBioModelEntityObjects.add(bioModelEntityObject);
            }
            // if (selectedBioPaxObjects.get(0) instanceof ReactionStep) {
            // selectionManager.setActiveView(new ActiveView(null,DocumentEditorTreeFolderClass.REACTIONS_NODE, ActiveViewID.reactions));
            // } else if (selectedBioPaxObjects.get(0) instanceof SpeciesContext) {
            // selectionManager.setActiveView(new ActiveView(null,DocumentEditorTreeFolderClass.SPECIES_NODE, ActiveViewID.species));
            // }
            selectionManager.followHyperlink(new ActiveView(null, DocumentEditorTreeFolderClass.REACTION_DIAGRAM_NODE, ActiveViewID.reaction_diagram), selectedBioModelEntityObjects.toArray(new BioModelEntityObject[0]));
        }
    }
}
Also used : BioPaxObject(org.vcell.pathway.BioPaxObject) ArrayList(java.util.ArrayList) BioModelEntityObject(cbit.vcell.model.BioModelEntityObject) ActiveView(cbit.vcell.client.desktop.biomodel.SelectionManager.ActiveView) RelationshipObject(org.vcell.relationship.RelationshipObject)

Aggregations

ActiveView (cbit.vcell.client.desktop.biomodel.SelectionManager.ActiveView)20 BioPaxObject (org.vcell.pathway.BioPaxObject)10 RelationshipObject (org.vcell.relationship.RelationshipObject)8 Component (java.awt.Component)5 MouseAdapter (java.awt.event.MouseAdapter)5 MouseEvent (java.awt.event.MouseEvent)5 Entity (org.vcell.pathway.Entity)5 ActiveViewID (cbit.vcell.client.desktop.biomodel.SelectionManager.ActiveViewID)4 Dimension (java.awt.Dimension)4 ArrayList (java.util.ArrayList)4 BoxLayout (javax.swing.BoxLayout)4 JComponent (javax.swing.JComponent)4 JLabel (javax.swing.JLabel)4 JPanel (javax.swing.JPanel)4 BioModelEntityObject (cbit.vcell.model.BioModelEntityObject)3 SimulationContext (cbit.vcell.mapping.SimulationContext)2 SpatialObject (cbit.vcell.mapping.spatial.SpatialObject)2 MathModel (cbit.vcell.mathmodel.MathModel)2 SpeciesContext (cbit.vcell.model.SpeciesContext)2 HashSet (java.util.HashSet)2