Package com.levigo.jadice.web.client
Class ViewerBuilder
java.lang.Object
com.levigo.jadice.web.client.ViewerBuilder
Builder for Viewers
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
boolean
setAutoDetectResolution
(boolean enabled) Enables automatic resolution detection.setDisabledAutomaticFontLoading
(boolean disableAutomaticFontLoading) We automatically callFontConfig#get
usually so that the fonts for rendering annotations are loaded at the first possible moment.setGlobalDeviceResolution
(int deviceResolution) Defines a globally defined default resolution.setHasNativeScrollbars
(boolean nativeScrollbars) Sets native scrollbars of the browser or special scrollbars.setHideScrollbarButtons
(boolean hideScrollbarButtons) Defines whether the scrollbar should have buttons.setLevibatsLoaded
(boolean levibatsLoaded) setPageView
(PageView pageView) setPixelSize
(int width, int height) Sets the size of the viewer.setScrollbarOverDocument
(boolean scrollbarOverDocument) Defines whether the scrollbar is over the document.setScrollbarVisibility
(ScrollbarVisibility scrollbarVisibility) Sets theScrollbarVisibility
for the created viewer to the desired value.Sets the Size of the ViewersetType
(ViewerType type) Deprecated.setUIStyle
(UIStyle style) setUseTouchScrollbar
(boolean useTouchScrollbar) Defines whether the single touch scrollbar should be used or the default scrollbars.
-
Constructor Details
-
ViewerBuilder
public ViewerBuilder()
-
-
Method Details
-
setHasNativeScrollbars
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
setScrollbarVisibility(ScrollbarVisibility)
.- Parameters:
nativeScrollbars
- true for native scrollbars- Returns:
- the builder itself
-
setType
Deprecated. -
setPageView
-
setUIStyle
-
setPixelSize
Sets the size of the viewer.default: fullsize
- Parameters:
width
- pxheight
- px- Returns:
- the builder itself
-
setSize
Sets the Size of the Viewerdefault: fullsize
- Parameters:
width
- the widthheight
- the height- Returns:
- the builder itself
-
setGlobalDeviceResolution
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
Enables automatic resolution detection.- Parameters:
enabled
- controls if an automatic resolution detection shall be performed.- Returns:
- The builder itself
-
setUseTouchScrollbar
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
-
setHideScrollbarButtons
Defines whether the scrollbar should have buttons.- Parameters:
hideScrollbarButtons
- Whether the scrollbar should have buttons. By default it's not used.- Returns:
- the builder itself
-
setScrollbarOverDocument
Defines whether the scrollbar is over the document.- Parameters:
scrollbarOverDocument
- Whether the scrollbar should be over the document. By default it's not.- Returns:
- the builder itself
-
setScrollbarVisibility
Sets theScrollbarVisibility
for the created viewer to the desired value. The given scrollbar visibility will just be used if usage of native scrollbars is desired (setHasNativeScrollbars(boolean)
).- Parameters:
scrollbarVisibility
- the desiredScrollbarVisibility
- Returns:
- the builder itself
-
isLevibatsLoaded
public boolean isLevibatsLoaded() -
setLevibatsLoaded
- Parameters:
levibatsLoaded
- if set to true, load the Levibats-Regular font. See the github project
-
setDisabledAutomaticFontLoading
We automatically callFontConfig#get
usually so that the fonts for rendering annotations are loaded at the first possible moment. This is done because we rely on those fonts for a correct annotation rendering. If you want to disable this in order to dynamically load the fonts, please be aware to take extra care that the fonts are really loaded before an annotation rendering is triggered.- Parameters:
disableAutomaticFontLoading
- if set to true, disable the automatic font loading
-
build
- Returns:
- The new Viewer instance
-