Package net.sourceforge.ganttproject.task

Examples of net.sourceforge.ganttproject.task.Task


        Iterator it = this.listStructure.iterator();

        while (it.hasNext()) {
            CustomPropertiesStructure cps = (CustomPropertiesStructure) it
                    .next();
            Task task = taskManager.getTask(cps.taskID);
            CustomColumn cc = myColumnStorage.getCustomColumnByID(cps.taskPropertyID);
            String valueStr = cps.value;
            Object value = null;
            Class cla = cc.getType();

            if (valueStr!=null) {
              if (cla.equals(String.class))
                  value = valueStr.toString();
              else if (cla.equals(Boolean.class))
                  value = Boolean.valueOf(valueStr);
              else if (cla.equals(Integer.class))
                  value = Integer.valueOf(valueStr);
              else if (cla.equals(Double.class))
                  value = Double.valueOf(valueStr);
              else if (GregorianCalendar.class.isAssignableFrom(cla))
                  try {
                      value = new GanttCalendar(DateParser.parse(valueStr));
                  } catch (InvalidDateException e) {
                    if (!GPLogger.log(e)) {
                      e.printStackTrace(System.err);
                    }
                  }
            }
            try {
                // System.out.println(task.getName());
                task.getCustomValues().setValue(cc.getName(), value);
            } catch (CustomColumnsException e) {
              if (!GPLogger.log(e)) {
                e.printStackTrace(System.err);
              }
            }
View Full Code Here


        public void paint(GraphicPrimitiveContainer.Rectangle next) {
            Object modelObject = next.getModelObject();
            if (modelObject instanceof TaskActivity==false) {
                throw new RuntimeException("Model object is expected to be TaskActivity ");
            }
            Task task = ((TaskActivity)modelObject).getTask();
            Color c = task.getColor();
            if (c==null) {
                c = getDefaultColor();
            }
            Graphics2D g = (Graphics2D) myGraphics;
            g.setColor(c);
            ShapePaint shapePaint = task.getShape();
            if (myConfig.isCriticalPathOn() && task.isCritical()) {
                shapePaint = new ShapePaint(ShapeConstants.THICK_BACKSLASH,
                        Color.BLACK, c);
            }
           
            if (shapePaint!=null) {
View Full Code Here

            myTasks = tasks;
            myMutators = new ArrayList(myTasks.size());
            myInitialStarts = new ArrayList(myTasks.size());
            Iterator itTasks = myTasks.iterator();
            while (itTasks.hasNext()) {
                Task t = (Task) itTasks.next();
                myMutators.add(t.createMutator());
                myInitialStarts.add(t.getStart());
            }
        }
View Full Code Here

            float diff = getLengthDiff(event);
            TaskLength bottomUnitLength = getTaskManager().createLength(
                    getViewState().getBottomTimeUnit(), diff);

            for (int i = 0; i < myTasks.size(); i++) {
                Task task = (Task) myTasks.get(i);
                TaskLength taskLength = task
                        .translateDuration(bottomUnitLength);
                int dayDiff = (int) (taskLength.getValue());
                if (dayDiff != 0) {
                    ((TaskMutator) myMutators.get(i)).shift(dayDiff);
                }
View Full Code Here

              getUIFacade().showErrorDialog(e);
            }

            Iterator itTasks = myTasks.iterator();
            while (itTasks.hasNext()) {
                Task t = ((Task) itTasks.next());
                t.applyThirdDateConstraint();
            }

            GanttGraphicArea.this.repaint();
        }
View Full Code Here

                it = Arrays.asList(getTaskManager().getTasks()).iterator();
            } else {
                it = myTaskSelectionManager.getSelectedTasks().iterator();
            }
            while (it.hasNext()) {
                Task t = (Task) it.next();
                GanttCalendar dStart = t.getStart();
                GanttCalendar dEnd = t.getEnd();

                min = min == null ? dStart.Clone()
                        : (min.compareTo(dStart) > 0 ? dStart.Clone() : min);
                max = max == null ? dEnd.Clone()
                        : (max.compareTo(dEnd) < 0 ? dEnd.Clone() : max);
View Full Code Here

            MouseListener {
        private MouseSupport myMouseSupport = new MouseSupport();

        public void mouseClicked(MouseEvent e) {
            if (e.getButton() == MouseEvent.BUTTON1) {
                Task taskUnderPointer = myMouseSupport
                        .findTaskUnderMousePointer(e.getX(), e.getY());
                if (taskUnderPointer == null) {
                    tree.selectTreeRow(-1);
                }
            }
View Full Code Here

        public void mousePressed(MouseEvent e) {
            tree.stopEditing();
            if (appli.isOnlyViewer)
                return;
            Task taskUnderPointer = myMouseSupport.findTaskUnderMousePointer(e
                    .getX(), e.getY());
            if (taskUnderPointer!=null && !Mediator.getTaskSelectionManager().isTaskSelected(
                    taskUnderPointer)) {
                boolean ctrl = (e.getModifiersEx() & InputEvent.CTRL_DOWN_MASK) == InputEvent.CTRL_DOWN_MASK;
                tree.selectTask(taskUnderPointer, ctrl);
View Full Code Here

        // Move the move on the area
        public void mouseMoved(MouseEvent e) {
            ChartItem itemUnderPoint = myMouseSupport
                    .getChartItemUnderMousePoint(e.getX(), e.getY());
            Task taskUnderPoint = itemUnderPoint == null ? null
                    : itemUnderPoint.getTask();
            // System.err.println("[OldMouseMotionListenerImpl] mouseMoved:
            // taskUnderPoint="+taskUnderPoint);
            if (taskUnderPoint == null) {
                setDefaultCursor();
View Full Code Here

            public void taskAdded(TaskHierarchyEvent e) {
                setHasBeenCalled(true);
            }
        };
        taskManager.addTaskListener(listener);
        Task task = taskManager.createTask();
        assertTrue("Event taskAdded() is expected to be sent", listener
                .hasBeenCalled());
    }
View Full Code Here

TOP

Related Classes of net.sourceforge.ganttproject.task.Task

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.