// Path: src/main/java/com/github/haixing_hu/javafx/control/popover/ArrowLocation.java
// public enum ArrowLocation {
// 
//   LEFT_TOP,
// 
//   LEFT_CENTER,
// 
//   LEFT_BOTTOM,
// 
//   RIGHT_TOP,
// 
//   RIGHT_CENTER,
// 
//   RIGHT_BOTTOM,
// 
//   TOP_LEFT,
// 
//   TOP_CENTER,
// 
//   TOP_RIGHT,
// 
//   BOTTOM_LEFT,
// 
//   BOTTOM_CENTER,
// 
//   BOTTOM_RIGHT;
// }


import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import javafx.beans.InvalidationListener;
import javafx.beans.binding.Bindings;
import javafx.beans.property.DoubleProperty;
import javafx.beans.property.SimpleDoubleProperty;
import javafx.event.EventHandler;
import javafx.geometry.Point2D;
import javafx.geometry.Pos;
import javafx.scene.Group;
import javafx.scene.Node;
import javafx.scene.control.Label;
import javafx.scene.control.Skin;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.StackPane;
import javafx.scene.shape.Circle;
import javafx.scene.shape.HLineTo;
import javafx.scene.shape.Line;
import javafx.scene.shape.LineTo;
import javafx.scene.shape.MoveTo;
import javafx.scene.shape.Path;
import javafx.scene.shape.PathElement;
import javafx.scene.shape.QuadCurveTo;
import javafx.scene.shape.VLineTo;
import javafx.stage.Window;
import static java.lang.Double.MAX_VALUE;
import static javafx.geometry.Pos.CENTER_RIGHT;
import static javafx.scene.control.ContentDisplay.GRAPHIC_ONLY;
import static com.github.haixing_hu.javafx.control.popover.ArrowLocation.*;
            Bindings.add(topEdgePlusRadiusProperty, arrowIndentProperty),
            Bindings.multiply(arrowSizeProperty, 2)));

    lineILeft = new LineTo();
    lineILeft.xProperty().bind(
        Bindings.subtract(leftEdgeProperty, arrowSizeProperty));
    lineILeft.yProperty().bind(
        Bindings.add(
            Bindings.add(topEdgePlusRadiusProperty, arrowIndentProperty),
            arrowSizeProperty));

    lineJLeft = new LineTo();
    lineJLeft.xProperty().bind(leftEdgeProperty);
    lineJLeft.yProperty().bind(
        Bindings.add(topEdgePlusRadiusProperty, arrowIndentProperty));

    lineKLeft = new VLineTo();
    lineKLeft.yProperty().bind(topEdgePlusRadiusProperty);

    topCurveTo = new QuadCurveTo();
    topCurveTo.xProperty().bind(leftEdgePlusRadiusProperty);
    topCurveTo.yProperty().bind(topEdgeProperty);
    topCurveTo.controlXProperty().bind(leftEdgeProperty);
    topCurveTo.controlYProperty().bind(topEdgeProperty);
  }

  private Window getPopupWindow() {
    return getSkinnable().getScene().getWindow();
  }

// Path: src/main/java/com/github/haixing_hu/javafx/control/popover/ArrowLocation.java
// public enum ArrowLocation {
// 
//   LEFT_TOP,
// 
//   LEFT_CENTER,
// 
//   LEFT_BOTTOM,
// 
//   RIGHT_TOP,
// 
//   RIGHT_CENTER,
// 
//   RIGHT_BOTTOM,
// 
//   TOP_LEFT,
// 
//   TOP_CENTER,
// 
//   TOP_RIGHT,
// 
//   BOTTOM_LEFT,
// 
//   BOTTOM_CENTER,
// 
//   BOTTOM_RIGHT;
// }


// Path: src/main/java/com/github/haixing_hu/javafx/control/popover/PopOverSkin.java
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import javafx.beans.InvalidationListener;
import javafx.beans.binding.Bindings;
import javafx.beans.property.DoubleProperty;
import javafx.beans.property.SimpleDoubleProperty;
import javafx.event.EventHandler;
import javafx.geometry.Point2D;
import javafx.geometry.Pos;
import javafx.scene.Group;
import javafx.scene.Node;
import javafx.scene.control.Label;
import javafx.scene.control.Skin;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.StackPane;
import javafx.scene.shape.Circle;
import javafx.scene.shape.HLineTo;
import javafx.scene.shape.Line;
import javafx.scene.shape.LineTo;
import javafx.scene.shape.MoveTo;
import javafx.scene.shape.Path;
import javafx.scene.shape.PathElement;
import javafx.scene.shape.QuadCurveTo;
import javafx.scene.shape.VLineTo;
import javafx.stage.Window;
import static java.lang.Double.MAX_VALUE;
import static javafx.geometry.Pos.CENTER_RIGHT;
import static javafx.scene.control.ContentDisplay.GRAPHIC_ONLY;
import static com.github.haixing_hu.javafx.control.popover.ArrowLocation.*;

            Bindings.add(topEdgePlusRadiusProperty, arrowIndentProperty),
            Bindings.multiply(arrowSizeProperty, 2)));

    lineILeft = new LineTo();
    lineILeft.xProperty().bind(
        Bindings.subtract(leftEdgeProperty, arrowSizeProperty));
    lineILeft.yProperty().bind(
        Bindings.add(
            Bindings.add(topEdgePlusRadiusProperty, arrowIndentProperty),
            arrowSizeProperty));

    lineJLeft = new LineTo();
    lineJLeft.xProperty().bind(leftEdgeProperty);
    lineJLeft.yProperty().bind(
        Bindings.add(topEdgePlusRadiusProperty, arrowIndentProperty));

    lineKLeft = new VLineTo();
    lineKLeft.yProperty().bind(topEdgePlusRadiusProperty);

    topCurveTo = new QuadCurveTo();
    topCurveTo.xProperty().bind(leftEdgePlusRadiusProperty);
    topCurveTo.yProperty().bind(topEdgeProperty);
    topCurveTo.controlXProperty().bind(leftEdgeProperty);
    topCurveTo.controlYProperty().bind(topEdgeProperty);
  }

  private Window getPopupWindow() {
    return getSkinnable().getScene().getWindow();
  }

  private boolean showArrow(ArrowLocation location) {