1
|
/*******************************************************************************
|
2
|
* Copyright 2005, CHISEL Group, University of Victoria, Victoria, BC, Canada.
|
3
|
* All rights reserved. This program and the accompanying materials are made
|
4
|
* available under the terms of the Eclipse Public License v1.0 which
|
5
|
* accompanies this distribution, and is available at
|
6
|
* http://www.eclipse.org/legal/epl-v10.html
|
7
|
*
|
8
|
* Contributors: The Chisel Group, University of Victoria
|
9
|
*******************************************************************************/
|
10
|
package org.eclipse.zest.layouts.progress;
|
11
|
|
12
|
/**
|
13
|
* When an algorithm wants to notify everyone it has completely part of its task, it
|
14
|
* throws a ProgressEvent. The progress is a number (currentProgress) representing the
|
15
|
* current steps completed out of the total number of steps (totalProgress)
|
16
|
*
|
17
|
* @author Casey Best
|
18
|
*/
|
19
|
public class ProgressEvent {
|
20
|
int stepsCompleted;
|
21
|
int totalSteps;
|
22
|
|
23
|
/**
|
24
|
* Creates a progress event.
|
25
|
* @param stepsCompleted The current progress out of the total
|
26
|
* @param totalNumberOfSteps The number used to indicate when the algorithm will finish
|
27
|
*/
|
28
|
public ProgressEvent(int stepsCompleted, int totalNumberOfSteps) {
|
29
|
this.stepsCompleted = stepsCompleted;
|
30
|
this.totalSteps = totalNumberOfSteps;
|
31
|
}
|
32
|
|
33
|
/**
|
34
|
* Returns the number of steps already completed.
|
35
|
*/
|
36
|
public int getStepsCompleted() {
|
37
|
return stepsCompleted;
|
38
|
}
|
39
|
|
40
|
/**
|
41
|
* Returns the total number of steps to complete.
|
42
|
*/
|
43
|
public int getTotalNumberOfSteps() {
|
44
|
return totalSteps;
|
45
|
}
|
46
|
}
|