Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redesign the springsalad-specific user interface #1387

Merged
merged 29 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
0b00b07
Trick to display different properties panels for the same SpeciesCont…
danv61 Oct 1, 2024
00c216b
WIP fixing errors
danv61 Oct 1, 2024
e294a61
Manage tricky selection for LangevinSpeciesContext step class, stub f…
danv61 Oct 3, 2024
d5d3400
Use existing large shape panel, new Anchor issues, bug fixing
danv61 Oct 4, 2024
53060da
Site location initialization for membrane molecules
danv61 Oct 8, 2024
d8a86a6
Implemented the correct Transition Condition FREE - meaning that the …
danv61 Oct 9, 2024
72c9b93
Fixed import and export for Transition Condition FREE
danv61 Oct 10, 2024
e86e50e
WIP: painting the shapes of the sites
danv61 Oct 11, 2024
5ded011
WIP: painting the shapes of the sites
danv61 Oct 16, 2024
98e431c
WIP: painting the shapes of the sites
danv61 Oct 18, 2024
cf43233
WIP: painting the shapes of the sites
danv61 Oct 21, 2024
85cef01
WIP: painting the scompartments
danv61 Oct 23, 2024
9ed923d
Utilities: graph continuity, color management
danv61 Oct 24, 2024
16eda45
molecular details: compartments, axes, links, zoom
danv61 Oct 24, 2024
089fbdc
molecular details: NamedColor combobox, editor, renderer
danv61 Oct 25, 2024
1bc1632
molecular details: NamedColor combobox, editor, renderer
danv61 Oct 29, 2024
5d7bf8f
WIP: molecular structure panel, renderer
danv61 Oct 31, 2024
f2356e4
WIP: molecular structure panel, renderer
danv61 Oct 31, 2024
264aaf9
fix test
danv61 Oct 31, 2024
2b5acbe
taking the units out of the table, they will only show in the cell to…
danv61 Nov 1, 2024
1cb32fa
WIP: refactoring all Specifications subpanels for Springsalad
danv61 Nov 4, 2024
f6325e6
WIP: refactoring Springsalad panels, navigation, issues
danv61 Nov 5, 2024
b2fe0a9
WIP: table for MolecularInternalLinkSpec display, rendering for super…
danv61 Nov 7, 2024
3487e57
WIP: table for MolecularInternalLinkSpec display
danv61 Nov 12, 2024
1b07ab0
WIP: renderers for LinkSpecsTableModel
danv61 Nov 12, 2024
a019104
WIP: add / delete links, keep table in sync
danv61 Nov 18, 2024
091043f
PropertyChange event when changing site attributes
danv61 Nov 19, 2024
da4ec77
Cosmetic fixes
danv61 Nov 19, 2024
662dcf1
Merge branch 'master' into dan-ss-molecular-struct-properties
danv61 Nov 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,6 @@ public JComboBox getJComboBoxURI() {
@Override
public void actionPerformed(ActionEvent e) {
VCMetaDataDataType mdt = (VCMetaDataDataType)jComboBoxURI.getSelectedItem();
System.out.println("aici");
if(mdt != null && mdt.isSearchable()) {
getJButtonSearchRef().setEnabled(true);
} else {
Expand Down Expand Up @@ -939,7 +938,6 @@ protected void onSelectedObjectsChange(Object[] selectedObjects) {
}
if(selectedObjects[0] instanceof Identifiable && selectedObjects[0] instanceof Displayable) {
selectedObject = (Identifiable)selectedObjects[0];
System.out.println("AnnotationsPanel: class: " + selectedObject.getClass().getSimpleName() + ", selected object: " + ((Displayable)selectedObject).getDisplayName());
} else {
selectedObject = null;
System.out.println("Unsupported or null entity");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
import javax.swing.JComponent;
import javax.swing.ListSelectionModel;

import cbit.vcell.mapping.*;
import cbit.vcell.mapping.gui.*;
import org.vcell.model.rbm.MolecularType;
import org.vcell.model.rbm.SpeciesPattern;
import org.vcell.pathway.BioPaxObject;
Expand Down Expand Up @@ -56,20 +58,9 @@
import cbit.vcell.geometry.CSGObject;
import cbit.vcell.geometry.GeometryInfo;
import cbit.vcell.geometry.gui.CSGObjectPropertiesPanel;
import cbit.vcell.mapping.BioEvent;
import cbit.vcell.mapping.MathMappingCallbackTaskAdapter;
import cbit.vcell.mapping.ReactionRuleSpec;
import cbit.vcell.mapping.ReactionSpec;
import cbit.vcell.mapping.SimulationContext;
import cbit.vcell.mapping.SimulationContext.Application;
import cbit.vcell.mapping.SimulationContext.MathMappingCallback;
import cbit.vcell.mapping.SimulationContext.NetworkGenerationRequirements;
import cbit.vcell.mapping.SpeciesContextSpec;
import cbit.vcell.mapping.gui.DataSymbolsSpecPanel;
import cbit.vcell.mapping.gui.ReactionRuleSpecPropertiesPanel;
import cbit.vcell.mapping.gui.SpatialObjectPropertyPanel;
import cbit.vcell.mapping.gui.SpatialProcessPropertyPanel;
import cbit.vcell.mapping.gui.SpeciesContextSpecPanel;
import cbit.vcell.mapping.spatial.SpatialObject;
import cbit.vcell.mapping.spatial.processes.SpatialProcess;
import cbit.vcell.model.Model;
Expand Down Expand Up @@ -132,6 +123,7 @@ public class BioModelEditor extends DocumentEditor {
private ReactionParticipantPropertiesPanel reactionParticipantPropertiesPanel = null;
private ApplicationPropertiesPanel applicationPropertiesPanel = null;
private SpeciesContextSpecPanel speciesContextSpecPanel = null;
private MolecularStructuresPropertiesPanel molecularStructuresPropertiesPanel = null;
private KineticsTypeTemplatePanel kineticsTypeTemplatePanel = null;
private ReactionRuleSpecPropertiesPanel reactionRuleSpecPropertiesPanel = null;
private SimulationSummaryPanel simulationSummaryPanel = null;
Expand Down Expand Up @@ -631,6 +623,17 @@ private SpeciesContextSpecPanel getSpeciesContextSpecPanel() {
}
return speciesContextSpecPanel;
}
private MolecularStructuresPropertiesPanel getMolecularStructuresPropertiesPanel() {
if (molecularStructuresPropertiesPanel == null) {
try {
molecularStructuresPropertiesPanel = new MolecularStructuresPropertiesPanel();
molecularStructuresPropertiesPanel.setName("MolecularStructuresPropertiesPanel");
} catch (java.lang.Throwable ivjExc) {
handleException(ivjExc);
}
}
return molecularStructuresPropertiesPanel;
}

private void initialize() {
try {
Expand Down Expand Up @@ -681,6 +684,7 @@ private void initialize() {
getReactionRulePropertiesPanel().setSelectionManager(selectionManager);
getReactionPropertiesPanel().setSelectionManager(selectionManager);
getSpeciesContextSpecPanel().setSelectionManager(selectionManager);
getMolecularStructuresPropertiesPanel().setSelectionManager(selectionManager);
getReactionRuleSpecPropertiesPanel().setSelectionManager(selectionManager);
getSpatialObjectPropertyPanel().setSelectionManager(selectionManager);
getSpatialProcessPropertyPanel().setSelectionManager(selectionManager);
Expand Down Expand Up @@ -769,7 +773,19 @@ protected void setRightBottomPanelOnSelection(Object[] selections) {
bShowInDatabaseProperties = true;
bottomComponent = geometryMetaDataPanel;
} else if (singleSelection instanceof SpeciesContextSpec) {
bottomComponent = getSpeciesContextSpecPanel();
SpeciesContextSpec scs = (SpeciesContextSpec)singleSelection;
switch(scs.provenance) {
case LangevinSpecs:
bottomComponent = getMolecularStructuresPropertiesPanel();
break;
case LangevinInitialConditions: // TODO: we'll have here a simplified SpeciesContextSpecPanel
bottomComponent = getSpeciesContextSpecPanel();
break;
case GeneralInitialConditions:
default:
bottomComponent = getSpeciesContextSpecPanel();
break;
}
} else if (singleSelection instanceof ReactionSpec) {
bottomComponent = getKineticsTypeTemplatePanel();
} else if (singleSelection instanceof ReactionRuleSpec) { //
Expand Down Expand Up @@ -1006,7 +1022,6 @@ private BioModelEditorApplicationsPanel getBioModelEditorApplicationsPanel() {
/**
* Sets the bioModel property (cbit.vcell.biomodel.BioModel) value.
* @param bioModel The new value for the property.
* @see #getBioModel
*/
public void setBioModel(BioModel bioModel) {
if (this.bioModel == bioModel) {
Expand All @@ -1016,6 +1031,7 @@ public void setBioModel(BioModel bioModel) {
bioModelEditorModelPanel.setBioModel(bioModel);
getBioModelEditorApplicationsPanel().setBioModel(bioModel);
getSpeciesContextSpecPanel().setBioModel(bioModel);
getMolecularStructuresPropertiesPanel().setBioModel(bioModel);
getReactionRuleSpecPropertiesPanel().setBioModel(bioModel);
getScriptingPanel().setBioModel(bioModel);
getBioModelEditorPathwayPanel().setBioModel(bioModel);
Expand All @@ -1041,7 +1057,7 @@ public void setBioModel(BioModel bioModel) {
/**
* Insert the method's description here.
* Creation date: (5/7/2004 5:40:13 PM)
* @param newBioModelWindowManager cbit.vcell.client.desktop.BioModelWindowManager
* @param bioModelWindowManager cbit.vcell.client.desktop.BioModelWindowManager
*/
public void setBioModelWindowManager(BioModelWindowManager bioModelWindowManager) {
if (this.bioModelWindowManager == bioModelWindowManager) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
package cbit.vcell.graph.gui;

import javax.swing.*;

public class SsldLargeShapePanel extends JPanel {

// private boolean showDifferencesOnly = false;
// private boolean bShowMoleculeColor = false;
// private boolean bShowNonTrivialOnly = false;


// zooming the shape, 0 means normal size, a negative number means smaller shape
private static final int SmallestZoomFactor = -7; // -7 is the smallest where the shapes scale decently well
private static final int DefaultZoomFactor = 0;
private static final int LargestZoomFactor = 0;
private int zoomFactor = DefaultZoomFactor;

// by default the shapes are editable and their border and text is black / gray, aso
// otherwise they are a shade of brown, very much alike the DefaultScrollTableCellRenderer.uneditableForeground
private boolean editable = true;



// public void setShowMoleculeColor(boolean bShowMoleculeColor) {
// this.bShowMoleculeColor = bShowMoleculeColor;
// }
// public void setShowNonTrivialOnly(boolean bShowNonTrivialOnly) {
// this.bShowNonTrivialOnly = bShowNonTrivialOnly;
// }


public boolean zoomLarger() { // returns false when upper limit was reached
zoomFactor++;
if(zoomFactor >= LargestZoomFactor) {
zoomFactor = LargestZoomFactor;
System.out.println("MAX. Factor is " + zoomFactor);
return false;
} else {
System.out.println("Up. Factor is " + zoomFactor);
return true;
}
}
public void setZoomFactor(int newZoomFactor) {
if(newZoomFactor > LargestZoomFactor || newZoomFactor < SmallestZoomFactor) {
throw new RuntimeException("Large Shape Panel zoom factor is out of bounds");
}
zoomFactor = newZoomFactor;
}
public boolean zoomSmaller() { // returns false when lower limit was reached
zoomFactor--;
if(zoomFactor <= SmallestZoomFactor) {
zoomFactor = SmallestZoomFactor;
System.out.println("MIN. Factor is " + zoomFactor);
return false;
} else {
System.out.println("Down. Factor is " + zoomFactor);
return true;
}
}
public boolean isLargestZoomFactor() {
return zoomFactor >= LargestZoomFactor ? true : false;
}
public boolean isSmallestZoomFactor() {
return zoomFactor <= SmallestZoomFactor ? true : false;
}
public int getZoomFactor() {
return zoomFactor;
}

public void setEditable(boolean editable) {
this.editable = editable;
}
public boolean isEditable() {
return editable;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import java.awt.Component;
import java.awt.FlowLayout;
import java.awt.Graphics;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.Vector;

Expand Down Expand Up @@ -157,8 +158,15 @@ public void valueChanged(javax.swing.event.ListSelectionEvent e) {
if (e.getValueIsAdjusting()) {
return;
}
if (e.getSource() == getScrollPaneTable().getSelectionModel())
setSelectedObjectsFromTable(getScrollPaneTable(), tableModel);
if (e.getSource() == getScrollPaneTable().getSelectionModel()) {

int row = getScrollPaneTable().getSelectedRow();
SpeciesContextSpec scsSelected = tableModel.getValueAt(row);

ArrayList<Object> selectedObjects = new ArrayList<Object>();
selectedObjects.add(scsSelected);
selectionManager.setSelectedObjects(selectedObjects.toArray());
}
}

;
Expand Down Expand Up @@ -440,7 +448,7 @@ private JSortTable getScrollPaneTable() {
try {
table = new JSortTable();
table.setName("spceciesContextSpecsTable");
tableModel = new SpeciesContextSpecsTableModel(table);
tableModel = new SpeciesContextSpecsTableModel(table, this);
table.setModel(tableModel);
table.setScrollTableActionManager(new InternalScrollTableActionManager(table));
table.setAutoResizeMode(JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS);
Expand Down
Loading