private void refreshProgressBar(final boolean isVisible) {
        Progress progress = null;
        if (dataNavigatorData.isSegmented()
                && dataNavigatorData.getCharOffsetFrom().isPresent()
                && dataNavigatorData.getCharOffsetTo().isPresent()) {

            if (dataNavigatorData.getTotalChars().isExact()) {
                progress = Progress.boundedRange(
                        dataNavigatorData.getTotalChars().getCount() - 1, // count to zero based bound
                        dataNavigatorData.getCharOffsetFrom().get(),
                        dataNavigatorData.getCharOffsetTo().get());
            } else {
                progress = Progress.unboundedRange(
                        dataNavigatorData.getCharOffsetFrom().get(),
                        dataNavigatorData.getCharOffsetTo().get());
            }
        } else if (dataNavigatorData.getByteOffsetFrom().isPresent()
                && dataNavigatorData.getByteOffsetTo().isPresent()) {

            if (dataNavigatorData.getTotalBytes().isPresent()) {
                progress = Progress.boundedRange(
                        dataNavigatorData.getTotalBytes().get() - 1, // count to zero based bound
                        dataNavigatorData.getByteOffsetFrom().get(),
                        dataNavigatorData.getByteOffsetTo().get());
            } else {
                progress = Progress.unboundedRange(
                        dataNavigatorData.getByteOffsetFrom().get(),
                        dataNavigatorData.getByteOffsetTo().get());
            }
        }

        if (progress != null) {
            progressPresenter.setVisible(true);
            progressPresenter.setProgress(progress);

            if (progress.isComplete()) {
                // Don't want users clicking if we are showing everything
                progressPresenter.setClickHandler(null);
            } else {
                progressPresenter.setClickHandler(byteOffsetDbl -> {
                    final long byteOffset = (long) Math.floor(byteOffsetDbl);
                    // update the location with the new range
                    doWithConfig(sourceConfig -> {
                        final long maxChars = sourceConfig.getMaxCharactersPerFetch();
                        dataNavigatorData.setDataRange(DataRange.fromByteOffset(byteOffset, maxChars));
                    });
                });
            }
        } else {
            progressPresenter.setVisible(false);
        }
    }
Compare the {@link DataRange}s using on the from/to {@link Location};
stroom-core-client/src/main/java/stroom/data/client/presenter/SourcePresenter.java