Object o = node.getUserObject(); Experiment experiment; if (o instanceof SocietyComponent) { SocietyComponent sc = (SocietyComponent) o; String name = "Temp Experiment for  " + sc.getSocietyName(); name = experimentNames.generateName(name); experiment = new Experiment(name, new SocietyComponent[] {sc}, new ImpactComponent[0], new Metric[0]); DefaultMutableTreeNode parent = (DefaultMutableTreeNode) node.getParent(); DefaultMutableTreeNode newNode = new DefaultMutableTreeNode(experiment, false); model.insertNodeInto(newNode, parent, parent.getChildCount()); experimentNames.add(name); experiment.addModificationListener(myModificationListener); workspace.setSelection(newNode); } else if (o instanceof Experiment) { experiment = (Experiment) o; } else { return; } csmart.runConsole(experiment);
Object o = node.getUserObject(); Experiment experiment; if (o instanceof SocietyComponent) { SocietyComponent sc = (SocietyComponent) o; String name = "Temp Experiment for  " + sc.getSocietyName(); name = experimentNames.generateName(name); experiment = new Experiment(name, new SocietyComponent[] {sc}, new ImpactComponent[0], new Metric[0]); DefaultMutableTreeNode parent = (DefaultMutableTreeNode) node.getParent(); DefaultMutableTreeNode newNode = new DefaultMutableTreeNode(experiment, false); model.insertNodeInto(newNode, parent, parent.getChildCount()); experimentNames.add(name); experiment.addModificationListener(myModificationListener); workspace.setSelection(newNode); } else if (o instanceof Experiment) { experiment = (Experiment) o; } else { return;
    private void startConsole(DefaultMutableTreeNode node) {        Object o = node.getUserObject();        Experiment experiment;        if (o instanceof SocietyComponent) {            SocietyComponent sc = (SocietyComponent) o;            String name = "Temp Experiment for  " + sc.getSocietyName();            name = experimentNames.generateName(name);            experiment = new Experiment(name,                                        new SocietyComponent[] {sc},                                        new ImpactComponent[0],                                        new Metric[0]);            DefaultMutableTreeNode parent = 	      (DefaultMutableTreeNode) node.getParent();	    DefaultMutableTreeNode newNode =	      new DefaultMutableTreeNode(experiment, false);            model.insertNodeInto(newNode, parent, parent.getChildCount());            experimentNames.add(name);	    experiment.addModificationListener(myModificationListener);	    workspace.setSelection(newNode);        } else if (o instanceof Experiment) {            experiment = (Experiment) o;        } else {            return;        }        csmart.runConsole(experiment);    }