예제 #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();
 }