Search in sources :

Example 1 with SpatialObject

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;
}
Also used : SelectionManager(cbit.vcell.client.desktop.biomodel.SelectionManager) SpatialProcess(cbit.vcell.mapping.spatial.processes.SpatialProcess) VolumeRegionObject(cbit.vcell.mapping.spatial.VolumeRegionObject) SpatialObject(cbit.vcell.mapping.spatial.SpatialObject) PointObject(cbit.vcell.mapping.spatial.PointObject) SurfaceRegionObject(cbit.vcell.mapping.spatial.SurfaceRegionObject) SpatialProcessTableModel(cbit.vcell.client.desktop.biomodel.SpatialProcessTableModel) SpatialObject(cbit.vcell.mapping.spatial.SpatialObject)

Example 2 with SpatialObject

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;
}
Also used : SelectionManager(cbit.vcell.client.desktop.biomodel.SelectionManager) SpatialProcess(cbit.vcell.mapping.spatial.processes.SpatialProcess) VolumeRegionObject(cbit.vcell.mapping.spatial.VolumeRegionObject) SpatialObject(cbit.vcell.mapping.spatial.SpatialObject) PointObject(cbit.vcell.mapping.spatial.PointObject) SurfaceRegionObject(cbit.vcell.mapping.spatial.SurfaceRegionObject) SpatialObjectTableModel(cbit.vcell.client.desktop.biomodel.SpatialObjectTableModel) SpatialObject(cbit.vcell.mapping.spatial.SpatialObject)

Example 3 with SpatialObject

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;
}
Also used : SpatialProcess(cbit.vcell.mapping.spatial.processes.SpatialProcess) SurfaceRegionObject(cbit.vcell.mapping.spatial.SurfaceRegionObject) SpatialObject(cbit.vcell.mapping.spatial.SpatialObject)

Example 4 with SpatialObject

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();
}
Also used : PointObject(cbit.vcell.mapping.spatial.PointObject) SpatialProcess(cbit.vcell.mapping.spatial.processes.SpatialProcess) SpatialObject(cbit.vcell.mapping.spatial.SpatialObject)

Example 5 with SpatialObject

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;
}
Also used : VolumeRegionObject(cbit.vcell.mapping.spatial.VolumeRegionObject) SpatialProcess(cbit.vcell.mapping.spatial.processes.SpatialProcess) SpatialObject(cbit.vcell.mapping.spatial.SpatialObject)

Aggregations

SpatialObject (cbit.vcell.mapping.spatial.SpatialObject)29 SpatialProcess (cbit.vcell.mapping.spatial.processes.SpatialProcess)18 SurfaceRegionObject (cbit.vcell.mapping.spatial.SurfaceRegionObject)9 VolumeRegionObject (cbit.vcell.mapping.spatial.VolumeRegionObject)9 BioEvent (cbit.vcell.mapping.BioEvent)8 SimulationContext (cbit.vcell.mapping.SimulationContext)8 PointObject (cbit.vcell.mapping.spatial.PointObject)8 AssignmentRule (cbit.vcell.mapping.AssignmentRule)7 RateRule (cbit.vcell.mapping.RateRule)7 ReactionStep (cbit.vcell.model.ReactionStep)7 Geometry (cbit.vcell.geometry.Geometry)6 SimulationContextParameter (cbit.vcell.mapping.SimulationContext.SimulationContextParameter)6 SpeciesContextSpec (cbit.vcell.mapping.SpeciesContextSpec)6 StructureMapping (cbit.vcell.mapping.StructureMapping)6 ArrayList (java.util.ArrayList)6 Element (org.jdom.Element)6 ReactionRule (cbit.vcell.model.ReactionRule)5 SpeciesContext (cbit.vcell.model.SpeciesContext)5 NetworkConstraints (org.vcell.model.rbm.NetworkConstraints)5 BioModel (cbit.vcell.biomodel.BioModel)4