Class CirclePopupMenu
java.lang.Object
jfxtras.scene.menu.CirclePopupMenu
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.
-
Nested Class Summary
Nested Classes -
Property Summary
PropertiesTypePropertyDescriptionjavafx.beans.property.ObjectProperty<javafx.util.Duration> animationDurationjavafx.beans.property.ObjectProperty<CircularPane.AnimationInterpolation> 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)final javafx.beans.property.ReadOnlyBooleanPropertyshown -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final javafx.beans.property.ObjectProperty<javafx.util.Duration> private final javafx.beans.property.ObjectProperty<CircularPane.AnimationInterpolation> private CircularPaneprivate final javafx.collections.ObservableList<javafx.scene.control.MenuItem> itemsprivate final AtomicLongprivate javafx.scene.Nodeprivate javafx.stage.Popupprivate javafx.beans.property.ReadOnlyBooleanWrapper -
Constructor Summary
ConstructorsConstructorDescriptionCirclePopupMenu(javafx.scene.Node node, javafx.scene.input.MouseButton mouseButton) -
Method Summary
Modifier and TypeMethodDescriptionjavafx.beans.property.ObjectProperty<javafx.util.Duration> animationDurationjavafx.beans.property.ObjectProperty<CircularPane.AnimationInterpolation> 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)private voidconstruct(javafx.scene.Node node, javafx.scene.input.MouseButton mouseButton) javafx.util.DurationGets the value of theanimationDurationproperty.Gets the value of theanimationInterpolationproperty.final javafx.collections.ObservableList<javafx.scene.control.MenuItem> getItems()voidhide()final booleanisShown()Gets the value of theshownproperty.voidsetAnimationDuration(javafx.util.Duration value) Sets the value of theanimationDurationproperty.voidSets the value of theanimationInterpolationproperty.private voidsetShown(boolean value) voidshow(double x, double y) voidshow(javafx.scene.input.MouseEvent mouseEvent) final javafx.beans.property.ReadOnlyBooleanPropertyshownwithAnimationDuration(javafx.util.Duration value)
-
Property Details
-
shown
public final javafx.beans.property.ReadOnlyBooleanProperty shownPropertyshown- See Also:
-
animationDuration
public javafx.beans.property.ObjectProperty<javafx.util.Duration> animationDurationPropertyanimationDuration- See Also:
-
animationInterpolation
public javafx.beans.property.ObjectProperty<CircularPane.AnimationInterpolation> animationInterpolationPropertyanimationInterpolation: 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:
-
-
Field Details
-
node
private javafx.scene.Node node -
popup
private javafx.stage.Popup popup -
circularPane
-
items
private final javafx.collections.ObservableList<javafx.scene.control.MenuItem> itemsitems -
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 PanemouseButton- 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- Returns:
- the
shownproperty - See Also:
-
setShown
private void setShown(boolean value) -
isShown
public final boolean isShown()Gets the value of theshownproperty.- Property description:
- shown
- Returns:
- the value of the
shownproperty - See Also:
-
animationDurationProperty
public javafx.beans.property.ObjectProperty<javafx.util.Duration> animationDurationProperty()animationDuration- Returns:
- the
animationDurationproperty - See Also:
-
getAnimationDuration
public javafx.util.Duration getAnimationDuration()Gets the value of theanimationDurationproperty.- Property description:
- animationDuration
- Returns:
- the value of the
animationDurationproperty - See Also:
-
setAnimationDuration
public void setAnimationDuration(javafx.util.Duration value) Sets the value of theanimationDurationproperty.- Property description:
- animationDuration
- Parameters:
value- the value for theanimationDurationproperty- See Also:
-
withAnimationDuration
-
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)- Returns:
- the
animationInterpolationproperty - See Also:
-
getAnimationInterpolation
Gets the value of theanimationInterpolationproperty.- 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)
- Returns:
- the value of the
animationInterpolationproperty - See Also:
-
setAnimationInterpolation
Sets the value of theanimationInterpolationproperty.- 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)
- Parameters:
value- the value for theanimationInterpolationproperty- See Also:
-
withAnimationInterpolation
-
show
public void show(javafx.scene.input.MouseEvent mouseEvent) - Parameters:
mouseEvent-
-
show
public void show(double x, double y) - Parameters:
x- origin of the circley- origin of the circle
-
hide
public void hide()
-