Search in sources :

Example 1 with GeometryException

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

the class ClientRequestManager method createMathModel.

/**
 * Insert the method's description here. Creation date: (5/24/2004 12:22:11 PM)
 *
 * @param windowID java.lang.String
 */
private MathModel createMathModel(String name, Geometry geometry) {
    MathModel mathModel = new MathModel(null);
    MathDescription mathDesc = mathModel.getMathDescription();
    try {
        mathDesc.setGeometry(geometry);
        if (geometry.getDimension() == 0) {
            mathDesc.addSubDomain(new CompartmentSubDomain("Compartment", CompartmentSubDomain.NON_SPATIAL_PRIORITY));
        } else {
            try {
                if (geometry.getDimension() > 0 && geometry.getGeometrySurfaceDescription().getGeometricRegions() == null) {
                    geometry.getGeometrySurfaceDescription().updateAll();
                }
            } catch (ImageException e) {
                e.printStackTrace(System.out);
                throw new RuntimeException("Geometric surface generation error: \n" + e.getMessage());
            } catch (GeometryException e) {
                e.printStackTrace(System.out);
                throw new RuntimeException("Geometric surface generation error: \n" + e.getMessage());
            }
            SubVolume[] subVolumes = geometry.getGeometrySpec().getSubVolumes();
            for (int i = 0; i < subVolumes.length; i++) {
                mathDesc.addSubDomain(new CompartmentSubDomain(subVolumes[i].getName(), subVolumes[i].getHandle()));
            }
            // 
            // add only those MembraneSubDomains corresponding to surfaces that acutally
            // exist in geometry.
            // 
            GeometricRegion[] regions = geometry.getGeometrySurfaceDescription().getGeometricRegions();
            for (int i = 0; i < regions.length; i++) {
                if (regions[i] instanceof SurfaceGeometricRegion) {
                    SurfaceGeometricRegion surfaceRegion = (SurfaceGeometricRegion) regions[i];
                    SubVolume subVolume1 = ((VolumeGeometricRegion) surfaceRegion.getAdjacentGeometricRegions()[0]).getSubVolume();
                    SubVolume subVolume2 = ((VolumeGeometricRegion) surfaceRegion.getAdjacentGeometricRegions()[1]).getSubVolume();
                    CompartmentSubDomain compartment1 = mathDesc.getCompartmentSubDomain(subVolume1.getName());
                    CompartmentSubDomain compartment2 = mathDesc.getCompartmentSubDomain(subVolume2.getName());
                    MembraneSubDomain membraneSubDomain = mathDesc.getMembraneSubDomain(compartment1, compartment2);
                    if (membraneSubDomain == null) {
                        SurfaceClass surfaceClass = geometry.getGeometrySurfaceDescription().getSurfaceClass(subVolume1, subVolume2);
                        membraneSubDomain = new MembraneSubDomain(compartment1, compartment2, surfaceClass.getName());
                        mathDesc.addSubDomain(membraneSubDomain);
                    }
                }
            }
        }
        mathDesc.isValid();
        mathModel.setName(name);
    } catch (Exception e) {
        e.printStackTrace(System.out);
    }
    return mathModel;
}
Also used : MathModel(cbit.vcell.mathmodel.MathModel) MembraneSubDomain(cbit.vcell.math.MembraneSubDomain) ImageException(cbit.image.ImageException) SetMathDescription(cbit.vcell.client.task.SetMathDescription) MathDescription(cbit.vcell.math.MathDescription) SurfaceClass(cbit.vcell.geometry.SurfaceClass) GeometryException(cbit.vcell.geometry.GeometryException) VolumeGeometricRegion(cbit.vcell.geometry.surface.VolumeGeometricRegion) ProgrammingException(org.vcell.util.ProgrammingException) MatrixException(cbit.vcell.matrix.MatrixException) GeometryException(cbit.vcell.geometry.GeometryException) IOException(java.io.IOException) DataAccessException(org.vcell.util.DataAccessException) MappingException(cbit.vcell.mapping.MappingException) PropertyVetoException(java.beans.PropertyVetoException) ImageException(cbit.image.ImageException) UtilCancelException(org.vcell.util.UtilCancelException) ModelException(cbit.vcell.model.ModelException) DataFormatException(java.util.zip.DataFormatException) ExpressionException(cbit.vcell.parser.ExpressionException) MathException(cbit.vcell.math.MathException) UserCancelException(org.vcell.util.UserCancelException) SurfaceGeometricRegion(cbit.vcell.geometry.surface.SurfaceGeometricRegion) VolumeGeometricRegion(cbit.vcell.geometry.surface.VolumeGeometricRegion) GeometricRegion(cbit.vcell.geometry.surface.GeometricRegion) CompartmentSubDomain(cbit.vcell.math.CompartmentSubDomain) SubVolume(cbit.vcell.geometry.SubVolume) AnalyticSubVolume(cbit.vcell.geometry.AnalyticSubVolume) ImageSubVolume(cbit.vcell.geometry.ImageSubVolume) SurfaceGeometricRegion(cbit.vcell.geometry.surface.SurfaceGeometricRegion)

Example 2 with GeometryException

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

the class XmlReader method getGeometry.

/**
 * This method returns a Geometry object from a XML representation.
 * Creation date: (4/26/2001 12:12:18 PM)
 * @return cbit.vcell.geometry.Geometry
 * @param param org.jdom.Element
 * @exception cbit.vcell.xml.XmlParseException The exception description.
 */
public Geometry getGeometry(Element param) throws XmlParseException {
    // Get the Extent object
    Extent newextent = getExtent(param.getChild(XMLTags.ExtentTag, vcNamespace));
    // Get VCimage information
    VCImage newimage = null;
    if (param.getChild(XMLTags.ImageTag, vcNamespace) != null) {
        try {
            newimage = getVCImage(param.getChild(XMLTags.ImageTag, vcNamespace), newextent);
        } catch (Throwable e) {
            e.printStackTrace();
            throw new XmlParseException(e);
        }
    }
    // Get attributes
    String name = unMangle(param.getAttributeValue(XMLTags.NameAttrTag));
    int newdimension = Integer.parseInt(param.getAttributeValue(XMLTags.DimensionAttrTag));
    // Get Version
    Version version = getVersion(param.getChild(XMLTags.VersionTag, vcNamespace));
    // Try to construct the geometry upon four different cases
    Geometry newgeometry = null;
    if (version != null && newimage != null) {
        newgeometry = new Geometry(version, newimage);
    } else if (version != null) {
        newgeometry = new Geometry(version, newdimension);
    } else if (newimage != null) {
        newgeometry = new Geometry(name, newimage);
    } else {
        newgeometry = new Geometry(name, newdimension);
    }
    // set attributes
    try {
        if (!newgeometry.getName().equalsIgnoreCase(name)) {
            newgeometry.setName(name);
        }
        // String annotation = param.getAttributeValue(XMLTags.AnnotationAttrTag);
        // if (annotation!=null) {
        // newgeometry.setDescription( unMangle(annotation) );
        // }
        // Add annotation
        String annotation = param.getChildText(XMLTags.AnnotationTag, vcNamespace);
        if (annotation != null && annotation.length() > 0) {
            newgeometry.setDescription(unMangle(annotation));
        }
    } catch (java.beans.PropertyVetoException e) {
        e.printStackTrace();
        throw new XmlParseException("A PropertyVetoException occurred when setting the name " + name + " to a Geometry object!", e);
    }
    // Add the Extent
    try {
        newgeometry.getGeometrySpec().setExtent(newextent);
    } catch (java.beans.PropertyVetoException e) {
        e.printStackTrace();
        throw new XmlParseException("A PropertyVetoException occurred while trying to set the Extent for the Geometry " + name, e);
    }
    // Add the Origin
    newgeometry.getGeometrySpec().setOrigin(getOrigin(param.getChild(XMLTags.OriginTag, vcNamespace)));
    // Add the SubVolumes
    List<Element> children = param.getChildren(XMLTags.SubVolumeTag, vcNamespace);
    SubVolume[] newsubvolumes = new SubVolume[children.size()];
    int subvolumeCounter = 0;
    for (Element child : children) {
        newsubvolumes[subvolumeCounter] = getSubVolume(child);
        subvolumeCounter++;
    }
    try {
        newgeometry.getGeometrySpec().setSubVolumes(newsubvolumes);
    } catch (java.beans.PropertyVetoException e) {
        e.printStackTrace();
        throw new XmlParseException("A PropertyVetoException was generated when ading the subvolumes to the Geometry " + name, e);
    }
    if (newgeometry.getDimension() > 0) {
        // Add SurfaceClasses
        List<Element> surfaceClassChildren = param.getChildren(XMLTags.SurfaceClassTag, vcNamespace);
        SurfaceClass[] newSurfaceClassArr = new SurfaceClass[surfaceClassChildren.size()];
        int surfClassCounter = 0;
        for (Element surfClassChild : surfaceClassChildren) {
            newSurfaceClassArr[surfClassCounter] = getSurfaceClass(surfClassChild, newgeometry);
            surfClassCounter++;
        }
        try {
            newgeometry.getGeometrySurfaceDescription().setSurfaceClasses(newSurfaceClassArr);
        } catch (java.beans.PropertyVetoException e) {
            e.printStackTrace();
            throw new XmlParseException("A PropertyVetoException was generated when ading the subvolumes to the Geometry " + name, e);
        }
    }
    // read Filaments (if any)
    Iterator<Element> iterator = param.getChildren(XMLTags.FilamentTag, vcNamespace).iterator();
    while (iterator.hasNext()) {
        Element tempElement = iterator.next();
        String filname = unMangle(tempElement.getAttributeValue(XMLTags.NameAttrTag));
        Iterator<Element> curveiterator = tempElement.getChildren().iterator();
        while (curveiterator.hasNext()) {
            ControlPointCurve curve = getControlPointCurve(curveiterator.next());
            newgeometry.getGeometrySpec().getFilamentGroup().addCurve(filname, curve);
        }
    }
    // read Surface description (if any)
    Element sd = param.getChild(XMLTags.SurfaceDescriptionTag, vcNamespace);
    if (sd != null) {
        GeometrySurfaceDescription dummy = getGeometrySurfaceDescription(sd, newgeometry);
    }
    try {
        newgeometry.precomputeAll(new GeometryThumbnailImageFactoryAWT(), false, false);
    } catch (GeometryException e) {
        e.printStackTrace(System.out);
    } catch (ImageException e) {
        e.printStackTrace(System.out);
    } catch (ExpressionException e) {
        e.printStackTrace(System.out);
    }
    return newgeometry;
}
Also used : ImageException(cbit.image.ImageException) GeometrySurfaceDescription(cbit.vcell.geometry.surface.GeometrySurfaceDescription) Extent(org.vcell.util.Extent) SurfaceClass(cbit.vcell.geometry.SurfaceClass) GeometryException(cbit.vcell.geometry.GeometryException) Element(org.jdom.Element) VCImage(cbit.image.VCImage) ControlPointCurve(cbit.vcell.geometry.ControlPointCurve) ExpressionException(cbit.vcell.parser.ExpressionException) Geometry(cbit.vcell.geometry.Geometry) PropertyVetoException(java.beans.PropertyVetoException) GeometryThumbnailImageFactoryAWT(cbit.vcell.geometry.GeometryThumbnailImageFactoryAWT) Version(org.vcell.util.document.Version) RedistributionVersion(cbit.vcell.solvers.mb.MovingBoundarySolverOptions.RedistributionVersion) SimulationVersion(org.vcell.util.document.SimulationVersion) VCellSoftwareVersion(org.vcell.util.document.VCellSoftwareVersion) SubVolume(cbit.vcell.geometry.SubVolume) CompartmentSubVolume(cbit.vcell.geometry.CompartmentSubVolume) AnalyticSubVolume(cbit.vcell.geometry.AnalyticSubVolume) ImageSubVolume(cbit.vcell.geometry.ImageSubVolume)

Example 3 with GeometryException

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

the class StochtestRunService method runOne.

public void runOne() throws IllegalArgumentException, SQLException, DataAccessException, XmlParseException, PropertyVetoException, ExpressionException, MappingException, GeometryException, ImageException, IOException {
    StochtestRun stochtestRun = StochtestDbUtils.acceptNextWaitingStochtestRun(conFactory);
    String biomodelXML = null;
    if (stochtestRun != null) {
        String networkGenProbs = null;
        try {
            User user = new User(PropertyLoader.ADMINISTRATOR_ACCOUNT, new KeyValue(PropertyLoader.ADMINISTRATOR_ID));
            ServerDocumentManager serverDocumentManager = new ServerDocumentManager(this.dbServerImpl);
            biomodelXML = serverDocumentManager.getBioModelXML(new QueryHashtable(), user, stochtestRun.stochtest.biomodelRef, true);
            BioModel bioModel = XmlHelper.XMLToBioModel(new XMLSource(biomodelXML));
            bioModel.refreshDependencies();
            SimulationContext srcSimContext = null;
            for (SimulationContext sc : bioModel.getSimulationContexts()) {
                if (sc.getKey().equals(stochtestRun.stochtest.simContextRef)) {
                    srcSimContext = sc;
                }
            }
            if (srcSimContext == null) {
                throw new RuntimeException("cannot find simcontext with key=" + stochtestRun.stochtest.simContextRef);
            }
            // 
            for (SpeciesContextSpec scs : srcSimContext.getReactionContext().getSpeciesContextSpecs()) {
                scs.setConstant(false);
            }
            SimulationContext simContext = srcSimContext;
            StochtestMathType parentMathType = stochtestRun.parentMathType;
            StochtestMathType mathType = stochtestRun.mathType;
            if (parentMathType != mathType) {
                if (parentMathType == StochtestMathType.nonspatialstochastic && mathType == StochtestMathType.rules) {
                    simContext = SimulationContext.copySimulationContext(srcSimContext, "generatedRules", false, Application.RULE_BASED_STOCHASTIC);
                } else if (parentMathType == StochtestMathType.rules && mathType == StochtestMathType.nonspatialstochastic) {
                    simContext = SimulationContext.copySimulationContext(srcSimContext, "generatedSSA", false, Application.NETWORK_STOCHASTIC);
                } else {
                    throw new RuntimeException("unexpected copy of simcontext from " + parentMathType + " to " + mathType);
                }
                bioModel.addSimulationContext(simContext);
            }
            MathMappingCallback mathMappingCallback = new MathMappingCallback() {

                @Override
                public void setProgressFraction(float fractionDone) {
                }

                @Override
                public void setMessage(String message) {
                }

                @Override
                public boolean isInterrupted() {
                    return false;
                }
            };
            MathMapping mathMapping = simContext.createNewMathMapping(mathMappingCallback, NetworkGenerationRequirements.ComputeFullStandardTimeout);
            MathDescription mathDesc = mathMapping.getMathDescription(mathMappingCallback);
            simContext.setMathDescription(mathDesc);
            if (simContext.isInsufficientIterations()) {
                networkGenProbs = "insufficientIterations";
            } else if (simContext.isInsufficientMaxMolecules()) {
                networkGenProbs = "insufficientMaxMolecules";
            }
            File baseDirectory = StochtestFileUtils.createDirFile(baseDir, stochtestRun);
            try {
                OutputTimeSpec outputTimeSpec = new UniformOutputTimeSpec(0.5);
                double endTime = 10.0;
                computeTrials(simContext, stochtestRun, baseDirectory, outputTimeSpec, endTime, numTrials);
                StochtestDbUtils.finalizeAcceptedStochtestRun(conFactory, stochtestRun, StochtestRun.StochtestRunStatus.complete, null, networkGenProbs);
            } finally {
                StochtestFileUtils.clearDir(baseDirectory);
            }
        } catch (Exception e) {
            StochtestDbUtils.finalizeAcceptedStochtestRun(conFactory, stochtestRun, StochtestRun.StochtestRunStatus.failed, e.getMessage(), networkGenProbs);
            // 
            if (biomodelXML != null) {
                XmlUtil.writeXMLStringToFile(biomodelXML, new File(baseDir, "stochtestrun_" + stochtestRun.stochtest.key + ".vcml").getPath(), false);
            }
            // 
            // write exception trace to .txt file
            // 
            StringWriter stringWriter = new StringWriter();
            PrintWriter printWriter = new PrintWriter(stringWriter);
            e.printStackTrace(printWriter);
            printWriter.flush();
            System.out.println(stringWriter.getBuffer().toString());
            XmlUtil.writeXMLStringToFile(stringWriter.getBuffer().toString(), new File(baseDir, "stochtestrun_" + stochtestRun.stochtest.key + "_error.txt").getPath(), false);
        }
    } else {
        System.out.println("no jobs waiting");
        try {
            Thread.sleep(5000);
        } catch (InterruptedException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
}
Also used : QueryHashtable(cbit.sql.QueryHashtable) User(org.vcell.util.document.User) KeyValue(org.vcell.util.document.KeyValue) MathMappingCallback(cbit.vcell.mapping.SimulationContext.MathMappingCallback) UniformOutputTimeSpec(cbit.vcell.solver.UniformOutputTimeSpec) MathDescription(cbit.vcell.math.MathDescription) SimulationContext(cbit.vcell.mapping.SimulationContext) SpeciesContextSpec(cbit.vcell.mapping.SpeciesContextSpec) ServerDocumentManager(cbit.vcell.modeldb.ServerDocumentManager) PropertyVetoException(java.beans.PropertyVetoException) SQLException(java.sql.SQLException) XmlParseException(cbit.vcell.xml.XmlParseException) ImageException(cbit.image.ImageException) IOException(java.io.IOException) DataAccessException(org.vcell.util.DataAccessException) ExpressionException(cbit.vcell.parser.ExpressionException) MappingException(cbit.vcell.mapping.MappingException) GeometryException(cbit.vcell.geometry.GeometryException) UniformOutputTimeSpec(cbit.vcell.solver.UniformOutputTimeSpec) OutputTimeSpec(cbit.vcell.solver.OutputTimeSpec) StringWriter(java.io.StringWriter) BioModel(cbit.vcell.biomodel.BioModel) MathMapping(cbit.vcell.mapping.MathMapping) XMLSource(cbit.vcell.xml.XMLSource) File(java.io.File) PrintWriter(java.io.PrintWriter)

Example 4 with GeometryException

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

the class StochtestCompareService method compareOne.

public void compareOne() throws IllegalArgumentException, SQLException, DataAccessException, XmlParseException, PropertyVetoException, ExpressionException, MappingException, GeometryException, ImageException, IOException {
    StochtestCompare stochtestCompare = StochtestDbUtils.acceptNextWaitingStochtestCompare(conFactory);
    String biomodelXML = null;
    if (stochtestCompare != null) {
        try {
            StochtestRun stochtestRun1 = StochtestDbUtils.getStochtestRun(conFactory, stochtestCompare.stochtestRun1ref);
            StochtestRun stochtestRun2 = StochtestDbUtils.getStochtestRun(conFactory, stochtestCompare.stochtestRun2ref);
            if (stochtestRun1.status != StochtestRunStatus.complete) {
                throw new RuntimeException("incomplete run status found: " + stochtestRun1.status.name());
            }
            if (stochtestRun2.status != StochtestRunStatus.complete) {
                throw new RuntimeException("incomplete run status found: " + stochtestRun2.status.name());
            }
            TimeSeriesMultitrialData data1 = StochtestFileUtils.readData(StochtestFileUtils.getStochtestRunDataFile(baseDir, stochtestRun1));
            TimeSeriesMultitrialData data2 = StochtestFileUtils.readData(StochtestFileUtils.getStochtestRunDataFile(baseDir, stochtestRun2));
            SummaryStatistics results = TimeSeriesMultitrialData.statisticsSummary(data1, data2);
            XmlUtil.writeXMLStringToFile(results.results(), new File(baseDir, "stochtestcompare_" + stochtestCompare.key + "_summary.txt").getPath(), false);
            StochtestFileUtils.writeVarDiffData(new File(baseDir, "stochtestcompare_" + stochtestCompare.key + "_vardiff.csv"), data1, data2);
            StochtestFileUtils.writeKolmogorovSmirnovTest(new File(baseDir, "stochtestcompare_" + stochtestCompare.key + "_kolmogorovSmirnov.csv"), data1, data2);
            StochtestFileUtils.writeChiSquareTest(new File(baseDir, "stochtestcompare_" + stochtestCompare.key + "_chiSquared.csv"), data1, data2);
            StochtestCompareStatus status = (results.pass()) ? StochtestCompareStatus.not_verydifferent : StochtestCompareStatus.verydifferent;
            StochtestDbUtils.finalizeAcceptedStochtestCompare(conFactory, stochtestCompare, status, null, results);
        } catch (Exception e) {
            StochtestDbUtils.finalizeAcceptedStochtestCompare(conFactory, stochtestCompare, StochtestCompare.StochtestCompareStatus.failed, e.getMessage(), null);
            // 
            // write exception trace to .txt file
            // 
            StringWriter stringWriter = new StringWriter();
            PrintWriter printWriter = new PrintWriter(stringWriter);
            e.printStackTrace(printWriter);
            printWriter.flush();
            System.out.println(stringWriter.getBuffer().toString());
            XmlUtil.writeXMLStringToFile(stringWriter.getBuffer().toString(), new File(baseDir, "stochtestrun_" + stochtestCompare.key + "_error.txt").getPath(), false);
        }
    } else {
        System.out.println("no compare jobs waiting");
        try {
            Thread.sleep(5000);
        } catch (InterruptedException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
}
Also used : StochtestCompareStatus(org.vcell.stochtest.StochtestCompare.StochtestCompareStatus) StringWriter(java.io.StringWriter) SummaryStatistics(org.vcell.stochtest.TimeSeriesMultitrialData.SummaryStatistics) File(java.io.File) ImageException(cbit.image.ImageException) IOException(java.io.IOException) DataAccessException(org.vcell.util.DataAccessException) ExpressionException(cbit.vcell.parser.ExpressionException) PropertyVetoException(java.beans.PropertyVetoException) MappingException(cbit.vcell.mapping.MappingException) SQLException(java.sql.SQLException) GeometryException(cbit.vcell.geometry.GeometryException) XmlParseException(cbit.vcell.xml.XmlParseException) PrintWriter(java.io.PrintWriter)

Example 5 with GeometryException

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

the class ClientRequestManager method createMathModelFromApplication.

/**
 * Insert the method's description here. Creation date: (5/24/2004 12:22:11 PM)
 *
 * @param windowID java.lang.String
 */
public void createMathModelFromApplication(final BioModelWindowManager requester, final String name, final SimulationContext simContext) {
    if (simContext == null) {
        PopupGenerator.showErrorDialog(requester, "Selected Application is null, cannot generate corresponding math model");
        return;
    }
    switch(simContext.getApplicationType()) {
        case NETWORK_STOCHASTIC:
            break;
        case RULE_BASED_STOCHASTIC:
        case NETWORK_DETERMINISTIC:
    }
    AsynchClientTask task1 = new AsynchClientTask("Creating MathModel from BioModel Application", AsynchClientTask.TASKTYPE_NONSWING_BLOCKING) {

        @Override
        public void run(Hashtable<String, Object> hashTable) throws Exception {
            MathModel newMathModel = new MathModel(null);
            // Get corresponding mathDesc to create new mathModel.
            MathDescription mathDesc = simContext.getMathDescription();
            MathDescription newMathDesc = null;
            newMathDesc = new MathDescription(name + "_" + (new java.util.Random()).nextInt());
            try {
                if (mathDesc.getGeometry().getDimension() > 0 && mathDesc.getGeometry().getGeometrySurfaceDescription().getGeometricRegions() == null) {
                    mathDesc.getGeometry().getGeometrySurfaceDescription().updateAll();
                }
            } catch (ImageException e) {
                e.printStackTrace(System.out);
                throw new RuntimeException("Geometric surface generation error:\n" + e.getMessage());
            } catch (GeometryException e) {
                e.printStackTrace(System.out);
                throw new RuntimeException("Geometric surface generation error:\n" + e.getMessage());
            }
            newMathDesc.setGeometry(mathDesc.getGeometry());
            newMathDesc.read_database(new CommentStringTokenizer(mathDesc.getVCML_database()));
            newMathDesc.isValid();
            newMathModel.setName(name);
            newMathModel.setMathDescription(newMathDesc);
            hashTable.put("newMathModel", newMathModel);
        }
    };
    AsynchClientTask task2 = new AsynchClientTask("Creating MathModel from BioModel Application", AsynchClientTask.TASKTYPE_SWING_BLOCKING) {

        @Override
        public void run(Hashtable<String, Object> hashTable) throws Exception {
            MathModel newMathModel = (MathModel) hashTable.get("newMathModel");
            DocumentWindowManager windowManager = createDocumentWindowManager(newMathModel);
            if (simContext.getBioModel().getVersion() != null) {
                ((MathModelWindowManager) windowManager).setCopyFromBioModelAppVersionableTypeVersion(new VersionableTypeVersion(VersionableType.BioModelMetaData, simContext.getBioModel().getVersion()));
            }
            DocumentWindow dw = getMdiManager().createNewDocumentWindow(windowManager);
            setFinalWindow(hashTable, dw);
        }
    };
    ClientTaskDispatcher.dispatch(requester.getComponent(), new Hashtable<String, Object>(), new AsynchClientTask[] { task1, task2 }, false);
}
Also used : AsynchClientTask(cbit.vcell.client.task.AsynchClientTask) MathModel(cbit.vcell.mathmodel.MathModel) ImageException(cbit.image.ImageException) VersionableTypeVersion(org.vcell.util.document.VersionableTypeVersion) SetMathDescription(cbit.vcell.client.task.SetMathDescription) MathDescription(cbit.vcell.math.MathDescription) Hashtable(java.util.Hashtable) GeometryException(cbit.vcell.geometry.GeometryException) Random(java.util.Random) DocumentWindow(cbit.vcell.client.desktop.DocumentWindow) CommentStringTokenizer(org.vcell.util.CommentStringTokenizer) CSGObject(cbit.vcell.geometry.CSGObject)

Aggregations

GeometryException (cbit.vcell.geometry.GeometryException)8 ImageException (cbit.image.ImageException)6 PropertyVetoException (java.beans.PropertyVetoException)6 ExpressionException (cbit.vcell.parser.ExpressionException)5 IOException (java.io.IOException)4 DataAccessException (org.vcell.util.DataAccessException)4 ImageSubVolume (cbit.vcell.geometry.ImageSubVolume)3 SubVolume (cbit.vcell.geometry.SubVolume)3 MappingException (cbit.vcell.mapping.MappingException)3 MathDescription (cbit.vcell.math.MathDescription)3 VCImage (cbit.image.VCImage)2 SetMathDescription (cbit.vcell.client.task.SetMathDescription)2 AnalyticSubVolume (cbit.vcell.geometry.AnalyticSubVolume)2 Geometry (cbit.vcell.geometry.Geometry)2 SurfaceClass (cbit.vcell.geometry.SurfaceClass)2 MathException (cbit.vcell.math.MathException)2 MathModel (cbit.vcell.mathmodel.MathModel)2 XmlParseException (cbit.vcell.xml.XmlParseException)2 File (java.io.File)2 PrintWriter (java.io.PrintWriter)2