JavaFX Utils

ChangeMouseOnPress

Component to change mouse image on onMousePressed and onMouseReleased events of Node.

Constructors

	public ChangeMouseOnPress(T node, Cursor onPress, Cursor onRelease, boolean keepOldHandlers)
					

  • node : Node in which will be mounted animation.
  • onPress : Cursor to be set as mouse on onMousePressed event.
  • onRelease : Cursor to be set as mouse on onMouseReleased event.
  • keepOldHandlers : indicates if old EventHandlers are to keep or discard.

There are more constructors with different parameters, but all will internally call this first one.

Variations :

  • Constructors that don't receive keepOldHandlers this value is assumed as true.
  • Constructors that receive IComponent<T> component obtain Node from component.getNode() .
  • Constructors that receive Image onPress and Image onRelease will be used to instantiate Cursor.
  • Constructors that receive String onPressPath and String onReleasePath will be used to instantiate Image.
	public ChangeMouseOnPress(T node, Cursor onPress, Cursor onRelease)
					
	public ChangeMouseOnPress(T node, Image onPress, Image onRelease, boolean keepOldHandlers)
					
	public ChangeMouseOnPress(T node, Image onPress, Image onRelease)
					
	public ChangeMouseOnPress(T node, String onPressPath, String onReleasePath, boolean keepOldHandlers)
					
	public ChangeMouseOnPress(T node, String onPressPath, String onReleasePath)
					
	public ChangeMouseOnPress(IComponent<T> component, Cursor onPress, Cursor onRelease, boolean keepOldHandlers)
					
	public ChangeMouseOnPress(IComponent<T> component, Cursor onPress, Cursor onRelease)
					
	public ChangeMouseOnPress(IComponent<T> component, Image onPress, Image onRelease, boolean keepOldHandlers)
					
	public ChangeMouseOnPress(IComponent<T> component, Image onPress, Image onRelease)
					
	public ChangeMouseOnPress(IComponent<T> component, String onPressPath, String onReleasePath, boolean keepOldHandlers)
					
	public ChangeMouseOnPress(IComponent<T> component, String onPressPath, String onReleasePath)
					

Usage

	Button button;

	new ChangeMouseOnPress<>(button, Cursor.CLOSED_HAND, Cursor.OPEN_HAND).mount();
					

Links