Package net.sourceforge.ganttproject

Examples of net.sourceforge.ganttproject.GanttCalendar


    }

    public GanttCalendar parseDate(String date) throws ParseException {
        Calendar tmp = Calendar.getInstance(currentLocale);
        tmp.setTime(currentDateFormat.parse(date));
        return new GanttCalendar(tmp.get(Calendar.YEAR), tmp
                .get(Calendar.MONTH), tmp.get(Calendar.DATE));
    }
View Full Code Here


        applyComponentOrientation(language.getComponentOrientation());
    }

    /** Return The selected date. */
    public GanttCalendar getDate() {
        GanttCalendar result = panel.getDate();
        // System.err.println("[GanttDialogDate] getDate():
        // fixed="+myFixedDate);
        result.setFixed(myFixedDate);
        return result;
    }
View Full Code Here

            if (x < getWidth() / 7 * 7 && y > 15 && y < 7 * 15) {
                int X = x / (getWidth() / 7);
                int Y = (y - 15) / 15;

                // Recup the first monday
                GanttCalendar tmpdate = date.Clone();
                tmpdate.setDay(1);
                String d = tmpdate.getdayWeek();
                while (!d.equals(language.getDay(1))) {
                    tmpdate.go(Calendar.DATE, -1);
                    d = tmpdate.getdayWeek();
                }
                // Search the exact day
                for (int i = 0; i < Y * 7 + X; i++)
                    tmpdate.go(Calendar.DATE, 1);

                // Check the validity of the month
                // if(tmpdate.getMonth() == date.getMonth())
                // date = tmpdate;
                changeDate(tmpdate);
View Full Code Here

                String dw = dayWeek[(i + 1) % 7];
                g.drawString(
                        dw.substring(0, dw.length() < 3 ? dw.length() : 3), i
                                * sizex / 7 + 3, 12);
            }
            GanttCalendar tmpdate = date.Clone();
            TimeZone timeZone = tmpdate.getTimeZone();
            tmpdate.setDay(1);
            String d = tmpdate.getdayWeek();
            while (!d.equals(language.getDay(1))) {
                tmpdate.go(Calendar.DATE, -1);
                d = tmpdate.getdayWeek();
            }
            for (int i = 0; i < 6; i++) {
                for (int j = 0; j < 7; j++) {
                    if (tmpdate.getMonth() != date.getMonth())
                        g.setColor(gris);
                    else {
                        if (tmpdate.getDay() == date.getDay()) {
                            g.setColor(bleu);
                            g.fillRect(j * sizex / 7 - 1, 15 + i * 15,
                                    sizex / 7, 15);
                            g.setColor(Color.white);
                        } else
                            g.setColor(Color.black);
                    }
                    g.drawString("" + tmpdate.getDate(), j * sizex / 7 + 4,
                            30 + i * 15 - 3);
                    tmpdate.go(Calendar.DATE, 1);
                    if (timeZone != null
                            && timeZone.inDaylightTime(tmpdate.getTime())) {
                        tmpdate.add(Calendar.MILLISECOND, timeZone
                                .getDSTSavings());
                        timeZone = null;
                    }

                }
View Full Code Here

                  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);
                    }
                  }
View Full Code Here

        JPanel startDatePanel = new JPanel(
                new FlowLayout(FlowLayout.LEFT, 5, 0));
        startDatePanel.add(startDateLabel1);
        myStartDatePicker = createDatePicker(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                setStart(new GanttCalendar(((JXDatePicker)e.getSource()).getDate()), false);
            }
        });
        startDatePanel.add(myStartDatePicker);
        //startDatePanel.add(startDateButton1);


        JPanel finishDatePanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 5,
                0));
        finishDatePanel.add(finishDateLabel1);
        myEndDatePicker = createDatePicker(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                setEnd(new GanttCalendar(((JXDatePicker)e.getSource()).getDate()), false);
            }
        });
        finishDatePanel.add(myEndDatePicker);
        //finishDatePanel.add(finishDateButton1);

        JPanel thirdDatePanel = new JPanel(
                new FlowLayout(FlowLayout.LEFT, 5, 0));
        thirdDatePanel.add(thirdDateComboBox);
        myThirdDatePicker = createDatePicker(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                setThird(new GanttCalendar(((JXDatePicker)e.getSource()).getDate()), false);
            }
        });
        thirdDatePanel.add(myThirdDatePicker);
        //thirdDatePanel.add(thirdDateButton1);
View Full Code Here

            myDependenciesPanel.durationChanged(_length);
        myAllocationsPanel[0].durationChanged(_length);
        durationFieldNotes.setText(_length + "");
        length = _length;
        // change the end date
        GanttCalendar _end = start.newAdd(length);
        this.end = _end;
        finishDateField1.setText(_end.toString());
    }
View Full Code Here

//        this.setStartFixed(dstart.isFixed());

        if (this.start.compareTo(this.end) < 0) {
            adjustLength();
        } else {
            GanttCalendar _end = start.newAdd(this.taskLength);
            this.end = _end;
            //finishDateField1.setText(_end.toString());
            this.myEndDatePicker.setDate(this.end.getTime());
        }
    }
View Full Code Here

//        this.setFinishFixed(dend.isFixed());

        if (this.start.compareTo(this.end) < 0) {
            adjustLength();
        } else {
            GanttCalendar _start = this.end.newAdd(-length);
            this.start = _start;
            startDateField1.setText(_start.toString());
        }
    }
View Full Code Here

                    defValue = new Double(Double.parseDouble(td));
                }
                break;
            case 3:
                colClass = GregorianCalendar.class;
                defValue = myDate.getValue()==null ? null : new GanttCalendar(myDate.getValue());
                break;
            case 4:
                colClass = Boolean.class;
                defValue = new Boolean(radioTrue.isSelected());
                break;
View Full Code Here

TOP

Related Classes of net.sourceforge.ganttproject.GanttCalendar

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.