public static void loadCommonSettings(MainWindow mainWindow, RSyntaxTextArea area) { area.setAntiAliasingEnabled(true); mainWindow.getEditorTheme().apply(area); JadxSettings settings = mainWindow.getSettings(); area.setFont(settings.getFont()); }
@Override public void actionPerformed(ActionEvent e) { JFontChooser fontChooser = new JFontChooser(); fontChooser.setSelectedFont(textArea.getFont()); fontChooser.setSelectedFontSize(textArea.getFont().getSize()); int result = fontChooser.showDialog(mainWindow); if (result == JFontChooser.OK_OPTION) { textArea.setFont(fontChooser.getSelectedFont()); luytenPrefs.setFont_size(fontChooser.getSelectedFontSize()); } } });
textArea.setFont(new Font(textArea.getFont().getName(), textArea.getFont().getStyle(), luytenPrefs.getFont_size()));
/** * Set the font for all token types. * * @param textArea The text area to modify. * @param font The font to use. */ public static void setFont(RSyntaxTextArea textArea, Font font) { if (font != null) { SyntaxScheme ss = textArea.getSyntaxScheme(); ss = (SyntaxScheme) ss.clone(); for (int i = 0; i < ss.getStyleCount(); i++) { if (ss.getStyle(i) != null) { ss.getStyle(i).font = font; } } textArea.setSyntaxScheme(ss); textArea.setFont(font); } }
public void decFontSize(float delta) { float size = (float)editor.getFont().getSize() - delta; if (size > 8) { editor.setFont(editor.getFont().deriveFont(size)); System.out.println(size); } }
public void incFontSize(float delta) { float size = (float)editor.getFont().getSize() + delta; if (size < 32) { editor.setFont(editor.getFont().deriveFont(size)); System.out.println(size); } } }
textArea.setFont(baseFont); textArea.setBackground(bgColor); textArea.setCaretColor(caretColor);
public void setTamanhoFonteEditor(float tamanho) { if ((tamanho != textArea.getFont().getSize()) && (tamanho >= TAMANHO_MINIMO_FONTE) && (tamanho <= TAMANHO_MAXIMO_FONTE)) { textArea.setFont(textArea.getFont().deriveFont(tamanho)); Configuracoes.getInstancia().setTamanhoFonteEditor(tamanho); } }
@Override public void initLayout(ScriptingWindow scriptingWindow) { m_scriptingWindow = scriptingWindow; m_scriptEditor = new RSyntaxTextArea(); m_scriptEditor.setFont(new Font(Font.MONOSPACED, Font.PLAIN, m_scriptEditor.getFont().getSize())); m_scriptEditor.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_GROOVY); m_scriptEditor.setCodeFoldingEnabled(true); RTextScrollPane scrollPaneEditor = new RTextScrollPane(m_scriptEditor); // scrollPaneEditor.setMinimumSize(minimumSize1); m_csp = new CollapsibleSectionPanel(); m_scriptingWindow.frame.getContentPane().add(m_csp); m_csp.add(scrollPaneEditor); initSearchDialogs(); }
sourceTextArea.setFont(new Font("monospaced", Font.PLAIN, 12)); sourceTextArea.setCodeFoldingEnabled(true); sourceTextArea.setEditable(false);
@Override public void updateConfiguration() { this.editor.setFont(PreferencesManager.getInstance().getFont(PreferencesManager.getInstance().getPreferences(), SpecificKeys.PROPERTY_TEXT_EDITOR_FONT, DEFAULT_FONT)); this.editor.revalidate(); this.editor.repaint(); }
textArea.setFont(font); textArea.setSyntaxScheme(createSyntaxScheme(font, Color.orange)); textArea.setBackground(Color.orange);
this.editor.setFont(PreferencesManager.getInstance().getFont(PreferencesManager.getInstance().getPreferences(), SpecificKeys.PROPERTY_TEXT_EDITOR_FONT, DEFAULT_FONT));
/** * Called by constructors to initialize common properties of the text * editor. */ protected void init() { // Programmer's editors should default to a monospaced font. Note // that WindowsLookAndFeel defaults to a monospaced font, but other // LookAndFeels don't. Font font = getFont(); setFont(new Font("Monospaced", font.getStyle(),font.getSize())); // Set some RSyntaxTextArea default values. syntaxStyleKey = SYNTAX_STYLE_NONE; setMatchedBracketBGColor(getDefaultBracketMatchBGColor()); setMatchedBracketBorderColor(getDefaultBracketMatchBorderColor()); setBracketMatchingEnabled(true); setSelectionColor(getDefaultSelectionColor()); // Set auto-indent related stuff. setAutoIndentEnabled(true); setClearWhitespaceLinesEnabled(true); setHyperlinksEnabled(true); setLinkScanningMask(InputEvent.CTRL_DOWN_MASK); setHyperlinkForeground(Color.BLUE); isScanningForLinks = false; restoreDefaultSyntaxScheme(); }
@Override public void updateConfiguration() { initPlantUml(); updateGraphvizLabelVisibility(); this.imageComponent.updateConfig(); this.editor.setFont(PreferencesManager.getInstance().getFont(PreferencesManager.getInstance().getPreferences(), SpecificKeys.PROPERTY_TEXT_EDITOR_FONT, DEFAULT_FONT)); this.editor.revalidate(); this.editor.repaint(); }
if (mimeType != null) { final RSyntaxTextArea syntaxArea = new RSyntaxTextArea(8, 17); syntaxArea.setFont(WidgetUtils.FONT_MONOSPACE); syntaxArea.setTabSize(2); syntaxArea.setSyntaxEditingStyle(mimeType);
textArea.setFont(baseFont); textArea.setBackground(bgColor); textArea.setCaretColor(caretColor);