Search in sources :

Example 1 with SelectionManager

use of cbit.vcell.client.desktop.biomodel.SelectionManager 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 SelectionManager

use of cbit.vcell.client.desktop.biomodel.SelectionManager 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)

Aggregations

SelectionManager (cbit.vcell.client.desktop.biomodel.SelectionManager)2 PointObject (cbit.vcell.mapping.spatial.PointObject)2 SpatialObject (cbit.vcell.mapping.spatial.SpatialObject)2 SurfaceRegionObject (cbit.vcell.mapping.spatial.SurfaceRegionObject)2 VolumeRegionObject (cbit.vcell.mapping.spatial.VolumeRegionObject)2 SpatialProcess (cbit.vcell.mapping.spatial.processes.SpatialProcess)2 SpatialObjectTableModel (cbit.vcell.client.desktop.biomodel.SpatialObjectTableModel)1 SpatialProcessTableModel (cbit.vcell.client.desktop.biomodel.SpatialProcessTableModel)1