use of artisynth.core.workspace.RootModel in project artisynth_core by artisynth.
the class RigidBodyAgent 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;
}
use of artisynth.core.workspace.RootModel in project artisynth_core by artisynth.
the class RigidBodyConnectorList 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;
}
use of artisynth.core.workspace.RootModel in project artisynth_core by artisynth.
the class TracingProbePanel method getPrototypeProbe.
protected TracingProbe getPrototypeProbe(String traceableName) {
TracingProbe tmpProbe = TracingProbe.create(myTraceable, traceableName);
Class<?> type = tmpProbe.getClass();
TracingProbe comp = myPrototypeMap.get(type);
if (comp == null) {
// look for prototype as the last instance in the
// container
RootModel root = myMain.getRootModel();
for (Probe probe : root.getOutputProbes()) {
if (type.isAssignableFrom(probe.getClass())) {
comp = (TracingProbe) probe;
}
}
if (comp == null || !(comp instanceof CopyableComponent)) {
comp = tmpProbe;
// try {
// comp = (TracingProbe)type.newInstance();
// }
// catch (Exception e) {
// throw new InternalErrorException (
// "cannot create no-args instance of " + type);
// }
initializePrototype(comp);
} else {
comp = (TracingProbe) ((CopyableComponent) comp).copy(0, null);
}
myPrototypeMap.put(type, comp);
}
return comp;
}
use of artisynth.core.workspace.RootModel in project artisynth_core by artisynth.
the class AxialSpringListWidget 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;
}
use of artisynth.core.workspace.RootModel in project artisynth_core by artisynth.
the class ControlPanel method connectToHierarchy.
public void connectToHierarchy() {
RootModel rootModel = RootModel.getRoot(this);
if (rootModel != null) {
setSynchronizeObject(rootModel);
setFocusableWindowState(rootModel.isFocusable());
}
addGlobalValueChangeListener(myRerenderListener);
pack();
setVisible(true);
super.connectToHierarchy();
}
Aggregations