Class ComponentObservationEvent

java.lang.Object
java.util.EventObject
com.vaadin.flow.component.ComponentEvent<ComponentObserver>
org.vaadin.miki.superfields.lazyload.ComponentObservationEvent
All Implemented Interfaces:
Serializable

public class ComponentObservationEvent extends com.vaadin.flow.component.ComponentEvent<ComponentObserver>
Information about the component being observed by ComponentObserver.
Since:
2020-04-28
Author:
miki
See Also:
  • Field Summary

    Fields inherited from class java.util.EventObject

    source
  • Constructor Summary

    Constructors
    Constructor
    Description
    ComponentObservationEvent(ComponentObserver source, com.vaadin.flow.component.Component observedComponent, double visibilityRange)
    Constructs a prototypical Event.
  • Method Summary

    Modifier and Type
    Method
    Description
    com.vaadin.flow.component.Component
    Returns the component that has been observed.
    double
    Returns the visibility range that happened to the observed component.
    final boolean
    Helper method for checking if the observed component is fully visible.
    final boolean
    Helper method for checking if the observed component is no longer visible.

    Methods inherited from class com.vaadin.flow.component.ComponentEvent

    getSource, isFromClient, unregisterListener

    Methods inherited from class java.util.EventObject

    toString

    Methods inherited from class java.lang.Object

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

    • ComponentObservationEvent

      public ComponentObservationEvent(ComponentObserver source, com.vaadin.flow.component.Component observedComponent, double visibilityRange)
      Constructs a prototypical Event.
      Parameters:
      source - The object on which the Event initially occurred
      observedComponent - Component that was observed.
      visibilityRange - Visibility range when the event happened.
      Throws:
      IllegalArgumentException - if source is null
  • Method Details

    • getObservedComponent

      public com.vaadin.flow.component.Component getObservedComponent()
      Returns the component that has been observed.
      Returns:
      A Component.
    • getVisibilityRange

      public double getVisibilityRange()
      Returns the visibility range that happened to the observed component.
      Returns:
      A number between 0 and 1, close to one of the registered visibility ranges.
    • isNotVisible

      public final boolean isNotVisible()
      Helper method for checking if the observed component is no longer visible.
      Returns:
      getVisibilityRange() == 0.0d
    • isFullyVisible

      public final boolean isFullyVisible()
      Helper method for checking if the observed component is fully visible.
      Returns:
      getVisibilityRange() == 1.0d