use of cbit.vcell.geometry.gui.GeometryViewer in project vcell by virtualcell.
the class MathModelWindowManager method actionPerformed.
/**
* Invoked when an action occurs.
*/
public void actionPerformed(java.awt.event.ActionEvent e) {
String actionCommand = e.getActionCommand();
final Object source = e.getSource();
if (source instanceof GeometryViewer && actionCommand.equals(GuiConstants.ACTIONCMD_CREATE_GEOMETRY) || actionCommand.equals(GuiConstants.ACTIONCMD_EDITCURRENTSPATIAL_GEOMETRY)) {
AsynchClientTask geomRegionsTask = new AsynchClientTask("Update Geometric regions", AsynchClientTask.TASKTYPE_NONSWING_BLOCKING) {
@Override
public void run(Hashtable<String, Object> hashTable) throws Exception {
Geometry newGeom = (Geometry) hashTable.get("doc");
ClientRequestManager.continueAfterMathModelGeomChangeWarning(MathModelWindowManager.this, newGeom);
newGeom.precomputeAll(new GeometryThumbnailImageFactoryAWT());
}
};
AsynchClientTask applyGeomTask = new AsynchClientTask("Apply Geometry", AsynchClientTask.TASKTYPE_SWING_BLOCKING) {
@Override
public void run(Hashtable<String, Object> hashTable) throws Exception {
Geometry newGeom = (Geometry) hashTable.get("doc");
if (newGeom.getName() == null) {
newGeom.setName(getMathModel().getName() + "_" + BeanUtils.generateDateTimeString());
}
((MathModel) getVCDocument()).getMathDescription().setGeometry(newGeom);
}
};
createGeometry(getMathModel().getMathDescription().getGeometry(), new AsynchClientTask[] { /*editSelectTask,*/
geomRegionsTask, applyGeomTask }, TopLevelWindowManager.DEFAULT_CREATEGEOM_SELECT_DIALOG_TITLE, TopLevelWindowManager.APPLY_GEOMETRY_BUTTON_TEXT, (actionCommand.equals(GuiConstants.ACTIONCMD_EDITCURRENTSPATIAL_GEOMETRY) ? new DocumentWindowManager.GeometrySelectionInfo() : null));
}
if (source instanceof GeometryViewer && actionCommand.equals(GuiConstants.ACTIONCMD_CHANGE_GEOMETRY)) {
Hashtable<String, Object> hashTable = new Hashtable<String, Object>();
hashTable.put(SELECT_GEOM_POPUP, new Boolean(true));
getRequestManager().changeGeometry(this, null, hashTable);
}
}
use of cbit.vcell.geometry.gui.GeometryViewer in project vcell by virtualcell.
the class GeometrySummaryViewer method getGeometryViewer.
/**
* Return the GeometrySummaryPanel1 property value.
* @return cbit.vcell.geometry.gui.GeometrySummaryPanel
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private GeometryViewer getGeometryViewer() {
if (geometryViewer == null) {
try {
geometryViewer = new GeometryViewer();
geometryViewer.setName("GeometryViewer");
// user code begin {1}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {2}
// user code end
handleException(ivjExc);
}
}
return geometryViewer;
}
use of cbit.vcell.geometry.gui.GeometryViewer in project vcell by virtualcell.
the class ApplicationGeometryPanel method initialize.
@Override
protected void initialize() {
super.initialize();
geometryViewer = new GeometryViewer();
structureMappingCartoonPanel = new StructureMappingCartoonPanel();
spatialEntitiesPanel = new SpatialEntitiesPanel();
GeometryPanelTab[] geometryPanelTabs = new GeometryPanelTab[GeometryPanelTabID.values().length];
geometryPanelTabs[GeometryPanelTabID.structure_mapping.ordinal()] = new GeometryPanelTab(GeometryPanelTabID.structure_mapping, structureMappingCartoonPanel, null);
geometryPanelTabs[GeometryPanelTabID.geometry_definition.ordinal()] = new GeometryPanelTab(GeometryPanelTabID.geometry_definition, geometryViewer, null);
geometryPanelTabs[GeometryPanelTabID.spatial_entities.ordinal()] = new GeometryPanelTab(GeometryPanelTabID.spatial_entities, spatialEntitiesPanel, null);
for (GeometryPanelTab tab : geometryPanelTabs) {
tab.component.setBorder(GuiConstants.TAB_PANEL_BORDER);
tabbedPane.addTab(tab.id.title, tab.icon, tab.component);
}
}
use of cbit.vcell.geometry.gui.GeometryViewer in project vcell by virtualcell.
the class BioModelWindowManager method actionPerformed.
/**
* Invoked when an action occurs.
*/
public void actionPerformed(java.awt.event.ActionEvent e) {
String actionCommand = e.getActionCommand();
final Object source = e.getSource();
if (source instanceof GeometryViewer && (actionCommand.equals(GuiConstants.ACTIONCMD_CREATE_GEOMETRY) || actionCommand.equals(GuiConstants.ACTIONCMD_EDITCURRENTSPATIAL_GEOMETRY))) {
final GeometryViewer geometryViewer = (GeometryViewer) source;
AsynchClientTask precomputeAllTask = new AsynchClientTask("precomputeAll geometry", AsynchClientTask.TASKTYPE_NONSWING_BLOCKING) {
@Override
public void run(Hashtable<String, Object> hashTable) throws Exception {
Geometry newGeom = (Geometry) hashTable.get("doc");
if (newGeom != null) {
newGeom.precomputeAll(new GeometryThumbnailImageFactoryAWT());
}
}
};
AsynchClientTask setGeomOnSimContextTask = new AsynchClientTask("Setting geometry on application", AsynchClientTask.TASKTYPE_SWING_BLOCKING) {
@Override
public void run(Hashtable<String, Object> hashTable) throws Exception {
Geometry newGeom = (Geometry) hashTable.get("doc");
for (SimulationContext simulationContext : getBioModel().getSimulationContexts()) {
if (simulationContext == geometryViewer.getGeometryOwner()) {
if (newGeom.getName() == null) {
newGeom.setName(getBioModel().getName() + "_" + (simulationContext.getName() + "_" + BeanUtils.generateDateTimeString()));
}
simulationContext.setGeometry(newGeom);
return;
}
}
Geometry origGeom = geometryViewer.getGeometryOwner().getGeometry();
throw new IllegalArgumentException("Couldn't find matching application editor for orig geom '" + origGeom.getName() + "' key=" + origGeom.getKey() + " in application hash.");
}
};
Geometry currentGeometry = geometryViewer.getGeometryOwner().getGeometry();
createGeometry(currentGeometry, new AsynchClientTask[] { /*oldEditorTask,*/
precomputeAllTask, setGeomOnSimContextTask }, (e.toString().equals(FIELD_DATA_FLAG) ? FIELD_DATA_FLAG : TopLevelWindowManager.DEFAULT_CREATEGEOM_SELECT_DIALOG_TITLE), TopLevelWindowManager.APPLY_GEOMETRY_BUTTON_TEXT, (actionCommand.equals(GuiConstants.ACTIONCMD_EDITCURRENTSPATIAL_GEOMETRY) ? new DocumentWindowManager.GeometrySelectionInfo() : null));
}
if (source instanceof MathematicsPanel && actionCommand.equals(GuiConstants.ACTIONCMD_CREATE_MATH_MODEL)) {
SimulationContext sc = ((MathematicsPanel) source).getSimulationContext();
getRequestManager().createMathModelFromApplication(this, "Untitled", sc);
}
if (source instanceof GeometryViewer && actionCommand.equals(GuiConstants.ACTIONCMD_CHANGE_GEOMETRY)) {
final GeometryViewer geometryViewer = (GeometryViewer) source;
Hashtable<String, Object> hashTable = new Hashtable<String, Object>();
hashTable.put(SELECT_GEOM_POPUP, new Boolean(true));
getRequestManager().changeGeometry(this, (SimulationContext) geometryViewer.getGeometryOwner(), hashTable);
}
}
use of cbit.vcell.geometry.gui.GeometryViewer in project vcell by virtualcell.
the class MathModelEditor method initialize.
private void initialize() {
try {
rightSplitPane.setDividerLocation(400);
rightSplitPane.setBottomComponent(rightBottomTabbedPane);
mathModelEditorTreeModel = new MathModelEditorTreeModel(documentEditorTree);
mathModelEditorTreeModel.setSelectionManager(selectionManager);
mathModelEditorTreeCellRenderer = new MathModelEditorTreeCellRenderer();
documentEditorTree.setModel(mathModelEditorTreeModel);
documentEditorTree.setCellRenderer(mathModelEditorTreeCellRenderer);
vcmlEditorPanel = new VCMLEditorPanel();
vcmlEditorPanel.setMinimumSize(new java.awt.Dimension(198, 148));
rightSplitPane.setTopComponent(vcmlEditorPanel);
geometryViewer = new GeometryViewer();
geometryViewer.setSelectionManager(selectionManager);
geometryViewer.setIssueManager(issueManager);
simulationListPanel = new SimulationListPanel();
simulationListPanel.setSelectionManager(selectionManager);
simulationListPanel.setIssueManager(issueManager);
outputFunctionsPanel = new OutputFunctionsPanel();
outputFunctionsPanel.setSelectionManager(selectionManager);
outputFunctionsPanel.setIssueManager(issueManager);
simulationSummaryPanel = new SimulationSummaryPanel();
simulationSummaryPanel.setSelectionManager(selectionManager);
simulationSummaryPanel.setIssueManager(issueManager);
mathModelEditorAnnotationPanel.setSelectionManager(selectionManager);
mathModelEditorAnnotationPanel.setIssueManager(issueManager);
csgObjectPropertiesPanel = new CSGObjectPropertiesPanel();
csgObjectPropertiesPanel.setSelectionManager(selectionManager);
csgObjectPropertiesPanel.setIssueManager(issueManager);
} catch (java.lang.Throwable ivjExc) {
handleException(ivjExc);
}
}
Aggregations