本文整理了Java中javax.swing.text.SimpleAttributeSet.removeAttribute()
方法的一些代码示例,展示了SimpleAttributeSet.removeAttribute()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SimpleAttributeSet.removeAttribute()
方法的具体详情如下:
包路径:javax.swing.text.SimpleAttributeSet
类名称:SimpleAttributeSet
方法名:removeAttribute
暂无
代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-ui
private void insertAttr(SimpleAttributeSet attrs, Object key, Object value)
{
while(attrs.isDefined(key))
{
attrs.removeAttribute(key);
}
attrs.addAttribute(key, value);
}
}
代码示例来源:origin: cpesch/RouteConverter
return;
textAttribs.removeAttribute(Foreground);
textAttribs.addAttribute(Foreground, color);
setForeground(color);
代码示例来源:origin: cpesch/RouteConverter
public void setViewData(View v) {
doc = (HTMLDocument) v.getDocument();
textAttribs = new SimpleAttributeSet();
textAttribs.removeAttribute(FontSize);
textAttribs.removeAttribute(Bold);
textAttribs.removeAttribute(Italic);
Font font = getFont();
textAttribs.addAttribute(FontFamily, font.getName());
textAttribs.addAttribute(FontSize, font.getSize());
textAttribs.addAttribute(Bold, font.isBold());
textAttribs.addAttribute(Italic, font.isItalic());
}
代码示例来源:origin: javax.help/javahelp
return;
textAttribs.removeAttribute(StyleConstants.Foreground);
textAttribs.addAttribute(StyleConstants.Foreground, color);
setForeground(color);
代码示例来源:origin: cpesch/RouteConverter
public void setTextFontWeight(String weight) {
boolean isBold = "bold".equals(weight);
textAttribs.removeAttribute(Bold);
textAttribs.addAttribute(Bold, isBold);
setFont(getAttributeSetFont(textAttribs));
Font font = getFont();
}
代码示例来源:origin: cpesch/RouteConverter
public void setTextFontStyle(String style) {
boolean isItalic = "italic".equals(style);
textAttribs.removeAttribute(Italic);
textAttribs.addAttribute(Italic, isItalic);
setFont(getAttributeSetFont(textAttribs));
Font font = getFont();
}
代码示例来源:origin: javax.help/javahelp
/**
* Sets the text Font Style for the activator text.
* Valid font styles are
* <ul>
* <li>plain
* <li>italic
* </ul>
*/
public void setTextFontStyle(String style) {
boolean isItalic=false;
if (style.compareTo("italic") == 0) {
isItalic = true;
} else {
isItalic = false;
}
textAttribs.removeAttribute(StyleConstants.Italic);
textAttribs.addAttribute(StyleConstants.Italic, new Boolean(isItalic));
setFont(getAttributeSetFont(textAttribs));
Font font = getFont();
}
代码示例来源:origin: javax.help/javahelp
/**
* Sets the text Font Weigth for the activator text.
* Valid weights are
* <ul>
* <li>plain
* <li>bold
* </ul>
*/
public void setTextFontWeight(String weight) {
boolean isBold=false;
if (weight.compareTo("bold") == 0) {
isBold = true;
} else {
isBold = false;
}
textAttribs.removeAttribute(StyleConstants.Bold);
textAttribs.addAttribute(StyleConstants.Bold, new Boolean(isBold));
setFont(getAttributeSetFont(textAttribs));
Font font = getFont();
}
代码示例来源:origin: javax.help/javahelp
/**
* Sets the text Font family for the activator text.
* For JDK 1.1 this must a family name of Dialog, DialogInput, Monospaced,
* Serif, SansSerif, or Symbol.
*/
public void setTextFontFamily(String family) {
textAttribs.removeAttribute(StyleConstants.FontFamily);
textAttribs.addAttribute(StyleConstants.FontFamily, family);
setFont(getAttributeSetFont(textAttribs));
Font font = getFont();
}
代码示例来源:origin: cpesch/RouteConverter
public void setTextFontFamily(String family) {
textAttribs.removeAttribute(FontFamily);
textAttribs.addAttribute(FontFamily, family);
setFont(getAttributeSetFont(textAttribs));
Font font = getFont();
}
代码示例来源:origin: javax.help/javahelp
textAttribs.removeAttribute(StyleConstants.FontSize);
textAttribs.removeAttribute(StyleConstants.Bold);
textAttribs.removeAttribute(StyleConstants.Italic);
textAttribs.addAttribute(StyleConstants.FontFamily,
font.getName());
代码示例来源:origin: cpesch/RouteConverter
return;
textAttribs.removeAttribute(FontSize);
textAttribs.addAttribute(FontSize, newsize);
setFont(getAttributeSetFont(textAttribs));
代码示例来源:origin: javax.help/javahelp
return;
textAttribs.removeAttribute(StyleConstants.FontSize);
textAttribs.addAttribute(StyleConstants.FontSize,
new Integer(newsize));
代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-ui
} else {
sasText.removeAttribute(HTML.Tag.P);
SimpleAttributeSet attribs = new SimpleAttributeSet();
attribs.addAttribute(HTML.Attribute.ALIGN, a_);
内容来源于网络,如有侵权,请联系作者删除!