Class BehaviorBase<C extends javafx.scene.control.Control,S extends javafx.scene.control.SkinBase<C>>

java.lang.Object
atlantafx.base.controls.BehaviorBase<C,S>
Direct Known Subclasses:
CalendarBehavior

public class BehaviorBase<C extends javafx.scene.control.Control,S extends javafx.scene.control.SkinBase<C>> extends Object
Encapsulates behavior interaction logic for a skin. The main functionality in BehaviorBase revolves around infrastructure for resolving events into function calls. A BehaviorBase implementation will usually contain logic for handling key events based on the host platform, as well as view-specific functions for handling mouse and key and other input events.

Although BehaviorBase is typically used as a base class, it is not abstract and several skins instantiate an instance of BehaviorBase directly.

Note: This is an excerpt of the private Behavior API from the JavaFX codebase. It serves as a compatibility layer for implementing certain controls, although it can also be useful for new controls.

  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    BehaviorBase(C control, S skin)
    Constructor for all BehaviorBase instances.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Called from SkinBase.dispose() to clean up the behavior state.
    Gets the control associated with this behavior.
    Gets the skin associated with this behavior.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BehaviorBase

      protected BehaviorBase(C control, S skin)
      Constructor for all BehaviorBase instances.
      Parameters:
      control - The control for which this Skin should attach to.
      skin - The skin used by the control.
  • Method Details

    • getControl

      public C getControl()
      Gets the control associated with this behavior.
      Returns:
      The control for this behavior.
    • getSkin

      public S getSkin()
      Gets the skin associated with this behavior.
      Returns:
      The control for this behavior.
    • dispose

      public void dispose()
      Called from SkinBase.dispose() to clean up the behavior state.