KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > taskblocks > modelimpl > TaskImpl


1 /*
2  * Copyright (C) Jakub Neubauer, 2007
3  *
4  * This file is part of TaskBlocks
5  *
6  * TaskBlocks is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * TaskBlocks is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */

19
20 package taskblocks.modelimpl;
21
22 import java.awt.Color JavaDoc;
23
24 import taskblocks.Colors;
25
26 public class TaskImpl {
27     
28     private String JavaDoc _name;
29     private long _startTime;
30     private long _duration;
31     private TaskImpl[] _predecessors;
32     private ManImpl _man;
33     
34     private ColorLabel _colorLabel;
35     
36     /** Used only when saving */
37     public String JavaDoc _id;
38     
39     public long getDuration() {
40         return _duration;
41     }
42     public void setDuration(long _duration) {
43         if(_duration < 1) {
44             _duration = 1;
45         }
46         this._duration = _duration;
47     }
48     public String JavaDoc getName() {
49         return _name;
50     }
51     public void setName(String JavaDoc _name) {
52         this._name = _name;
53     }
54     public long geSstartTime() {
55         return _startTime;
56     }
57     public void setStartTime(long time) {
58         _startTime = time;
59     }
60     public long getStartTime() {
61         return _startTime;
62     }
63     public TaskImpl[] getPredecessors() {
64         return _predecessors;
65     }
66     public void setPredecessors(TaskImpl[] preds) {
67         _predecessors = preds;
68     }
69     public void setMan(ManImpl man) {
70         _man = man;
71     }
72     public ManImpl getMan() {
73         return _man;
74     }
75     
76     public Color JavaDoc getColor() {
77         if(_colorLabel == null) {
78             return Colors.TASK_COLOR;
79         } else {
80             return _colorLabel._color;
81         }
82     }
83     
84     public ColorLabel getColorLabel() {
85         return _colorLabel;
86     }
87     public void setColorLabel(ColorLabel cl) {
88         _colorLabel = cl;
89     }
90 }
91
Popular Tags