Search in sources :

Example 31 with RootModel

use of artisynth.core.workspace.RootModel in project artisynth_core by artisynth.

the class FemModel3dAgent method getPrototypeMap.

protected Map<Class, ModelComponent> getPrototypeMap() {
    RootModel root = myMain.getRootModel();
    if (root != null && root != myLastRootModel) {
        myPrototypeMap = new HashMap<Class, ModelComponent>();
        myLastRootModel = root;
    }
    return myPrototypeMap;
}
Also used : RootModel(artisynth.core.workspace.RootModel)

Example 32 with RootModel

use of artisynth.core.workspace.RootModel in project artisynth_core by artisynth.

the class AddPropertyPane method readComponentField.

/**
 * called when the component string field changes
 */
private void readComponentField() {
    isComplete = false;
    clearDimensionLabel();
    // System.out.println("SET FALSE");
    myParent.actionPerformed(new ActionEvent(this, 0, "Invalidate"));
    // System.out.println("new value "+compNameField.getText());
    Object compOrProp = myPropField.getValue();
    RootModel root = Main.getMain().getRootModel();
    if (compOrProp instanceof ModelComponent) {
        propertyPath = ComponentUtils.getPathName(root, (ModelComponent) compOrProp);
        myParent.actionPerformed(new ActionEvent(this, 0, "blank"));
    } else if (compOrProp instanceof Property) {
        Property prop = (Property) compOrProp;
        propertyPath = ComponentUtils.getPropertyPathName(prop, root, /*excludeLeaf=*/
        false);
        if (!HasProperties.class.isAssignableFrom(prop.get().getClass())) {
            isComplete = true;
            int dim = NumericProbeEditor.GetPropDim(propertyPath);
            setDimensionLabel(dim);
            myParent.actionPerformed(new ActionEvent(this, 0, "PropSelected"));
            normalColor = NumericProbeEditor.completedColor;
        } else {
            myParent.actionPerformed(new ActionEvent(this, 0, "blank"));
        }
    } else {
        propertyPath = "";
        myParent.actionPerformed(new ActionEvent(this, 0, "blank"));
    }
    updateAppearance();
// readFullPath(compNameField.getText());
}
Also used : RootModel(artisynth.core.workspace.RootModel) ModelComponent(artisynth.core.modelbase.ModelComponent) ActionEvent(java.awt.event.ActionEvent) Property(maspack.properties.Property)

Example 33 with RootModel

use of artisynth.core.workspace.RootModel in project artisynth_core by artisynth.

the class FrameMarkerAgent method getPrototypeMap.

protected HashMap<Class, ModelComponent> getPrototypeMap() {
    RootModel root = myMain.getRootModel();
    if (root != null && root != myLastRootModel) {
        myPrototypeMap = new HashMap<Class, ModelComponent>();
        myLastRootModel = root;
    }
    return myPrototypeMap;
}
Also used : RootModel(artisynth.core.workspace.RootModel)

Example 34 with RootModel

use of artisynth.core.workspace.RootModel in project artisynth_core by artisynth.

the class MechModelAgent method getPrototypeMap.

protected HashMap<Class, ModelComponent> getPrototypeMap() {
    RootModel root = myMain.getRootModel();
    if (root != null && root != myLastRootModel) {
        myPrototypeMap = new HashMap<Class, ModelComponent>();
        myLastRootModel = root;
    }
    return myPrototypeMap;
}
Also used : RootModel(artisynth.core.workspace.RootModel) ModelComponent(artisynth.core.modelbase.ModelComponent)

Example 35 with RootModel

use of artisynth.core.workspace.RootModel in project artisynth_core by artisynth.

the class ParticleAgent method getPrototypeMap.

protected HashMap<Class, ModelComponent> getPrototypeMap() {
    RootModel root = myMain.getRootModel();
    if (root != null && root != myLastRootModel) {
        myPrototypeMap = new HashMap<Class, ModelComponent>();
        myLastRootModel = root;
    }
    return myPrototypeMap;
}
Also used : RootModel(artisynth.core.workspace.RootModel)

Aggregations

RootModel (artisynth.core.workspace.RootModel)44 ModelComponent (artisynth.core.modelbase.ModelComponent)10 InternalErrorException (maspack.util.InternalErrorException)7 IOException (java.io.IOException)6 WayPoint (artisynth.core.probes.WayPoint)4 FileNotFoundException (java.io.FileNotFoundException)4 InvocationTargetException (java.lang.reflect.InvocationTargetException)4 Probe (artisynth.core.probes.Probe)3 WayPointProbe (artisynth.core.probes.WayPointProbe)3 File (java.io.File)3 Property (maspack.properties.Property)3 ControlPanel (artisynth.core.gui.ControlPanel)2 CompositeComponent (artisynth.core.modelbase.CompositeComponent)2 TracingProbe (artisynth.core.probes.TracingProbe)2 Point (java.awt.Point)2 JFileChooser (javax.swing.JFileChooser)2 JMenuItem (javax.swing.JMenuItem)2 JSeparator (javax.swing.JSeparator)2 CompositeProperty (maspack.properties.CompositeProperty)2 ArgParser (argparser.ArgParser)1