JavaFX Utils

ChangeButtonOnPass

Component to change Button background on onMouseEntered and onMouseExited events.

ChangeButtonOnPass class is generic in T extends Button.

Constructors

	public ChangeButtonOnPass(T button, ImageView onEnter, ImageView onExit, boolean keepOldHandlers)
					

  • button : Button in which will be mounted animation.
  • onEnter : ImageView to be set as background on onMouseEntered event.
  • onExit : ImageView to be set as background on onMouseExited 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 Button from component.getNode() .
  • Constructors that receive Image onEnter and Image onExit will be used to instantiate ImageView.
  • Constructors that receive String onEnterPath and String onExitPath will be used to instantiate Image.
	public ChangeButtonOnPass(T button, ImageView onEnter, ImageView onExit)
					
	public ChangeButtonOnPass(T button, Image onEnter, Image onExit, boolean keepOldHandlers)
					
	public ChangeButtonOnPass(T button, Image onEnter, Image onExit)
					
	public ChangeButtonOnPass(T button, String onEnterPath, String onExitPath, boolean keepOldHandlers)
					
	public ChangeButtonOnPass(T button, String onEnterPath, String onExitPath)
					
	public ChangeButtonOnPass(IComponent<T> component, ImageView onEnter, ImageView onExit, boolean keepOldHandlers)
					
	public ChangeButtonOnPass(IComponent<T> component, ImageView onEnter, ImageView onExit)
					
	public ChangeButtonOnPass(IComponent<T> component, Image onEnter, Image onExit, boolean keepOldHandlers)
					
	public ChangeButtonOnPass(IComponent<T> component, Image onEnter, Image onExit)
					
	public ChangeButtonOnPass(IComponent<T> component, String onEnterPath, String onExitPath, boolean keepOldHandlers)
					
	public ChangeButtonOnPass(IComponent<T> component, String onEnterPath, String onExitPath)
					

Usage

	Button button;

	new ChangeButtonOnPass<>(button, IN_IMAGE, OUT_IMAGE).mount();
					

Links