模块 java.desktop

接口 MutableAttributeSet

所有父级接口:
AttributeSet
所有已知的子接口:
Style
所有已知的实现类:
AbstractDocument.AbstractElement , AbstractDocument.BranchElement , AbstractDocument.LeafElement , DefaultStyledDocument.SectionElement , HTMLDocument.BlockElement , HTMLDocument.RunElement , SimpleAttributeSet , StyleContext.NamedStyle

public interface MutableAttributeSet extends AttributeSet
唯一属性的可变集合的通用接口。实现可能希望提供以下形式的构造函数:

 public XXXAttributeSet(ConstAttributeSet source); 
  • 方法详情

    • addAttribute

      void addAttribute(Object  name, Object  value)
      创建一个与此类似的新属性集,不同之处在于它包含具有给定名称和值的属性。该对象必须是不可变的,或者不会被任何客户端改变。
      参数:
      name - 名字
      value - 值
    • addAttributes

      void addAttributes(AttributeSet  attributes)
      创建一个与此类似的新属性集,不同之处在于它包含给定的属性和值。
      参数:
      attributes - 属性集
    • removeAttribute

      void removeAttribute(Object  name)
      删除具有给定 name 的属性。
      参数:
      name - 属性名称
    • removeAttributes

      void removeAttributes(Enumeration <?> names)
      删除具有给定 names 的属性集。
      参数:
      names - 名称集
    • removeAttributes

      void removeAttributes(AttributeSet  attributes)
      删除一组具有给定 name 的属性。
      参数:
      attributes - 属性集
    • setResolveParent

      void setResolveParent(AttributeSet  parent)
      设置解析父级。如果未在本地定义属性,则这是要解析的属性集。
      参数:
      parent - 父母