Search in sources :

Example 16 with GeometryThumbnailImageFactoryAWT

use of cbit.vcell.geometry.GeometryThumbnailImageFactoryAWT in project vcell by virtualcell.

the class GeometrySubVolumePanel method moveSubvolumeFront.

/**
 * connEtoM6:  (FrontButton.action.actionPerformed(java.awt.event.ActionEvent) --> Geometry.bringForward(Lcbit.vcell.geometry.AnalyticSubVolume;)V)
 * @param arg1 java.awt.event.ActionEvent
 */
private void moveSubvolumeFront() {
    try {
        if ((getSelectedSubVolume() != null)) {
            AsynchClientTask task1 = new AsynchClientTask("moving to front", AsynchClientTask.TASKTYPE_NONSWING_BLOCKING) {

                @Override
                public void run(Hashtable<String, Object> hashTable) throws Exception {
                    SubVolume selectedSubVolume = getSelectedSubVolume();
                    if (selectedSubVolume instanceof CSGObject) {
                        getGeometrySpec().bringForward((CSGObject) selectedSubVolume);
                    } else if (selectedSubVolume instanceof AnalyticSubVolume) {
                        getGeometrySpec().bringForward((AnalyticSubVolume) selectedSubVolume);
                    }
                    getGeometry().precomputeAll(new GeometryThumbnailImageFactoryAWT());
                }
            };
            ClientTaskDispatcher.dispatch(GeometrySubVolumePanel.this, new Hashtable<String, Object>(), new AsynchClientTask[] { task1 }, false);
        }
    } catch (java.lang.Throwable ivjExc) {
        handleException(ivjExc);
    }
}
Also used : GeometryThumbnailImageFactoryAWT(cbit.vcell.geometry.GeometryThumbnailImageFactoryAWT) AsynchClientTask(cbit.vcell.client.task.AsynchClientTask) Hashtable(java.util.Hashtable) SubVolume(cbit.vcell.geometry.SubVolume) ImageSubVolume(cbit.vcell.geometry.ImageSubVolume) AnalyticSubVolume(cbit.vcell.geometry.AnalyticSubVolume) CSGObject(cbit.vcell.geometry.CSGObject) CSGObject(cbit.vcell.geometry.CSGObject) AnalyticSubVolume(cbit.vcell.geometry.AnalyticSubVolume)

Example 17 with GeometryThumbnailImageFactoryAWT

use of cbit.vcell.geometry.GeometryThumbnailImageFactoryAWT in project vcell by virtualcell.

the class GeometrySubVolumePanel method addSubVolume.

private void addSubVolume(final SubVolume subVolume) {
    AsynchClientTask task1 = new AsynchClientTask("adding subdomain", AsynchClientTask.TASKTYPE_NONSWING_BLOCKING) {

        @Override
        public void run(Hashtable<String, Object> hashTable) throws Exception {
            if (subVolume instanceof AnalyticSubVolume) {
                getGeometrySpec().addSubVolume((AnalyticSubVolume) subVolume, true);
            } else if (subVolume instanceof CSGObject) {
                getGeometrySpec().addSubVolume((CSGObject) subVolume, true);
            }
            getGeometry().precomputeAll(new GeometryThumbnailImageFactoryAWT());
        }
    };
    AsynchClientTask task2 = new AsynchClientTask("adding subdomain", AsynchClientTask.TASKTYPE_SWING_BLOCKING) {

        @Override
        public void run(Hashtable<String, Object> hashTable) throws Exception {
            DocumentEditorSubPanel.setTableSelections(new Object[] { subVolume }, ivjScrollPaneTable, ivjgeometrySubVolumeTableModel);
        }
    };
    ClientTaskDispatcher.dispatch(GeometrySubVolumePanel.this, new Hashtable<String, Object>(), new AsynchClientTask[] { task1, task2 }, true, false, false, null, true);
}
Also used : GeometryThumbnailImageFactoryAWT(cbit.vcell.geometry.GeometryThumbnailImageFactoryAWT) AsynchClientTask(cbit.vcell.client.task.AsynchClientTask) Hashtable(java.util.Hashtable) CSGObject(cbit.vcell.geometry.CSGObject) CSGObject(cbit.vcell.geometry.CSGObject) AnalyticSubVolume(cbit.vcell.geometry.AnalyticSubVolume)

Example 18 with GeometryThumbnailImageFactoryAWT

use of cbit.vcell.geometry.GeometryThumbnailImageFactoryAWT in project vcell by virtualcell.

the class GeometrySubVolumePanel method deleteSubvolume.

/**
 * connEtoM1:  (DeleteButton.action.actionPerformed(java.awt.event.ActionEvent) --> Geometry.removeAnalyticSubVolume(Lcbit.vcell.geometry.AnalyticSubVolume;)V)
 * @param arg1 java.awt.event.ActionEvent
 */
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private void deleteSubvolume() {
    try {
        if ((getSelectedSubVolume() != null)) {
            AsynchClientTask task1 = new AsynchClientTask("removing subdomain", AsynchClientTask.TASKTYPE_NONSWING_BLOCKING) {

                @Override
                public void run(Hashtable<String, Object> hashTable) throws Exception {
                    if (getSelectedSubVolume() instanceof AnalyticSubVolume) {
                        getGeometrySpec().removeAnalyticSubVolume((AnalyticSubVolume) getSelectedSubVolume());
                    } else if (getSelectedSubVolume() instanceof CSGObject) {
                        getGeometrySpec().removeCSGObject((CSGObject) getSelectedSubVolume());
                    }
                    getGeometry().precomputeAll(new GeometryThumbnailImageFactoryAWT());
                }
            };
            ClientTaskDispatcher.dispatch(GeometrySubVolumePanel.this, new Hashtable<String, Object>(), new AsynchClientTask[] { task1 }, false);
        }
    } catch (java.lang.Throwable ivjExc) {
        handleException(ivjExc);
    }
}
Also used : GeometryThumbnailImageFactoryAWT(cbit.vcell.geometry.GeometryThumbnailImageFactoryAWT) AsynchClientTask(cbit.vcell.client.task.AsynchClientTask) Hashtable(java.util.Hashtable) CSGObject(cbit.vcell.geometry.CSGObject) CSGObject(cbit.vcell.geometry.CSGObject) AnalyticSubVolume(cbit.vcell.geometry.AnalyticSubVolume)

Example 19 with GeometryThumbnailImageFactoryAWT

use of cbit.vcell.geometry.GeometryThumbnailImageFactoryAWT in project vcell by virtualcell.

the class GeometrySubVolumePanel method moveBack.

/**
 * connEtoM9:  (BackButton.action.actionPerformed(java.awt.event.ActionEvent) --> Geometry.sendBackward(Lcbit.vcell.geometry.AnalyticSubVolume;)V)
 * @param arg1 java.awt.event.ActionEvent
 */
private void moveBack() {
    try {
        if ((getSelectedSubVolume() != null)) {
            AsynchClientTask task1 = new AsynchClientTask("moving to back", AsynchClientTask.TASKTYPE_NONSWING_BLOCKING) {

                @Override
                public void run(Hashtable<String, Object> hashTable) throws Exception {
                    SubVolume selectedSubVolume = getSelectedSubVolume();
                    if (selectedSubVolume instanceof CSGObject) {
                        getGeometrySpec().sendBackward((CSGObject) selectedSubVolume);
                    } else if (selectedSubVolume instanceof AnalyticSubVolume) {
                        getGeometrySpec().sendBackward((AnalyticSubVolume) selectedSubVolume);
                    }
                    getGeometry().precomputeAll(new GeometryThumbnailImageFactoryAWT());
                }
            };
            ClientTaskDispatcher.dispatch(GeometrySubVolumePanel.this, new Hashtable<String, Object>(), new AsynchClientTask[] { task1 }, false);
        }
    } catch (java.lang.Throwable ivjExc) {
        handleException(ivjExc);
    }
}
Also used : GeometryThumbnailImageFactoryAWT(cbit.vcell.geometry.GeometryThumbnailImageFactoryAWT) AsynchClientTask(cbit.vcell.client.task.AsynchClientTask) Hashtable(java.util.Hashtable) SubVolume(cbit.vcell.geometry.SubVolume) ImageSubVolume(cbit.vcell.geometry.ImageSubVolume) AnalyticSubVolume(cbit.vcell.geometry.AnalyticSubVolume) CSGObject(cbit.vcell.geometry.CSGObject) CSGObject(cbit.vcell.geometry.CSGObject) AnalyticSubVolume(cbit.vcell.geometry.AnalyticSubVolume)

Example 20 with GeometryThumbnailImageFactoryAWT

use of cbit.vcell.geometry.GeometryThumbnailImageFactoryAWT in project vcell by virtualcell.

the class GeometryViewer method updateSurfaceView.

private void updateSurfaceView() {
    if (tabbedPane.getSelectedComponent() == surfaceViewer && getGeometry() != null) {
        AsynchClientTask surfaceGenerationTask = new AsynchClientTask("creating new smoothed surface", AsynchClientTask.TASKTYPE_NONSWING_BLOCKING) {

            public void run(Hashtable<String, Object> hashTable) throws Exception {
                getGeometry().precomputeAll(new GeometryThumbnailImageFactoryAWT(), true, true);
            }
        };
        AsynchClientTask[] tasks = new AsynchClientTask[] { surfaceGenerationTask };
        ClientTaskDispatcher.dispatch(this, new Hashtable<String, Object>(), tasks);
    }
}
Also used : GeometryThumbnailImageFactoryAWT(cbit.vcell.geometry.GeometryThumbnailImageFactoryAWT) AsynchClientTask(cbit.vcell.client.task.AsynchClientTask) Hashtable(java.util.Hashtable)

Aggregations

GeometryThumbnailImageFactoryAWT (cbit.vcell.geometry.GeometryThumbnailImageFactoryAWT)28 AsynchClientTask (cbit.vcell.client.task.AsynchClientTask)17 Hashtable (java.util.Hashtable)17 Geometry (cbit.vcell.geometry.Geometry)16 AnalyticSubVolume (cbit.vcell.geometry.AnalyticSubVolume)11 CSGObject (cbit.vcell.geometry.CSGObject)10 SubVolume (cbit.vcell.geometry.SubVolume)9 SimulationContext (cbit.vcell.mapping.SimulationContext)9 VCImage (cbit.image.VCImage)8 Expression (cbit.vcell.parser.Expression)7 PropertyVetoException (java.beans.PropertyVetoException)7 ISize (org.vcell.util.ISize)7 ImageException (cbit.image.ImageException)6 Extent (org.vcell.util.Extent)6 GeometryException (cbit.vcell.geometry.GeometryException)5 GeometrySpec (cbit.vcell.geometry.GeometrySpec)5 ImageSubVolume (cbit.vcell.geometry.ImageSubVolume)5 SurfaceClass (cbit.vcell.geometry.SurfaceClass)5 ArrayList (java.util.ArrayList)5 Origin (org.vcell.util.Origin)5