Changeset 9529 in josm for trunk/src


Ignore:
Timestamp:
2016-01-18T21:42:58+01:00 (4 years ago)
Author:
simon04
Message:

HttpClient: test progress monitor handling

Location:
trunk/src/org/openstreetmap/josm
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/progress/AbstractProgressMonitor.java

    r9078 r9529  
    219219    ==================*/
    220220
    221     abstract void updateProgress(double value);
     221    protected abstract void updateProgress(double value);
    222222
    223223    @Override
  • trunk/src/org/openstreetmap/josm/io/StreamProgressUpdater.java

    r9274 r9529  
    2727
    2828    private void initProgressMonitor() {
     29        progressMonitor.beginTask(taskTitle);
    2930        if (size > 0) {
    30             progressMonitor.subTask(taskTitle);
    3131            progressMonitor.setTicksCount((int) size);
    3232        } else {
  • trunk/src/org/openstreetmap/josm/tools/HttpClient.java

    r9396 r9529  
    103103            connection.setFixedLengthStreamingMode(requestBody.length);
    104104            connection.setDoOutput(true);
     105            final ProgressMonitor subTaskMonitor = progressMonitor.createSubTaskMonitor(1, false);
    105106            try (OutputStream out = new BufferedOutputStream(
    106                     new ProgressOutputStream(connection.getOutputStream(), requestBody.length, progressMonitor))) {
     107                    new ProgressOutputStream(connection.getOutputStream(), requestBody.length, subTaskMonitor))) {
    107108                out.write(requestBody);
    108109            }
     
    256257                in = connection.getErrorStream();
    257258            }
     259            monitor.subTask(tr("Fetching content..."));
    258260            if (in != null) {
    259                 in = new ProgressInputStream(in, getContentLength(), monitor);
     261                in = new ProgressInputStream(in, getContentLength(), monitor.createSubTaskMonitor(1, false));
    260262                in = "gzip".equalsIgnoreCase(getContentEncoding()) ? new GZIPInputStream(in) : in;
    261263                Compression compression = Compression.NONE;
Note: See TracChangeset for help on using the changeset viewer.