📄 defaults.java
字号:
/** * List fly-over text color (item under mouse pointer) */ static Color ListFlyOverTxtClr = Color.black;/** * If set to 'true', fly-over items will be drawn with an inset border * (outset otherwise) */ static boolean ListFlyOverInset;/** * Default Label text color */ static Color LabelClr = Color.black;/** * Default Label font */ static Font LabelFont;/** * If set to 'true', Label text will be drawn carved (with right-down highlight) */ static boolean LabelTxtCarved;/** * Default background color for Buttons */ static Color BtnClr = new Color( 163, 163, 163);/** * Default text color for Buttons */ static Color BtnTxtClr = Color.black;/** * Button background color if button is under mouse pointer */ static Color BtnPointClr = new Color( 180, 180, 180);/** * Button text color if button is under mouse pointer */ static Color BtnPointTxtClr = FocusClr;/** * Default font for Buttons */ static Font BtnFont;/** * If set to 'true', Button text will be drawn carved (with right-down highlight) */ static boolean BtnTxtCarved = true;/** * Color for Component borders */ static Color BorderClr = new Color( 159, 159, 159);/** * Name of RootWindow (screen) class. Only used in standalone environments */ static String RootWindowClass = "java.awt.RootWindow";/** * Background color for RootWindow (stand-alone environments only) */ static Color RootWindowClr = Color.blue;/** * Image filename to be used to tile RootWindow background (only for standalone environments) */ static String RootWindowImg = "marble.jpg";/** * Name of KeyTable translation class (only used in standalone environments) */ static String KeyTabClass = "java.awt.KeyTabGr";/** * Color for active window borders (only used in standalone environments) */ static Color WndActiveClr = new Color( 191, 0, 0);/** * Color for active window titlebar background (only used in standalone environments) */ static Color WndActiveTitleClr = Color.yellow;/** * Color for inactive window borders (only for standalone environments) */ static Color WndInactiveClr = Color.lightGray;/** * Color for inactive window titlebar background (only used in standalone environments) */ static Color WndInactiveTitleClr = Color.black;/** * Name of class to be used to control desktop pages and controls (only for * standalone environments) */ static String ControlBoxClass = "java.awt.WinTaskBar";/** * Name of class to be used to display and control minimized windows (only for * standalone environments) */ static String MinBoxClass = "java.awt.WinTaskBar";/** * Maximum size of image files to be produced immediately (when the corrseponding * image is created). Images with files exceeding this size will be produced * asynchronously on demand */ static int FileImageThreshold = Integer.MAX_VALUE;/** * Maximum size of image data buffers to be produced immediately (when the corrseponding * image is created). Images with data buffers exceeding this size will be produced * asynchronously on demand */ static int DataImageThreshold = Integer.MAX_VALUE;/** * Maximum size of MemoryImageSource data to be produced immediately (when the * corrseponding image is created). Images with data buffers exceeding this * size will be produced asynchronously on demand (currently, everything != 0 * will cause async production) */ static int MemImageSrcThreshold = Integer.MAX_VALUE; static int RecycleEvents = 0;/** * Name of the file to load as the startup banner. */ static String banner;/** * Name of the file to play when we need to 'beep' */ static String beep; static String UserInitClass = setStringValue( "awt.UserInitClass", null);static { // these are the computed values Dimension sd = Toolkit.getDefaultToolkit().getScreenSize(); ScreenWidth = sd.width; ScreenHeight = sd.height; // we assume a 4:3 width/height ratio of the display XResolution = (int)((double) ScreenWidth * 10 / ( 0.8 * ScreenSize)); // dpi YResolution = (int)((double) ScreenHeight * 10 / ( 0.6 * ScreenSize)); // dpi String version = Toolkit.tlkVersion(); if ( version.startsWith( "grx") ) { FsDefault = "helv%d%s%s.fnt"; FsMonospaced = "xm7x13b.fnt"; FsSansSerif = "helv%d%s%s.fnt"; FsSerif = "tms%d%s%s.fnt"; FsDialog = "cour%d%s%s.fnt"; FsDialogInput = "cour%d%s%s.fnt"; FsZapfDingbats = "helv%d%s%s.fnt"; } else if ( version.startsWith( "X") ) { // This is another heuristic - large screens usually don't get along // with the 75dpi fonts (too small). Unfortunately, the computed // XResolution is often close to 100 dpi for 1024x768 screens (laptops), // but we definitely want to use the 75 dpi fonts, there. It seems to be the // best compromise to base this on the ScreenWidth (instead of the computed // dpi). Anyway, what we definitely don't want to do is to mix 75 and 100 dpi // fonts, since this might end up in discontinuities of X fonts (depending // on the X fontserver settings, which are all too often broken). That's why // we explicitly specify the value, here int res = (ScreenWidth > 1024) ? 100 : 75; String fntCat = Integer.toString(res) + '-' + res + "-*-*-*-*"; //FsDefault = "-b&h-lucida-%s-%s-*-*-*-%d-" + fntCat; FsDefault = "-adobe-helvetica-%s-%s-*-*-*-%d-" + fntCat; FsMonospaced = "-adobe-courier-%s-%s-*-*-*-%d-" + fntCat; FsSansSerif = "-adobe-helvetica-%s-%s-*-*-*-%d-" + fntCat; FsSerif = "-adobe-times-%s-%s-*-*-*-%d-" + fntCat; FsDialog = "-misc-fixed-%s-%s-*-*-*-%d-" + fntCat; FsDialogInput = "-b&h-lucidatypewriter-%s-%s-*-*-*-%d-" + fntCat; FsZapfDingbats = "-adobe-new century schoolbook-%s-%s-*-*-*-%d-" + fntCat; } else { // no idea, we have to leave it for the native layer FsDefault = "Default"; FsMonospaced = "Monospaced"; FsSansSerif = "SansSerif"; FsSerif = "Serif"; FsDialog = "Dialog"; FsDialogInput = "DialogInput"; FsZapfDingbats = "ZapfDingbats"; } WndFont = new Font( "Default", Font.BOLD, 10); MenuFont = new Font( "Default", Font.BOLD, 10); TextFont = new Font( "Default", Font.BOLD, 10); TextAreaFont = new Font( "Monospaced", Font.PLAIN, 12); TextFieldFont = new Font( "Default", Font.BOLD, 10); ListFont = new Font( "Default", Font.BOLD, 10); LabelFont = new Font( "Default", Font.PLAIN, 10); BtnFont = new Font( "Default", Font.BOLD, 10); WndFontMetrics = Toolkit.getDefaultToolkit().getFontMetrics( WndFont); if ( MenuBarHeight == 0 ){ // we assume this is something like the "system font", which is a synonym // for the TitlebarHeight (alternatively, we could use the MenuFont itself) MenuBarHeight = WndFontMetrics.getHeight() + 8; } beep = System.getProperty("awt.beep", "beep.wav"); // Display startup banner, if any if ( (banner = System.getProperty("awt.banner", "banner.gif")) != null ){ Toolkit.tlkDisplayBanner(banner); } if ( UserInitClass != null ) { try { Class asc = Class.forName( UserInitClass); } catch ( Exception x ) { System.err.println( "UserInitClass not initialized: " + x); } }}static boolean setBooleanValue ( String propKey, boolean defValue ) { boolean val; String s = System.getProperty( propKey); if ( s != null ) { val = s.equalsIgnoreCase( "true"); } else { val = defValue; } return val;}static Color setColorValue ( String propKey, Color defValue ) { Color val = defValue; String s = System.getProperty( propKey); if ( s != null ) { try { val = new Color( Integer.parseInt( s, 16)); } catch ( NumberFormatException x ) { System.err.println( "malformed awt property: " + propKey); } s = null; } return val;}static int setIntValue ( String propKey, int defValue ) { int val = defValue; String s = System.getProperty( propKey); if ( s != null ) { try { val = Integer.parseInt( s); } catch ( NumberFormatException x ) { System.err.println( "malformed awt property: " + propKey); } s = null; } return val;}static String setStringValue ( String propKey, String defValue ) { // we could do this directly via System.getProperty(key,def), but just // for Strings, and we want more types String val = System.getProperty( propKey); if ( val == null ) val = defValue; return val;}}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -