use of artisynth.core.gui.editorManager.TracingProbePanel in project artisynth_core by artisynth.
the class SelectionPopup method addTracing.
private void addTracing(LinkedList<ModelComponent> selectedItems) {
// RootModel root = myMain.getRootModel();
// String name = null;
// double startTime = myMain.getTimeSec();
// double updateInterval = root.getMaxStepSizeSec();
Traceable firstTraceable = null;
for (ModelComponent comp : selectedItems) {
if (comp instanceof Traceable) {
firstTraceable = (Traceable) comp;
}
}
if (firstTraceable == null) {
throw new InternalErrorException("'Add tracing' called with no traceabled in selection");
}
TracingProbePanel panel = new TracingProbePanel(firstTraceable, getCommonTraceables(selectedItems));
panel.pack();
GuiUtils.locateRelative(panel, myLastBounds, 0.5, 0.5, 0, 0.5);
// if (myTraceItemLoc != null)
// { panel.setLocation (
// myTraceItemLoc.x, myTraceItemLoc.y);
// }
panel.setVisible(true);
if (panel.getReturnValue() == OptionPanel.OK_OPTION) {
for (ModelComponent comp : selectedItems) {
if (comp instanceof Traceable) {
TracingProbe probe = panel.createProbe((Traceable) comp);
myMain.getRootModel().addOutputProbe(probe);
}
}
}
}
Aggregations