Class ViewerBuilder


  • public class ViewerBuilder
    extends Object
    Builder for Viewers
    • Constructor Detail

      • ViewerBuilder

        public ViewerBuilder()
    • Method Detail

      • setHasNativeScrollbars

        public ViewerBuilder setHasNativeScrollbars​(boolean nativeScrollbars)
        Sets native scrollbars of the browser or special scrollbars.

        Scrollbar behavior

        • true, Browser specific Scrollbars (enhanced performance on some devices)
        • false, Special Scrollbars (big documents / deep zoom levels)
        • default, AutoSwitch via Device
        When using native scroll bars, the visibility of the scrollbars can be set via setScrollbarVisibility(ScrollbarVisibility).
        Parameters:
        nativeScrollbars - true for native scrollbars
        Returns:
        the builder itself
      • setPixelSize

        public ViewerBuilder setPixelSize​(int width,
                                          int height)
        Sets the size of the viewer.

        default: fullsize

        Parameters:
        width - px
        height - px
        Returns:
        the builder itself
      • setSize

        public ViewerBuilder setSize​(String width,
                                     String height)
        Sets the Size of the Viewer

        default: fullsize

        Parameters:
        width - the width
        height - the height
        Returns:
        the builder itself
      • setGlobalDeviceResolution

        public ViewerBuilder setGlobalDeviceResolution​(int deviceResolution)
        Defines a globally defined default resolution.

        This will configure exactly one global resolution that will be used by all clients.

        Defaults to -1 which indicates that no globally defined resolution shall be used. When there is no individual resolution defined either for a specific client an estimation of the resolution will be used.

        Parameters:
        deviceResolution - the resolution to be used by all clients.
        Returns:
        the builder itself
      • setAutoDetectResolution

        public ViewerBuilder setAutoDetectResolution​(boolean enabled)
        Enables automatic resolution detection.
        Parameters:
        enabled - controls if an automatic resolution detection shall be performed.
        Returns:
        The builder itself
      • setUseTouchScrollbar

        public ViewerBuilder setUseTouchScrollbar​(boolean useTouchScrollbar)
        Defines whether the single touch scrollbar should be used or the default scrollbars.
        Parameters:
        useTouchScrollbar - whether the touch scrollbar should be used or not. By default it's not used.
        Returns:
        the builder itself
      • build

        public Viewer build()
        Builds an appropriate Viewer instance - a BasicViewer for mobile devices; a BigViewer otherwise.
        Returns:
        The new Viewer instance