Dimension (JBHiDPIScaledImage image) { if (image == null) return new Dimension(0, 0); BufferedImage bi = (BufferedImage)image.getDelegate(); assert bi != null; return new Dimension(bi.getWidth(), bi.getHeight()); }