private JComponent createNoPlannerFoundTextField() { String infoMessage = "No planner benchmarks have been found in the benchmarkDirectory (" + benchmarkAggregator.getBenchmarkDirectory() + ")."; JTextPane textPane = new JTextPane(); textPane.setEditable(false); textPane.setText(infoMessage); // center info message StyledDocument styledDocument = textPane.getStyledDocument(); SimpleAttributeSet center = new SimpleAttributeSet(); StyleConstants.setAlignment(center, StyleConstants.ALIGN_CENTER); StyleConstants.setBold(center, true); styledDocument.setParagraphAttributes(0, styledDocument.getLength(), center, false); return textPane; }
protected void addStylesToDocument(JTextPane outputArea) { StyledDocument doc = outputArea.getStyledDocument(); Style def = StyleContext.getDefaultStyleContext().getStyle(StyleContext.DEFAULT_STYLE); Style regular = doc.addStyle("regular", def); StyleConstants.setFontFamily(def, "Monospaced"); promptStyle = doc.addStyle("prompt", regular); StyleConstants.setForeground(promptStyle, Color.BLUE); commandStyle = doc.addStyle("command", regular); StyleConstants.setForeground(commandStyle, Color.MAGENTA); outputStyle = doc.addStyle("output", regular); StyleConstants.setBold(outputStyle, true); }
StyleConstants.setBold(set, random.nextBoolean()); StyleConstants.setItalic(set, random.nextBoolean()); StyleConstants.setUnderline(set, random.nextBoolean());
private static void addStyle(String name, Color bg, Color fg, boolean bold, boolean italic) { SimpleAttributeSet style = new SimpleAttributeSet(); StyleConstants.setFontFamily(style, HelperUi.FONT_UBUNTU_MONO.getFontName()); StyleConstants.setFontSize(style, HelperUi.FONT_UBUNTU_MONO.getSize()); StyleConstants.setBackground(style, bg); StyleConstants.setForeground(style, fg); StyleConstants.setBold(style, bold); StyleConstants.setItalic(style, italic); styles.put(name, style); }
public void run() { for (int i = 0; i < fnt.length; i++) { StyleConstants.setBold(mas, false); StyleConstants.setItalic(mas, false); StyleConstants.setFontFamily(mas, fnt[i]); e.printStackTrace(); StyleConstants.setBold(mas, true); dis(fnt[i] + " Bold"); try { e.printStackTrace(); StyleConstants.setBold(mas, false); dis(fnt[i] + " Italic"); try {
private static AttributeSet getUnusedFieldAttributes () { if (unusedFieldAttributeSet == null) { SimpleAttributeSet sas = new SimpleAttributeSet (); StyleConstants.setForeground (sas, new Color (115, 115, 115)); StyleConstants.setBold (sas, true); unusedFieldAttributeSet = sas; } return unusedFieldAttributeSet; }
private static SimpleAttributeSet createAttributeSet(Color c, boolean bold) { SimpleAttributeSet outAttributes = new SimpleAttributeSet(); StyleConstants.setForeground(outAttributes, c); StyleConstants.setBold(outAttributes, bold); return outAttributes; }
public int postBoldAt(String text, int position) { SimpleAttributeSet attribs = new SimpleAttributeSet(); StyleConstants.setBold(attribs, true); return postAttributed(text, position, attribs); }
private void addFormattedText(Color color, int start, int end, Map<Integer, Integer> ranges, Map<Integer, MutableAttributeSet> rangesStyle) { if (!inRanges(start, ranges) && !inRanges(end, ranges)) { ranges.put(start, end); MutableAttributeSet attr = styles.standard(color); StyleConstants.setBold(attr, true); attr.addAttribute("start", start); rangesStyle.put(start,attr); } }
private static void addStyle(String name, Color bg, Color fg, boolean bold, boolean italic) { SimpleAttributeSet style = new SimpleAttributeSet(); StyleConstants.setFontFamily(style, "Monospaced"); StyleConstants.setFontSize(style, 12); StyleConstants.setBackground(style, bg); StyleConstants.setForeground(style, fg); StyleConstants.setBold(style, bold); StyleConstants.setItalic(style, italic); styles.put(name, style); }
public static SimpleAttributeSet getStyle(final Color color, final boolean italic, final boolean bold, final String fontName, final int fontSize) { final SimpleAttributeSet style = new SimpleAttributeSet(); StyleConstants.setForeground(style, color); StyleConstants.setItalic(style, italic); StyleConstants.setBold(style, bold); StyleConstants.setFontFamily(style, fontName); StyleConstants.setFontSize(style, fontSize); return style; }
private void createStyles() { for (Color color : owlEditorKit.getWorkspace().getKeyWordColorMap().values()) { Style style = getStyledDocument().addStyle(color.toString(), null); StyleConstants.setForeground(style, color); StyleConstants.setBold(style, true); } StyleConstants.setForeground(getStyledDocument().addStyle(Color.BLACK.toString(), null), Color.BLACK); }
private void createStyles() { for (Color color : owlEditorKit.getWorkspace().getKeyWordColorMap().values()) { Style style = getStyledDocument().addStyle(color.toString(), null); StyleConstants.setForeground(style, color); StyleConstants.setBold(style, true); } StyleConstants.setForeground(getStyledDocument().addStyle(Color.BLACK.toString(), null), Color.BLACK); }
private void createStyles() { for (Color color : owlEditorKit.getWorkspace().getKeyWordColorMap().values()) { Style style = getStyledDocument().addStyle(color.toString(), null); StyleConstants.setForeground(style, color); StyleConstants.setBold(style, true); } StyleConstants.setForeground(getStyledDocument().addStyle(Color.BLACK.toString(), null), Color.BLACK); }
protected AttributeSet getStyle() { final MutableAttributeSet style = new SimpleAttributeSet(); StyleConstants.setFontFamily( style, "Dialog" ); StyleConstants.setFontSize( style, SettingsManager.getLocalPreferences().getChatRoomFontSize() ); StyleConstants.setForeground( style, textColor ); StyleConstants.setBold( style, bold ); StyleConstants.setItalic( style, italic ); StyleConstants.setUnderline( style, underline ); StyleConstants.setStrikeThrough( style, strikeThrough ); return style; }
protected void addStylesToDocument(JTextPane outputArea) { StyledDocument doc = outputArea.getStyledDocument(); Style def = StyleContext.getDefaultStyleContext().getStyle(StyleContext.DEFAULT_STYLE); Style regular = doc.addStyle("regular", def); StyleConstants.setFontFamily(def, "Monospaced"); promptStyle = doc.addStyle("prompt", regular); StyleConstants.setForeground(promptStyle, Color.BLUE); commandStyle = doc.addStyle("command", regular); StyleConstants.setForeground(commandStyle, Color.MAGENTA); outputStyle = doc.addStyle("output", regular); StyleConstants.setBold(outputStyle, true); }
protected void addStylesToDocument(JTextPane outputArea) { StyledDocument doc = outputArea.getStyledDocument(); Style def = StyleContext.getDefaultStyleContext().getStyle(StyleContext.DEFAULT_STYLE); Style regular = doc.addStyle("regular", def); StyleConstants.setFontFamily(def, "Monospaced"); promptStyle = doc.addStyle("prompt", regular); StyleConstants.setForeground(promptStyle, Color.BLUE); commandStyle = doc.addStyle("command", regular); StyleConstants.setForeground(commandStyle, Color.MAGENTA); outputStyle = doc.addStyle("output", regular); StyleConstants.setBold(outputStyle, true); }
protected void addStylesToDocument(JTextPane outputArea) { StyledDocument doc = outputArea.getStyledDocument(); Style def = StyleContext.getDefaultStyleContext().getStyle(StyleContext.DEFAULT_STYLE); Style regular = doc.addStyle("regular", def); StyleConstants.setFontFamily(def, "Monospaced"); promptStyle = doc.addStyle("prompt", regular); StyleConstants.setForeground(promptStyle, Color.BLUE); commandStyle = doc.addStyle("command", regular); StyleConstants.setForeground(commandStyle, Color.MAGENTA); outputStyle = doc.addStyle("output", regular); StyleConstants.setBold(outputStyle, true); }
protected void addStylesToDocument(JTextPane outputArea) { StyledDocument doc = outputArea.getStyledDocument(); Style def = StyleContext.getDefaultStyleContext().getStyle(StyleContext.DEFAULT_STYLE); Style regular = doc.addStyle("regular", def); StyleConstants.setFontFamily(def, "Monospaced"); promptStyle = doc.addStyle("prompt", regular); StyleConstants.setForeground(promptStyle, Color.BLUE); commandStyle = doc.addStyle("command", regular); StyleConstants.setForeground(commandStyle, Color.MAGENTA); outputStyle = doc.addStyle("output", regular); StyleConstants.setBold(outputStyle, true); }