JavaFX Utils

IComponent

Interface that defines the contract for all components.

Component is a class that implements IComponent and mounts some utilities on Node object.

To avoid casts over Node objects this interface is generic in T extends Node. This way when you get the reference to Node through getNode() you don't need to cast it.

A component have to implement 2 methods:

  • void mount() throws ComponentException

    Mounts the utility over the Node.

  • T getNode()

    Returns the Node in which where mounted the utility.

To help implement a component you can extend Component which is an abstract class that implements IComponent. Component class has a constructor that receives a Node and returns it on getNode() method. This Node can be accessed through protected field node.

Links