static Dimension toDimension(WidthAndHeight wh) { ret wh == null ?: new Dimension(wh.getWidth(), wh.getHeight()); }