Class ApplyDynamicZoomRule
java.lang.Object
com.levigo.jadice.web.client.rule.AbstractPresentationRule
com.levigo.jadice.web.client.rules.ApplyDynamicZoomRule
- All Implemented Interfaces:
PresentationRule
Dynamically adjusts the zoom factor for each displayed page.
Supports the following modes:
- Fit to height
- Fit to width
- Fit both
Switches to single page layout when activated. Lets the width or the height of the displayed page capture the whole viewer widget (depending on the mode). Stays active when a new document is loaded or a new page is displayed.
Is deactivated when the zoom factor is modified manually. Is deactivated when the page layout is set to anything different from single page layout.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Used for a property that reflects an ongoing zoom factor modification caused by dynamic zoom mode. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
currentPageChanged
(PageView view, Page page) void
pageLayoutStyleChanged
(PageView view, PageLayout pageLayoutStyle) Deactivates dynamic zoom mode whenever the layout is changed from SinglePageLayout to anything different.void
renderSettingChanged
(PageView pageView, RenderSettingsEvent evt) Changes the layout to SinglePageLayout whenever DYNAMIC_ZOOM_MODE is activated.void
viewResized
(PageView view) Called when the size of the page view is modified.
-
Field Details
-
DYNAMIC_ZOOM_STATE
Used for a property that reflects an ongoing zoom factor modification caused by dynamic zoom mode. In that case dynamic zoom mode shall be activated.- See Also:
-
-
Constructor Details
-
ApplyDynamicZoomRule
public ApplyDynamicZoomRule()
-
-
Method Details
-
renderSettingChanged
Changes the layout to SinglePageLayout whenever DYNAMIC_ZOOM_MODE is activated.- Specified by:
renderSettingChanged
in interfacePresentationRule
- Overrides:
renderSettingChanged
in classAbstractPresentationRule
- Parameters:
pageView
- ThePageView
.evt
- The event informing us about a possible layout change.
-
viewResized
Called when the size of the page view is modified.- Specified by:
viewResized
in interfacePresentationRule
- Overrides:
viewResized
in classAbstractPresentationRule
- Parameters:
view
- thePageView
.
-
currentPageChanged
- Specified by:
currentPageChanged
in interfacePresentationRule
- Overrides:
currentPageChanged
in classAbstractPresentationRule
-
pageLayoutStyleChanged
Deactivates dynamic zoom mode whenever the layout is changed from SinglePageLayout to anything different.- Specified by:
pageLayoutStyleChanged
in interfacePresentationRule
- Overrides:
pageLayoutStyleChanged
in classAbstractPresentationRule
- Parameters:
view
- ThePageView
.pageLayoutStyle
- The new layout.
-