Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'linetype' for theme elements #1072

Merged
merged 14 commits into from
Apr 3, 2024
Merged
Prev Previous commit
Next Next commit
Renaming.
  • Loading branch information
OLarionova-HORIS committed Apr 2, 2024
commit 50368f54f166e14f03745ffed516216c111e6382
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ interface LegendTheme {
fun backgroundColor(): Color
fun backgroundFill(): Color
fun backgroundStrokeWidth(): Double
fun backgroundRectLineType(): LineType
fun backgroundLineType(): LineType
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ interface PlotTheme {
fun backgroundColor(): Color
fun backgroundFill(): Color
fun backgroundStrokeWidth(): Double
fun backgroundRectLineType(): LineType
fun backgroundLineType(): LineType
fun titleStyle(): ThemeTextStyle
fun subtitleStyle(): ThemeTextStyle
fun captionStyle(): ThemeTextStyle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ class PlotSvgComponent constructor(
strokeColor().set(plotTheme.backgroundColor())
val width = plotTheme.backgroundStrokeWidth()
strokeWidth().set(width)
StrokeDashArraySupport.apply(this, width, plotTheme.backgroundRectLineType())
StrokeDashArraySupport.apply(this, width, plotTheme.backgroundLineType())
d().set(SvgPathDataBuilder().rect(backgroundRect).build())
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,5 @@ internal class DefaultLegendTheme(
return getNumber(getElemValue(backgroundKey), ThemeOption.Elem.SIZE)
}

override fun backgroundRectLineType() = getLineType(getElemValue(backgroundKey))
override fun backgroundLineType() = getLineType(getElemValue(backgroundKey))
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ internal class DefaultPlotTheme(
return getNumber(getElemValue(backgroundKey), Elem.SIZE)
}

override fun backgroundRectLineType(): LineType {
return getLineType(getElemValue(backgroundKey))
}
override fun backgroundLineType() = getLineType(getElemValue(backgroundKey))

override fun titleStyle(): ThemeTextStyle {
return getTextStyle(getElemValue(titleKey))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class DefaultTheme internal constructor(
FILL to containerTheme.plot.backgroundFill(),
COLOR to this.plot.backgroundColor(),
SIZE to this.plot.backgroundStrokeWidth(),
LINETYPE to this.plot.backgroundRectLineType()
LINETYPE to this.plot.backgroundLineType()
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ abstract class LegendBox : SvgComponent() {
strokeColor().set(theme.backgroundColor())
val width = theme.backgroundStrokeWidth()
strokeWidth().set(width)
StrokeDashArraySupport.apply(this, width, theme.backgroundRectLineType())
StrokeDashArraySupport.apply(this, width, theme.backgroundLineType())
fillColor().set(theme.backgroundFill())
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class CompositeFigureSvgComponent constructor(
strokeColor().set(plotTheme.backgroundColor())
val width = plotTheme.backgroundStrokeWidth()
strokeWidth().set(width)
StrokeDashArraySupport.apply(this, width, plotTheme.backgroundRectLineType())
StrokeDashArraySupport.apply(this, width, plotTheme.backgroundLineType())
})
}
}
Expand Down