Custom Border for Callout Popup

Werner Lehmann lehmann at media-interactive.de
Wed May 9 02:51:17 PDT 2012


Hi Jasper,

thanks - however, you are not using a skin class, and the ColorPicker
has a fixed size, . So it is dancing around the problems I had, such as:

1. Control is requested to show the popup but only the skin knows the
hotspot position. But the control cannot tell the skin because it does
not know the skin instance.

2. To position the control I need to know its size but I get that only
when showing the control first at a bogus position. Chicken/egg stuff.

Solved it though, see my other email.

Werner

PS: converting to screen coordinates should be available out of the box 
in my opinion. You just need it for the popup, context menu, etc. Maybe 
it helps to provide some code? :-)

   /**
    * Converts point in local coordinates of specified node into screen 
coordinates.
    * The node must be attached to a scene and a window.
    *
    * @param node local coordinates are relative to this node
    * @param local relative coordinates
    * @return absolute screen coordinates
    */
   public static Point2D localToScreen(Node node, Point2D local)
   {
     Scene scene = node.getScene();
     Window window = scene.getWindow();
     Point2D sceneLocal = node.localToScene(local);
     return new Point2D(
       window.getX() + scene.getX() + sceneLocal.getX(),
       window.getY() + scene.getY() + sceneLocal.getY());
   }


On 09.05.2012 01:09, Jasper Potts wrote:
> Hi,
>
> You can look at what I did for the color picker for FXExperience
> tools. It is a hard coded size but might prove interesting.
>
> https://github.com/fxexperience/code/blob/master/FXExperienceControls/src/com/fxexperience/javafx/scene/control/colorpicker/ColorPickerPopover.java
>
>
>
> Jasper


More information about the openjfx-dev mailing list