本文整理汇总了Java中com.intellij.openapi.editor.colors.EditorColorsScheme.getEditorFontSize方法的典型用法代码示例。如果您正苦于以下问题:Java EditorColorsScheme.getEditorFontSize方法的具体用法?Java EditorColorsScheme.getEditorFontSize怎么用?Java EditorColorsScheme.getEditorFontSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.editor.colors.EditorColorsScheme
的用法示例。
在下文中一共展示了EditorColorsScheme.getEditorFontSize方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createTaskInfoPanel
import com.intellij.openapi.editor.colors.EditorColorsScheme; //导入方法依赖的package包/类
@Override
public JComponent createTaskInfoPanel(Project project) {
myTaskTextPane = new JTextPane();
final JBScrollPane scrollPane = new JBScrollPane(myTaskTextPane);
myTaskTextPane.setContentType(new HTMLEditorKit().getContentType());
final EditorColorsScheme editorColorsScheme = EditorColorsManager.getInstance().getGlobalScheme();
int fontSize = editorColorsScheme.getEditorFontSize();
final String fontName = editorColorsScheme.getEditorFontName();
final Font font = new Font(fontName, Font.PLAIN, fontSize);
String bodyRule = "body { font-family: " + font.getFamily() + "; " +
"font-size: " + font.getSize() + "pt; }" +
"pre {font-family: Courier; display: inline; ine-height: 50px; padding-top: 5px; padding-bottom: 5px; padding-left: 5px; background-color:"
+ ColorUtil.toHex(ColorUtil.dimmer(UIUtil.getPanelBackground())) + ";}" +
"code {font-family: Courier; display: flex; float: left; background-color:"
+ ColorUtil.toHex(ColorUtil.dimmer(UIUtil.getPanelBackground())) + ";}";
((HTMLDocument)myTaskTextPane.getDocument()).getStyleSheet().addRule(bodyRule);
myTaskTextPane.setEditable(false);
if (!UIUtil.isUnderDarcula()) {
myTaskTextPane.setBackground(EditorColorsManager.getInstance().getGlobalScheme().getDefaultBackground());
}
myTaskTextPane.setBorder(new EmptyBorder(20, 20, 0, 10));
myTaskTextPane.addHyperlinkListener(BrowserHyperlinkListener.INSTANCE);
return scrollPane;
}
示例2: tweakEditorAndFireUpdateUI
import com.intellij.openapi.editor.colors.EditorColorsScheme; //导入方法依赖的package包/类
private static void tweakEditorAndFireUpdateUI(UISettings settings, boolean inPresentation) {
EditorColorsScheme globalScheme = EditorColorsManager.getInstance().getGlobalScheme();
int fontSize = inPresentation ? settings.PRESENTATION_MODE_FONT_SIZE : globalScheme.getEditorFontSize();
if (inPresentation) {
ourSavedConsoleFontSize = globalScheme.getConsoleFontSize();
globalScheme.setConsoleFontSize(fontSize);
}
else {
globalScheme.setConsoleFontSize(ourSavedConsoleFontSize);
}
for (Editor editor : EditorFactory.getInstance().getAllEditors()) {
if (editor instanceof EditorEx) {
((EditorEx)editor).setFontSize(fontSize);
}
}
UISettings.getInstance().fireUISettingsChanged();
LafManager.getInstance().updateUI();
EditorUtil.reinitSettings();
}
示例3: Context
import com.intellij.openapi.editor.colors.EditorColorsScheme; //导入方法依赖的package包/类
Context(@NotNull CharSequence charSequence, @NotNull EditorColorsScheme scheme, int indentSymbolsToStrip) {
myText = charSequence;
myDefaultForeground = scheme.getDefaultForeground();
myDefaultBackground = scheme.getDefaultBackground();
// Java assumes screen resolution of 72dpi when calculating font size in pixels. External applications are supposedly using correct
// resolution, so we need to adjust font size for copied text to look the same in them.
// (See https://docs.oracle.com/javase/7/docs/webnotes/tsg/TSG-Desktop/html/java2d.html#gdlwn)
// Java on Mac is not affected by this issue.
int javaFontSize = scheme.getEditorFontSize();
float fontSize = SystemInfo.isMac || ApplicationManager.getApplication().isHeadlessEnvironment() ?
javaFontSize :
javaFontSize * 72f / Toolkit.getDefaultToolkit().getScreenResolution();
builder = new SyntaxInfo.Builder(myDefaultForeground, myDefaultBackground, fontSize);
myIndentSymbolsToStrip = indentSymbolsToStrip;
}
示例4: createTaskTextPane
import com.intellij.openapi.editor.colors.EditorColorsScheme; //导入方法依赖的package包/类
@NotNull
private static JTextPane createTaskTextPane() {
final JTextPane taskTextPane = new JTextPane();
taskTextPane.setContentType(new HTMLEditorKit().getContentType());
final EditorColorsScheme editorColorsScheme = EditorColorsManager.getInstance().getGlobalScheme();
int fontSize = editorColorsScheme.getEditorFontSize();
final String fontName = editorColorsScheme.getEditorFontName();
final Font font = new Font(fontName, Font.PLAIN, fontSize);
String bodyRule = "body { font-family: " + font.getFamily() + "; " +
"font-size: " + font.getSize() + "pt; }";
((HTMLDocument)taskTextPane.getDocument()).getStyleSheet().addRule(bodyRule);
taskTextPane.setEditable(false);
if (!UIUtil.isUnderDarcula()) {
taskTextPane.setBackground(EditorColorsManager.getInstance().getGlobalScheme().getDefaultBackground());
}
taskTextPane.setBorder(new EmptyBorder(15, 20, 0, 100));
return taskTextPane;
}
示例5: execute
import com.intellij.openapi.editor.colors.EditorColorsScheme; //导入方法依赖的package包/类
@Override
public void execute(Editor editor, DataContext dataContext) {
if (!(editor instanceof EditorEx)) {
return;
}
EditorColorsScheme globalScheme = EditorColorsManager.getInstance().getGlobalScheme();
int fontSize = editor.getUserData(ConsoleViewUtil.EDITOR_IS_CONSOLE_VIEW) == Boolean.TRUE
? globalScheme.getConsoleFontSize() : globalScheme.getEditorFontSize();
EditorEx editorEx = (EditorEx)editor;
editorEx.setFontSize(fontSize);
}
示例6: FQNameCellRenderer
import com.intellij.openapi.editor.colors.EditorColorsScheme; //导入方法依赖的package包/类
public FQNameCellRenderer() {
EditorColorsScheme scheme = EditorColorsManager.getInstance().getGlobalScheme();
FONT = new Font(scheme.getEditorFontName(), Font.PLAIN, scheme.getEditorFontSize());
setOpaque(true);
}
示例7: getEditorFont
import com.intellij.openapi.editor.colors.EditorColorsScheme; //导入方法依赖的package包/类
public static Font getEditorFont() {
EditorColorsScheme scheme = EditorColorsManager.getInstance().getGlobalScheme();
int size = UISettings.getInstance().PRESENTATION_MODE
? UISettings.getInstance().PRESENTATION_MODE_FONT_SIZE - 4 : scheme.getEditorFontSize();
return new Font(scheme.getEditorFontName(), Font.PLAIN, size);
}
示例8: CellRenderer
import com.intellij.openapi.editor.colors.EditorColorsScheme; //导入方法依赖的package包/类
public CellRenderer(String name) {
myName = name;
EditorColorsScheme scheme = EditorColorsManager.getInstance().getGlobalScheme();
FONT = new Font(scheme.getEditorFontName(), Font.PLAIN, scheme.getEditorFontSize());
setOpaque(true);
}