Record Class LegendConfig
java.lang.Object
java.lang.Record
com.arbergashi.charts.ui.legend.LegendConfig
public record LegendConfig(LegendPlacement placement, LegendPosition overlayPosition, LegendDockSide dockSide)
extends Record
Legend configuration for an
ArberChartPanel.- Since:
- 2026-01-01
- Version:
- 1.0.0
- Author:
- Arber Gashi
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final LegendConfigDefault legend configuration (overlay, top-left, right dock fallback). -
Constructor Summary
ConstructorsConstructorDescriptionLegendConfig(LegendPlacement placement, LegendPosition overlayPosition, LegendDockSide dockSide) Creates a legend configuration with null-safe defaults. -
Method Summary
Modifier and TypeMethodDescriptionstatic LegendConfigdocked(LegendDockSide side) Creates a docked legend configuration.dockSide()Returns the value of thedockSiderecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static LegendConfigoverlay(LegendPosition position) Creates an overlay legend configuration.Returns the value of theoverlayPositionrecord component.Returns the value of theplacementrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
DEFAULT
Default legend configuration (overlay, top-left, right dock fallback).
-
-
Constructor Details
-
LegendConfig
public LegendConfig(LegendPlacement placement, LegendPosition overlayPosition, LegendDockSide dockSide) Creates a legend configuration with null-safe defaults.- Parameters:
placement- overlay vs docked placementoverlayPosition- overlay anchor positiondockSide- docking side for docked legends
-
-
Method Details
-
overlay
Creates an overlay legend configuration.- Parameters:
position- overlay position (defaults to top-left when null)- Returns:
- legend configuration in overlay mode
-
docked
Creates a docked legend configuration.- Parameters:
side- docking side (non-null)- Returns:
- legend configuration in docked mode
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
placement
Returns the value of theplacementrecord component.- Returns:
- the value of the
placementrecord component
-
overlayPosition
Returns the value of theoverlayPositionrecord component.- Returns:
- the value of the
overlayPositionrecord component
-
dockSide
Returns the value of thedockSiderecord component.- Returns:
- the value of the
dockSiderecord component
-