Class AbstractChartEvent<T extends BaseChartEventDetail>

java.lang.Object
java.util.EventObject
com.vaadin.flow.component.ComponentEvent<JmixChart>
io.jmix.chartsflowui.kit.component.event.AbstractChartEvent<T>
Type Parameters:
T - origin event class type
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AbstractChartMouseEvent, ChartDataZoomEvent, ChartFinishedEvent, ChartGlobalCursorTakenEvent, ChartGlobalOutEvent, ChartLegendInverseSelectEvent, ChartLegendScrollEvent, ChartLegendSelectAllEvent, ChartLegendSelectChangedEvent, ChartMagicTypeChangedEvent, ChartRenderedEvent, ChartRestoreEvent

public abstract class AbstractChartEvent<T extends BaseChartEventDetail> extends com.vaadin.flow.component.ComponentEvent<JmixChart>
Base chart event class. Stores an detailJson object containing the event context.
See Also:
  • Field Details

  • Constructor Details

    • AbstractChartEvent

      public AbstractChartEvent(JmixChart source, boolean fromClient, elemental.json.JsonObject detail, Class<T> detailClass)
  • Method Details

    • getDetailJson

      public elemental.json.JsonObject getDetailJson()
      detailJson can be used for independent parsing if the predefined mapping doesn't match.
      Returns:
      JsonObject describing the context of the event that occurred on the client-side.
    • getDetail

      public T getDetail()
      Lazily returns an event detail object. Implemented in a lazy way due to the fact that the event stream can be loaded and because of this, parsing all the details can cause performance issues.
      Returns:
      POJO describing the event
    • convertDetail

      protected <M> M convertDetail(Class<M> detailClass)
      Deserializes the incoming event JSON object into a POJO.
      Type Parameters:
      M - resulting POJO class type
      Parameters:
      detailClass - the class of the resulting POJO object
      Returns:
      POJO describing the event if the parse was successful
      Throws:
      IllegalArgumentException - if parsing fails