Package net.sourceforge.processdash.hier

Examples of net.sourceforge.processdash.hier.PropertyKey


        public CommentTreeModel(DashHierarchy hierarchy) {
            super(hierarchy);
        }

        public int getCommentStatus(Object node) {
            PropertyKey key = key(node);
            Integer result = statusData.get(key);
            if (result == null) {
                result = calcCommentStatus(key.path());
                statusData.put(key, result);
            }
            return result;
        }
View Full Code Here


            statusData.remove(key);
            nodeChanged(getNodeForKey(key));
        }

        public void commentStatusChanged(String path) {
            PropertyKey key = tree.findExistingKey(path);
            if (key != null)
                commentStatusChanged(key);
        }
View Full Code Here

    reload (props, root, rootKey);
    root.setUserObject(rootKey.path());
  }

  public PropertyKey getPropKey (DashHierarchy props, Object [] path) {
    PropertyKey key = rootKey;
    if (path != null)
      for (int i = 1; i < path.length; i++) {
        int index = getIndexOfChild (path [i - 1], path [i]);
        key = props.getChildKey (key, index);
      }
View Full Code Here

    if (key == null)
      return null;
    if (rootKey.equals(key))
      return (TreeNode) getRoot();

    PropertyKey parentKey = key.getParent();
    int numChildren = props.getNumChildren(parentKey);
    TreeNode parent = getNodeForKey(props, parentKey);
    if (parent == null || parent.getChildCount() != numChildren)
        return null;

    PropertyKey childKey;
    for (int i = numChildren;  i-- > 0; ) {
      childKey = props.getChildKey(parentKey, i);
      if (childKey.equals(key))
        return parent.getChildAt(i);
    }

    return null;
  }
View Full Code Here

                conflictingCommentAuthor =
                    notes.get(HierarchyNoteManager.NOTE_CONFLICT_KEY).getAuthor();
            }
        }
       
        PropertyKey parent = currentNode.getParent();
       
        if (parent != null)
            setCommentTooltipAndConflict(parent);
    }
View Full Code Here

                + HTMLUtils.escapeEntities(bylineText)
                + "</div>";
    }

    public void actionPerformed(ActionEvent e) {
        PropertyKey phaseToShow = (commentConflictPresent) ? taskInConflict
                                    : context.getCurrentPhase();
        HierarchyNoteEditorDialog.showGlobalNoteEditor(context, phaseToShow);
    }
View Full Code Here

        this(hierarchy);
        setSelectionStatusRecursive((TreeNode) model.getRoot(), false);
        if (paths != null)
            for (Iterator iter = paths.iterator(); iter.hasNext();) {
                String path = (String) iter.next();
                PropertyKey key = PropertyKey.fromPath(path);
                TreeNode node = ((HierarchyTreeModel) model).getNodeForKey(key);
                setSelectionStatusRecursive(node, true);
            }
    }
View Full Code Here

      adjustMenu (false, true, false, null, null, null);
      addTemplateMenu.setEnabled (false);
      return;
    }
    Object [] path = tp.getPath();
    PropertyKey key = treeModel.getPropKey (useProps, path);

    DefaultMutableTreeNode node =
      (DefaultMutableTreeNode)tp.getLastPathComponent();
    moveUpAction.setEnabled(moveUpIsLegal(node));
    moveDownAction.setEnabled(moveDownIsLegal(node));

    // Place code to update selection-sensitive field(s) here.
    Prop val = useProps.pget (key);

    String status = val.getStatus();
    if (status == null)
      status = "";

    int     parseIndex      = 0;
    boolean moveable        = true;
    boolean editable        = true;
    boolean deletable       = true;
    boolean allowsSiblings  = true;
    boolean allowsChildren  = true;
    Vector  allowedChildren = null;

    if ((status.length() > 0) && (status.charAt (0) == NO_MOVE_CHAR)) {
      moveable = false;
      parseIndex++;
      if ((status.length() > 1) && (status.charAt (1) == NO_EDIT_CHAR)) {
        editable = false;
        parseIndex++;
      }
    } else if ((status.length() > 0) && (status.charAt (0) == NO_EDIT_CHAR)) {
      editable = false;
      parseIndex++;
    }

    if (path.length <= 1)       // top two levels (root & 1st sub) static
      deletable = false;
    else if (!editable && !moveable)
      deletable =
        status.startsWith("" + NO_MOVE_CHAR + NO_EDIT_CHAR + DELETE_OK_CHAR);
    deleteMenuItem.setEnabled (deletable);
    cutAction.setEnabled (deletable);

    String pStatus = useProps.pget(key.getParent()).getStatus();
    if ((pStatus != null) && (pStatus.indexOf(ALLOWED_CHILD) >= 0))
      allowsSiblings = false;
    if ((parseIndex = status.indexOf (ALLOWED_CHILD)) >= 0) {
      allowsChildren = false;   // can only add specified templates
      allowedChildren = new Vector(); // non-null implies REQUIRED match

      int lastChar = status.indexOf (REQUIRED_PARENT);
      if (lastChar < 0)
        lastChar = status.length();
      if (lastChar > parseIndex + 1) {
                                // at least one allowed, make list...
        StringTokenizer st = new StringTokenizer
          (status.substring (parseIndex + 1, lastChar),
           String.valueOf (ALLOWED_CHILD));
        String sDebug, childID;
        int endIndex;
        while (st.hasMoreElements()) {
          sDebug = st.nextToken();
          endIndex = sDebug.indexOf ("(");
          if (endIndex < 0)
            endIndex = sDebug.length();
          childID = sDebug.substring (0, endIndex);
          PropertyKey childKey = templates.getByID(childID);
                               // if there isn't already a child with this name
                               // or if the given template is rename-able,
          if (childKey == null ||
              (val.isUniqueChildName(Prop.unqualifiedName(childKey.name())) ||
               templateIsMalleable(childKey)))
                               // then it's okay to allow adding this template.
            allowedChildren.addElement (childID);
//        System.out.println("Allowing Template " +
//                           sDebug.substring (0, endIndex));
View Full Code Here

    Prop      p;
    int       idx;
    JMenu     addTemplateMenu = this.addTemplateMenu;
    JMenuItem menuItem;
    String    val;
    PropertyKey tKey = PropertyKey.ROOT;
    boolean enableMenu = false;

    addTemplateMenu.removeAll(); // clear the JMenu

//    System.out.println("Update:" + id);
View Full Code Here

    */
  public void treeNodesChanged (TreeModelEvent e) { // name change
    Object [] path = e.getPath();
    int [] indices = e.getChildIndices();
    Object [] children = e.getChildren();
    PropertyKey parent = treeModel.getPropKey (useProps, path);
    String previousName, newName;
    int index;

    for (int i = 0; i < indices.length; i++) {
      previousName = useProps.getChildName(parent, indices[i]);
View Full Code Here

TOP

Related Classes of net.sourceforge.processdash.hier.PropertyKey

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.