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 Summary

    Fields
    Modifier and Type
    Field
    Description
    protected T
     
    protected Class<T>
     
    protected tools.jackson.databind.node.ObjectNode
     
    static final String
     

    Fields inherited from class java.util.EventObject

    source
  • Constructor Summary

    Constructors
    Constructor
    Description
    AbstractChartEvent(JmixChart source, boolean fromClient, tools.jackson.databind.node.ObjectNode detail, Class<T> detailClass)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected <M> M
    convertDetail(Class<M> detailClass)
    Deserializes the incoming event JSON object into a POJO.
    Lazily returns an event detail object.
    tools.jackson.databind.node.ObjectNode
    detailJson can be used for independent parsing if the predefined mapping doesn't match.

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

    getSource, getUI, 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
  • Field Details

  • Constructor Details

    • AbstractChartEvent

      public AbstractChartEvent(JmixChart source, boolean fromClient, tools.jackson.databind.node.ObjectNode detail, Class<T> detailClass)
  • Method Details

    • getDetailJson

      public tools.jackson.databind.node.ObjectNode getDetailJson()
      detailJson can be used for independent parsing if the predefined mapping doesn't match.
      Returns:
      ObjectNode 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