Package com.storedobject.chart
Class ChartEvent
java.lang.Object
com.storedobject.chart.ChartEvent
Represents an event that occurs in a chart.
A
ChartEvent
encapsulates the type of the event, the ID of the part
of the chart related to the event, and optionally, any additional data related to the event.- Author:
- Syam
-
Constructor Summary
ConstructorsConstructorDescriptionChartEvent
(SOChart soChart, ChartEventType type, long partId) Constructs a new ChartEvent with the specified type and part ID. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a key-value pair to the additional data associated with the chart event.getData()
Retrieves the additional data associated with the event.long
Retrieves the ID of the part associated with the chart event.Retrieves theSOChart
instance associated with this chart event.getType()
Retrieves the type of the chart event.toString()
-
Constructor Details
-
ChartEvent
Constructs a new ChartEvent with the specified type and part ID.- Parameters:
soChart
- TheSOChart
instance associated with this event.type
- The type of the chart event. This determines the kind of event that occurred.partId
- The ID of the chart part associated with this event.
-
-
Method Details
-
getSoChart
Retrieves theSOChart
instance associated with this chart event.- Returns:
- The
SOChart
instance linked to this event.
-
getType
Retrieves the type of the chart event.- Returns:
- The type of the chart event as a
ChartEventType
.
-
getPartId
public long getPartId()Retrieves the ID of the part associated with the chart event.- Returns:
- The ID of the part as a long value.
-
getData
-
addData
Adds a key-value pair to the additional data associated with the chart event. If the data map is not initialized, it will create a new one before adding the entry.- Parameters:
key
- The key representing the data entry.data
- The value associated with the key.
-
toString
-