Package net.sourceforge.processdash.hier

Examples of net.sourceforge.processdash.hier.PropertyKey


      (DIMENSION_SETTING_NAME,
       frameWidth + "," + frameHeight + "," + dividerLocation);
  }

  void applyFilter () {
    PropertyKey selectedKey = null, defectLogKey = null;
    PropertyKey key = null;
    DefaultMutableTreeNode selected = getSelectedNode();
    String extraPathFilter = null;
    if (selected != null) {
      key = selectedKey = treeModel.getPropKey (useProps, selected.getPath());
      if (key != null) {
        String selectedPath = key.path();
        DefectLogID logid = useProps.defectLog(key, "unimportant");
        if (logid != null) {
          defectLogKey = logid.path;
          if (logid.path != key) {
            key = logid.path;
            String defectLogPath = key.path();
            extraPathFilter = selectedPath.substring(defectLogPath.length()+1);
          } else {
            PropertyKey currPhase = dashboard.getCurrentPhase();
            if (currPhase != null && currPhase.getParent().equals(selectedKey))
                selectedKey = currPhase;
          }
        }
      }
    }
    updateImportActions(selectedKey, defectLogKey);
    // apply the filter and load the vector (and the table)
    VTableModel model = (VTableModel)table.table.getModel();
    Object[] row = new Object [11];
    DefectListID dli;
    DefectListEntry dle;
    PropertyKey pk;
    currentLog.removeAllElements();
    model.setNumRows (0);
    Enumeration dlList = defectLogs.keys ();
    while (dlList.hasMoreElements()) {
      pk = (PropertyKey) dlList.nextElement();
      if (key != null) {
        if ( !pk.key().equals(key.key()) &&
            (!pk.isChildOf (key)))
          continue;             // this one filtered
      }
      dli = (DefectListID) defectLogs.get (pk);
      for (int ii = 0; ii < dli.defects.length; ii++) {
        dle = new DefectListEntry (dli, ii);
View Full Code Here


 
  private void reupdateImportActions() {
      DefaultMutableTreeNode selectedTreeNode = getSelectedNode();
      if (selectedTreeNode == null)
          return;
      PropertyKey selectedKey = treeModel.getPropKey(useProps,
                selectedTreeNode.getPath());
      if (selectedKey == null || hasDefLog(selectedKey) == false)
          return;

      PropertyKey currPhase = dashboard.getCurrentPhase();
      if (currPhase == null)
          return;

      if (currPhase.path().startsWith(selectedKey.path()+"/"))
          updateImportActions(currPhase, selectedKey);
  }
View Full Code Here

  }

  public static void rename(DashHierarchy oldProps, DashHierarchy newProps,
                            String oldPrefix, String newPrefix,
                            ProcessDashboard dashboard) {
    PropertyKey oldKey = PropertyKey.fromPath(oldPrefix);
    String oldLogName = oldProps.pget(oldKey).getDefectLog();
    if (oldLogName != null && oldLogName.length() > 0) {
      // if the node addressed by oldProps owns its own defect log, we
      // don't need to worry.
      return;
    }

    DefectLogID oldLog = oldProps.defectLog(oldKey, dashboard.getDirectory());
    if (oldLog == null) {
      // if the node addressed by oldProps doesn't have a defect log,
      // we don't need to worry.
      return;
    }

    String logPath = oldLog.path.path();
    oldPrefix = oldPrefix.substring(logPath.length() + 1);

    PropertyKey newKey = PropertyKey.fromPath(newPrefix);
    DefectLogID newLog = newProps.defectLog(newKey, dashboard.getDirectory());
    if (newLog == null) {
      // Should this ever happen???
      return;
    }
View Full Code Here

    String defLogName = prop.getDefectLog ();
    return (defLogName != null && defLogName.length() > 0);
  }
  public void setSelectedPhase(PropertyKey phase) {
    if (phase == null) return;
    PropertyKey parent = phase.getParent();
    if (!hasDefLog(phase) && hasDefLog(parent))
      setSelectedNode(parent);
    else
      setSelectedNode(phase);
  }
View Full Code Here

    protected void writeContents() throws IOException {
        String prefix = getPrefix();
        if (prefix == null) prefix = "";

        DashHierarchy props = getPSPProperties();
        PropertyKey key = props.findExistingKey(prefix);

        out.write("<HTML><HEAD>");
        out.write("<link rel=stylesheet type='text/css' href='/style.css'>");
        out.write("<TITLE>Hierarchy");
        if (prefix.length() > 0) {
View Full Code Here

    panel.add(buttonBox, BorderLayout.SOUTH);

    setDefaultCloseOperation(DISPOSE_ON_CLOSE);

    if (showCurrent) {
      PropertyKey currentPhase = dash.getCurrentPhase();
      TreePath path = new TreePath
        (treeModel.getPathToKey(useProps, currentPhase));
      tree.makeVisible(path);
      tree.scrollPathToVisible(path);
      tree.getSelectionModel().addSelectionPath(path);
View Full Code Here

    scriptList.clear();

    DefaultMutableTreeNode selected = getSelectedNode();
    if (selected == null) return;

    PropertyKey key = treeModel.getPropKey (useProps, selected.getPath());
    if (key == null) return;

    List<ScriptID> scripts = ScriptEnumerator.getScripts(dashboard, key);
    if (scripts == null || scripts.size() == 0) return;
View Full Code Here

  private void updateAll() {
    String clickPref = Settings.getVal(DROP_DOWN_BEHAVIOR_PREF);
    clickOpensDefault = "true".equals(clickPref);
    setMainButtonBehavior(clickOpensDefault ? RUN_FIRST_MENU_OPTION
            : OPEN_DROP_DOWN_MENU);
    PropertyKey currentPhase = parent.getActiveTaskModel().getNode();
    path = (currentPhase == null ? null : currentPhase.path());
    setPaths(ScriptEnumerator.getScripts(parent, currentPhase));
  }
View Full Code Here

    protected boolean isDirty() {
        return timeLog != null && timeLog.hasUncommittedData();
    }
   
    public void narrowToPath(String path) {
        PropertyKey key = useProps.findExistingKey(path);
        if (key == null)
            throw new IllegalArgumentException("Path not found");
       
        treeModel.setRootKey(key);
        treeModel.reload(useProps);
View Full Code Here

            t += collectTime(treeModel.getChild(node, i), timesIn, timesOut);
        }

        // fetch and add time spent in this node
        Object[] treePath = treeModel.getPathToRoot((TreeNode) node);
        PropertyKey key = treeModel.getPropKey(useProps, treePath);
        if (key != null) {
            String pathPrefix = key.path();
            // For efficiency, we only search through the portion of the
            // SortedMap which could contain paths matching our prefix.
            // "Matching our prefix" means that it exactly equals our
            // prefix, or it begins with our prefix followed by a slash.
            // The character after the slash character is the zero '0'.
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.