模块 java.desktop

类 BevelBorder

java.lang.Object
javax.swing.border.AbstractBorder
javax.swing.border.BevelBorder
所有已实现的接口:
Serializable , Border
已知子类:
BorderUIResource.BevelBorderUIResource , SoftBevelBorder

public class BevelBorder extends AbstractBorder
一个实现简单的两线斜角边框的类。

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

  • 字段详细信息

    • RAISED

      public static final int RAISED
      凸起的斜面类型。
      参见:
    • LOWERED

      public static final int LOWERED
      降低的斜面类型。
      参见:
    • bevelType

      protected int bevelType
      斜面类型。
    • highlightOuter

      protected Color  highlightOuter
      用于斜面外部高光的颜色。
    • highlightInner

      protected Color  highlightInner
      用于斜面内部高光的颜色。
    • shadowInner

      protected Color  shadowInner
      用于斜角内部阴影的颜色。
    • shadowOuter

      protected Color  shadowOuter
      用于斜面外阴影的颜色
  • 构造方法详细信息

    • BevelBorder

      public BevelBorder(int bevelType)
      创建具有指定类型的斜角边框,其颜色将从传递到 paintBorder 方法的组件的背景颜色派生。
      参数:
      bevelType - 边框的斜角类型
    • BevelBorder

      public BevelBorder(int bevelType, Color  highlight, Color  shadow)
      创建具有指定类型、高亮和阴影颜色的斜角边框。斜面外部高光颜色和斜面内部高光颜色将从指定的高光颜色派生,斜面外部阴影颜色和斜面内部阴影颜色将从指定的阴影颜色派生。
      参数:
      bevelType - 边框的斜角类型
      highlight - 用于斜面高光的颜色
      shadow - 用于斜面阴影的颜色
    • BevelBorder

      @ConstructorProperties ({"bevelType","highlightOuterColor","highlightInnerColor","shadowOuterColor","shadowInnerColor"}) public BevelBorder(int bevelType, Color  highlightOuterColor, Color  highlightInnerColor, Color  shadowOuterColor, Color  shadowInnerColor)
      创建具有指定类型、高亮和阴影颜色的斜角边框。
      参数:
      bevelType - 边框的斜角类型
      highlightOuterColor - 用于斜面外部高光的颜色
      highlightInnerColor - 用于斜面内部高光的颜色
      shadowOuterColor - 用于斜面外阴影的颜色
      shadowInnerColor - 用于斜面内阴影的颜色
  • 方法详情

    • paintBorder

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

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

      public Color  getHighlightOuterColor(Component  c)
      返回在指定组件上呈现时斜角边框的外部突出显示颜色。如果在实例化时未指定高亮颜色,则高亮颜色源自指定组件的背景颜色。
      参数:
      c - 可以导出高亮的组件
      返回:
      外部突出显示Color
      自从:
      1.3
    • getHighlightInnerColor

      public Color  getHighlightInnerColor(Component  c)
      返回在指定组件上渲染时斜角边框的内部高亮颜色。如果在实例化时未指定高亮颜色,则高亮颜色源自指定组件的背景颜色。
      参数:
      c - 可以导出高亮的组件
      返回:
      内部亮点Color
      自从:
      1.3
    • getShadowInnerColor

      public Color  getShadowInnerColor(Component  c)
      返回在指定组件上呈现时斜角边框的内部阴影颜色。如果在实例化时未指定阴影颜色,则阴影颜色源自指定组件的背景颜色。
      参数:
      c - 可以派生阴影的组件
      返回:
      内阴影Color
      自从:
      1.3
    • getShadowOuterColor

      public Color  getShadowOuterColor(Component  c)
      返回在指定组件上渲染时斜角边框的外部阴影颜色。如果在实例化时未指定阴影颜色,则阴影颜色源自指定组件的背景颜色。
      参数:
      c - 可以派生阴影的组件
      返回:
      外阴影Color
      自从:
      1.3
    • getHighlightOuterColor

      public Color  getHighlightOuterColor()
      返回斜角边框的外部突出显示颜色。如果在实例化时没有指定高亮颜色,将返回 null。
      返回:
      外部高亮 Colornull 如果没有指定高亮颜色
      自从:
      1.3
    • getHighlightInnerColor

      public Color  getHighlightInnerColor()
      返回斜角边框的内部高亮颜色。如果在实例化时没有指定高亮颜色,将返回 null。
      返回:
      内部高亮 Colornull 如果没有指定高亮颜色
      自从:
      1.3
    • getShadowInnerColor

      public Color  getShadowInnerColor()
      返回斜角边框的内部阴影颜色。如果在实例化时没有指定阴影颜色,将返回 null。
      返回:
      内部阴影 Colornull 如果没有指定阴影颜色
      自从:
      1.3
    • getShadowOuterColor

      public Color  getShadowOuterColor()
      返回斜角边框的外部阴影颜色。如果在实例化时没有指定阴影颜色,将返回 null。
      返回:
      外部阴影 Colornull 如果没有指定阴影颜色
      自从:
      1.3
    • getBevelType

      public int getBevelType()
      返回斜角边框的类型。
      返回:
      斜角边框类型,RAISEDLOWERED
    • isBorderOpaque

      public boolean isBorderOpaque()
      返回边框是否不透明。此实现返回 true
      指定者:
      isBorderOpaque 在接口 Border
      重写:
      isBorderOpaque 在类 AbstractBorder
      返回:
      true
    • paintRaisedBevel

      protected void paintRaisedBevel(Component  c, Graphics  g, int x, int y, int width, int height)
      为具有指定位置和大小的指定组件绘制凸起的斜面。
      参数:
      c - 正在为其绘制凸起斜角的组件
      g - 油漆图形
      x - 凸起斜面的 x 位置
      y - 凸起斜面的 y 位置
      width - 凸起斜面的宽度
      height - 凸起斜角的高度
    • paintLoweredBevel

      protected void paintLoweredBevel(Component  c, Graphics  g, int x, int y, int width, int height)
      为具有指定位置和大小的指定组件绘制降低的斜面。
      参数:
      c - 正在为其绘制降低斜角的组件
      g - 油漆图形
      x - 降低斜面的 x 位置
      y - 降低斜面的 y 位置
      width - 降低斜角的宽度
      height - 降低斜角的高度