Package com.art.anette.datamodel.dataobjects.managed

Examples of com.art.anette.datamodel.dataobjects.managed.WorkPackage


        } else if (dObj instanceof Department) {
            setIcon(new ImageIcon(getClass().getResource("/com/art/anette/client/ui/resources/department.png")));
        } else if (dObj instanceof Project) {
            setIcon(new ImageIcon(getClass().getResource("/com/art/anette/client/ui/resources/project.png")));
        } else if (dObj instanceof WorkPackage) {
            WorkPackage wp = (WorkPackage) dObj;
            if (wp.isRoot()) {
                if (wp.isCompleted()) {
                    setIcon(new ImageIcon(getClass().getResource("/com/art/anette/client/ui/resources/rootworkpackage_blue.png")));
                } else {
                    setIcon(new ImageIcon(getClass().getResource("/com/art/anette/client/ui/resources/rootworkpackage.png")));
                }
            } else {
                if (wp.isCompleted()) {
                    setIcon(new ImageIcon(getClass().getResource("/com/art/anette/client/ui/resources/workpackage_blue.png")));
                } else if (wp.getManager().equals(emp)) {
                    setIcon(new ImageIcon(getClass().getResource("/com/art/anette/client/ui/resources/workpackage_green.png")));
                } else if (!wp.hasEmployee(emp)) {
                    setIcon(new ImageIcon(getClass().getResource("/com/art/anette/client/ui/resources/workpackage_red.png")));
                } else {
                    setIcon(new ImageIcon(getClass().getResource("/com/art/anette/client/ui/resources/workpackage.png")));
                }
            }
View Full Code Here


                error = null;

                throw tmp;
            }

            WorkPackage tmp = workPackage;
            workPackage = null;

            return tmp;
        }
View Full Code Here

            return false;
        }
        final Date start = dateBox.getStart();
        final Date end = dateBox.getEnd();
        if (wpParent instanceof WorkPackage) {
            WorkPackage parentWP = (WorkPackage) wpParent;
            if (!parentWP.isRangeInside(start, end)) {
                ProgressUtils.infoMessage(lang.getString("WrongDateWP"));
                return false;
            }
        } else if (wpParent instanceof Project) {
            Project parentProject = (Project) wpParent;
View Full Code Here

    /**
     * Die Daten des Arbeitspakets werden ausgelesen und angezeigt.
     */
    @Override
    protected void update() {
        WorkPackage workPackage = (WorkPackage) dataObject;
        WorkPackageDetailedInformation wdi = logic.getWorkPackageDetailedInfo(workPackage);

        lblName.setText(workPackage.getName());
        lblManager.setText(workPackage.getManager().toString());
        lblStart.setText(DateTimeUtils.formatDate(workPackage.getStart()));
        lblEnd.setText(DateTimeUtils.formatDate(workPackage.getEnd()));
        lblFreeze.setText(DateTimeUtils.formatDateTime(workPackage.getFreezeTime()));
        lblTrackedTime.setText(DateTimeUtils.timeToString(Logic.getTrackedTime((WorkPackage) dataObject)));

        chkCompleted.setSelected(workPackage.isCompleted());
        chkMilestone.setSelected(workPackage.isMilestone());

        pgPanel.setDetailedInformation(wdi);
    }
View Full Code Here

    public List<Task> getTableEntries() {
        Date now = new Date();
        Logic.lockReading();
        List<Task> tasks;
        try {
            WorkPackage wp = (WorkPackage) object;
            tasks = new ArrayList<Task>();
            for (WorkPackage workPackage : wp.getSubWorkPackagesRec()) {
                for (Task task : workPackage.getTasks(filter)) {
                    if (employee.isAllowedToAdd(task, Duration.class) && workPackage.isRangeInside(now, now)) {
                        tasks.add(task);
                        task.addObserver(this);
                    }
View Full Code Here

     * Zeigt den Dialog zum Setzen der Abhängigkeiten des Arbeitspaketes an.
     *
     * @param evt Wird nicht verwendet.
     */
    private void btnLinkWorkPackageActionPerformed(ActionEvent evt) {//GEN-FIRST:event_btnLinkWorkPackageActionPerformed
        WorkPackage wp = gantt.getSelectedWorkPackage();
        //TODO Fix really edit and not add check?
        if (wp != null && logic.getEmployee().isAllowedToEdit(wp)) {
            new LinkWorkPackageDialog(logic, wp).setVisible(true);
        }
    }//GEN-LAST:event_btnLinkWorkPackageActionPerformed
View Full Code Here

     * Zeigt den Dialog zum Löschen der Abhängigkeiten des Arbeitspaketes an.
     *
     * @param evt Wird nicht verwendet.
     */
    private void btnUnlinkWorkPackageActionPerformed(ActionEvent evt) {//GEN-FIRST:event_btnUnlinkWorkPackageActionPerformed
        WorkPackage wp = gantt.getSelectedWorkPackage();
        //TODO Fix really edit and not delete check?
        if (wp != null && logic.getEmployee().isAllowedToEdit(wp)) {
            new UnlinkWorkPackageDialog(logic, wp).setVisible(true);
        }
    }//GEN-LAST:event_btnUnlinkWorkPackageActionPerformed
View Full Code Here

     * @param event Wird nicht verwendet.
     */
    @Override
    public void mouseClicked(MouseEvent event) {
        gantt.grabFocus();
        WorkPackage wp = gantt.getSelectedWorkPackage();
        if (wp != null) {
            Employee user = logic.getEmployee();
            btnAddWorkPackage.setEnabled(user.isAllowedToAdd(wp, WorkPackage.class));
            btnEditWorkPackage.setEnabled(user.isAllowedToEdit(wp));
            btnDeleteWorkPackage.setEnabled(user.isAllowedToDelete(wp));
View Full Code Here

    }

    @Override
    public void mousePressed(MouseEvent evt) {
        if (evt.isPopupTrigger()) {
            WorkPackage wp = gantt.getSelectedWorkPackage();
            if (wp != null) {
                mw.popupSource = this;
                mw.doWorkPackagePopup(wp, evt);
            }
        }
View Full Code Here

    @Override
    public Object getValueAt(int rowIndex, int columnIndex) {
        if (!entries.isEmpty()) {
            DataObject obj = entries.get(rowIndex);
            WorkPackage wp = null;
            Task task = null;
            if (obj instanceof WorkPackage) {
                wp = (WorkPackage) obj;
            } else {
                task = (Task) obj;
            }

            switch (columnIndex) {
                case NAME:
                    return wp != null ? wp.getName() : task.getName();
                case MANAGER:
                    return wp != null ? wp.getManager().toString() : task.getEmployee().toString();
                case TYPE:
                    return wp != null ? lang.getString("ColTypeW") : lang.getString("ColTypeT");
                case PROGRESS:
                    return wp != null ? (float) Logic.getProgress(wp) : 0;
View Full Code Here

TOP

Related Classes of com.art.anette.datamodel.dataobjects.managed.WorkPackage

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.