@Override
 public void paint(Graphics2D g) {
   Icon icon = swingImage.getIcon();
   if (icon != null) {
     ImageView node = getNode();
     swingImage.setBounds(
         node.getX().intValue(),
         node.getY().intValue(),
         icon.getIconWidth(),
         icon.getIconHeight());
     swingImage.paint(g);
   }
 }
 @Override
 public double prefHeight(double width) {
   Icon icon = swingImage.getIcon();
   return icon == null ? getNode().getFitHeight() : icon.getIconHeight();
 }
 @Override
 public double prefWidth(double height) {
   Icon icon = swingImage.getIcon();
   return icon == null ? getNode().getFitWidth() : icon.getIconWidth();
 }