예제 #1
0
  private static void addVariableNodes(
      SimpleTreeNode owner, VariableContext m, Icon icon, int nodetype, int permission) {
    owner.removeAllChildren();

    Iterator it = m.names(nodetype);

    while (it.hasNext()) {
      String element = (String) it.next();

      SimpleTreeNode node =
          createVariableNode(m.getVariable(element), icon, nodetype, permission, element);

      owner.add(node);
    }
  }
예제 #2
0
  /**
   * DOCUMENT ME!
   *
   * @param selected DOCUMENT ME!
   * @param oldKey DOCUMENT ME!
   * @param newKey DOCUMENT ME!
   * @param newVal DOCUMENT ME!
   * @return DOCUMENT ME!
   */
  public boolean replaceVariable(
      SimpleTreeNode selected, String oldKey, String newKey, Object newVal) {
    vm.replaceVariable(oldKey, newKey, newVal);

    Variable var = (Variable) selected.getUserObject();
    var.setVariable(newVal);
    var.setDisplayName(newKey);
    var.setVariableName(newKey);

    return true;
  }
예제 #3
0
  private static SimpleTreeNode asTree1(VariableContext context) {
    SimpleTreeNode rootNode =
        new SimpleTreeNode(new Variable(App.messages.getString("res.205"), 0), variableIcon);

    SimpleTreeNode catagory =
        new SimpleTreeNode(
            new Variable(App.messages.getString("res.206"), INSERTABLE),
            parameterIcon,
            VariableTree.PARAMETER_CATAGORY);

    addVariableNodes(
        catagory,
        context,
        parameterIcon,
        VariableContext.PARAMETER,
        REMOVABLE | EDITABLE | SETTABLE);

    rootNode.add(catagory);
    catagory =
        new SimpleTreeNode(
            new Variable(App.messages.getString("res.207"), INSERTABLE),
            formulaIcon,
            VariableTree.FORMULA_CATAGORY);

    addVariableNodes(
        catagory, context, formulaIcon, VariableContext.FORMULA, REMOVABLE | EDITABLE | SETTABLE);

    rootNode.add(catagory);

    commandNode =
        new SimpleTreeNode(
            new Variable(App.messages.getString("res.208"), INSERTABLE),
            commandIcon,
            VariableTree.COMMAND_CATAGORY);

    addVariableNodes(
        commandNode,
        context,
        commandIcon,
        VariableContext.COMMAND,
        REMOVABLE | EDITABLE | SETTABLE);

    rootNode.add(commandNode);

    catagory =
        new SimpleTreeNode(
            new Variable(App.messages.getString("res.209"), 0),
            componentIcon,
            VariableTree.COMPONENT_CATAGORY);

    addVariableNodes(catagory, context, componentIcon, VariableContext.COMPONENT, SETTABLE);
    rootNode.add(catagory);

    SimpleTreeNode sytemCatagory =
        new SimpleTreeNode(
            new Variable(App.messages.getString("res.210"), 0), sysIcon, SYSTEM_CATAGORY);
    String[] vars = VariableContext.getSystemVariables();

    for (int i = 0; i < vars.length; i++) {
      sytemCatagory.add(
          new SimpleTreeNode(
              new Variable(vars[i], SETTABLE, vars[i]), sysIcon, VariableContext.SYSTEM0));
    }

    rootNode.add(sytemCatagory);

    return rootNode;
  }
예제 #4
0
 /**
  * DOCUMENT ME!
  *
  * @param type DOCUMENT ME!
  * @return DOCUMENT ME!
  */
 public Iterator variables(int type) {
   return vm.variables(type);
 }
예제 #5
0
 /**
  * DOCUMENT ME!
  *
  * @return DOCUMENT ME!
  */
 public Iterator variables() {
   return vm.variables();
 }
예제 #6
0
 /**
  * DOCUMENT ME!
  *
  * @param oldKey DOCUMENT ME!
  * @param newKey DOCUMENT ME!
  * @param newVal DOCUMENT ME!
  * @return DOCUMENT ME!
  */
 public boolean replace(String oldKey, String newKey, Object newVal) {
   return vm.replace(oldKey, newKey, newVal);
 }
예제 #7
0
 /**
  * DOCUMENT ME!
  *
  * @param varName DOCUMENT ME!
  * @return DOCUMENT ME!
  */
 public Object getVariable(String varName) {
   return vm.getVariable(varName);
 }
예제 #8
0
 /** DOCUMENT ME! */
 public void clear() {
   vm.clear();
 }