Class BgFill

java.lang.Object
com.imyeyu.fx.utils.BgFill

public class BgFill extends Object
快速构建简单背景填充,支持渐变背景。build() 作为导出作用,最后执行
    new BgFill("red").build()                                 // 创建简单的背景填充
    new BgFill("red", "blue").toRight().build()               // 创建由红到蓝,从左往右的渐变填充背景
    new BgFill("red").radii(bgRadii).insets(bgInsets).build() // 设置圆角率和边距
Since:
2021-02-13 12:52
Author:
夜雨
  • Constructor Summary

    Constructors
    Constructor
    Description
    BgFill(String color)
    纯色构造器
    BgFill(String start, String end)
    渐变构造器
    BgFill(javafx.scene.paint.Paint color)
    纯色构造器
  • Method Summary

    Modifier and Type
    Method
    Description
    javafx.scene.layout.Background
    导出背景
    javafx.scene.layout.BackgroundFill
    buildFill(javafx.scene.paint.Paint color)
    导出背景填充
    insets(double size)
    设置内边距
    insets(double topBottom, double leftRight)
    设置内边距
    insets(double top, double right, double bottom, double left)
    设置内边距
    insets(javafx.geometry.Insets insets)
    设置内边距
    raddi(double size)
    设置四角圆角大小
    raddi(double topLeft, double topRight, double bottomRight, double bottomLeft, boolean asPercent)
    设置四角圆角大小
    static javafx.scene.layout.Background
    快速构造测试背景
    从上往下渐变
    从左往右渐变

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BgFill

      public BgFill(javafx.scene.paint.Paint color)
      纯色构造器
      Parameters:
      color - 颜色
    • BgFill

      public BgFill(String color)
      纯色构造器
      Parameters:
      color - 颜色
    • BgFill

      public BgFill(String start, String end)
      渐变构造器
      Parameters:
      start - 起点颜色
      end - 结束颜色
  • Method Details

    • raddi

      public BgFill raddi(double size)
      设置四角圆角大小
      Parameters:
      size - 大小
      Returns:
      本实例
    • raddi

      public BgFill raddi(double topLeft, double topRight, double bottomRight, double bottomLeft, boolean asPercent)
      设置四角圆角大小
      Parameters:
      topLeft - 左上
      topRight - 右上
      bottomRight - 右下
      bottomLeft - 左下
      asPercent - true 为百分比数值
      Returns:
      本实例
    • insets

      public BgFill insets(javafx.geometry.Insets insets)
      设置内边距
      Parameters:
      insets - 内边距
      Returns:
      本实例
    • insets

      public BgFill insets(double size)
      设置内边距
      Parameters:
      size - 四边边距
      Returns:
      本实例
    • insets

      public BgFill insets(double topBottom, double leftRight)
      设置内边距
      Parameters:
      topBottom - 上下边距
      leftRight - 左右边距
      Returns:
      本实例
    • insets

      public BgFill insets(double top, double right, double bottom, double left)
      设置内边距
      Parameters:
      top - 上边距
      right - 右边距
      bottom - 下边距
      left - 左边距
      Returns:
      本实例
    • toRight

      public BgFill toRight()
      从左往右渐变
      Returns:
      本实例
    • toBottom

      public BgFill toBottom()
      从上往下渐变
      Returns:
      本实例
    • build

      public javafx.scene.layout.Background build()
      导出背景
      Returns:
      背景
    • buildFill

      public javafx.scene.layout.BackgroundFill buildFill(javafx.scene.paint.Paint color)
      导出背景填充
      Parameters:
      color - 颜色
      Returns:
      背景填充
    • test

      public static javafx.scene.layout.Background test()
      快速构造测试背景
      Returns:
      背景