Module jfxtras.menu

Class CirclePopupMenu

java.lang.Object
jfxtras.scene.menu.CirclePopupMenu

public class CirclePopupMenu extends Object
CirclePopupMenu is a menu is intended to pop up at any place in a scene. It will show the provided menu items in a circle with the origin at the point where the mouse button was clicked. It is possible to, and per default will, animate the menu items in and out of view. CirclePopupMenu requires a node to attach itself to, most commonly this will be the outer (largest) pane, but it is also possible to register to a specific node. CirclePopupMenu uses CircularPane and this will leak through in the API. For example: it is possible to customize the animation, and the required interface to implement is the one from CircularPane.
  • Property Details

  • Field Details

    • node

      private javafx.scene.Node node
    • circularPane

      private CircularPane circularPane
    • items

      private final javafx.collections.ObservableList<javafx.scene.control.MenuItem> items
      items
    • shown

      private javafx.beans.property.ReadOnlyBooleanWrapper shown
    • animationDurationObjectProperty

      private final javafx.beans.property.ObjectProperty<javafx.util.Duration> animationDurationObjectProperty
    • animationInterpolationObjectProperty

      private final javafx.beans.property.ObjectProperty<CircularPane.AnimationInterpolation> animationInterpolationObjectProperty
  • Constructor Details

    • CirclePopupMenu

      public CirclePopupMenu(javafx.scene.Node node, javafx.scene.input.MouseButton mouseButton)
      Parameters:
      node - the node to render upon, this probably should be a Pane
      mouseButton - the mouse button on which the popup is shown (null means the coder will take care of showing and hiding)
  • Method Details

    • construct

      private void construct(javafx.scene.Node node, javafx.scene.input.MouseButton mouseButton)
    • getItems

      public final javafx.collections.ObservableList<javafx.scene.control.MenuItem> getItems()
    • shownProperty

      public final javafx.beans.property.ReadOnlyBooleanProperty shownProperty()
      shown
      See Also:
    • setShown

      private void setShown(boolean value)
    • isShown

      public final boolean isShown()
      Gets the value of the property shown.
      Property description:
      shown
    • animationDurationProperty

      public javafx.beans.property.ObjectProperty<javafx.util.Duration> animationDurationProperty()
      animationDuration
      See Also:
    • getAnimationDuration

      public javafx.util.Duration getAnimationDuration()
      Gets the value of the property animationDuration.
      Property description:
      animationDuration
    • setAnimationDuration

      public void setAnimationDuration(javafx.util.Duration value)
      Sets the value of the property animationDuration.
      Property description:
      animationDuration
    • withAnimationDuration

      public CirclePopupMenu withAnimationDuration(javafx.util.Duration value)
    • animationInterpolationProperty

      public javafx.beans.property.ObjectProperty<CircularPane.AnimationInterpolation> animationInterpolationProperty()
      animationInterpolation: calculate the position of a node during the animation (default: move from origin), use node.relocate to position node (or manually apply layoutBounds.minX/Y)
      See Also:
    • getAnimationInterpolation

      public CircularPane.AnimationInterpolation getAnimationInterpolation()
      Gets the value of the property animationInterpolation.
      Property description:
      animationInterpolation: calculate the position of a node during the animation (default: move from origin), use node.relocate to position node (or manually apply layoutBounds.minX/Y)
    • setAnimationInterpolation

      public void setAnimationInterpolation(CircularPane.AnimationInterpolation value)
      Sets the value of the property animationInterpolation.
      Property description:
      animationInterpolation: calculate the position of a node during the animation (default: move from origin), use node.relocate to position node (or manually apply layoutBounds.minX/Y)
    • withAnimationInterpolation

      public CirclePopupMenu withAnimationInterpolation(CircularPane.AnimationInterpolation value)
    • show

      public void show(javafx.scene.input.MouseEvent mouseEvent)
      Parameters:
      mouseEvent -
    • show

      public void show(double x, double y)
      Parameters:
      x - origin of the circle
      y - origin of the circle
    • hide

      public void hide()