public ProgressController( Frame owner, FinishedListener finishedListener, String dialogTitel, String message) { this.finishedListener = finishedListener; view = new ProgressView(owner); view.setTitle(dialogTitel); view.getLblMessage().setText(message); view.addWindowListener(new CloseWindowListener()); view.setVisible(true); }
@Override public void informFinished() { view.dispose(); // route the event to the original listener finishedListener.informFinished(); }
private static void setExtendedTestStatus(final View view, final boolean finished) { final ProgressView extendedProgress = (ProgressView) view.findViewById(R.id.resultExtendedProgressView); final TextView extendedStatus = (TextView) view.findViewById(R.id.resultExtendedTestStatus); final Button extendedButtonCancel = (Button) view.findViewById(R.id.resultButtonCancel); final Button extendedButtonDetails = (Button) view.findViewById(R.id.extendedDetailsButton); if (extendedProgress != null) extendedProgress.setProgress(finished ? 1f : 0f); if (extendedButtonCancel != null) extendedButtonCancel.setVisibility(finished ? View.GONE : View.VISIBLE); if (extendedButtonDetails != null) extendedButtonDetails.setVisibility(finished ? View.VISIBLE : View.GONE); if (extendedStatus != null) extendedStatus.setText( finished ? R.string.result_extended_test_finished : R.string.result_extended_test_running); }
@Override public void setMessage(String message) { view.getLblMessage().setText(message); }
@Override public void setCurrentValue(int currentValue) { view.getProgressBar().setValue(currentValue); }
@Override public void setEndValue(int endValue) { view.getLblEnd().setText(String.format("%,d", endValue)); view.getProgressBar().setMaximum(endValue); }
@Override public void setStartValue(int startValue) { view.getLblStart().setText(String.valueOf(startValue)); view.getProgressBar().setMinimum(startValue); }