Package com.bc.ceres.swing.progress
Class ProgressDialog
- java.lang.Object
-
- com.bc.ceres.swing.progress.ProgressDialog
-
public class ProgressDialog extends Object
A utility class very similar toProgressMonitor
but with the following extensions:- It is cancelable.
- It has a
dialog modality type
.
-
-
Field Summary
Fields Modifier and Type Field Description JButton
cancelButton
static Color
SELECTED_BORDER_COLOR
-
Constructor Summary
Constructors Constructor Description ProgressDialog(Component parentComponent)
Constructs a graphic object that shows progress, typically by filling in a rectangular bar as the process nears completion.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cancel()
Sets the canceled state if this dialog is cancelable.void
close()
Indicate that the operation is complete.static ImageIcon
createRolloverIcon(ImageIcon imageIcon)
JComponent
getExtensibleMessageComponent()
int
getMaximum()
Returns the maximum value -- the higher end of the progress value.JComponent
getMessageComponent()
int
getMinimum()
Returns the minimum value -- the lower end of the progress value.Dialog.ModalityType
getModalityType()
String
getNote()
Specifies the additional note that is displayed along with the progress message.Component
getParentComponent()
String
getTitle()
Specifies the message that is displayed.boolean
isCancelable()
boolean
isCanceled()
void
setCancelable(boolean cancelable)
void
setExtensibleMessageComponent(JComponent extensibleMessageComponent, boolean placeExtensibleMessageAboveProgressBar)
void
setMaximum(int maximum)
Specifies the maximum value.void
setMessageComponent(JComponent messageComponent)
void
setMessageComponent(JComponent messageComponent, boolean placeMessageAboveProgressBar)
void
setMinimum(int minimum)
Specifies the minimum value.void
setModalityType(Dialog.ModalityType modalityType)
void
setNote(String note)
Specifies the additional note that is displayed along with the progress message.void
setProgress(int progress)
Indicate the progress of the operation being monitored.void
setTitle(String title)
Specifies the message that is displayed.void
show()
-
-
-
Constructor Detail
-
ProgressDialog
public ProgressDialog(Component parentComponent)
Constructs a graphic object that shows progress, typically by filling in a rectangular bar as the process nears completion.- Parameters:
parentComponent
- the parent component for the dialog box
-
-
Method Detail
-
getParentComponent
public Component getParentComponent()
-
getMessageComponent
public JComponent getMessageComponent()
-
setMessageComponent
public void setMessageComponent(JComponent messageComponent)
-
setMessageComponent
public void setMessageComponent(JComponent messageComponent, boolean placeMessageAboveProgressBar)
-
getExtensibleMessageComponent
public JComponent getExtensibleMessageComponent()
-
setExtensibleMessageComponent
public void setExtensibleMessageComponent(JComponent extensibleMessageComponent, boolean placeExtensibleMessageAboveProgressBar)
-
getModalityType
public Dialog.ModalityType getModalityType()
-
setModalityType
public void setModalityType(Dialog.ModalityType modalityType)
-
isCancelable
public boolean isCancelable()
-
setCancelable
public void setCancelable(boolean cancelable)
-
setProgress
public void setProgress(int progress)
Indicate the progress of the operation being monitored. If the specified value is >= the maximum, the progress monitor is closed.- Parameters:
progress
- an int specifying the current value, between the maximum and minimum specified for this component- See Also:
setMinimum(int)
,setMaximum(int)
,close()
-
cancel
public void cancel()
Sets the canceled state if this dialog is cancelable. Note that this method will not automatically close the dialog.
-
close
public void close()
Indicate that the operation is complete. This happens automatically when the value set bysetProgress(int)
is >=maximum
, but it may be called earlier if the operation ends early.
-
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 minimum)
Specifies the minimum value.- Parameters:
minimum
- 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 maximum)
Specifies the maximum value.- Parameters:
maximum
- an int specifying the maximum value- See Also:
getMaximum()
-
isCanceled
public boolean isCanceled()
- Returns:
true
if the user hit the 'Cancel' button in the progress dialog.
-
setTitle
public void setTitle(String title)
Specifies the message that is displayed.- Parameters:
title
- a String specifying the message to display- See Also:
getTitle()
-
getTitle
public String getTitle()
Specifies the message that is displayed.- Returns:
- a String specifying the message to display
- See Also:
setTitle(java.lang.String)
-
setNote
public void setNote(String note)
Specifies the additional note that is displayed along with the progress message. Used, for example, to show which file the is currently being copied during a multiple-file copy.- Parameters:
note
- a String specifying the note to display- See Also:
getNote()
-
getNote
public String getNote()
Specifies the additional note that is displayed along with the progress message.- Returns:
- a String specifying the note to display
- See Also:
setNote(java.lang.String)
-
show
public void show()
-
-