模块 java.desktop

类 MatteBorder

所有已实现的接口:
Serializable , Border
已知子类:
BorderUIResource.MatteBorderUIResource

public class MatteBorder extends EmptyBorder
提供纯色或平铺图标的类似磨砂边框的类。

Warning: 此类的序列化对象将与未来的 Swing 版本不兼容。当前的序列化支持适用于运行相同版本 Swing 的应用程序之间的短期存储或 RMI。从 1.4 开始,对所有 JavaBeans 的长期存储的支持已添加到 java.beans 包中。请参阅 XMLEncoder

  • 字段详细信息

    • color

      protected Color  color
      为边框呈现的颜色。
    • tileIcon

      protected Icon  tileIcon
      用于平铺边框的图标。
  • 构造方法详细信息

    • MatteBorder

      public MatteBorder(int top, int left, int bottom, int right, Color  matteColor)
      创建具有指定insets和颜色的无光泽边框。
      参数:
      top - 边框的顶部insets
      left - 边框的左insets
      bottom - 边框的底部insets
      right - 边框的右insets
      matteColor - 为边框呈现的颜色
    • MatteBorder

      public MatteBorder(Insets  borderInsets, Color  matteColor)
      创建具有指定insets和颜色的无光泽边框。
      参数:
      borderInsets - 边框的insets
      matteColor - 为边框呈现的颜色
      抛出:
      NullPointerException - 如果指定的 borderInsetsnull
      自从:
      1.3
    • MatteBorder

      public MatteBorder(int top, int left, int bottom, int right, Icon  tileIcon)
      使用指定的insets和平铺图标创建磨砂边框。
      参数:
      top - 边框的顶部insets
      left - 边框的左insets
      bottom - 边框的底部insets
      right - 边框的右insets
      tileIcon - 用于平铺边框的图标
    • MatteBorder

      public MatteBorder(Insets  borderInsets, Icon  tileIcon)
      使用指定的insets和平铺图标创建磨砂边框。
      参数:
      borderInsets - 边框的insets
      tileIcon - 用于平铺边框的图标
      抛出:
      NullPointerException - 如果指定的 borderInsetsnull
      自从:
      1.3
    • MatteBorder

      public MatteBorder(Icon  tileIcon)
      使用指定的图块图标创建一个无光泽边框。insets将根据磁贴图标的大小动态计算,其中顶部和底部等于磁贴图标的高度,左侧和右侧等于磁贴图标的宽度。
      参数:
      tileIcon - 用于平铺边框的图标
  • 方法详情

    • paintBorder

      public void paintBorder(Component  c, Graphics  g, int x, int y, int width, int height)
      绘制无光泽边框。
      指定者:
      paintBorder 在接口 Border
      重写:
      paintBorder 在类 EmptyBorder
      参数:
      c - 为其绘制边框的组件
      g - 油漆图形
      x - 绘制边框的 x 位置
      y - 绘制边框的 y 位置
      width - 绘制边框的宽度
      height - 绘制边框的高度
    • getBorderInsets

      public Insets  getBorderInsets(Component  c, Insets  insets)
      使用此边框的当前 Insets 重新初始化 insets 参数。
      重写:
      getBorderInsets 在类 EmptyBorder
      参数:
      c - 此边框插入值适用的组件
      insets - 要重新初始化的对象
      返回:
      insets 对象
      抛出:
      NullPointerException - 如果指定的 insetsnull
      自从:
      1.3
    • getBorderInsets

      public Insets  getBorderInsets()
      返回边框的insets。
      重写:
      getBorderInsets 在类 EmptyBorder
      返回:
      一个 Insets 对象,包含顶部、左侧、底部和右侧的insets
      自从:
      1.3
    • getMatteColor

      public Color  getMatteColor()
      返回用于平铺边框的颜色,如果使用平铺图标,则返回 null。
      返回:
      用于呈现边框的 Color 对象或 null(如果使用平铺图标)
      自从:
      1.3
    • getTileIcon

      public Icon  getTileIcon()
      返回用于平铺边框的图标,如果使用纯色则返回 null。
      返回:
      Icon 用于平铺边框或 null(如果使用纯色填充边框)
      自从:
      1.3
    • isBorderOpaque

      public boolean isBorderOpaque()
      返回边框是否不透明。
      指定者:
      isBorderOpaque 在接口 Border
      重写:
      isBorderOpaque 在类 EmptyBorder
      返回:
      true 如果边框不透明,false 否则