Examples of Prop


Examples of net.sourceforge.processdash.hier.Prop

        }
    }

    private void augmentHierarchy(DashHierarchy hier, PropertyKey parentNode,
            Element parentXml) {
        Prop parentProp = (Prop) hier.get(parentNode);
        if (parentProp == null)
            return;

        for (Element childXml : XMLUtils.getChildElements(parentXml)) {
            String childName = childXml.getAttribute("name");
            PropertyKey childNode = new PropertyKey(parentNode, childName);
            parentProp.addChild(childNode, -1);
            hier.put(childNode, new Prop());
            augmentHierarchy(hier, childNode, childXml);
        }
    }
View Full Code Here

Examples of net.sourceforge.processdash.hier.Prop

        Set<String> templateIDs = getTeamProcessIDs();

        Set<String> result = new HashSet<String>();
        DashHierarchy hier = dashboardContext.getHierarchy();
        for (Iterator i = hier.values().iterator(); i.hasNext();) {
            Prop prop = (Prop) i.next();
            String oneID = prop.getID();
            if (oneID != null && oneID.endsWith("Root")) {
                int slashPos = oneID.indexOf('/');
                if (slashPos != -1) {
                    String oneProcessID = oneID.substring(0, slashPos);
                    if (templateIDs.contains(oneProcessID))
View Full Code Here

Examples of net.sourceforge.processdash.hier.Prop

        brokenIDs.put("pspForEng/8A/script.htm", "PSP2.1-PFE-8A");
        brokenIDs.put("pspForMSE/2A/script.htm", "PSP0.1-MSE-2A");
        brokenIDs.put("pspForMSE/3B/script.htm", "PSP1-MSE-3B");
        brokenIDs.put("pspForMSE/4B/script.htm", "PSP1.0.1-MSE-4B");

        Prop        value;
        String      s;
        for (Iterator i = hierarchy.entrySet().iterator(); i.hasNext();) {
            Map.Entry e = (Map.Entry) i.next();
            value = (Prop)e.getValue();
            if (! Prop.hasValue(value.getID())) continue;
            if (! Prop.hasValue(s = value.getScriptFile ())) continue;
            s = (String) brokenIDs.get(s);
            if (s != null) value.setID(s);
        }
    }
View Full Code Here

Examples of net.sourceforge.processdash.hier.Prop

        return result;
    }

    private static void buildWbsIdMap(Map result, DashHierarchy props,
            PropertyKey pKey, DataRepository data) {
        Prop prop = props.pget(pKey);
        String path = pKey.path();

        // Get the WBS ID of this node in the hierarchy.
        String wbsId = getWbsId(data, path);
        if (!result.containsKey(wbsId))
            result.put(wbsId, path);

        // Check to see if this node supplies subcomponent info
        Map componentInfo = getWbsSubcomponentInfo(data, path, wbsId);
        if (componentInfo != null)
            result.putAll(componentInfo);

        // recursively scan all the children of this node.
        for (int i = 0; i < prop.getNumChildren(); i++)
            buildWbsIdMap(result, props, prop.getChild(i), data);
    }
View Full Code Here

Examples of net.sourceforge.processdash.hier.Prop

                processes.add(key);
        }

        if (processes.size() > 0) {
            Collections.sort(processes);
            Prop p = new Prop();
            while (processes.size() > 0)
                p.addChild((PropertyKey)processes.remove(0), -1);
            templates.put(PropertyKey.ROOT, p);
        }
    }
View Full Code Here

Examples of net.sourceforge.processdash.hier.Prop

        }
    }
    private static void addScriptMaps(DashHierarchy templates,
                                      PropertyKey key, String ID,
                                      Vector v) {
        Prop val = (Prop) templates.get(key);
        if (val == null) return;
        if (Prop.hasValue(val.getID())) {
            ID = val.getID();
            v = (Vector) scriptMaps.get(ID);
            if (v == null)
                scriptMaps.put(ID, (v = new Vector()));
        }

        val.setScriptFile(processScriptFlag(v, val.getScriptFile()));

        for (int i = 0;   i < val.getNumChildren();   i++)
            addScriptMaps(templates, val.getChild(i), ID, v);
    }
View Full Code Here

Examples of net.sourceforge.processdash.hier.Prop

                       DefaultMutableTreeNode node,
                       PropertyKey            key) {
    DefaultMutableTreeNode child;
    int childIndex = 0;
    //set the current node name
    Prop value = props.pget (key);
    if (!key.name().equals(node.getUserObject())) {
        node.setUserObject(key.name());
        nodeChanged(node);
    }
    int numPropChildren = value.getNumChildren();
    while (numPropChildren > childIndex) {
      if (getChildCount (node) <= childIndex) {
        child = new DefaultMutableTreeNode ("changeMeLater");
        insertNodeInto(child, node, childIndex);
      } else
View Full Code Here

Examples of net.sourceforge.processdash.hier.Prop

      (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));
        }
      }
    }
    String valID = val.getID();
    if (valID == null) valID = "";
    adjustMenu (allowsSiblings, allowsChildren, editable,
                allowedChildren, valID, key.path());
  }
View Full Code Here

Examples of net.sourceforge.processdash.hier.Prop

      return true;
  }

  public void updateTemplateMenu(Vector tList,
                                 String id) {
    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);
    for (int ii = 0; ii < templates.getNumChildren (tKey); ii++) {
      p = templates.pget (templates.getChildKey (tKey, ii));
                                // ensure tList includes the current ID
                                // (current template is an allowed child)
//      System.out.println("Update: testing " +p.getID());
      if ((tList != null) && (! tList.contains (p.getID())))
        continue;

//      System.out.println("Update:  test2 " +p.getStatus());
      val = p.getStatus();
      if ((val != null) && ((idx = val.indexOf (REQUIRED_PARENT)) >= 0)) {
                                //check for reqd parent
        if (id == null)
          continue;
        boolean found = false;
View Full Code Here

Examples of net.sourceforge.processdash.hier.Prop

//    System.out.println (e.toString());
  }


  public void setStatusRecursive (PropertyKey key, String status) {
    Prop val = useProps.pget (key);
    val.setStatus (status);
    useProps.put (key, val);
    for (int ii = 0; ii < val.getNumChildren(); ii++)
      setStatusRecursive (val.getChild (ii), status);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.