Changeset 11672 in josm for trunk/src/org
- Timestamp:
- 2017-03-04T23:06:30+01:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/PleaseWaitDialog.java
r10179 r11672 28 28 import org.openstreetmap.josm.tools.ImageProvider; 29 29 30 /** 31 * This is a dialog that displays the progress of an action to the user. 32 */ 30 33 public class PleaseWaitDialog extends JDialog implements ProgressMonitorDialog { 31 34 … … 34 37 private final JLabel currentAction = new JLabel(""); 35 38 private final JLabel customText = new JLabel(""); 39 /** 40 * The direct progress access. 41 * @deprecated To be removed in mid-2017. Use {@link #updateProgress(int)} 42 */ 43 @Deprecated 36 44 public final transient BoundedRangeModel progress = progressBar.getModel(); 37 45 private JButton btnCancel; … … 40 48 private final JosmTextArea taLog = new JosmTextArea(5, 50); 41 49 private final JScrollPane spLog = new JScrollPane(taLog); 50 51 52 /** 53 * Constructs a new {@code PleaseWaitDialog}. 54 * @param parent the {@code Component} from which the dialog is displayed. Can be {@code null}. 55 */ 56 public PleaseWaitDialog(Component parent) { 57 super(GuiHelper.getFrameForComponent(parent), ModalityType.DOCUMENT_MODAL); 58 initDialog(); 59 } 42 60 43 61 private void initDialog() { … … 76 94 } 77 95 78 /**79 * Constructs a new {@code PleaseWaitDialog}.80 * @param parent the {@code Component} from which the dialog is displayed. Can be {@code null}.81 */82 public PleaseWaitDialog(Component parent) {83 super(GuiHelper.getFrameForComponent(parent), ModalityType.DOCUMENT_MODAL);84 initDialog();85 }86 87 96 @Override 88 97 public void setIndeterminate(boolean newValue) { … … 99 108 100 109 /** 101 * Sets a custom text line below currentAction. Can be used to display additional information 110 * Sets a custom text line below currentAction. Can be used to display additional information. 102 111 * @param text custom text 103 112 */ … … 142 151 143 152 /** 144 * Sets whether the cancel button is enabled or not 153 * Sets whether the cancel button is enabled or not. 145 154 * 146 155 * @param enabled true, if the cancel button is enabled; false otherwise 156 * @see #setCancelCallback(ActionListener) 147 157 */ 148 158 public void setCancelEnabled(boolean enabled) { … … 150 160 } 151 161 162 /** 163 * Enables / disables a button that can be pressed to run the task in background. 164 * 165 * @param value <code>true</code> iff that button should be displayed. 166 * @see #setInBackgroundCallback(ActionListener) 167 */ 152 168 public void setInBackgroundPossible(boolean value) { 153 169 btnInBackground.setVisible(value); … … 190 206 @Override 191 207 public void updateProgress(int progress) { 192 this.progress .setValue(progress);208 this.progressBar.setValue(progress); 193 209 this.progressBar.repaint(); 194 210 } 211 212 /** 213 * Sets the maximum progress value. 214 * @param progressBarMax The value that represents the rightmost point of the progress bar (100%). 215 */ 216 public void setMaximumProgress(int progressBarMax) { 217 this.progressBar.setMaximum(progressBarMax); 218 } 195 219 } -
trunk/src/org/openstreetmap/josm/gui/progress/PleaseWaitProgressMonitor.java
r11283 r11672 191 191 dialog.setCustomText(""); 192 192 dialog.addWindowListener(windowListener); 193 dialog. progress.setMaximum(PROGRESS_BAR_MAX);193 dialog.setMaximumProgress(PROGRESS_BAR_MAX); 194 194 dialog.setVisible(true); 195 195 });
Note:
See TracChangeset
for help on using the changeset viewer.