Lines Matching refs:style

288             Style style = ((StyledDocument) document).getStyle(StyleContext.DEFAULT_STYLE);
289 if (style.getAttribute(FONT_ATTRIBUTE_KEY) != null) {
290 style.removeAttribute(FONT_ATTRIBUTE_KEY);
320 Style style = ((StyledDocument) document).getStyle(StyleContext.DEFAULT_STYLE);
321 if (! font.equals(style.getAttribute(FONT_ATTRIBUTE_KEY))) {
322 style.addAttribute(FONT_ATTRIBUTE_KEY, font);
333 * Update the color in the default style of the document.
336 * from the document's style
340 Style style = doc.getStyle(StyleContext.DEFAULT_STYLE);
342 if (style == null) {
347 if (style.getAttribute(StyleConstants.Foreground) != null) {
348 style.removeAttribute(StyleConstants.Foreground);
351 if (! color.equals(StyleConstants.getForeground(style))) {
352 StyleConstants.setForeground(style, color);
358 * Update the font in the default style of the document.
361 * from the document's style
365 Style style = doc.getStyle(StyleContext.DEFAULT_STYLE);
367 if (style == null) {
371 String fontFamily = (String) style.getAttribute(StyleConstants.FontFamily);
372 Integer fontSize = (Integer) style.getAttribute(StyleConstants.FontSize);
373 Boolean isBold = (Boolean) style.getAttribute(StyleConstants.Bold);
374 Boolean isItalic = (Boolean) style.getAttribute(StyleConstants.Italic);
375 Font fontAttribute = (Font) style.getAttribute(FONT_ATTRIBUTE_KEY);
378 style.removeAttribute(StyleConstants.FontFamily);
381 style.removeAttribute(StyleConstants.FontSize);
384 style.removeAttribute(StyleConstants.Bold);
387 style.removeAttribute(StyleConstants.Italic);
390 style.removeAttribute(FONT_ATTRIBUTE_KEY);
394 StyleConstants.setFontFamily(style, font.getName());
398 StyleConstants.setFontSize(style, font.getSize());
402 StyleConstants.setBold(style, font.isBold());
406 StyleConstants.setItalic(style, font.isItalic());
409 style.addAttribute(FONT_ATTRIBUTE_KEY, font);