Package com.storedobject.chart
Interface Clickable
- All Known Subinterfaces:
ComponentGroup
- All Known Implementing Classes:
AbstractChart
,AbstractGanttChart
,ActivityChart
,AngleAxis
,Axis
,BarChart
,BubbleChart
,CandlestickChart
,Chart
,DonutChart
,EffectScatterChart
,FunnelChart
,GanttChart
,GaugeChart
,GraphChart
,HeatmapChart
,LineChart
,NightingaleRoseChart
,PieChart
,RadarAxis
,RadarChart
,RadiusAxis
,SankeyChart
,ScatterChart
,SelfPositioningChart
,SelfPositioningSpecialChart
,SunburstChart
,TreeChart
,TreemapChart
,XAxis
,XRangeChart
,XYAxis
,XYChart
,YAxis
public interface Clickable
Represents a common interface for objects that have a clickable functionality.
- Author:
- Syam
-
Method Summary
Modifier and TypeMethodDescriptiondefault String
Get the key name for the click event for encoding purposes.default boolean
Retrieves the clickable state for encoding purposes.default boolean
Determines whether the current object is clickable.default boolean
matchSource
(ChartEvent event) Matches the source of the providedChartEvent
with the current object, if the object is an instance ofComponentPart
and its ID matches the part ID of the event.static boolean
matchSource
(ChartEvent event, ComponentPart... parts) Matches the source of the providedChartEvent
against the components specified in theparts
array.static boolean
matchSource
(ChartEvent event, BiConsumer<ComponentPart, ChartEvent> customizer, ComponentPart... parts) Matches the source of the providedChartEvent
with any of the givenComponentPart
objects.default void
setClickable
(boolean clickable) Sets the clickable state of this object.static void
setClickable
(boolean clickable, ComponentPart... parts) Sets the clickable state for a variable number ofComponentPart
objects, provided they are instances ofClickable
.
-
Method Details
-
setClickable
default void setClickable(boolean clickable) Sets the clickable state of this object.- Parameters:
clickable
- A boolean value indicating whether the object should be clickable or not. Iftrue
, the object will be clickable; iffalse
, it will not be clickable.
-
isClickable
default boolean isClickable()Determines whether the current object is clickable.- Returns:
true
if the object is clickable,false
otherwise.
-
getClickKeyName
Get the key name for the click event for encoding purposes.- Returns:
- Key name.
-
getClickValue
default boolean getClickValue()Retrieves the clickable state for encoding purposes.- Returns:
true
if the object is clickable,false
otherwise.
-
matchSource
Matches the source of the providedChartEvent
with the current object, if the object is an instance ofComponentPart
and its ID matches the part ID of the event. If the match is successful, the current object is added as a "source" entry in the event's data map.- Parameters:
event
- TheChartEvent
to be matched against the current object. It contains the part ID to compare and a data map for storing additional information.- Returns:
true
if the object matches the part ID in the event and is added as the source;false
otherwise.
-
matchSource
Matches the source of the providedChartEvent
against the components specified in theparts
array. If the event matches any of the parts and the matched component is aClickable
instance, the match is recorded in the event's data map.- Parameters:
event
- TheChartEvent
to be matched against the provided components. It contains the part ID and additional data map for storing match information.parts
- An array ofComponentPart
instances to compare against the event's part ID.- Returns:
true
if any component in theparts
array matches the part ID in the event;false
otherwise.
-
matchSource
static boolean matchSource(ChartEvent event, BiConsumer<ComponentPart, ChartEvent> customizer, ComponentPart... parts) Matches the source of the providedChartEvent
with any of the givenComponentPart
objects. If a match is found, an optional customizer action can be executed on the matching part and event.- Parameters:
event
- TheChartEvent
to match against the providedComponentPart
objects. It contains details about the chart event, such as the part ID to match and additional data.customizer
- An optionalBiConsumer
that accepts aComponentPart
and theChartEvent
. If provided, this function is executed when a match is found.parts
- An array ofComponentPart
objects to check for a match with the givenChartEvent
. These parts may implement clickable behavior to perform the matching.- Returns:
true
if any part in the array matches the source of the givenChartEvent
,false
otherwise.
-
setClickable
Sets the clickable state for a variable number ofComponentPart
objects, provided they are instances ofClickable
.- Parameters:
clickable
- A boolean value indicating whether the specified parts should be clickable. Iftrue
, the parts will be set as clickable; iffalse
, the parts will not be clickable.parts
- An array ofComponentPart
objects whose clickable state should be updated. Components that are not instances ofClickable
will be ignored.
-