Package org.evokit.ui.internal.model.EvolveParameters

Examples of org.evokit.ui.internal.model.EvolveParameters.Parent


    List<Node> parents = this.getAllChildren("parent.\\d+");
    int nextIndex = 0;
    WritableList evalParents = parameters.getParents();
    evalParents.clear();
    for (Node parent : parents) {
      evalParents.add(nextIndex++, new Parent(parent.getKey(),
          (String) parent.getValue()));
    }

    // Random Number Parameters
View Full Code Here


        parameters.getStateClassname());

    // Parent Parameters
    int index = 0;
    for (Object obj : parameters.getParents()) {
      Parent p = (Parent) obj;
      ParameterTreeUtils.setKeyAndString(this, "parent." + p.getKey(),
          Integer.toString(index++), p.getName());
    }
    this.updateChildKeys();

    // Random Number Parameters
View Full Code Here

    parentsTableViewer = new TableViewer(composite, SWT.BORDER | SWT.FULL_SELECTION);
    parentsTableViewer.setLabelProvider(new LabelProvider() {

      @Override
      public String getText(Object element) {
        Parent parent = (Parent) element;
        return parent.getName();
      }
     
    });

    Table table = parentsTableViewer.getTable();
    table.setHeaderVisible(false);
    table.setLinesVisible(false);
    table.setLayoutData(new ColumnWeightData(1));
    toolkit.paintBordersFor(table);
    TableColumn tcName = new TableColumn(table, SWT.NONE);
    tcLayout.setColumnData(tcName, new ColumnWeightData(100));
   
    parentsTableViewer.setColumnProperties(new String[] { "name" });
    parentsTableViewer.setCellEditors(new CellEditor[] {
        new TextCellEditor(table)
    });
    parentsTableViewer.setCellModifier(new ICellModifier() {
     
      @Override
      public void modify(Object element, String property, Object value) {
        Parent parent = (Parent) ((Item) element).getData();
        parent.setName((String) value);
        parentsTableViewer.refresh();
      }
     
      @Override
      public Object getValue(Object element, String property) {
        Parent parent = (Parent) element;
        return parent.getName();
      }
     
      @Override
      public boolean canModify(Object element, String property) {
        return true;
      }
    });
    parentsTableViewer.addSelectionChangedListener(new ISelectionChangedListener() {     
      @Override
      public void selectionChanged(SelectionChangedEvent event) {
        updateButtonStates();
      }
    });
   
    btnAdd = new Button(container, SWT.NONE);
    btnAdd.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        Table t = parentsTableViewer.getTable();
        WritableList wl = (WritableList) parentsTableViewer.getInput();
        Parent p = new Parent(null, "");
        wl.add(p);
        parentsTableViewer.editElement(p, 0);
        t.setSelection(wl.size() - 1);
      }
    });
View Full Code Here

TOP

Related Classes of org.evokit.ui.internal.model.EvolveParameters.Parent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.