001: /*
002: * Copyright (C) Jakub Neubauer, 2007
003: *
004: * This file is part of TaskBlocks
005: *
006: * TaskBlocks is free software; you can redistribute it and/or modify
007: * it under the terms of the GNU General Public License as published by
008: * the Free Software Foundation; either version 3 of the License, or
009: * (at your option) any later version.
010: *
011: * TaskBlocks is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
014: * GNU General Public License for more details.
015: *
016: * You should have received a copy of the GNU General Public License
017: * along with this program. If not, see <http://www.gnu.org/licenses/>.
018: */
019:
020: package taskblocks.modelimpl;
021:
022: import java.awt.Color;
023:
024: import taskblocks.Colors;
025:
026: public class TaskImpl {
027:
028: private String _name;
029: private long _startTime;
030: private long _duration;
031: private TaskImpl[] _predecessors;
032: private ManImpl _man;
033:
034: private ColorLabel _colorLabel;
035:
036: /** Used only when saving */
037: public String _id;
038:
039: public long getDuration() {
040: return _duration;
041: }
042:
043: public void setDuration(long _duration) {
044: if (_duration < 1) {
045: _duration = 1;
046: }
047: this ._duration = _duration;
048: }
049:
050: public String getName() {
051: return _name;
052: }
053:
054: public void setName(String _name) {
055: this ._name = _name;
056: }
057:
058: public long geSstartTime() {
059: return _startTime;
060: }
061:
062: public void setStartTime(long time) {
063: _startTime = time;
064: }
065:
066: public long getStartTime() {
067: return _startTime;
068: }
069:
070: public TaskImpl[] getPredecessors() {
071: return _predecessors;
072: }
073:
074: public void setPredecessors(TaskImpl[] preds) {
075: _predecessors = preds;
076: }
077:
078: public void setMan(ManImpl man) {
079: _man = man;
080: }
081:
082: public ManImpl getMan() {
083: return _man;
084: }
085:
086: public Color getColor() {
087: if (_colorLabel == null) {
088: return Colors.TASK_COLOR;
089: } else {
090: return _colorLabel._color;
091: }
092: }
093:
094: public ColorLabel getColorLabel() {
095: return _colorLabel;
096: }
097:
098: public void setColorLabel(ColorLabel cl) {
099: _colorLabel = cl;
100: }
101: }
|