public class FXHoverBehavior extends HoverBehavior<javafx.scene.Node>
Modifier and Type | Field and Description |
---|---|
static int |
CREATION_DELAY_MILLIS |
static double |
MOUSE_MOVE_THRESHOLD |
static int |
REMOVAL_DELAY_MILLIS |
pcs
ACTIVE_PROPERTY
Constructor and Description |
---|
FXHoverBehavior() |
Modifier and Type | Method and Description |
---|---|
protected void |
addFeedback(java.util.List<? extends IVisualPart<javafx.scene.Node,? extends javafx.scene.Node>> targets,
java.util.Map<java.lang.Object,java.lang.Object> contextMap) |
void |
deactivate() |
javafx.scene.effect.Effect |
getHandleHoverFeedbackEffect(java.util.Map<java.lang.Object,java.lang.Object> contextMap)
Returns the
Effect that is applied to IHandlePart s as a
replacement for IFeedbackPart s which are created for normal
parts. |
static boolean |
isContained(java.util.List<? extends IVisualPart<javafx.scene.Node,? extends javafx.scene.Node>> rootParts,
IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> part)
Searches for the specified part in the given list of root parts.
|
protected boolean |
isHostOrHoverHandlePart(IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> part)
Returns
true if the given IVisualPart is either the
host or a handle part controlled by this behavior (
AbstractBehavior.getHandleParts() ). |
protected boolean |
isInCreationDelay()
Returns
true when the creation delay is currently running. |
protected boolean |
isInRemovalDelay()
Returns
true when the removal delay is currently running. |
protected void |
onCreationDelay()
Called as soon as the creation delay finishes.
|
protected void |
onHover()
Called when the host, or any of its hover handles, is hovered after none
of them was hovered.
|
protected void |
onHoverChange(IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> oldHovered,
IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> newHovered) |
protected void |
onMouseMove(javafx.scene.input.MouseEvent event)
Called when the mouse moves while the mouse handler is active.
|
protected void |
onRelease()
Called when the pressed visual is released and we are unhovered.
|
protected void |
onRemovalDelay()
Called when the removal delay finishes.
|
protected void |
onUnhover()
Called when the host, and all of its hover handles, are unhovered after
any one of them was previously hovered.
|
protected void |
registerMouseHandler()
Registers the mouse handler that restarts the creation delay upon mouse
moves.
|
protected void |
removeFeedback(java.util.List<? extends IVisualPart<javafx.scene.Node,? extends javafx.scene.Node>> targets) |
protected void |
startHandleCreationDelay() |
protected void |
startHandleRemovalDelay() |
protected void |
stopCreationDelay() |
protected void |
stopRemovalDelay() |
protected void |
unregisterMouseHandler() |
activate, getHoverModel, propertyChange
addFeedback, addHandles, addHandles, addPropertyChangeListener, getAdaptable, getFeedbackParts, getHandleParts, getHost, isActive, removeHandles, removePropertyChangeListener, setAdaptable, switchAdaptableScopes
public static final int REMOVAL_DELAY_MILLIS
public static final int CREATION_DELAY_MILLIS
public static final double MOUSE_MOVE_THRESHOLD
public static boolean isContained(java.util.List<? extends IVisualPart<javafx.scene.Node,? extends javafx.scene.Node>> rootParts, IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> part)
true
if the part can be found. Otherwise returns
false
.rootParts
- List of root parts to search through.part
- The part that is checked for containment.true
when the part is contained in the hierarchy
given by rootParts, otherwise false
.protected void addFeedback(java.util.List<? extends IVisualPart<javafx.scene.Node,? extends javafx.scene.Node>> targets, java.util.Map<java.lang.Object,java.lang.Object> contextMap)
addFeedback
in class AbstractBehavior<javafx.scene.Node>
public void deactivate()
deactivate
in interface IActivatable
deactivate
in class HoverBehavior<javafx.scene.Node>
public javafx.scene.effect.Effect getHandleHoverFeedbackEffect(java.util.Map<java.lang.Object,java.lang.Object> contextMap)
Effect
that is applied to IHandlePart
s as a
replacement for IFeedbackPart
s which are created for normal
parts.contextMap
- A map with context information that might be needed to
identify the concrete creation context.Effect
that is applied to IHandlePart
s as a
replacement for IFeedbackPart
s which are created for
normal parts.protected boolean isHostOrHoverHandlePart(IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> part)
true
if the given IVisualPart
is either the
host or a handle part controlled by this behavior (
AbstractBehavior.getHandleParts()
).part
- The IVisualPart
to test.true
if the given IVisualPart
is either the
host (AbstractBehavior.getHost()
) or a handle part controlled by this
behavior (AbstractBehavior.getHandleParts()
), false
otherwise.protected boolean isInCreationDelay()
true
when the creation delay is currently running.
Otherwise returns false
.true
when the creation delay is currently running,
otherwise false
.protected boolean isInRemovalDelay()
true
when the removal delay is currently running.
Otherwise returns false
.true
when the removal delay is currently running,
otherwise false
.protected void onCreationDelay()
protected void onHover()
protected void onHoverChange(IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> oldHovered, IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> newHovered)
onHoverChange
in class HoverBehavior<javafx.scene.Node>
protected void onMouseMove(javafx.scene.input.MouseEvent event)
protected void onRelease()
protected void onRemovalDelay()
protected void onUnhover()
protected void registerMouseHandler()
protected void removeFeedback(java.util.List<? extends IVisualPart<javafx.scene.Node,? extends javafx.scene.Node>> targets)
removeFeedback
in class AbstractBehavior<javafx.scene.Node>
protected void startHandleCreationDelay()
protected void startHandleRemovalDelay()
protected void stopCreationDelay()
protected void stopRemovalDelay()
protected void unregisterMouseHandler()
Copyright (c) 2014 itemis AG and others. All rights reserved.