Class PixelScaleSupportAWT

java.lang.Object
panamagl.canvas.PixelScaleSupportAWT

public class PixelScaleSupportAWT extends Object
Shared HiDPI plumbing for AWT and Swing canvases.

Reads the current pixel scale via GraphicsConfiguration.getDefaultTransform() (Java 9+) and notifies registered PixelScaleListeners when it changes. Three signals trigger a re-check:

  • "graphicsConfiguration" property change — fired when the component is moved between monitors of different DPI;
  • HierarchyEvent.DISPLAYABILITY_CHANGED — captures the initial value once the component is attached to a peer;
  • polling on a background thread (default 200 ms) — fallback for cases where neither of the above fires (some JVMs, mixed-DPI setups).

Listeners always run on the EDT.