Search in sources :

Example 1 with TestNode

use of maspack.properties.TestNode in project artisynth_core by artisynth.

the class PropertyGuiTest method main.

public static void main(String[] args) {
    TestHierarchy test = new TestHierarchy();
    LinkedList<TestNode> nodeList = new LinkedList<TestNode>();
    for (int i = 0; i < args.length; i++) {
        TestNode node = test.getNode(args[i]);
        if (node == null) {
            System.err.println("Node '" + args[i] + "' not found");
            System.exit(1);
        }
        nodeList.add(node);
    }
    // test.M1.getMaterial().setStiffness (123.0);
    System.out.println("Properties:");
    test.printAllProperties(System.out, test.recordAllProperties(test.getRoot()));
    if (nodeList.size() == 0) {
        System.err.println("Usage: java maspack.apps.PropertyGuiTest <NodeName1> <NodeName2> ... ");
        System.exit(1);
    } else if (nodeList.size() == 1) {
        HasProperties host = nodeList.get(0);
        PropertyDialog dialog = new PropertyDialog("prop panel test", host, "OK Cancel");
        dialog.setVisible(true);
        while (dialog.isVisible()) {
            try {
                Thread.sleep(100);
            } catch (Exception e) {
            // 
            }
        }
        dialog.dispose();
    } else {
        HostList hostList = new HostList((HasProperties[]) nodeList.toArray(new TestNode[0]));
        PropertyDialog dialog = new PropertyDialog("prop panel test", hostList, "OK Cancel");
        dialog.setVisible(true);
        while (dialog.isVisible()) {
            try {
                Thread.sleep(100);
            } catch (Exception e) {
            // 
            }
        }
        dialog.dispose();
    }
}
Also used : PropertyDialog(maspack.widgets.PropertyDialog) HasProperties(maspack.properties.HasProperties) TestNode(maspack.properties.TestNode) HostList(maspack.properties.HostList) TestHierarchy(maspack.properties.TestHierarchy)

Aggregations

HasProperties (maspack.properties.HasProperties)1 HostList (maspack.properties.HostList)1 TestHierarchy (maspack.properties.TestHierarchy)1 TestNode (maspack.properties.TestNode)1 PropertyDialog (maspack.widgets.PropertyDialog)1