Record Class BasicChartTheme
java.lang.Object
java.lang.Record
com.arbergashi.charts.api.BasicChartTheme
- All Implemented Interfaces:
ChartTheme
public record BasicChartTheme(Color background, Color foreground, Color gridColor, Color axisLabelColor, Color accentColor, Color[] seriesColors, Font baseFont)
extends Record
implements ChartTheme
Basic implementation of ChartTheme using immutable value object pattern.
- Since:
- 2026-01-16
- Version:
- 1.0.0
- Author:
- Arber Gashi
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for BasicChartTheme. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theaccentColorrecord component.Returns the value of theaxisLabelColorrecord component.Returns the value of thebackgroundrecord component.baseFont()Returns the value of thebaseFontrecord component.static BasicChartTheme.Builderbuilder()Creates a new builder for constructing a BasicChartTheme.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theforegroundrecord component.Gets the accent color (primary highlight color).Gets the color for axis labels.Gets the background color for the chart panel.Gets the base font for chart text.Gets the foreground color for text and lines.Gets the grid color for axes and grid lines.getSeriesColor(int index) Gets a series color by index.Returns the value of thegridColorrecord component.final inthashCode()Returns a hash code value for this object.Color[]Returns the value of theseriesColorsrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from interface ChartTheme
getBearishColor, getBullishColor
-
Constructor Details
-
BasicChartTheme
public BasicChartTheme(Color background, Color foreground, Color gridColor, Color axisLabelColor, Color accentColor, Color[] seriesColors, Font baseFont) Creates an instance of aBasicChartThemerecord class.- Parameters:
background- the value for thebackgroundrecord componentforeground- the value for theforegroundrecord componentgridColor- the value for thegridColorrecord componentaxisLabelColor- the value for theaxisLabelColorrecord componentaccentColor- the value for theaccentColorrecord componentseriesColors- the value for theseriesColorsrecord componentbaseFont- the value for thebaseFontrecord component
-
-
Method Details
-
getBackground
Description copied from interface:ChartThemeGets the background color for the chart panel.- Specified by:
getBackgroundin interfaceChartTheme- Returns:
- The background color
-
getForeground
Description copied from interface:ChartThemeGets the foreground color for text and lines.- Specified by:
getForegroundin interfaceChartTheme- Returns:
- The foreground color
-
getGridColor
Description copied from interface:ChartThemeGets the grid color for axes and grid lines.- Specified by:
getGridColorin interfaceChartTheme- Returns:
- The grid color
-
getAxisLabelColor
Description copied from interface:ChartThemeGets the color for axis labels.- Specified by:
getAxisLabelColorin interfaceChartTheme- Returns:
- The axis label color
-
getAccentColor
Description copied from interface:ChartThemeGets the accent color (primary highlight color).- Specified by:
getAccentColorin interfaceChartTheme- Returns:
- The accent color
-
getSeriesColor
Description copied from interface:ChartThemeGets a series color by index.Implementations should cycle through available colors using modulo arithmetic to ensure a valid color is always returned.
- Specified by:
getSeriesColorin interfaceChartTheme- Parameters:
index- The series index (0-based)- Returns:
- The series color for the given index
-
getBaseFont
Description copied from interface:ChartThemeGets the base font for chart text.- Specified by:
getBaseFontin interfaceChartTheme- Returns:
- The base font
-
builder
Creates a new builder for constructing a BasicChartTheme.- Returns:
- A new Builder instance
-
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). -
background
Returns the value of thebackgroundrecord component.- Returns:
- the value of the
backgroundrecord component
-
foreground
Returns the value of theforegroundrecord component.- Returns:
- the value of the
foregroundrecord component
-
gridColor
Returns the value of thegridColorrecord component.- Returns:
- the value of the
gridColorrecord component
-
axisLabelColor
Returns the value of theaxisLabelColorrecord component.- Returns:
- the value of the
axisLabelColorrecord component
-
accentColor
Returns the value of theaccentColorrecord component.- Returns:
- the value of the
accentColorrecord component
-
seriesColors
Returns the value of theseriesColorsrecord component.- Returns:
- the value of the
seriesColorsrecord component
-
baseFont
Returns the value of thebaseFontrecord component.- Returns:
- the value of the
baseFontrecord component
-