Package clips.delegate.shedule.individual

Examples of clips.delegate.shedule.individual.SheduleIndividualData


    class SheduleIndividualDataComparator implements Comparator {

        @Override
        public int compare(Object o1, Object o2) {
            SheduleIndividualData p1 = (SheduleIndividualData) o1;
            SheduleIndividualData p2 = (SheduleIndividualData) o2;
            if (p1.getBegin().after(p2.getBegin())) {
                return 1;
            } else {
                return -1;
            }
        }
View Full Code Here


                    while (it.hasNext()) {
                        datas.add(it.next());
                    }
                    Collections.sort(datas, new SheduleIndividualDataComparator());
                    for (int i = 0; i < datas.size(); i++) {
                        SheduleIndividualData data = datas.get(i);
                        Date begin = data.getBegin();
                        int duration = data.getWorkDuration();
                        tb.setTime(begin);
                        te.setTime(begin);
                        te.add(Calendar.MINUTE, duration);
                        String timeTxt = String.format("%02d:%02d-%02d:%02d", tb.get(Calendar.HOUR_OF_DAY), tb.get(Calendar.MINUTE), te.get(Calendar.HOUR_OF_DAY), te.get(Calendar.MINUTE));
                        String type = data.getType().getTitle();
                        String cabinet = data.getCabinet().toString();
                        toScreen = toScreen + type + "\n" + timeTxt + "\n(" + cabinet + ") \n\n";
                    }
                }
                return toScreen;
            } catch (ClipsException ex) {
View Full Code Here

    class SheduleIndividualDataComparator implements Comparator {

        @Override
        public int compare(Object o1, Object o2) {
            SheduleIndividualData p1 = (SheduleIndividualData) o1;
            SheduleIndividualData p2 = (SheduleIndividualData) o2;
            if (p1.getBegin().after(p2.getBegin())) {
                return 1;
            } else {
                return -1;
            }
        }
View Full Code Here

     * Подтверждает у пользователя и удалеет спан, информирует таблицы
     * @param span
     */
    protected void removeSpanWithConformation(TimeSpanWork span) {
        if(MessageBox.showConfirmYesNo(MessageBox.C_DEL_WORK) == MessageBox.ANSWER_YES) {
            SheduleIndividualData work = span.getWork();
            currentList.remove(work);
            removeTimeSpan(span);       
        }
    }
View Full Code Here

     * @param span
     * @return
     */
    protected boolean showSpanDetails(TimeSpanWork span) {
        try {
            SheduleIndividualData job = span.getWork();
            GregorianCalendar gc = (GregorianCalendar) GregorianCalendar.getInstance();
            gc.setTimeInMillis(job.getBegin().getTime());
           
            int begin = gc.get(GregorianCalendar.HOUR_OF_DAY)*60 + gc.get(GregorianCalendar.MINUTE);
            int end = begin + job.getWorkDuration();
                   
            IndividualTimeSpanDialog dlg = new IndividualTimeSpanDialog(MainWindow.mainWindow, begin, end,
                    span.canBeResized(), span.canBeMoved(), span.canBeDeleted(),
                    5, span.getMinimalTime()/(60*1000), job.getType(), sil.getCollaborator(), job.getCabinet(), am);
            dlg.setVisible(true);
            if (dlg.getDlgResult() == IndividualTimeSpanDialog.DLG_DELETED) {
                removeSpanWithConformation(span);
                return true;
            } else if (dlg.getDlgResult() == IndividualTimeSpanDialog.DLG_OK) {
                SheduleIndividualData saved = (SheduleIndividualData) job.clone();

                gc.set(GregorianCalendar.HOUR_OF_DAY, dlg.getTimeBegin()/60);
                gc.set(GregorianCalendar.MINUTE, dlg.getTimeBegin()%60);

                job.setBegin(gc.getTime());
                job.setWorkDuration(dlg.getTimeEnd() - dlg.getTimeBegin());
                job.setType(dlg.getWorkType());
                job.setCabinet(dlg.getCabinet());
                try {
                    span.updateSpan();
                } catch (SpanException ex) {
                    MessageBox.showException(ex);
                    job.setBegin(saved.getBegin());
                    job.setWorkDuration(saved.getWorkDuration());
                    job.setType(saved.getType());
                    job.setCabinet(saved.getCabinet());
                }
                return true;
            }
        } catch (ClipsException ex) {
            MessageBox.showException(ex);
View Full Code Here

     * @param table
     */
    @Override
    public void spanResized(TimeSpan span, JTimeTable table) {
        TimeSpanWork jobSpan = (TimeSpanWork)span;
        SheduleIndividualData job = jobSpan.getWork();

        job.setBegin(span.getBegin());
               
        job.setWorkDuration(span.getLength());
    }
View Full Code Here

     * @param table
     */
    @Override
    public void spanMoved(TimeSpan span, JTimeTable table) {
        TimeSpanWork jobSpan = (TimeSpanWork)span;
        SheduleIndividualData job = jobSpan.getWork();

        job.setBegin(span.getBegin());
               
        job.setWorkDuration(span.getLength());
    }
View Full Code Here

           try {
                IndividualTimeSpanDialog dlg = new IndividualTimeSpanDialog(MainWindow.mainWindow, 9*60, 21*60,
                        true, true, false, 5, 10, null, sil.getCollaborator(), null, am);
                dlg.setVisible(true);
                if (dlg.getDlgResult() == TimeSpanDialog.DLG_OK) {
                    SheduleIndividualData work = new SheduleIndividualData(sil.getCollaborator());
                    Calendar cal = currentweekIndex.getBegin();
                    cal.add(Calendar.DAY_OF_MONTH, day.getEuropean());
                    cal.add(Calendar.MINUTE, dlg.getTimeBegin());
                   
                    work.setBegin(cal.getTime());
                    work.setWorkDuration(dlg.getTimeEnd() - dlg.getTimeBegin());
                    work.setDefaultServiceDuration(0);
                    work.setType(dlg.getWorkType());
                    work.setCabinet(dlg.getCabinet());
                    currentList.append(work);
       
                    TimeSpanWork span = new TimeSpanWork(work);
                    addTimeSpan(span);
                }
View Full Code Here

                    while (it.hasNext()) {
                        datas.add(it.next());
                    }
                    Collections.sort(datas, new SheduleIndividualDataComparator());
                    for (int i = 0; i < datas.size(); i++) {
                        SheduleIndividualData data = datas.get(i);
                        Date begin = data.getBegin();
                        int duration = data.getWorkDuration();
                        tb.setTime(begin);
                        te.setTime(begin);
                        te.add(Calendar.MINUTE, duration);
                        String timeTxt = String.format("%02d:%02d-%02d:%02d", tb.get(Calendar.HOUR_OF_DAY), tb.get(Calendar.MINUTE), te.get(Calendar.HOUR_OF_DAY), te.get(Calendar.MINUTE));
                        String type = data.getType().getTitle();
                        String cabinet = data.getCabinet().toString();
                        toScreen = toScreen + type + "\n" + timeTxt + "\n(" + cabinet + ") \n\n";
                    }
                }
                return toScreen;
            } catch (ClipsException ex) {
View Full Code Here

            int year = itemBegin.get(Calendar.YEAR);
            int month = itemBegin.get(Calendar.MONTH);
            int dayy = itemBegin.get(Calendar.DAY_OF_MONTH);
           
            while (it.hasNext()) {
                SheduleIndividualData work = it.next();
               
                workBegin.setTime(work.getBegin());
                workBegin.set(year, month, dayy);
               
                workEnd.setTime(work.getBegin());
                workEnd.add(Calendar.MINUTE, work.getWorkDuration());
                workEnd.set(year, month, dayy);
               
                if ((itemBegin.after(workBegin) || itemBegin.equals(workBegin)) &&
                        (itemEnd.before(workEnd) || itemEnd.equals(workEnd))) {
                    cabinet = work.getCabinet();
                    break;
                }
            }
           
            Calendar tb = GregorianCalendar.getInstance();
View Full Code Here

TOP

Related Classes of clips.delegate.shedule.individual.SheduleIndividualData

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.