public boolean notifyProgress(int value, int maximum) { this.ensureVisible(); this.setProgressBarValue(value, maximum); this.setProgressText(value, maximum); return !this.isCancelPending(); }
/** * Creates new form ProgressDialog. * * @param parent the {@code Frame} from which this dialog is displayed * @param modal specifies whether this dialog blocks input to the top-level * frame */ public ProgressDialog(java.awt.Frame parent, boolean modal) { super(parent, modal); initComponents(); }
/** * Ensures that this <code>ProgressDialog</code> is visible. */ private void ensureVisible() { if (!this.isVisible()) { this.setVisible(true); } }
public void notifyStatusChanged(String status) { this.ensureVisible(); this.statusText = status; this.updateStatusLabel(); }
public boolean notifyProgress(double progress) { this.ensureVisible(); this.setProgressBarValue((int) Math.floor(100.0 * progress), 100); this.clearProgressText(); return !this.isCancelPending(); }
public boolean notifyIndeterminantProgress() { this.ensureVisible(); this.progressBar.setIndeterminate(true); this.clearProgressText(); return !this.isCancelPending(); }
cancelButton = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); statusLabel.setText("Progress..."); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) ); pack();
/** * Initiates the process of cancelling the operation. */ private void onCancel() { this.setCancelPending(); }
/** * Fires when the user clicks on the cancel button. * @param evt The event arguments. */ private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed this.onCancel(); }//GEN-LAST:event_cancelButtonActionPerformed
/** Creates a new <code>ProgressDialog</code>. */ public ProgressDialog() { super((java.awt.Frame) null, false); initComponents(); }