1 19 20 package org.netbeans.editor; 21 22 import java.awt.Color ; 23 import java.awt.Font ; 24 import java.awt.Insets ; 25 import java.awt.Dimension ; 26 import java.awt.event.KeyEvent ; 27 import java.awt.event.InputEvent ; 28 import javax.swing.KeyStroke ; 29 import javax.swing.UIManager ; 30 import java.util.Map ; 31 import java.util.HashMap ; 32 33 43 44 public class SettingsDefaults { 45 46 private static final Integer INTEGER_MAX_VALUE = new Integer (Integer.MAX_VALUE); 47 48 public static final Color defaultCaretColor = Color.black; 50 51 public static final Coloring emptyColoring = new Coloring(null, null, null); 53 54 private static int defaultFontSize; static { 57 Integer customFontSize = (Integer )UIManager.get("customFontSize"); if (customFontSize != null) { 59 defaultFontSize = customFontSize.intValue(); 60 } else { 61 Font systemDefaultFont = UIManager.getFont("TextField.font"); defaultFontSize = (systemDefaultFont != null) 63 ? systemDefaultFont.getSize() 64 : 12; 65 } 66 } 67 68 public static final Font defaultFont = new Font ("Monospaced", Font.PLAIN, defaultFontSize); public static final Color defaultForeColor = Color.black; 70 public static final Color defaultBackColor = Color.white; 71 public static final Coloring defaultColoring 72 = new Coloring(defaultFont, defaultForeColor, defaultBackColor); 73 public static final Color defaultLineNumberForeColor = Color.BLACK; 75 public static final Color defaultLineNumberBackColor = new Color (233, 232, 226); 76 public static final Coloring defaultLineNumberColoring 77 = new Coloring(null, defaultLineNumberForeColor, defaultLineNumberBackColor); 78 public static final Color defaultGutterLine = new Color (184, 184, 184); 80 public static final Color defaultSelectionForeColor = Color.white; 82 public static final Color defaultSelectionBackColor = new Color (180, 180, 180); 83 public static final Coloring defaultSelectionColoring 84 = new Coloring(null, defaultSelectionForeColor, defaultSelectionBackColor); 85 public static final Color defaultHighlightSearchForeColor = Color.black; 87 public static final Color defaultHighlightSearchBackColor = new Color (246, 248, 139); 88 public static final Coloring defaultHighlightSearchColoring 89 = new Coloring(null, defaultHighlightSearchForeColor, defaultHighlightSearchBackColor); 90 public static final Color defaultIncSearchForeColor = Color.black; 92 public static final Color defaultIncSearchBackColor = new Color (255, 153, 0); 93 public static final Coloring defaultIncSearchColoring 94 = new Coloring(null, defaultIncSearchForeColor, defaultIncSearchBackColor); 95 public static final Color defaultBlockSearchForeColor = Color.black; 97 public static final Color defaultBlockSearchBackColor = new Color (224,232,241); 98 public static final Coloring defaultblockSearchColoring 99 = new Coloring(null, defaultBlockSearchForeColor, defaultBlockSearchBackColor); 100 101 public static final Color defaultGuardedForeColor = null; 103 public static final Color defaultGuardedBackColor = new Color (225, 236, 247); 104 public static final Coloring defaultGuardedColoring 105 = new Coloring(null, defaultGuardedForeColor, defaultGuardedBackColor); 106 107 public static final Color defaultCodeFoldingForeColor = new Color (102, 102, 102); 109 public static final Coloring defaultCodeFoldingColoring 110 = new Coloring(null, defaultCodeFoldingForeColor, null); 111 112 public static final Color defaultCodeFoldingBarForeColor = new Color (102, 102, 102); 114 public static final Color defaultCodeFoldingBarBackColor = Color.WHITE; 115 public static final Coloring defaultCodeFoldingBarColoring 116 = new Coloring(null, defaultCodeFoldingBarForeColor, null); 117 118 public static final Color defaultStatusBarForeColor = 119 UIManager.getColor("ScrollPane.foreground"); public static final Color defaultStatusBarBackColor = 121 UIManager.getColor("ScrollPane.background"); public static final Coloring defaultStatusBarColoring 123 = new Coloring(defaultFont, defaultStatusBarForeColor, defaultStatusBarBackColor); 124 125 public static final Color defaultStatusBarBoldForeColor = Color.white; 126 public static final Color defaultStatusBarBoldBackColor = Color.red; 127 public static final Coloring defaultStatusBarBoldColoring 128 = new Coloring(defaultFont, defaultStatusBarBoldForeColor, defaultStatusBarBoldBackColor); 129 130 public static final Integer defaultCaretBlinkRate = new Integer (300); 131 public static final Integer defaultTabSize = new Integer (8); 132 public static final Integer defaultSpacesPerTab = new Integer (4); 133 public static final Integer defaultShiftWidth = new Integer (4); 136 public static final Integer defaultStatusBarCaretDelay = new Integer (200); 137 138 public static final Color defaultTextLimitLineColor = new Color (255, 235, 235); 139 public static final Integer defaultTextLimitWidth = new Integer (80); 140 141 public static final Acceptor defaultIdentifierAcceptor = AcceptorFactory.LETTER_DIGIT; 142 public static final Acceptor defaultWhitespaceAcceptor = AcceptorFactory.WHITESPACE; 143 144 public static final Float defaultLineHeightCorrection = new Float (1.0f); 145 146 public static final Integer defaultTextLeftMarginWidth = new Integer (2); 147 public static final Insets defaultMargin = new Insets (0, 0, 0, 0); 148 public static final Insets defaultScrollJumpInsets = new Insets (-5, -10, -5, -30); 149 public static final Insets defaultScrollFindInsets = new Insets (-10, -10, -10, -10); 150 public static final Dimension defaultComponentSizeIncrement = new Dimension (-5, -30); 151 152 public static final Integer defaultReadBufferSize = new Integer (16384); 153 public static final Integer defaultWriteBufferSize = new Integer (16384); 154 public static final Integer defaultReadMarkDistance = new Integer (180); 155 public static final Integer defaultMarkDistance = new Integer (100); 156 public static final Integer defaultMaxMarkDistance = new Integer (150); 157 public static final Integer defaultMinMarkDistance = new Integer (50); 158 public static final Integer defaultSyntaxUpdateBatchSize 159 = new Integer (defaultMarkDistance.intValue() * 7); 160 public static final Integer defaultLineBatchSize = new Integer (2); 161 162 public static final Boolean defaultExpandTabs = Boolean.TRUE; 163 164 public static final String defaultCaretTypeInsertMode = BaseCaret.LINE_CARET; 165 public static final String defaultCaretTypeOverwriteMode = BaseCaret.BLOCK_CARET; 166 public static final Color defaultCaretColorInsertMode = Color.black; 167 public static final Color defaultCaretColorOvwerwriteMode = Color.black; 168 public static final Boolean defaultCaretItalicInsertMode = Boolean.FALSE; 169 public static final Boolean defaultCaretItalicOverwriteMode = Boolean.FALSE; 170 public static final Acceptor defaultAbbrevExpandAcceptor = AcceptorFactory.WHITESPACE; 171 public static final Acceptor defaultAbbrevAddTypedCharAcceptor = AcceptorFactory.NL; 172 public static final Acceptor defaultAbbrevResetAcceptor = AcceptorFactory.NON_JAVA_IDENTIFIER; 173 public static final Map defaultAbbrevMap = new HashMap (); 174 175 public static final Map defaultMacroMap = new HashMap (); 176 177 public static final Boolean defaultStatusBarVisible = Boolean.TRUE; 178 179 public static final Boolean defaultLineNumberVisible = Boolean.FALSE; 180 public static final Boolean defaultPrintLineNumberVisible = Boolean.TRUE; 181 public static final Boolean defaultTextLimitLineVisible = Boolean.TRUE; 182 public static final Boolean defaultHomeKeyColumnOne = Boolean.FALSE; 183 public static final Boolean defaultWordMoveNewlineStop = Boolean.TRUE; 184 public static final Boolean defaultInputMethodsEnabled = Boolean.TRUE; 185 public static final Boolean defaultFindHighlightSearch = Boolean.TRUE; 186 public static final Boolean defaultFindIncSearch = Boolean.TRUE; 187 public static final Boolean defaultFindBackwardSearch = Boolean.FALSE; 188 public static final Boolean defaultFindWrapSearch = Boolean.TRUE; 189 public static final Boolean defaultFindMatchCase = Boolean.FALSE; 190 public static final Boolean defaultFindWholeWords = Boolean.FALSE; 191 public static final Boolean defaultFindRegExp = Boolean.FALSE; 192 public static final Integer defaultFindHistorySize = new Integer (30); 193 public static final Integer defaultWordMatchSearchLen = INTEGER_MAX_VALUE; 194 public static final Boolean defaultWordMatchWrapSearch = Boolean.TRUE; 195 public static final Boolean defaultWordMatchMatchOneChar = Boolean.TRUE; 196 public static final Boolean defaultWordMatchMatchCase = Boolean.FALSE; 197 public static final Boolean defaultWordMatchSmartCase = Boolean.FALSE; 198 public static final Boolean defaultCodeFoldingEnable = Boolean.FALSE; 199 200 public static final String [] defaultColoringNames 201 = new String [] { 202 SettingsNames.DEFAULT_COLORING, 203 SettingsNames.LINE_NUMBER_COLORING, 204 SettingsNames.GUARDED_COLORING, 205 SettingsNames.CODE_FOLDING_COLORING, 206 SettingsNames.CODE_FOLDING_BAR_COLORING, 207 SettingsNames.SELECTION_COLORING, 208 SettingsNames.HIGHLIGHT_SEARCH_COLORING, 209 SettingsNames.INC_SEARCH_COLORING, 210 SettingsNames.BLOCK_SEARCH_COLORING, 211 SettingsNames.STATUS_BAR_COLORING, 212 SettingsNames.STATUS_BAR_BOLD_COLORING 213 }; 214 215 216 private static final int FIND_NEXT_KEY = 217 System.getProperty("mrj.version") == null ? 218 KeyEvent.VK_F3 : KeyEvent.VK_G; 219 220 private static final int FIND_NEXT_MASK = 221 System.getProperty("mrj.version") == null ? 222 0 : KeyEvent.META_DOWN_MASK; 223 224 private static final int MENU_MASK = java.awt.Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(); 226 227 private static final int WORD_SELECT_MASK = System.getProperty("mrj.version") == null ? 229 InputEvent.CTRL_DOWN_MASK : InputEvent.ALT_DOWN_MASK; 230 231 private static final int ALT_MASK = System.getProperty("mrj.version") == null ? 232 InputEvent.ALT_DOWN_MASK : InputEvent.CTRL_DOWN_MASK; 233 234 707 static { 709 int end = 8; 710 if (System.getProperty("mrj.version") != null) { } 757 } 758 } 759 | Popular Tags |