Search in sources :

Example 11 with VCMetaData

use of cbit.vcell.biomodel.meta.VCMetaData in project vcell by virtualcell.

the class AnnotationMapping method getComponentInfo.

private ArrayList<String> getComponentInfo(BioModel bioModel, Identifiable identifiable) {
    ArrayList<String> info = new ArrayList<String>();
    VCMetaData vcMetaData = bioModel.getVCMetaData();
    VCID vcid = vcMetaData.getIdentifiableProvider().getVCID(identifiable);
    String modelComponentType = vcid.getClassName();
    String modelComponentName = vcid.getLocalName();
    info.add(modelComponentName);
    info.add(modelComponentType);
    return info;
}
Also used : VCID(cbit.vcell.biomodel.meta.VCID) VCMetaData(cbit.vcell.biomodel.meta.VCMetaData) ArrayList(java.util.ArrayList)

Example 12 with VCMetaData

use of cbit.vcell.biomodel.meta.VCMetaData in project vcell by virtualcell.

the class StructurePropertiesPanel method changeAnnotation.

/**
 * Comment
 */
private void changeAnnotation() {
    try {
        if (structure == null || fieldModel == null) {
            return;
        }
        VCMetaData vcMetaData = fieldModel.getVcMetaData();
        String textAreaStr = (annotationTextArea.getText() == null || annotationTextArea.getText().length() == 0 ? null : annotationTextArea.getText());
        if (!Compare.isEqualOrNull(vcMetaData.getFreeTextAnnotation(structure), textAreaStr)) {
            vcMetaData.setFreeTextAnnotation(structure, textAreaStr);
        }
    } catch (Exception e) {
        e.printStackTrace(System.out);
        PopupGenerator.showErrorDialog(this, e.getMessage(), e);
    }
}
Also used : VCMetaData(cbit.vcell.biomodel.meta.VCMetaData) PropertyVetoException(java.beans.PropertyVetoException)

Example 13 with VCMetaData

use of cbit.vcell.biomodel.meta.VCMetaData in project vcell by virtualcell.

the class ReactionPropertiesPanel method changeFreeTextAnnotation.

private void changeFreeTextAnnotation() {
    try {
        if (reactionStep == null) {
            return;
        }
        // set text from annotationTextField in free text annotation for simple reactions in vcMetaData (from model)
        if (bioModel.getModel() != null && bioModel.getModel().getVcMetaData() != null) {
            VCMetaData vcMetaData = bioModel.getModel().getVcMetaData();
            String textAreaStr = (annotationTextArea.getText() == null || annotationTextArea.getText().length() == 0 ? null : annotationTextArea.getText());
            if (!Compare.isEqualOrNull(vcMetaData.getFreeTextAnnotation(reactionStep), textAreaStr)) {
                vcMetaData.setFreeTextAnnotation(reactionStep, textAreaStr);
            }
        }
    } catch (Exception e) {
        e.printStackTrace(System.out);
        PopupGenerator.showErrorDialog(this, "Edit Reaction Error\n" + e.getMessage(), e);
    }
}
Also used : VCMetaData(cbit.vcell.biomodel.meta.VCMetaData) PropertyVetoException(java.beans.PropertyVetoException)

Example 14 with VCMetaData

use of cbit.vcell.biomodel.meta.VCMetaData in project vcell by virtualcell.

the class SpeciesPropertiesPanel method changeFreeTextAnnotation.

/**
 * Comment
 */
private void changeFreeTextAnnotation() {
    try {
        if (getSpeciesContext() == null) {
            return;
        }
        // set text from annotationTextField in free text annotation for species in vcMetaData (from model)
        if (bioModel.getModel() != null && bioModel.getModel().getVcMetaData() != null) {
            VCMetaData vcMetaData = bioModel.getModel().getVcMetaData();
            String textAreaStr = (annotationTextArea.getText() == null || annotationTextArea.getText().length() == 0 ? null : annotationTextArea.getText());
            if (!Compare.isEqualOrNull(vcMetaData.getFreeTextAnnotation(getSpeciesContext().getSpecies()), textAreaStr)) {
                vcMetaData.setFreeTextAnnotation(getSpeciesContext().getSpecies(), textAreaStr);
            }
        }
    } catch (Exception e) {
        e.printStackTrace(System.out);
        PopupGenerator.showErrorDialog(this, "Edit Species Error\n" + e.getMessage(), e);
    }
}
Also used : VCMetaData(cbit.vcell.biomodel.meta.VCMetaData) URNParseFailureException(org.vcell.sybil.models.miriam.MIRIAMRef.URNParseFailureException) PropertyVetoException(java.beans.PropertyVetoException) ExpandVetoException(javax.swing.tree.ExpandVetoException) MalformedURLException(java.net.MalformedURLException)

Example 15 with VCMetaData

use of cbit.vcell.biomodel.meta.VCMetaData in project vcell by virtualcell.

the class ObservablePropertiesPanel method changeFreeTextAnnotation.

private void changeFreeTextAnnotation() {
    try {
        if (observable == null) {
            return;
        }
        // set text from annotationTextField in free text annotation for species in vcMetaData (from model)
        if (bioModel.getModel() != null && bioModel.getModel().getVcMetaData() != null) {
            VCMetaData vcMetaData = bioModel.getModel().getVcMetaData();
            String textAreaStr = (annotationTextArea.getText() == null || annotationTextArea.getText().length() == 0 ? null : annotationTextArea.getText());
            if (!Compare.isEqualOrNull(vcMetaData.getFreeTextAnnotation(observable), textAreaStr)) {
                vcMetaData.setFreeTextAnnotation(observable, textAreaStr);
            }
        }
    } catch (Exception e) {
        e.printStackTrace(System.out);
        PopupGenerator.showErrorDialog(this, "Edit Observable Error\n" + e.getMessage(), e);
    }
}
Also used : VCMetaData(cbit.vcell.biomodel.meta.VCMetaData) ExpandVetoException(javax.swing.tree.ExpandVetoException)

Aggregations

VCMetaData (cbit.vcell.biomodel.meta.VCMetaData)21 PropertyVetoException (java.beans.PropertyVetoException)10 BioModel (cbit.vcell.biomodel.BioModel)5 SimulationContext (cbit.vcell.mapping.SimulationContext)4 Structure (cbit.vcell.model.Structure)4 ExpressionException (cbit.vcell.parser.ExpressionException)4 MiriamResource (cbit.vcell.biomodel.meta.MiriamManager.MiriamResource)3 Model (cbit.vcell.model.Model)3 ReactionStep (cbit.vcell.model.ReactionStep)3 Simulation (cbit.vcell.solver.Simulation)3 IOException (java.io.IOException)3 MolecularType (org.vcell.model.rbm.MolecularType)3 MiriamManager (cbit.vcell.biomodel.meta.MiriamManager)2 DocumentEditorTreeFolderClass (cbit.vcell.client.desktop.biomodel.DocumentEditorTreeModel.DocumentEditorTreeFolderClass)2 DocumentEditorTreeFolderNode (cbit.vcell.client.desktop.biomodel.DocumentEditorTreeModel.DocumentEditorTreeFolderNode)2 CSGObject (cbit.vcell.geometry.CSGObject)2 GeometryInfo (cbit.vcell.geometry.GeometryInfo)2 SpeciesContextSpec (cbit.vcell.mapping.SpeciesContextSpec)2 Catalyst (cbit.vcell.model.Catalyst)2 ReactionParticipant (cbit.vcell.model.ReactionParticipant)2