Search in sources :

Example 71 with SimulationContext

use of cbit.vcell.mapping.SimulationContext in project vcell by virtualcell.

the class SimulationWorkspaceModelInfo method getContextName.

/**
 * Insert the method's description here.
 * Creation date: (9/25/2005 11:04:29 AM)
 * @return java.lang.String
 */
public java.lang.String getContextName() {
    String results = null;
    if (simulationOwner instanceof MathModel) {
        MathModel mathModel = (MathModel) simulationOwner;
        results = mathModel.getName();
    } else if (simulationOwner instanceof SimulationContext) {
        SimulationContext simContext = (SimulationContext) simulationOwner;
        results = simContext.getBioModel().getName() + "::" + simContext.getName();
    }
    return results;
}
Also used : MathModel(cbit.vcell.mathmodel.MathModel) SimulationContext(cbit.vcell.mapping.SimulationContext)

Example 72 with SimulationContext

use of cbit.vcell.mapping.SimulationContext in project vcell by virtualcell.

the class InitialConditionsPanel method setSimulationContext.

/**
 * Sets the simulationContext property (cbit.vcell.mapping.SimulationContext) value.
 * @param simulationContext The new value for the property.
 * @see #getSimulationContext
 */
public void setSimulationContext(SimulationContext newValue) {
    SimulationContext oldValue = fieldSimulationContext;
    if (oldValue != null) {
        oldValue.removePropertyChangeListener(ivjEventHandler);
    }
    fieldSimulationContext = newValue;
    if (newValue != null) {
        newValue.addPropertyChangeListener(ivjEventHandler);
    }
    tableModel.setSimulationContext(fieldSimulationContext);
    updateTopScrollPanel();
}
Also used : SimulationContext(cbit.vcell.mapping.SimulationContext)

Example 73 with SimulationContext

use of cbit.vcell.mapping.SimulationContext in project vcell by virtualcell.

the class MicroscopeMeasurementPanel method setSimulationContext.

public void setSimulationContext(SimulationContext newValue) {
    if (this.simulationContext == newValue) {
        return;
    }
    SimulationContext oldValue = newValue;
    if (oldValue != null) {
        oldValue.getModel().removePropertyChangeListener(internalEventHandler);
        oldValue.getMicroscopeMeasurement().removePropertyChangeListener(internalEventHandler);
    }
    this.simulationContext = newValue;
    if (newValue != null) {
        newValue.getModel().addPropertyChangeListener(internalEventHandler);
        newValue.getMicroscopeMeasurement().addPropertyChangeListener(internalEventHandler);
    }
    refreshInterface();
}
Also used : SimulationContext(cbit.vcell.mapping.SimulationContext)

Example 74 with SimulationContext

use of cbit.vcell.mapping.SimulationContext in project vcell by virtualcell.

the class ModelProcessSpecsTableModel method setSimulationContext.

/**
 * Sets the simulationContext property (cbit.vcell.mapping.SimulationContext) value.
 * @param simulationContext The new value for the property.
 * @see #getSimulationContext
 */
public void setSimulationContext(SimulationContext simulationContext) {
    SimulationContext oldValue = fieldSimulationContext;
    if (oldValue != null) {
        oldValue.removePropertyChangeListener(this);
        ReactionContext reactionContext = oldValue.getReactionContext();
        reactionContext.removePropertyChangeListener(this);
        ReactionSpec[] oldReactionSpecs = reactionContext.getReactionSpecs();
        for (int i = 0; i < oldReactionSpecs.length; i++) {
            oldReactionSpecs[i].getReactionStep().removePropertyChangeListener(this);
            oldReactionSpecs[i].removePropertyChangeListener(this);
        }
        ReactionRuleSpec[] oldReactionRuleSpecs = reactionContext.getReactionRuleSpecs();
        for (int i = 0; i < oldReactionRuleSpecs.length; i++) {
            oldReactionRuleSpecs[i].getReactionRule().removePropertyChangeListener(this);
            oldReactionRuleSpecs[i].removePropertyChangeListener(this);
        }
    }
    fieldSimulationContext = simulationContext;
    refreshColumns();
    if (simulationContext != null) {
        simulationContext.addPropertyChangeListener(this);
        ReactionContext reactionContext = fieldSimulationContext.getReactionContext();
        reactionContext.addPropertyChangeListener(this);
        ReactionSpec[] newReactionSpecs = reactionContext.getReactionSpecs();
        for (int i = 0; i < newReactionSpecs.length; i++) {
            newReactionSpecs[i].getReactionStep().addPropertyChangeListener(this);
            newReactionSpecs[i].addPropertyChangeListener(this);
        }
        ReactionRuleSpec[] newReactionRuleSpecs = reactionContext.getReactionRuleSpecs();
        for (int i = 0; i < newReactionRuleSpecs.length; i++) {
            newReactionRuleSpecs[i].getReactionRule().addPropertyChangeListener(this);
            newReactionRuleSpecs[i].addPropertyChangeListener(this);
        }
    }
    firePropertyChange("simulationContext", oldValue, simulationContext);
}
Also used : ReactionSpec(cbit.vcell.mapping.ReactionSpec) ReactionRuleSpec(cbit.vcell.mapping.ReactionRuleSpec) ReactionContext(cbit.vcell.mapping.ReactionContext) SimulationContext(cbit.vcell.mapping.SimulationContext)

Example 75 with SimulationContext

use of cbit.vcell.mapping.SimulationContext in project vcell by virtualcell.

the class SpeciesContextSpecsTableModel method setSimulationContext.

/**
 * Sets the simulationContext property (cbit.vcell.mapping.SimulationContext) value.
 * @param simulationContext The new value for the property.
 * @see #getSimulationContext
 */
public void setSimulationContext(SimulationContext simulationContext) {
    SimulationContext oldValue = fieldSimulationContext;
    int oldColumnCount = getColumnCount();
    if (oldValue != null) {
        oldValue.removePropertyChangeListener(this);
        oldValue.getGeometryContext().removePropertyChangeListener(this);
        updateListenersReactionContext(oldValue.getReactionContext(), true);
    }
    fieldSimulationContext = simulationContext;
    refreshColumns();
    int newColumnCount = getColumnCount();
    if (oldColumnCount != newColumnCount) {
        fireTableStructureChanged();
    }
    if (simulationContext != null) {
        simulationContext.addPropertyChangeListener(this);
        simulationContext.getGeometryContext().addPropertyChangeListener(this);
        updateListenersReactionContext(simulationContext.getReactionContext(), false);
        autoCompleteSymbolFilter = simulationContext.getAutoCompleteSymbolFilter();
        refreshData();
    }
}
Also used : SimulationContext(cbit.vcell.mapping.SimulationContext)

Aggregations

SimulationContext (cbit.vcell.mapping.SimulationContext)181 BioModel (cbit.vcell.biomodel.BioModel)73 Simulation (cbit.vcell.solver.Simulation)57 MathDescription (cbit.vcell.math.MathDescription)32 Geometry (cbit.vcell.geometry.Geometry)29 PropertyVetoException (java.beans.PropertyVetoException)28 MathModel (cbit.vcell.mathmodel.MathModel)25 Model (cbit.vcell.model.Model)25 KeyValue (org.vcell.util.document.KeyValue)25 SpeciesContextSpec (cbit.vcell.mapping.SpeciesContextSpec)23 ArrayList (java.util.ArrayList)23 DataAccessException (org.vcell.util.DataAccessException)23 XMLSource (cbit.vcell.xml.XMLSource)22 XmlParseException (cbit.vcell.xml.XmlParseException)22 AsynchClientTask (cbit.vcell.client.task.AsynchClientTask)20 Expression (cbit.vcell.parser.Expression)20 ExpressionException (cbit.vcell.parser.ExpressionException)19 SpeciesContext (cbit.vcell.model.SpeciesContext)17 Structure (cbit.vcell.model.Structure)17 IOException (java.io.IOException)17