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;
}
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);
}
}
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();
}
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);
}
}
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]));
}
}
}
Aggregations