From 0656e8548566f95c7886acf58ef8170576dcfc99 Mon Sep 17 00:00:00 2001 From: Chrriis Date: Mon, 29 Apr 2013 17:27:57 +0200 Subject: [PATCH] [#1177] Add SQL Console module to jOOQ - fix font issue and prepare for RSyntaxTextArea update. --- .../src/main/java/org/jooq/debug/console/SqlTextArea.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/jOOQ-console/src/main/java/org/jooq/debug/console/SqlTextArea.java b/jOOQ-console/src/main/java/org/jooq/debug/console/SqlTextArea.java index 33181bcaf1..0906303882 100644 --- a/jOOQ-console/src/main/java/org/jooq/debug/console/SqlTextArea.java +++ b/jOOQ-console/src/main/java/org/jooq/debug/console/SqlTextArea.java @@ -79,11 +79,12 @@ public class SqlTextArea extends RSyntaxTextArea { setMatchedBracketBGColor(null); setMatchedBracketBorderColor(new Color(192, 192, 192)); getActionMap().put("copy", new RSyntaxTextAreaEditorKit.CopyAsRtfAction()); - Font editorFont = getFont().deriveFont(UIManager.getFont("TextField.font").getSize2D()); + Font editorFont = UIManager.getFont("TextArea.font"); + editorFont = new Font("Monospaced", editorFont.getStyle(), editorFont.getSize()); SyntaxScheme syntaxScheme = getSyntaxScheme(); syntaxScheme.setStyle(Token.SEPARATOR, new Style(new Color(200, 0, 0), null)); syntaxScheme.setStyle(Token.RESERVED_WORD, new Style(Color.BLUE, null, editorFont)); - setFont(new Font("Monospaced", editorFont.getStyle(), editorFont.getSize())); + setFont(editorFont); addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { @@ -92,6 +93,7 @@ public class SqlTextArea extends RSyntaxTextArea { switch(e.getKeyCode()) { case KeyEvent.VK_P: if(isControlDown && isShiftDown) { + //int position = RSyntaxUtilities.getMatchingBracketPosition(SqlTextArea.this, null).y; int position = RSyntaxUtilities.getMatchingBracketPosition(SqlTextArea.this); if(position >= 0) { setCaretPosition(position + 1);