views::Border

来源:互联网 发布:windows ad域组策略 编辑:程序博客网 时间:2024/04/27 02:33

 class Border {
 public:
  Border();
  virtual ~Border();

  // Creates a border that is a simple line of the specified thickness and
  // color.
  static Border* CreateSolidBorder(int thickness, SkColor color);

  // Creates a border for reserving space. The returned border does not
  // paint anything.
  static Border* CreateEmptyBorder(int top, int left, int bottom, int right);

  // Renders the border for the specified view.
  virtual void Paint(const View& view, gfx::Canvas* canvas) const = 0;

  // Sets the specified insets to the the border insets.
  virtual void GetInsets(gfx::Insets* insets) const = 0;

 private:
  DISALLOW_COPY_AND_ASSIGN(Border);
};

 

此类提供static函数来创建Border,而Border是一个抽象类,其实现类有SolidBorder、EmptyBorder。其中实现了虚函数为virtual void Paint(const View& view, gfx::Canvas* canvas) const,用于画出Border。

 

因此,Border类用于画出View中的Border。