Search in sources :

Example 1 with PullController

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

the class MenuBarHandler method showPullControllerRenderPropsDialog.

private void showPullControllerRenderPropsDialog() {
    if (myPullControllerRenderPropsDialog == null) {
        PullController pc = myMain.getPullController();
        LinkedList<HasProperties> list = new LinkedList<HasProperties>();
        list.add(pc);
        RenderPropsDialog dialog = new RenderPropsDialog("Edit render properties", list);
        dialog.locateRight(myMain.getFrame());
        // dialog.setSynchronizeObject(myMain.getRootModel());
        dialog.setTitle("RenderProps for PullController");
        dialog.addWindowListener(new WindowAdapter() {

            public void windowClosed(WindowEvent e) {
                myPullControllerRenderPropsDialog = null;
            }
        });
        myMain.registerWindow(dialog);
        myPullControllerRenderPropsDialog = dialog;
        dialog.pack();
        dialog.setVisible(true);
    }
}
Also used : RenderPropsDialog(maspack.widgets.RenderPropsDialog) WindowEvent(java.awt.event.WindowEvent) HasProperties(maspack.properties.HasProperties) WindowAdapter(java.awt.event.WindowAdapter) LinkedList(java.util.LinkedList) PullController(artisynth.core.workspace.PullController)

Example 2 with PullController

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

the class MenuBarHandler method showPullControllerPropertyDialog.

private void showPullControllerPropertyDialog() {
    if (myPullControllerPropertyDialog == null) {
        PullController pc = myMain.getPullController();
        PropertyPanel panel = new PropertyPanel();
        PropertyDialog dialog = new PropertyDialog("PullController properties", panel, "OK");
        dialog.addWidget(pc, "stiffness");
        dialog.locateRight(myMain.getFrame());
        // dialog.setSynchronizeObject(myMain.getRootModel());
        dialog.addWindowListener(new WindowAdapter() {

            public void windowClosed(WindowEvent e) {
                myPullControllerPropertyDialog = null;
            }
        });
        myMain.registerWindow(dialog);
        myPullControllerPropertyDialog = dialog;
        dialog.pack();
        dialog.setVisible(true);
    }
}
Also used : PropertyDialog(maspack.widgets.PropertyDialog) WindowEvent(java.awt.event.WindowEvent) WindowAdapter(java.awt.event.WindowAdapter) PullController(artisynth.core.workspace.PullController) PropertyPanel(maspack.widgets.PropertyPanel)

Example 3 with PullController

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

the class PointModel method addController.

@Override
public void addController(Controller controller, Model model) {
    super.addController(controller, model);
    if (controller instanceof PullController) {
        PullController pc = ((PullController) controller);
        pc.setStiffness(20);
        RenderProps.setLineColor(pc, Color.RED.darker());
        RenderProps.setPointColor(pc, Color.RED.darker());
        RenderProps.setLineStyle(pc, LineStyle.SOLID_ARROW);
        RenderProps.setLineRadius(pc, 0.25);
    }
// mech.addForceEffector ((PullController)controller);
}
Also used : PullController(artisynth.core.workspace.PullController)

Aggregations

PullController (artisynth.core.workspace.PullController)3 WindowAdapter (java.awt.event.WindowAdapter)2 WindowEvent (java.awt.event.WindowEvent)2 LinkedList (java.util.LinkedList)1 HasProperties (maspack.properties.HasProperties)1 PropertyDialog (maspack.widgets.PropertyDialog)1 PropertyPanel (maspack.widgets.PropertyPanel)1 RenderPropsDialog (maspack.widgets.RenderPropsDialog)1