javax.swing.text.AttributeSet.copyAttributes()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(102)

本文整理了Java中javax.swing.text.AttributeSet.copyAttributes()方法的一些代码示例,展示了AttributeSet.copyAttributes()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AttributeSet.copyAttributes()方法的具体详情如下:
包路径:javax.swing.text.AttributeSet
类名称:AttributeSet
方法名:copyAttributes

AttributeSet.copyAttributes介绍

暂无

代码示例

代码示例来源:origin: org.gosu-lang.gosu/gosu-editor

private Collection<? extends ElementSpec> _getElementsForString( String str, AttributeSet a )
{
 a = a.copyAttributes();
 char[] chars = str.toCharArray();
 List<ElementSpec> ret = new ArrayList<ElementSpec>();
 ret.add( new ElementSpec( a, ElementSpec.ContentType, chars, 0, str.length() ) );
 return ret;
}

代码示例来源:origin: org.gosu-lang.gosu/gosu-lab

private Collection<? extends ElementSpec> _getElementsForString( String str, AttributeSet a )
{
 a = a.copyAttributes();
 char[] chars = str.toCharArray();
 List<ElementSpec> ret = new ArrayList<>();
 if( !handleStackTraceLink( str, ret, a ) &&
   !handleTestResults( str, ret, a ) )
 {
  ret.add( new ElementSpec( a, ElementSpec.ContentType, chars, 0, str.length() ) );
 }
 return ret;
}

代码示例来源:origin: blurpy/kouchat

final MutableAttributeSet smileyAttr = (MutableAttributeSet) attr.copyAttributes();

代码示例来源:origin: blurpy/kouchat

final MutableAttributeSet urlAttr = (MutableAttributeSet) attr.copyAttributes();

代码示例来源:origin: stackoverflow.com

AttributeSet as = element.getAttributes();
MutableAttributeSet asNew = new SimpleAttributeSet(as.copyAttributes());
StyleConstants.setBold(asNew, !StyleConstants.isBold(as));
doc.setCharacterAttributes(start, textPane.getSelectedText().length(), asNew, true);

代码示例来源:origin: stackoverflow.com

AttributeSet as = element.getAttributes();
MutableAttributeSet asNew = new SimpleAttributeSet(as.copyAttributes());
StyleConstants.setBold(asNew, !StyleConstants.isBold(as));
doc.setCharacterAttributes(selectionStart,textPane.getSelectedText().length(), asNew, true);

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-ui

DefaultDocumentEvent changes = new DefaultDocumentEvent(start, e.getEndOffset() - start,
  DocumentEvent.EventType.CHANGE);
AttributeSet sCopy = a.copyAttributes();
changes.addEdit(new AttributeUndoableEdit(e, sCopy, false));
MutableAttributeSet attr = (MutableAttributeSet) e.getAttributes();

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-team-commons

Style hlStyle = doc.getStyle("regularBlue-findtype");               // NOI18N
pane.putClientProperty(PREV_HIGHLIGHT_ATTRIBUTES, as.copyAttributes());
doc.setCharacterAttributes(h.startOffset, h.endOffset - h.startOffset, hlStyle, true);

相关文章