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 StringGet the key name for the click event for encoding purposes.default booleanRetrieves the clickable state for encoding purposes.default booleanDetermines whether the current object is clickable.default booleanmatchSource(ChartEvent event) Matches the source of the providedChartEventwith the current object, if the object is an instance ofComponentPartand its ID matches the part ID of the event.static booleanmatchSource(ChartEvent event, ComponentPart... parts) Matches the source of the providedChartEventagainst the components specified in thepartsarray.static booleanmatchSource(ChartEvent event, BiConsumer<ComponentPart, ChartEvent> customizer, ComponentPart... parts) Matches the source of the providedChartEventwith any of the givenComponentPartobjects.default voidsetClickable(boolean clickable) Sets the clickable state of this object.static voidsetClickable(boolean clickable, ComponentPart... parts) Sets the clickable state for a variable number ofComponentPartobjects, 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:
trueif the object is clickable,falseotherwise.
-
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:
trueif the object is clickable,falseotherwise.
-
matchSource
Matches the source of the providedChartEventwith the current object, if the object is an instance ofComponentPartand 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- TheChartEventto be matched against the current object. It contains the part ID to compare and a data map for storing additional information.- Returns:
trueif the object matches the part ID in the event and is added as the source;falseotherwise.
-
matchSource
Matches the source of the providedChartEventagainst the components specified in thepartsarray. If the event matches any of the parts and the matched component is aClickableinstance, the match is recorded in the event's data map.- Parameters:
event- TheChartEventto be matched against the provided components. It contains the part ID and additional data map for storing match information.parts- An array ofComponentPartinstances to compare against the event's part ID.- Returns:
trueif any component in thepartsarray matches the part ID in the event;falseotherwise.
-
matchSource
static boolean matchSource(ChartEvent event, BiConsumer<ComponentPart, ChartEvent> customizer, ComponentPart... parts) Matches the source of the providedChartEventwith any of the givenComponentPartobjects. If a match is found, an optional customizer action can be executed on the matching part and event.- Parameters:
event- TheChartEventto match against the providedComponentPartobjects. It contains details about the chart event, such as the part ID to match and additional data.customizer- An optionalBiConsumerthat accepts aComponentPartand theChartEvent. If provided, this function is executed when a match is found.parts- An array ofComponentPartobjects to check for a match with the givenChartEvent. These parts may implement clickable behavior to perform the matching.- Returns:
trueif any part in the array matches the source of the givenChartEvent,falseotherwise.
-
setClickable
Sets the clickable state for a variable number ofComponentPartobjects, 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 ofComponentPartobjects whose clickable state should be updated. Components that are not instances ofClickablewill be ignored.
-