Revision 3023 org.gvsig.tools/library/trunk/org.gvsig.tools/org.gvsig.tools.lib/src/main/java/org/gvsig/tools/task/impl/BaseTaskStatus.java

View differences:

BaseTaskStatus.java
66 66
        }
67 67
    }
68 68

  
69
    protected Date lastModification = null;
69
    protected long lastModification = 0;
70 70

  
71 71
    protected SubtaskValues values;
72 72
    protected List subtaskStack = null;
......
132 132
    }
133 133

  
134 134
    protected void touch(boolean clearmsg) {
135
        Date now = new Date();
135
        long now = System.currentTimeMillis();
136 136
        if (clearmsg) {
137
            if (this.lastModification != null && (now.getTime() - this.lastModification.getTime()) > 4000) {
137
            if (this.lastModification != 0 && (now- this.lastModification) > 4000) {
138 138
                this.values.message = null;
139 139
            }
140 140
        }
......
149 149

  
150 150
    @Override
151 151
    public Date getLastModification() {
152
        return this.lastModification;
152
        return new Date(this.lastModification);
153 153
    }
154 154

  
155 155
    @Override
......
175 175
        this.touch(false);
176 176
    }
177 177

  
178
    
179
    private long lastNotification = 0;
180
    
178 181
    @Override
179 182
    public void incrementCurrentValue() {
180 183
        this.values.curValue++;
181
        this.touch(false);
184

  
185
        long now = System.currentTimeMillis();
186
        if( this.values.curValue >= this.values.maxValue ) {
187
            this.touch(false);
188
            this.lastNotification = now;
189
        } else {                
190
            if( now - this.lastNotification > 200 ) {
191
                this.touch(false);
192
                this.lastNotification = now;
193
            } else {
194
                this.lastModification = now;
195
            }
196
        }
182 197
    }
183 198

  
184 199
    @Override

Also available in: Unified diff