/** Fires {@link ProgressStatusEvent} to parent. */ protected void fireEvent(ProgressStatusEvent event) { if (parent != null) { parent.fireEvent(event); } }
/** Fires {@link ProgressStatusEvent} to parent. */ protected void fireEvent(ProgressStatusEvent event) { if (parent != null) { parent.fireEvent(event); } }
@Override protected synchronized void fireEvent(ProgressStatusEvent event) { recount(); super.fireEvent(event); }
@Override protected synchronized void fireEvent(ProgressStatusEvent event) { recount(); super.fireEvent(event); }
@Override public synchronized void setTotalStepCount(int totalStepCount) { if (completed || this.totalStepCount == totalStepCount) { return; } this.totalStepCount = totalStepCount; if (totalStepCount >= 0 && this.currentStepCount > totalStepCount) { this.currentStepCount = totalStepCount; } fireEvent(new ProgressStatusEventSet(id, totalStepCount, null)); }
@Override public synchronized void setTotalStepCount(int totalStepCount) { if (completed || this.totalStepCount == totalStepCount) { return; } this.totalStepCount = totalStepCount; if (totalStepCount >= 0 && this.currentStepCount > totalStepCount) { this.currentStepCount = totalStepCount; } fireEvent(new ProgressStatusEventSet(id, totalStepCount, null)); }
@Override public synchronized void setCurrentStepCount(int stepCount) { if (completed) { return; } boolean stepsChanged = false; if (stepCount >= 0 && stepCount != currentStepCount) { if (totalStepCount < 0 || stepCount < totalStepCount) { currentStepCount = stepCount; stepsChanged = true; } else if (currentStepCount != totalStepCount) { currentStepCount = totalStepCount; stepsChanged = true; } } if (stepsChanged) { fireEvent(new ProgressStatusEventSet(id, null, stepCount)); } }
@Override public synchronized void setCurrentStepCount(int stepCount) { if (completed) { return; } boolean stepsChanged = false; if (stepCount >= 0 && stepCount != currentStepCount) { if (totalStepCount < 0 || stepCount < totalStepCount) { currentStepCount = stepCount; stepsChanged = true; } else if (currentStepCount != totalStepCount) { currentStepCount = totalStepCount; stepsChanged = true; } } if (stepsChanged) { fireEvent(new ProgressStatusEventSet(id, null, stepCount)); } }
@Override public void complete(String message) { if (completeSilently()) { fireEvent(new ProgressStatusEventComplete(id, message)); } }
@Override public void complete(String message) { if (completeSilently()) { fireEvent(new ProgressStatusEventComplete(id, message)); } }
@Override public synchronized void progress(int steps, String message, boolean spinner) { if (completed) { return; } int lastCurrentStepCount = this.currentStepCount; if (steps > 0) { if (totalStepCount < 0) { currentStepCount += steps; } else if (currentStepCount < totalStepCount) { currentStepCount += steps; if (currentStepCount > totalStepCount) { currentStepCount = totalStepCount; } } } if (currentStepCount != lastCurrentStepCount || message != null || spinner != getSpinnerStatus()) { fireEvent(new ProgressStatusEventProgress(id, steps, message, spinner)); } }
@Override public synchronized void progress(int steps, String message, boolean spinner) { if (completed) { return; } int lastCurrentStepCount = this.currentStepCount; if (steps > 0) { if (totalStepCount < 0) { currentStepCount += steps; } else if (currentStepCount < totalStepCount) { currentStepCount += steps; if (currentStepCount > totalStepCount) { currentStepCount = totalStepCount; } } } if (currentStepCount != lastCurrentStepCount || message != null || spinner != getSpinnerStatus()) { fireEvent(new ProgressStatusEventProgress(id, steps, message, spinner)); } }
public synchronized ProgressStatus createChild(String name, int allocatedSteps, int totalStepCount) { if (allocatedSteps < 0) { allocatedSteps = 0; } allocateStapsForChildProcess(allocatedSteps); ProgressStatusBase result = doCreateChild(name, totalStepCount); children.add(new ChildProgressStatus(allocatedSteps, result)); fireEvent(new ProgressStatusEventCreateChild(id, name, result.getId(), allocatedSteps, totalStepCount)); return result; }
public synchronized ProgressStatus createChild(String name, int allocatedSteps, int totalStepCount) { if (allocatedSteps < 0) { allocatedSteps = 0; } allocateStapsForChildProcess(allocatedSteps); ProgressStatusBase result = doCreateChild(name, totalStepCount); children.add(new ChildProgressStatus(allocatedSteps, result)); fireEvent(new ProgressStatusEventCreateChild(id, name, result.getId(), allocatedSteps, totalStepCount)); return result; }
super.fireEvent(event);
super.fireEvent(event);