Module technology.sola.engine
Class BaseStyles.Builder<Self extends BaseStyles.Builder<Self>>
java.lang.Object
technology.sola.engine.graphics.gui.style.BaseStyles.Builder<Self>
- Type Parameters:
Self- this builder type
- Direct Known Subclasses:
TextStyles.Builder
- Enclosing class:
- BaseStyles
@NullMarked
public static class BaseStyles.Builder<Self extends BaseStyles.Builder<Self>>
extends Object
Builder class for
BaseStyles.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a new styles instance based on the builder properties that were set.setBackgroundColor(@Nullable Color backgroundColor) Sets theBaseStyles.background()to be the color provided.setBorderColor(@Nullable Color borderColor) Sets theBaseStyles.border()to be the color provided with a 1px sizing.setCrossAxisChildren(@Nullable CrossAxisChildren crossAxisChildren) Sets theBaseStyles.crossAxisChildren().setDirection(@Nullable Direction direction) Sets theBaseStyles.direction().Sets theBaseStyles.gap().setHeight(int height) Sets theBaseStyles.height().Sets theBaseStyles.height().setMainAxisChildren(@Nullable MainAxisChildren mainAxisChildren) Sets theBaseStyles.mainAxisChildren().setPadding(@Nullable Integer size) Sets theBaseStyles.padding()to have the same value for top, right, bottom and left.setPadding(@Nullable Integer top, @Nullable Integer right, @Nullable Integer bottom, @Nullable Integer left) Sets theBaseStyles.padding()to have values for top, right, bottom and left.setPaddingBottom(@Nullable Integer bottom) Sets theBaseStyles.padding()bottom value only.setPaddingHorizontal(@Nullable Integer leftRight) Sets theBaseStyles.padding()to have the same value for left and right.setPaddingLeft(@Nullable Integer left) Sets theBaseStyles.padding()left value only.setPaddingRight(@Nullable Integer right) Sets theBaseStyles.padding()right value only.setPaddingTop(@Nullable Integer top) Sets theBaseStyles.padding()top value only.setPaddingVertical(@Nullable Integer topBottom) Sets theBaseStyles.padding()to have the same value for top and bottom.setPositionX(@Nullable String x) Sets theBaseStyles.position()to have an absolute value for x (y value remains unchanged).setPositionY(@Nullable String y) Sets theBaseStyles.position()to have an absolute value for y (x value remains unchanged).setVisibility(@Nullable Visibility visibility) Sets theBaseStyles.visibility().setWidth(int width) Sets theBaseStyles.width().Sets theBaseStyles.width().
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
build
Builds a new styles instance based on the builder properties that were set.- Returns:
- the new styles instance
-
setBackgroundColor
Sets theBaseStyles.background()to be the color provided.- Parameters:
backgroundColor- theColorof the background- Returns:
- this
-
setBorderColor
Sets theBaseStyles.border()to be the color provided with a 1px sizing.- Parameters:
borderColor- theColorof the border- Returns:
- this
-
setWidth
Sets theBaseStyles.width().- Parameters:
width- the width of the element- Returns:
- this
-
setWidth
Sets theBaseStyles.width().- Parameters:
width- the width of the element- Returns:
- this
-
setHeight
Sets theBaseStyles.height().- Parameters:
height- the height of the element- Returns:
- this
-
setHeight
Sets theBaseStyles.height().- Parameters:
height- the height of the element- Returns:
- this
-
setVisibility
Sets theBaseStyles.visibility().- Parameters:
visibility- theVisibilityof the element- Returns:
- this
-
setGap
Sets theBaseStyles.gap().- Parameters:
gap- the gap between child elements- Returns:
- this
-
setDirection
Sets theBaseStyles.direction().- Parameters:
direction- theDirectionchildren elements flow- Returns:
- this
-
setMainAxisChildren
Sets theBaseStyles.mainAxisChildren().- Parameters:
mainAxisChildren- theMainAxisChildrenof the element- Returns:
- this
-
setCrossAxisChildren
Sets theBaseStyles.crossAxisChildren().- Parameters:
crossAxisChildren- theCrossAxisChildrenof the element- Returns:
- this
-
setPositionX
Sets theBaseStyles.position()to have an absolute value for x (y value remains unchanged).- Parameters:
x- the absolute x position- Returns:
- this
-
setPositionY
Sets theBaseStyles.position()to have an absolute value for y (x value remains unchanged).- Parameters:
y- the absolute y position- Returns:
- this
-
setPadding
public Self setPadding(@Nullable Integer top, @Nullable Integer right, @Nullable Integer bottom, @Nullable Integer left) Sets theBaseStyles.padding()to have values for top, right, bottom and left.- Parameters:
top- the top paddingright- the right paddingbottom- the bottom paddingleft- the left padding- Returns:
- this
-
setPadding
Sets theBaseStyles.padding()to have the same value for top, right, bottom and left.- Parameters:
size- the padding value for all sides- Returns:
- this
-
setPaddingVertical
Sets theBaseStyles.padding()to have the same value for top and bottom. Left and right remain unchanged.- Parameters:
topBottom- the padding value for top and bottom- Returns:
- this
-
setPaddingHorizontal
Sets theBaseStyles.padding()to have the same value for left and right. Top and bottom remain unchanged.- Parameters:
leftRight- the padding value for left and right- Returns:
- this
-
setPaddingTop
Sets theBaseStyles.padding()top value only.- Parameters:
top- the top padding value- Returns:
- this
-
setPaddingRight
Sets theBaseStyles.padding()right value only.- Parameters:
right- the right padding value- Returns:
- this
-
setPaddingBottom
Sets theBaseStyles.padding()bottom value only.- Parameters:
bottom- the bottom padding value- Returns:
- this
-
setPaddingLeft
Sets theBaseStyles.padding()left value only.- Parameters:
left- the left padding value- Returns:
- this
-