Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.2.0)

E17493-03


oracle.javatools.dialogs.progress
Class DeterminateProgressMonitor

java.lang.Object
  extended by oracle.javatools.dialogs.progress.DeterminateProgressMonitor


public class DeterminateProgressMonitor
extends java.lang.Object

A progress monitor implementation for determinate progress feedback.

This class is based on Swing's ProgressMonitor, but the implementation conforms to user interface specifications and offers the following additional features:

By default, the progress monitor will not use a delay before making the dialog visible. Recommended settings for the popup decision and delay are 500 and 2000 milliseconds respectively. Thread advice - instances of this class should be configured and their methods invoked from a consumer worker thread and not the AWT event dispatcher thread, which must be left free to process events.

See Also:
IndeterminateProgressMonitor

Constructor Summary
DeterminateProgressMonitor(java.awt.Component parent, java.lang.String title)
           
DeterminateProgressMonitor(java.awt.Component parent, java.lang.String title, int min, int max)
           
DeterminateProgressMonitor(java.awt.Component parent, java.lang.String title, java.lang.Object message, java.lang.String note)
           
DeterminateProgressMonitor(java.awt.Component parent, java.lang.String title, java.lang.Object message, java.lang.String note, int min, int max)
           

 

Method Summary
 void addCancellationListener(javax.swing.event.ChangeListener l)
          Adds a listener for progress dialog cancellation.
 void close()
          Indicates that the operation is complete.
protected  void closeImpl()
           
protected  javax.swing.JProgressBar createProgressBar()
           
 void display()
          Forces the progress dialog to be displayed, regardless of timing.
protected  void displayImpl()
           
 void finish()
          Finishes progress indication by setting the level to its maximum ahead of monitor closure.
protected  void finishImpl(javax.swing.JProgressBar progressBar)
           
 boolean getCloseOnFinish()
          Asks whether the monitor's dialog will close when responding to the finish() method.
 java.awt.Component getComponent()
          Gets the progress monitor dialog component, if created.
 java.awt.Component getDetailContent()
          Returns the content of the dialog to appear in a 'details' section.
 int getMaximum()
          Returns the maximum value -- the higher end of the progress value.
 int getMillisToDecideToPopup()
          Returns the amount of time this object waits before deciding whether or not to popup a progress monitor.
 int getMillisToPopup()
          Returns the amount of time it will take for the popup to appear.
 int getMinimum()
          Returns the minimum value -- the lower end of the progress value.
 ProgressPanel getPanel()
          Gets the panel component for this progress monitor.
 int getProgress()
          Get the current progress.
 void incProgress()
          Increment the current progress by one.
 void incProgress(int increment)
          Increment the current progress by the specified amount
 boolean isBarVisible()
          Returns the visibility of the dialog's progress bar before it is shown.
 boolean isCanceled()
          Returns true if the user hits the Cancel button in the progress dialog.
 boolean isCancellable()
          Returns whether the progress dialog can be cancelled.
 boolean isCancelled()
          Returns true if the user hits the Cancel button in the progress dialog.
 boolean isDetailVisible()
          Gets whether the dialog detail content is made visible by default.
 boolean isModal()
           
 void removeCancellationListener(javax.swing.event.ChangeListener l)
          Removes a listener for progress dialog cancellation.
 void setBarVisible(boolean barVisible)
          Specifies the visibility of the dialog's progress bar before it is shown.
 void setCancellable(boolean cancellable)
          Specifies whether the progress dialog can be cancelled.
 void setCloseOnFinish(boolean closeOnFinish)
          Sets whether the monitor's dialog should close when responding to the finish() method.
 void setDetailContent(java.awt.Component detailContent)
          Specifies the content of the dialog to appear in a 'details' section.
 void setDetailVisible(boolean detailVisible)
          Sets whether the dialog detail content is made visible by default.
 void setMaximum(int m)
          Specifies the maximum value.
 void setMillisToDecideToPopup(int millisToDecideToPopup)
          Specifies the amount of time to wait before deciding whether or not to popup a progress monitor.
 void setMillisToPopup(int millisToPopup)
          Specifies the amount of time it will take for the popup to appear.
 void setMinimum(int m)
          Specifies the minimum value.
 void setModal(boolean isModal)
           
 void setProgress(int nv)
          Indicates the progress of the operation being monitored.
 void start()
          Starts the monitor, ensuring the dialog will be displayed after the configured delay.
 void startImpl()
          Starts the monitor, ensuring the dialog will be displayed after the configured delay.
 void uncancel()
          Resets the cancelled state of the progress dialog.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

DeterminateProgressMonitor

public DeterminateProgressMonitor(java.awt.Component parent,
                                  java.lang.String title)

DeterminateProgressMonitor

public DeterminateProgressMonitor(java.awt.Component parent,
                                  java.lang.String title,
                                  int min,
                                  int max)

DeterminateProgressMonitor

public DeterminateProgressMonitor(java.awt.Component parent,
                                  java.lang.String title,
                                  java.lang.Object message,
                                  java.lang.String note)

DeterminateProgressMonitor

public DeterminateProgressMonitor(java.awt.Component parent,
                                  java.lang.String title,
                                  java.lang.Object message,
                                  java.lang.String note,
                                  int min,
                                  int max)

Method Detail

getProgress

public int getProgress()
Get the current progress.
Returns:
the current progress.

incProgress

public void incProgress()
Increment the current progress by one.

incProgress

public void incProgress(int increment)
Increment the current progress by the specified amount
Parameters:
increment - amount to increase progress by

startImpl

public void startImpl()
Starts the monitor, ensuring the dialog will be displayed after the configured delay.

setProgress

public void setProgress(int nv)
Indicates the progress of the operation being monitored. If the specified value is >= the maximum, the progress monitor is closed. Do not invoke from the AWT event thread.
Parameters:
nv - an int specifying the current value, between the maximum and minimum specified for this component
See Also:
setMinimum(int), setMaximum(int), close()

getMinimum

public int getMinimum()
Returns the minimum value -- the lower end of the progress value.
Returns:
an int representing the minimum value
See Also:
setMinimum(int)

setMinimum

public void setMinimum(int m)
Specifies the minimum value.
Parameters:
m - an int specifying the minimum value
See Also:
getMinimum()

getMaximum

public int getMaximum()
Returns the maximum value -- the higher end of the progress value.
Returns:
an int representing the maximum value
See Also:
setMaximum(int)

setMaximum

public void setMaximum(int m)
Specifies the maximum value.
Parameters:
m - an int specifying the maximum value
See Also:
getMaximum()

setMillisToDecideToPopup

public void setMillisToDecideToPopup(int millisToDecideToPopup)
Specifies the amount of time to wait before deciding whether or not to popup a progress monitor.
Parameters:
millisToDecideToPopup - an int specifying the time to wait, in milliseconds
See Also:
getMillisToDecideToPopup()

getMillisToDecideToPopup

public int getMillisToDecideToPopup()
Returns the amount of time this object waits before deciding whether or not to popup a progress monitor.
Returns:
an int specifying waiting time, in milliseconds
See Also:
setMillisToDecideToPopup(int)

createProgressBar

protected javax.swing.JProgressBar createProgressBar()

finishImpl

protected void finishImpl(javax.swing.JProgressBar progressBar)

setCloseOnFinish

public void setCloseOnFinish(boolean closeOnFinish)
Sets whether the monitor's dialog should close when responding to the finish() method. By default, this is true.
Parameters:
closeOnFinish - a decision on dialog closure.

getCloseOnFinish

public boolean getCloseOnFinish()
Asks whether the monitor's dialog will close when responding to the finish() method.
Returns:
a verdict on dialog closure.

start

public void start()
Starts the monitor, ensuring the dialog will be displayed after the configured delay.

finish

public void finish()
Finishes progress indication by setting the level to its maximum ahead of monitor closure.

close

public void close()
Indicates that the operation is complete. This happens automatically when the value set by setProgress is >= max, but it may be called earlier if the operation ends early.

isCanceled

public boolean isCanceled()
Returns true if the user hits the Cancel button in the progress dialog.

addCancellationListener

public void addCancellationListener(javax.swing.event.ChangeListener l)
Adds a listener for progress dialog cancellation.

removeCancellationListener

public void removeCancellationListener(javax.swing.event.ChangeListener l)
Removes a listener for progress dialog cancellation.

setMillisToPopup

public void setMillisToPopup(int millisToPopup)
Specifies the amount of time it will take for the popup to appear. (If the predicted time remaining is less than this time, the popup won't be displayed.)
Parameters:
millisToPopup - an int specifying the time in milliseconds
See Also:
getMillisToPopup()

getMillisToPopup

public int getMillisToPopup()
Returns the amount of time it will take for the popup to appear.
Returns:
millisToPopup an int specifying the time in milliseconds
See Also:
setMillisToPopup(int)

setDetailContent

public void setDetailContent(java.awt.Component detailContent)
Specifies the content of the dialog to appear in a 'details' section. This part of the dialog is made optionally visible on a button.
Parameters:
detailContent - the detail content component.
See Also:
getDetailContent()

getDetailContent

public java.awt.Component getDetailContent()
Returns the content of the dialog to appear in a 'details' section.
Returns:
the detail content component.
See Also:
setDetailContent(java.awt.Component)

setDetailVisible

public void setDetailVisible(boolean detailVisible)
Sets whether the dialog detail content is made visible by default.
Parameters:
detailVisible - true if dialog detail will be made visible.

isDetailVisible

public boolean isDetailVisible()
Gets whether the dialog detail content is made visible by default.
Returns:
true if dialog detail will be made visible.

setBarVisible

public void setBarVisible(boolean barVisible)
Specifies the visibility of the dialog's progress bar before it is shown. By default, this is true.
Parameters:
barVisible - the visibility value.
See Also:
isBarVisible()

isBarVisible

public boolean isBarVisible()
Returns the visibility of the dialog's progress bar before it is shown.
Returns:
the visibility value.
See Also:
setBarVisible(boolean)

setCancellable

public void setCancellable(boolean cancellable)
Specifies whether the progress dialog can be cancelled. By default, this is true.
Parameters:
cancellable - the cancellable value.
See Also:
isCancellable()

isCancellable

public boolean isCancellable()
Returns whether the progress dialog can be cancelled.
Returns:
the cancellable value.
See Also:
setCancellable(boolean)

display

public void display()
Forces the progress dialog to be displayed, regardless of timing. Do not invoke from the AWT event thread.
See Also:
close()

getComponent

public java.awt.Component getComponent()
Gets the progress monitor dialog component, if created.
Returns:
the dialog component.

isCancelled

public boolean isCancelled()
Returns true if the user hits the Cancel button in the progress dialog.
Returns:
the cancellation value.

uncancel

public void uncancel()
Resets the cancelled state of the progress dialog. The cancel button will be re-enabled if the user has previously cancelled the dialog.

getPanel

public ProgressPanel getPanel()
Gets the panel component for this progress monitor.
Returns:
the progress panel.

displayImpl

protected void displayImpl()

closeImpl

protected void closeImpl()

isModal

public final boolean isModal()

setModal

public final void setModal(boolean isModal)

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.2.0)

E17493-03


Copyright © 1997, 2012, Oracle. All rights reserved.