Package jcgp.backend.function

Examples of jcgp.backend.function.FunctionSet


  private void refreshFunctions() {
    // remove all current functions
    nodeFunctions.getChildren().clear();
    CheckBox checkBox;
    // get a reference to the function set
    final FunctionSet functionSet = gui.getExperiment().getResources().getFunctionSet();
    for (int i = 0; i < functionSet.getTotalFunctionCount(); i++) {
      // add a checkbox for each function
      checkBox = new CheckBox(functionSet.getFunction(i).toString());
      checkBox.setId(String.valueOf(i));
      // make sure the selection matches the function set
      checkBox.setSelected(functionSet.isEnabled(functionSet.getFunction(i)));
      final int index = i;
      // set listener so function set gets updated if the checkboxes change
      checkBox.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent event) {
          if (((CheckBox) event.getSource()).isSelected()) {
            functionSet.enableFunction(index);
          } else {
            functionSet.disableFunction(index);
          }
          gui.updateFunctionSelector();
          revalidateParameters();
        }
      });
View Full Code Here

TOP

Related Classes of jcgp.backend.function.FunctionSet

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.