private Color getDefaultBackColor(){ EditorUI editorUI = getEditorUI(); if (editorUI!=null){ // font in folding coloring not available, get default (or inherited) Coloring defaultColoring = editorUI.getDefaultColoring(); if (defaultColoring!=null){ return defaultColoring.getBackColor(); } } return SettingsDefaults.defaultBackColor; }
private Color getDefaultBackColor(){ // font in folding coloring not available, get default (or inherited) Coloring defaultColoring = getEditorUI().getDefaultColoring(); if (defaultColoring!=null){ return defaultColoring.getBackColor(); } return SettingsDefaults.defaultBackColor; }
protected void updateScrollPaneCornerColor() { Coloring lineColoring = (Coloring)getColoringMap().get(SettingsNames.LINE_NUMBER_COLORING); Coloring defaultColoring = (Coloring)getDefaultColoring(); Color backgroundColor; if (lineColoring.getBackColor() != null) backgroundColor = lineColoring.getBackColor(); else backgroundColor = defaultColoring.getBackColor(); glyphCorner.setBackground(backgroundColor); } }
protected void updateScrollPaneCornerColor() { Coloring lineColoring = (Coloring) getColoringMap().get(SettingsNames.LINE_NUMBER_COLORING); Coloring defaultColoring = (Coloring) getDefaultColoring(); Color backgroundColor; if (lineColoring.getBackColor() != null) backgroundColor = lineColoring.getBackColor(); else backgroundColor = defaultColoring.getBackColor(); glyphCorner.setBackground(backgroundColor); } }
private Font getDefaultColoringFont(){ // font in folding coloring not available, get default (or inherited) Coloring defaultColoring = getEditorUI().getDefaultColoring(); if (defaultColoring!=null){ if (defaultColoring.getFont() != null){ return defaultColoring.getFont(); } } return SettingsDefaults.defaultFont; }
private Color getDefaultForeColor(){ // font in folding coloring not available, get default (or inherited) Coloring defaultColoring = getEditorUI().getDefaultColoring(); if (defaultColoring!=null && defaultColoring.getForeColor()!=null){ return defaultColoring.getForeColor(); } return SettingsDefaults.defaultForeColor; }
private Color getDefaultForeColor(){ EditorUI editorUI = getEditorUI(); if (editorUI!=null){ // font in folding coloring not available, get default (or inherited) Coloring defaultColoring = editorUI.getDefaultColoring(); if (defaultColoring!=null && defaultColoring.getForeColor()!=null){ return defaultColoring.getForeColor(); } } return SettingsDefaults.defaultForeColor; }
private Font getDefaultColoringFont(){ // font in folding coloring not available, get default (or inherited) EditorUI editorUI = getEditorUI(); if (editorUI!=null){ Coloring defaultColoring = editorUI.getDefaultColoring(); if (defaultColoring!=null){ if (defaultColoring.getFont() != null){ return defaultColoring.getFont(); } } } return SettingsDefaults.defaultFont; }
void checkLineLimit() { BaseDocument doc = getDocument(); if (doc != null) { Integer lineLimit = (Integer)doc.getProperty(BaseDocument.LINE_LIMIT_PROP); if (lineLimit != null) { if (component != null) { // Not using FM cache - could be called too early FontMetrics fm = component.getFontMetrics(getDefaultColoring().getFont()); if (fm != null) { int charWidth = fm.stringWidth("A"); // NOI18N updateVirtualWidth(charWidth * lineLimit.intValue() + lineNumberWidth); } } } } }
void checkLineLimit() { BaseDocument doc = getDocument(); if (doc != null) { Integer lineLimit = (Integer) doc.getProperty(BaseDocument.LINE_LIMIT_PROP); if (lineLimit != null) { if (component != null) { // Not using FM cache - could be called too early FontMetrics fm = component.getFontMetrics(getDefaultColoring().getFont()); if (fm != null) { int charWidth = fm.stringWidth("A"); updateVirtualWidth(charWidth * lineLimit.intValue() + lineNumberWidth); } } } } }
private int computeLineNumberDigitWidth(Graphics g){ // Handle line number fonts and widths Coloring dc = getDefaultColoring(); Coloring lnc = (Coloring)getColoringMap().get(SettingsNames.LINE_NUMBER_COLORING); if (lnc != null) { Font lnFont = lnc.getFont(); if (lnFont == null) { lnFont = dc.getFont(); } if (component == null) return lineNumberDigitWidth; FontMetrics lnFM = (g == null) ? FontMetricsCache.getFontMetrics(lnFont, component) : g.getFontMetrics(lnFont); if (lnFM == null) return lineNumberDigitWidth; int maxWidth = 1; char[] digit = new char[1]; // will be used for '0' - '9' for (int i = 0; i <= 9; i++) { digit[0] = (char)('0' + i); maxWidth = Math.max(maxWidth, lnFM.charsWidth(digit, 0, 1)); } return maxWidth; } return lineNumberDigitWidth; }
String settingName = (evt != null) ? evt.getSettingName() : null; if (kitClass != null) { Coloring dc = editorUI.getDefaultColoring(); coloring = editorUI.getColoring(SettingsNames.STATUS_BAR_COLORING); boldColoring = editorUI.getColoring(SettingsNames.STATUS_BAR_BOLD_COLORING);
String settingName = (evt != null) ? evt.getSettingName() : null; if (kitClass != null) { Coloring dc = editorUI.getDefaultColoring(); coloring = editorUI.getColoring(SettingsNames.STATUS_BAR_COLORING); boldColoring = editorUI.getColoring(SettingsNames.STATUS_BAR_BOLD_COLORING);
return ; Coloring lineColoring = (Coloring)editorUI.getColoringMap().get(SettingsNames.LINE_NUMBER_COLORING); Coloring defaultColoring = (Coloring)editorUI.getDefaultColoring();
Coloring defaultColoring = (Coloring) editorUI.getDefaultColoring();
/** Called when the <tt>BaseTextUI</tt> is being installed * into the component. */ protected void installUI(JTextComponent c) { synchronized (getComponentLock()) { this.component = c; putProperty(COMPONENT_PROPERTY, c); // listen on component component.addPropertyChangeListener(this); component.addFocusListener(focusL); // listen on caret Caret caret = component.getCaret(); if (caret != null) { caret.addChangeListener(this); } BaseDocument doc = getDocument(); if (doc != null) { modelChanged(null, doc); } } // Make sure all the things depending on non-null component will be updated settingsChange(null); // fix for issue #16352 getDefaultColoring().apply(component); }
/** * Called when the <tt>BaseTextUI</tt> is being installed into the * component. */ protected void installUI(JTextComponent c) { synchronized (getComponentLock()) { this.component = c; putProperty(COMPONENT_PROPERTY, c); // listen on component component.addPropertyChangeListener(this); component.addFocusListener(focusL); // listen on caret Caret caret = component.getCaret(); if (caret != null) { caret.addChangeListener(this); } BaseDocument doc = getDocument(); if (doc != null) { modelChanged(null, doc); } } // Make sure all the things depending on non-null component will be // updated settingsChange(null); // fix for issue #16352 getDefaultColoring().apply(component); }
if (editorUI==null) return; Coloring foldingColoring = editorUI.getColoring(SettingsNames.CODE_FOLDING_COLORING); Coloring defaultColoring = editorUI.getDefaultColoring();
getDefaultColoring().apply(component); FontMetricsCache.Info fmcInfo = FontMetricsCache.getInfo(getDefaultColoring().getFont()); defaultSpaceWidth = fmcInfo.getSpaceWidth(g);
ctx.y = ctx.startY; ctx.lineHeight = ctx.editorUI.getLineHeight(); ctx.defaultColoring = ctx.editorUI.getDefaultColoring(); ctx.tabSize = ctx.doc.getTabSize();