Package net.sourceforge.processdash.ev

Examples of net.sourceforge.processdash.ev.EVTask


        Iterator i = tasks.iterator();
        while (i.hasNext()) {
            Object item = i.next();
            if (item instanceof EVTask) {
                EVTask task = (EVTask) item;
                if (task.getDateCompleted() != null)
                    interval.addDataPoint(task.getPlanValue(),
                        task.getActualDirectTime());

            } else if (item instanceof DataPoint) {
                DataPoint point = (DataPoint) item;
                interval.addDataPoint(point.x, point.y);
            }
View Full Code Here


                    context.getData(), context.getHierarchy(),
                    context.getCache(), false);
                tl.recalc();
                List l = tl.findTasksByFullName(taskPath);
                if (l != null && l.size() == 1) {
                    EVTask t = (EVTask) l.get(0);
                    for (Iterator i = dependencies.iterator(); i.hasNext();) {
                        EVTaskDependency d = (EVTaskDependency) i.next();
                        d.loadParentDate(t);
                    }
                }
View Full Code Here

                Component result = super.getTableCellRendererComponent
                    (table, value, isSelected, hasFocus, row, column);
                String errorStr = null;

                TreePath path = getTree().getPathForRow(row);
                EVTask node = null;
                if (path != null) {
                    if (path.getLastPathComponent() instanceof EVTask)
                        node = (EVTask) path.getLastPathComponent();
                    errorStr = ((EVTaskList) model).getErrorStringAt
                        (path.getLastPathComponent(),
                         convertColumnIndexToModel(column));
                }

                if (result instanceof JComponent)
                    ((JComponent) result).setToolTipText(errorStr);

                if (errorStr != null)
                    result.setForeground(errorStr.startsWith(" ")
                                         ? Color.orange : Color.red);
                else if (node != null && node.isUserPruned())
                    result.setForeground(PHANTOM_COLOR);
                else if (node != null && node.isChronologicallyPruned())
                    result.setForeground(SEPIA);

                Font f = getFont(errorStr != null, result);
                if (f != null) result.setFont(f);
View Full Code Here

               
                comboBox.removeAllItems();
               
                TreePath path = getTree().getPathForRow(row);
                if (path != null) {
                    EVTask task = (EVTask) path.getLastPathComponent();
                    ListData types = task.getAcceptableNodeTypes();
                    if (types != null) {
                        for (int i = 1;  i < types.size();  i++) {
                            String oneType = (String) types.get(i);
                            if (oneType.startsWith("(") && oneType.endsWith(")"))
                                continue;
View Full Code Here

                (tree, value, selected, expanded, leaf, row, hasFocus);
            String errorStr = null;

            // find the EVTask for the indicated row
            TreePath path = tree.getPathForRow(row);
            EVTask node = null;
            if (path != null)
                node = (EVTask) path.getLastPathComponent();

            // in flat mode, display the full name of the node rather
            // than the terminal name
            if (node != null && tree.getModel() == flatModel)
                setText((String) flatModel.getValueAt(node,
                    EVTaskList.TASK_COLUMN));

            // retrieve the error string for this node
            if (node != null && model != null)
                errorStr = ((EVTaskList) model).getErrorStringAt
                    (node, EVTaskList.TASK_COLUMN);

            // display the error string if needed
            if (result instanceof JComponent)
                ((JComponent) result).setToolTipText(errorStr);
            if (errorStr != null)
                result.setForeground(errorStr.startsWith(" ")
                                     ? Color.orange : Color.red);
            Font f = getFont(errorStr != null, false, result);
            if (f != null) result.setFont(f);

            // give pruned nodes a special appearance
            if (node != null && node.isUserPruned()) {
                result.setForeground(PHANTOM_COLOR);
                if (errorStr == null && result instanceof JComponent)
                    ((JComponent) result).setToolTipText
                        (resources.getString("Task.Removed_Tooltip"));
                if (result instanceof JLabel)
                    ((JLabel) result).setIcon(getPrunedIcon(expanded, leaf));

            // give chronologically pruned nodes a special appearance
            } else if (node != null && node.isChronologicallyPruned()) {
                result.setForeground(SEPIA);
                if (errorStr == null && result instanceof JComponent) {
                    ((JComponent) result).setToolTipText
                        (resources.getString
                         ("Task.Previously_Completed_Tooltip"));
                    result.setFont(getFont(false, true, result));
                }
                if (result instanceof JLabel)
                    ((JLabel) result).setIcon(getChronIcon(expanded, leaf));

            // give cut nodes a special appearance
            } else if (row > 0 && cutList.get(row)) {
                if (result instanceof JLabel)
                    ((JLabel) result).setIcon(getCutLeafIcon());
                if (errorStr == null && result instanceof JComponent) {
                    ((JComponent) result).setToolTipText
                        (resources.getString("Task.Copied_Tooltip"));
                    result.setForeground(Color.BLUE);
                }

            // use strikethrough for completed (but otherwise normal) tasks
            } else if (node != null && node.getPercentComplete() > 0.99999
                    && errorStr == null) {
                result.setFont(getFont(false, true, result));
            }

            return result;
View Full Code Here

            nodeStructureChanged(node);
        }

        private void copyNodes(DefaultMutableTreeNode dest, EVTask src) {
            for (int i = 0; i < src.getNumChildren(); i++) {
                EVTask srcChild = src.getChild(i);
                NodeObject obj = new NodeObject(srcChild.getName(), srcChild
                        .getFullName());
                DefaultMutableTreeNode destChild = new DefaultMutableTreeNode(
                        obj);
                dest.add(destChild);
                copyNodes(destChild, srcChild);
View Full Code Here

    protected void highlightErrors(Map errors) {
        if (errors == null || errors.size() == 0) return;
        Iterator i = errors.values().iterator();
        while (i.hasNext()) {
            EVTask t = (EVTask) i.next();
            treeTable.getTree().makeVisible(new TreePath(t.getPath()));
        }
    }
View Full Code Here

        if (Settings.isReadOnly()) return;
       
        TreePath selPath = treeTable.getTree().getSelectionPath();
        if (selPath == null) return;
        if (isFlatView()) {
            EVTask selectedTask = (EVTask) selPath.getLastPathComponent();
            selPath = new TreePath(selectedTask.getPath());
        }

        int pathLen = selPath.getPathCount();
        if (isRollup()) {
            if (pathLen != 2 || !confirmDelete(selPath)) return;
View Full Code Here

        }
    }


    protected boolean confirmDelete(TreePath selPath) {
        EVTask task = (EVTask) selPath.getLastPathComponent();
        String fullName = isRollup() ? task.getName() : task.getFullName();
        String[] message =
            resources.formatStrings(isRollup()
                                        ? "Confirm.Delete_Schedule.Prompt_FMT"
                                        : "Confirm.Delete_Task.Prompt_FMT",
                                    fullName);
View Full Code Here

    protected int selectedTaskPos(TreePath selPath, TreeModel model) {
        if (selPath == null) return -1;

        int pathLen = selPath.getPathCount();
        if (pathLen != 2) return -1; // only adjust children of the root node.
        EVTask selectedTask = (EVTask) selPath.getPathComponent(pathLen-1);
        EVTask parentNode = (EVTask) selPath.getPathComponent(pathLen-2);
        return model.getIndexOfChild(parentNode, selectedTask);
    }
View Full Code Here

TOP

Related Classes of net.sourceforge.processdash.ev.EVTask

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.