Examples of TaskNode


Examples of cn.com.manager.domains.TaskNode

    /**
     * 注册任务
     * @param task
     */
    public static void registTask(Task task) {
        TaskNode currentNode = OperatFactory.getServiceObject(TaskService.class, DataProviderModel.FILE).getTaskNode(task.getNode());
        String nodeName = currentNode.getCurrentNode();
        ProcessNode processNode = new ProcessNode();
        Node n = OperatFactory.getServiceObject(NodeService.class, DataProviderModel.FILE).getNode(nodeName);
        processNode.setAutoFlag(n.isAutoFlag());
        processNode.setNodeName(n.getNodeName());
        processNode.setNodeDesc(n.getNodeDesc());
View Full Code Here

Examples of cn.com.manager.domains.TaskNode

     *
     * @return
     */
    public static void initNextProcessNode(ProcessNode processNode) {
        if (processNode != null) {
            TaskNode currentNode = OperatFactory.getServiceObject(TaskService.class, DataProviderModel.FILE).getTaskNode(processNode.getNodeName());
            Node node = null;
            // 依次设定下一节点
            String nodeName = currentNode.getNextNode();
            if (!StringUtil.isEmpty(nodeName) ) {
                node = OperatFactory.getServiceObject(NodeService.class, DataProviderModel.FILE).getNode(nodeName);
                ProcessNode subNode = new ProcessNode();
                subNode.setAutoFlag(node.isAutoFlag());
                subNode.setNodeName(node.getNodeName());
                subNode.setNodeDesc(node.getNodeDesc());
                subNode.setNodeStatus(node.getNodeStatus());
                processNode.setNext(subNode);
            }
            nodeName = currentNode.getParentNode();
            // 依次设定父节点
            if (!StringUtil.isEmpty(nodeName)) {
                node = OperatFactory.getServiceObject(NodeService.class, DataProviderModel.FILE).getNode(nodeName);
                ProcessNode parentNode = new ProcessNode();
                parentNode.setAutoFlag(node.isAutoFlag());
View Full Code Here

Examples of net.sourceforge.ganttproject.task.TaskNode

        treetable.getTree().addTreeSelectionListener(
                new TreeSelectionListener() {

                    public void valueChanged(TreeSelectionEvent e) {
                        Mediator.getTaskSelectionManager().clear();
                        TaskNode tn[] = (TaskNode[]) getSelectedTaskNodes();
                        if (tn != null)
                            for (int i = 0; i < tn.length; i++)
                                Mediator.getTaskSelectionManager().addTask(
                                        (Task) tn[i].getUserObject());
                    }
View Full Code Here

Examples of net.sourceforge.ganttproject.task.TaskNode

        //this.treetable.changeLanguage(language);
    }

    private void initRootNode() {
        getTaskManager().getRootTask().setName("root");
        rootNode = new TaskNode(getTaskManager().getRootTask());
    }
View Full Code Here

Examples of net.sourceforge.ganttproject.task.TaskNode

    }
    /** add an object with the expand information */
    public DefaultMutableTreeNode addObjectWithExpand(Object child,
            DefaultMutableTreeNode parent) {

        DefaultMutableTreeNode childNode = new TaskNode((Task) child);

        if (parent == null)
            parent = rootNode;

        treeModel.insertNodeInto(childNode, parent, parent.getChildCount());
        //forwardScheduling();

        Task task = (Task) (childNode.getUserObject());

        boolean res = true;

        if (parent == null)
            res = false;

        // test for expantion
        while (parent != null) {
            Task taskFather = (Task) (parent.getUserObject());
            if (!taskFather.getExpand()) {
                res = false;
                break;
            }
            parent = (DefaultMutableTreeNode) (parent.getParent());
        }

        treetable.getTree().scrollPathToVisible(
                new TreePath(childNode.getPath()));
        if (!res && parent!=null) {
            treetable.getTree().collapsePath(new TreePath(parent.getPath()));
        }
//        else
//            task.setExpand(false);
View Full Code Here

Examples of net.sourceforge.ganttproject.task.TaskNode

    }

    /** Add a sub task. */
    public TaskNode addObject(Object child, MutableTreeNode parent, int index) {
        TaskNode childNode = new TaskNode((Task) child);

        if (parent == null)
            parent = rootNode;

        // GanttTask tmpTask = (GanttTask)(childNode.getUserObject());
        // tmpTask.indentID((String)(((GanttTask)(parent.getUserObject())).getID()));

        treeModel.insertNodeInto(childNode, parent, index == -1 ? parent
                .getChildCount() : index);

        treetable.getTree().scrollPathToVisible(
                new TreePath(childNode.getPath()));

        nbTasks++;
        appli.refreshProjectInfos();

        return childNode;
View Full Code Here

Examples of net.sourceforge.ganttproject.task.TaskNode

        TreePath paths[] = treetable.getTree().getSelectionModel()
                .getSelectionPaths();
        Mediator.getTaskSelectionManager().clear();
        if (paths != null)
            for (int i = 0; i < paths.length; i++) {
                TaskNode tn = (TaskNode) paths[i].getLastPathComponent();
                if (!tn.isRoot())
                    Mediator.getTaskSelectionManager().addTask(
                            (Task) tn.getUserObject());
            }
    }
View Full Code Here

Examples of net.sourceforge.ganttproject.task.TaskNode

    public void pasteNode() {
        if (cpNodesArrayList != null) {
            final GanttTree2 gt2 = this;
            getUndoManager().undoableEdit("Paste", new Runnable() {
                public void run() {
                    TaskNode current = (TaskNode) treetable.getTree()
                            .getLastSelectedPathComponent();
                    List tasksList = new ArrayList();
                    if (current == null) {
                        current = rootNode;
                    }

                    boolean isAProjectTaskChild = false;
                    DefaultMutableTreeNode father = (DefaultMutableTreeNode) current
                            .getParent();
                    // if the task as a projectTask parent
                    while (father != null) {
                        if (((Task) father.getUserObject()).isProjectTask()) {
                            isAProjectTaskChild = true;
                        }
                        father = (DefaultMutableTreeNode) father.getParent();
                    }
                    mapOriginalIDCopyID = new HashMap();
                    // copyID = new ArrayList ();
                    // pasteID = new ArrayList ();

                    TaskManagerImpl tmi = (TaskManagerImpl) getTaskManager();
                    int MaxID = tmi.getMaxID();
                    // for(int i=0; i < cpNodesArrayList.size(); i++) {
                    for (int i = cpNodesArrayList.size() - 1; i >= 0; i--) {

                        if (isAProjectTaskChild)
                            ((Task) ((TaskNode) cpNodesArrayList.get(i))
                                    .getUserObject()).setProjectTask(false);
                        /*
                         * this will add new custom columns to the newly
                         * created task.
                         */
                        TreeNode sel = getSelectedTaskNode();
                        TreeNode parent = null;
                        if (sel != null) {
                            parent = sel.getParent();
                            if (parent != null)
                                where = parent.getIndex(sel);
                        }
                        tasksList.add((Task) insertClonedNode(
                                current == rootNode ? current
                                        : (DefaultMutableTreeNode) current
                                                .getParent(),
                                (DefaultMutableTreeNode) cpNodesArrayList
                                        .get(i), where + 1, true)
                                .getUserObject());
                        nbTasks++;
View Full Code Here

Examples of net.sourceforge.ganttproject.task.TaskNode

            assignment[i].delete();
        }

        getTaskManager().registerTask(newTask);

        DefaultMutableTreeNode cloneChildNode = new TaskNode(newTask);

        for (int i = 0; i < child.getChildCount(); i++) {
            insertClonedNode(cloneChildNode, (DefaultMutableTreeNode) child
                    .getChildAt(i), i, false);
        }
        // if(child.getParent() != null)
        // if(!child.getParent().equals(parent))
        // parent = (DefaultMutableTreeNode)parent.getParent();
        //
        //
        if (parent == null)
            location = 0;
        if (parent.getChildCount() < location)
            location = parent.getChildCount();

        ((GanttTreeTableModel) treeModel).insertNodeInto(cloneChildNode,
                parent, location);

        treetable.getTree().scrollPathToVisible(
                new TreePath(cloneChildNode.getPath()));

        // Remove the node from the expand list
        /*
         * int index = expand.indexOf(new
         * Integer(newTask.getTaskID())cloneChildNode.toString()); if (index >=
View Full Code Here

Examples of net.sourceforge.ganttproject.task.TaskNode

    }

    public void setDelay(final Task task, final Delay delay) {
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                TaskNode taskNode = (TaskNode) getNode(task.getTaskID());
                if (taskNode != null)
                    treetable.setDelay(taskNode, delay);
            }
        });
    }
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.