use of cbit.vcell.mapping.spatial.SpatialObject in project vcell by virtualcell.
the class DefaultScrollTableCellRenderer method isMatchWithSelectedObject.
private boolean isMatchWithSelectedObject(JTable table, int row) {
SpatialProcessTableModel tm = (SpatialProcessTableModel) table.getModel();
SelectionManager selectionManager = tm.getSelectionManager();
boolean found = false;
if (selectionManager != null) {
for (Object ob : selectionManager.getSelectedObjects()) {
if (ob instanceof SpatialObject) {
// a SpatialObject selected
List<SpatialProcess> spList = ((SpatialObject) ob).getRelatedSpatialProcesses();
for (SpatialProcess theirs : spList) {
SpatialProcess ours = tm.getValueAt(row);
if (ours == theirs) {
found = true;
break;
}
}
}
if (found == true) {
break;
}
}
}
return found;
}
use of cbit.vcell.mapping.spatial.SpatialObject in project vcell by virtualcell.
the class DefaultScrollTableCellRenderer method isMatchWithSelectedProcess.
private boolean isMatchWithSelectedProcess(JTable table, int row) {
SpatialObjectTableModel tm = (SpatialObjectTableModel) table.getModel();
SelectionManager selectionManager = tm.getSelectionManager();
boolean found = false;
if (selectionManager != null) {
for (Object ob : selectionManager.getSelectedObjects()) {
if (ob instanceof SpatialProcess) {
// a SpatialProcess selected
List<SpatialObject> soList = ((SpatialProcess) ob).getSpatialObjects();
for (SpatialObject theirs : soList) {
SpatialObject ours = tm.getValueAt(row);
if (ours == theirs) {
found = true;
break;
}
}
}
if (found == true) {
break;
}
}
}
return found;
}
use of cbit.vcell.mapping.spatial.SpatialObject in project vcell by virtualcell.
the class SpatialProcessDisplayPanel method getFreeSurfaceRegionObject.
private SurfaceRegionObject getFreeSurfaceRegionObject() {
for (SpatialObject spatialObject : simulationContext.getSpatialObjects()) {
if (spatialObject instanceof SurfaceRegionObject) {
SurfaceRegionObject surfaceRegionObject = (SurfaceRegionObject) spatialObject;
boolean bSurfaceRegionObjectFree = true;
for (SpatialProcess spatialProcess : simulationContext.getSpatialProcesses()) {
if (spatialProcess.getSpatialObjects().contains(surfaceRegionObject)) {
bSurfaceRegionObjectFree = false;
break;
}
}
if (bSurfaceRegionObjectFree) {
return surfaceRegionObject;
}
}
}
return null;
}
use of cbit.vcell.mapping.spatial.SpatialObject in project vcell by virtualcell.
the class SpatialProcessDisplayPanel method getOrCreateNextPointObject.
private PointObject getOrCreateNextPointObject() {
for (SpatialObject spatialObject : simulationContext.getSpatialObjects()) {
if (spatialObject instanceof PointObject) {
PointObject pointObject = (PointObject) spatialObject;
boolean bPointObjectFree = true;
for (SpatialProcess spatialProcess : simulationContext.getSpatialProcesses()) {
if (spatialProcess.getSpatialObjects().contains(pointObject)) {
bPointObjectFree = false;
break;
}
}
if (bPointObjectFree) {
return pointObject;
}
}
}
return simulationContext.createPointObject();
}
use of cbit.vcell.mapping.spatial.SpatialObject in project vcell by virtualcell.
the class SpatialProcessDisplayPanel method getFreeVolumeRegionObject.
private VolumeRegionObject getFreeVolumeRegionObject() {
for (SpatialObject spatialObject : simulationContext.getSpatialObjects()) {
if (spatialObject instanceof VolumeRegionObject) {
VolumeRegionObject volumeRegionObject = (VolumeRegionObject) spatialObject;
boolean bVolumeRegionObjectFree = true;
for (SpatialProcess spatialProcess : simulationContext.getSpatialProcesses()) {
if (spatialProcess.getSpatialObjects().contains(volumeRegionObject)) {
bVolumeRegionObjectFree = false;
break;
}
}
if (bVolumeRegionObjectFree) {
return volumeRegionObject;
}
}
}
return null;
}
Aggregations