~veger/ganttproject/manual-import

« back to all changes in this revision

Viewing changes to ganttproject/src/net/sourceforge/ganttproject/gui/GanttTaskPropertiesBean.java

  • Committer: Maarten Bezemer
  • Date: 2012-01-22 12:20:00 UTC
  • Revision ID: maarten.bezemer@gmail.com-20120122122000-qwyec45rjx86wi7o
Updated till 2fe683a778c3 

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 
5
5
This program is free software; you can redistribute it and/or
6
6
modify it under the terms of the GNU General Public License
7
 
as published by the Free Software Foundation; either version 2
 
7
as published by the Free Software Foundation; either version 3
8
8
of the License, or (at your option) any later version.
9
9
 
10
10
This program is distributed in the hope that it will be useful,
212
212
        addEmptyRow(propertiesPanel);
213
213
        propertiesPanel.add(new JLabel(language.getText("dateOfBegining")));
214
214
        myStartDatePicker = createDatePicker(new ActionListener() {
 
215
            @Override
215
216
            public void actionPerformed(ActionEvent e) {
216
217
                setStart(new GanttCalendar(((JXDatePicker)e.getSource()).getDate()), false);
217
218
            }
220
221
 
221
222
        propertiesPanel.add(new JLabel(language.getText("dateOfEnd")));
222
223
        myEndDatePicker = createDatePicker(new ActionListener() {
 
224
            @Override
223
225
            public void actionPerformed(ActionEvent e) {
224
226
                GanttCalendar c = new GanttCalendar(((JXDatePicker)e.getSource()).getDate());
225
227
                c.add(Calendar.DATE, 1);
232
234
        durationField1 = new JTextField(8);
233
235
        durationField1.setName("length");
234
236
        durationField1.addFocusListener(new FocusListener() {
235
 
                       public void focusLost(FocusEvent e) {
 
237
                       @Override
 
238
                    public void focusLost(FocusEvent e) {
236
239
                               fireDurationChanged();
237
240
                       }
238
 
                       public void focusGained(FocusEvent e) {}
 
241
                       @Override
 
242
                    public void focusGained(FocusEvent e) {}
239
243
               });
240
244
        propertiesPanel.add(durationField1);
241
245
 
245
249
        thirdDateComboBox.addItem(language.getText("earliestBegin"));
246
250
        thirdDateComboBox.setName("third");
247
251
        thirdDateComboBox.addActionListener(new ActionListener() {
 
252
            @Override
248
253
            public void actionPerformed(ActionEvent e) {
249
254
                switch (thirdDateComboBox.getSelectedIndex()) {
250
255
                case TaskImpl.EARLIESTBEGIN:
258
263
        });
259
264
        extraConstraintBox.add(thirdDateComboBox);
260
265
        myThirdDatePicker = createDatePicker(new ActionListener() {
 
266
            @Override
261
267
            public void actionPerformed(ActionEvent e) {
262
268
                setThird(new GanttCalendar(((JXDatePicker)e.getSource()).getDate()), false);
263
269
            }
293
299
        colorButton.setBackground(selectedTasks[0].getColor());
294
300
        final String colorChooserTitle = language.getText("selectColor");
295
301
        colorButton.addActionListener(new ActionListener() {
 
302
            @Override
296
303
            public void actionPerformed(ActionEvent e) {
297
304
                JDialog dialog = JColorChooser.createDialog(
298
305
                        GanttTaskPropertiesBean.this, colorChooserTitle,
299
306
                        true, colorChooser,
300
307
                        new ActionListener() {
 
308
                            @Override
301
309
                            public void actionPerformed(ActionEvent e) {
302
310
                                colorButton.setBackground(colorChooser.getColor());
303
311
                                isColorChanged = true;
315
323
        defaultColorButton.setToolTipText(GanttProject.getToolTip(language
316
324
                .getText("resetColor")));
317
325
        defaultColorButton.addActionListener(new ActionListener() {
 
326
            @Override
318
327
            public void actionPerformed(ActionEvent e) {
319
328
                colorButton.setBackground(GanttGraphicArea.taskDefaultColor);
320
329
                isColorChanged = true;
336
345
        weblinkBox.add(bWebLink);
337
346
 
338
347
        bWebLink.addActionListener(new ActionListener() {
 
348
            @Override
339
349
            public void actionPerformed(ActionEvent e) {
340
350
                // link to open the web link
341
351
                if (!BrowserControl.displayURL(tfWebLink.getText())) {
374
384
    }
375
385
 
376
386
    private void constructCustomColumnPanel() {
377
 
        myCustomColumnPanel = new CustomColumnsPanel(myProject.getTaskCustomColumnManager(), myUIfacade);
 
387
        myCustomColumnPanel = new CustomColumnsPanel(
 
388
                myProject.getTaskCustomColumnManager(),
 
389
                myUIfacade,
 
390
                selectedTasks[0].getCustomValues(),
 
391
                myUIfacade.getTaskTree().getVisibleFields());
378
392
    }
379
393
 
380
394
    /** Construct the predecessors tabbed pane */
428
442
 
429
443
        tabbedPane = new JTabbedPane();
430
444
        tabbedPane.getModel().addChangeListener(new ChangeListener() {
 
445
            @Override
431
446
            public void stateChanged(ChangeEvent e) {
432
447
                changeNameOfTask();
433
448
                fireDurationChanged();
455
470
        constructCustomColumnPanel();
456
471
        tabbedPane.addTab(language.getText("customColumns"), new ImageIcon(
457
472
                getClass().getResource("/icons/custom.gif")),
458
 
                myCustomColumnPanel);
 
473
                myCustomColumnPanel.geComponent());
459
474
        tabbedPane.addFocusListener(new FocusAdapter() {
460
475
            private boolean isFirstFocusGain = true;
461
476
            @Override
771
786
            result = Pair.create(language.getText("projectTask"), projectTaskCheckBox1);
772
787
        } else if (canBeMilestone) {
773
788
            mileStoneCheckBox1 = new JCheckBox(new AbstractAction() {
 
789
                @Override
774
790
                public void actionPerformed(ActionEvent arg0) {
775
791
                    enableMilestoneUnfriendlyControls(!isMilestone());
776
792
                }