Пример #1
0
 @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);
   }
 }
Пример #2
0
 @Override
 public double prefHeight(double width) {
   Icon icon = swingImage.getIcon();
   return icon == null ? getNode().getFitHeight() : icon.getIconHeight();
 }
Пример #3
0
 @Override
 public double prefWidth(double height) {
   Icon icon = swingImage.getIcon();
   return icon == null ? getNode().getFitWidth() : icon.getIconWidth();
 }