Cannot change variable in tree/ADD

Create issue
Issue #387 resolved
Francisco J. Diez created an issue

This network has an ADD for node State [1]. In this ADD, the option “Change variable” is available for Time in treatment [0]. It should also be available for the root node, Therapy type.

Comments (4)

  1. Jorge Pérez

    The issue is “located” in an “if” clause (TreeAddEditorPanel.java, line 178). When the node has already a subtree it don’t allow to change the root variable. It is important to reconsider if this option should be available or not (but at least it should not arise an Exception).

    if (!hasSubTrees && newPosibleRootVariables.size() != 0) {
      for (Variable variable : treeADD.getVariables()) {
        if (variable != currentRootVariable && variable != conditionedVariable) {
          JMenuItem posibleRootVariable = new JMenuItem(variable.getName());
          posibleRootVariable.addActionListener(this);
          posibleRootVariable.setActionCommand(ActionCommands.CHANGE_ROOT_VARIABLE);
          changeRootVariable.add(posibleRootVariable);
        }
      }
      contextualMenu.add(changeRootVariable);
    }
    
  2. Francisco J. Diez reporter

    I don’t know who introduced that restriction or why. Changing the variable should always be allowed, as well as any other edit, at the user’s risk. Undoing is always an option.

    Thank you very much, Jorge.

  3. Log in to comment