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.
-
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.ReadOnlyBooleanProperty
shown -
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final javafx.beans.property.ObjectProperty
<javafx.util.Duration> private final javafx.beans.property.ObjectProperty
<CircularPane.AnimationInterpolation> private CircularPane
private final javafx.collections.ObservableList
<javafx.scene.control.MenuItem> itemsprivate final AtomicLong
private javafx.scene.Node
private javafx.stage.Popup
private 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 void
construct
(javafx.scene.Node node, javafx.scene.input.MouseButton mouseButton) javafx.util.Duration
Gets the value of theanimationDuration
property.Gets the value of theanimationInterpolation
property.final javafx.collections.ObservableList
<javafx.scene.control.MenuItem> getItems()
void
hide()
final boolean
isShown()
Gets the value of theshown
property.void
setAnimationDuration
(javafx.util.Duration value) Sets the value of theanimationDuration
property.void
Sets the value of theanimationInterpolation
property.private void
setShown
(boolean value) void
show
(double x, double y) void
show
(javafx.scene.input.MouseEvent mouseEvent) final javafx.beans.property.ReadOnlyBooleanProperty
shownwithAnimationDuration
(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
shown
property - See Also:
-
setShown
private void setShown(boolean value) -
isShown
public final boolean isShown()Gets the value of theshown
property.- Property description:
- shown
- Returns:
- the value of the
shown
property - See Also:
-
animationDurationProperty
public javafx.beans.property.ObjectProperty<javafx.util.Duration> animationDurationProperty()animationDuration- Returns:
- the
animationDuration
property - See Also:
-
getAnimationDuration
public javafx.util.Duration getAnimationDuration()Gets the value of theanimationDuration
property.- Property description:
- animationDuration
- Returns:
- the value of the
animationDuration
property - See Also:
-
setAnimationDuration
public void setAnimationDuration(javafx.util.Duration value) Sets the value of theanimationDuration
property.- Property description:
- animationDuration
- Parameters:
value
- the value for theanimationDuration
property- 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
animationInterpolation
property - See Also:
-
getAnimationInterpolation
Gets the value of theanimationInterpolation
property.- 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
animationInterpolation
property - See Also:
-
setAnimationInterpolation
Sets the value of theanimationInterpolation
property.- 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 theanimationInterpolation
property- 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()
-