*******************************************************************************/
package org.simantics.scenegraph.utils;
+import java.awt.GraphicsEnvironment;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Toolkit;
if (initialized)
return;
- double dpi = Toolkit.getDefaultToolkit().getScreenResolution();
+ double dpi;
+ if (!GraphicsEnvironment.isHeadless())
+ dpi = Toolkit.getDefaultToolkit().getScreenResolution();
+ else
+ dpi = 96;
double baseDpi = 96;
int zoom = (int) Math.round(100.0 * dpi / baseDpi);
hasZoom = zoom != 100;