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 StringUsed for a property that reflects an ongoing zoom factor modification caused by dynamic zoom mode. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcurrentPageChanged(PageView view, Page page) voidpageLayoutStyleChanged(PageView view, PageLayout pageLayoutStyle) Deactivates dynamic zoom mode whenever the layout is changed from SinglePageLayout to anything different.voidrenderSettingChanged(PageView pageView, RenderSettingsEvent evt) Changes the layout to SinglePageLayout whenever DYNAMIC_ZOOM_MODE is activated.voidviewResized(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:
renderSettingChangedin interfacePresentationRule- Overrides:
renderSettingChangedin 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:
viewResizedin interfacePresentationRule- Overrides:
viewResizedin classAbstractPresentationRule- Parameters:
view- thePageView.
-
currentPageChanged
- Specified by:
currentPageChangedin interfacePresentationRule- Overrides:
currentPageChangedin classAbstractPresentationRule
-
pageLayoutStyleChanged
Deactivates dynamic zoom mode whenever the layout is changed from SinglePageLayout to anything different.- Specified by:
pageLayoutStyleChangedin interfacePresentationRule- Overrides:
pageLayoutStyleChangedin classAbstractPresentationRule- Parameters:
view- ThePageView.pageLayoutStyle- The new layout.
-