Package org.eclipse.swt.internal
Class DPIZoomChangeRegistry
java.lang.Object
org.eclipse.swt.internal.DPIZoomChangeRegistry
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
applyChange
(Widget widget, int newZoom, float scalingFactor) Calling this method will propagate the zoom change to all registered handlers that are responsible for the class of the provided widget or one of its super classes or interfaces.static void
registerHandler
(DPIZoomChangeHandler zoomChangeVisitor, Class<? extends Widget> clazzToRegisterFor)
-
Constructor Details
-
DPIZoomChangeRegistry
public DPIZoomChangeRegistry()
-
-
Method Details
-
applyChange
Calling this method will propagate the zoom change to all registered handlers that are responsible for the class of the provided widget or one of its super classes or interfaces. Usually there will be multiple handlers called per widget. To have a reliable and consistent execution order, the handler responsible for the most general class in the class hierarchy is called first, e.g. if aComposite
is updated, the handlers are executed like (Widget
->Control
->Scrollable
->Composite
). Each handler should only take care to update the attributes the class, it is registered for, adds to the hierarchy.- Parameters:
widget
- widget the zoom change shall be applied tonewZoom
- zoom in % of the standard resolution to be applied to the widgetscalingFactor
- factor as division between new zoom and old zoom, e.g. 1.5 for a scaling from 100% to 150%
-
registerHandler
public static void registerHandler(DPIZoomChangeHandler zoomChangeVisitor, Class<? extends Widget> clazzToRegisterFor)
-