Java Examples for javax.swing.plaf.FontUIResource
The following java examples will help you to understand the usage of javax.swing.plaf.FontUIResource. These source code samples are taken from different open source projects.
Example 1
| Project: jogetworkflow-master File: JaWEManager.java View source code |
public void start(String fileName) throws Throwable {
if (!isConfigured) {
return;
}
long tStart = System.currentTimeMillis();
String lookAndFeelClassName = JaWEManager.getLookAndFeelClassName();
if (lookAndFeelClassName != null && (!lookAndFeelClassName.equals(""))) {
try {
UIManager.setLookAndFeel(lookAndFeelClassName);
} catch (Exception ex) {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}
}
//TODO: it's probably a bad idea to mess around with fonts. Probably this
//shouldn't be done unless an explicit L&F was choosen!
javax.swing.plaf.FontUIResource f;
try {
try {
f = new javax.swing.plaf.FontUIResource(JaWEManager.getFontName(), Font.PLAIN, JaWEManager.getFontSize());
} catch (Exception ex) {
ex.printStackTrace();
f = new javax.swing.plaf.FontUIResource("Label.font", Font.PLAIN, JaWEManager.getFontSize());
}
java.util.Enumeration keys = UIManager.getDefaults().keys();
while (keys.hasMoreElements()) {
Object key = keys.nextElement();
Object value = UIManager.get(key);
if (value instanceof javax.swing.plaf.FontUIResource) {
UIManager.put(key, f);
}
}
} catch (Exception ex) {
ex.printStackTrace();
}
JaWESplash splashScr = null;
if (showSplash) {
splashScr = new JaWESplash();
}
JaWEManager.getInstance().init();
long tEnd = System.currentTimeMillis();
if (loggingManager != null) {
loggingManager.info("JaWEManager -> " + getName() + " editor initialization is finished, it lasted " + (tEnd - tStart) + " ms");
loggingManager.info(getName() + " ready and waiting ...");
}
if (fileName != null) {
jaweController.openPackageFromFile(fileName);
}
if (splashScr != null) {
splashScr.dispose();
splashScr = null;
}
jaweController.showJaWEFrame();
}Example 2
| Project: jw-community-master File: JaWEManager.java View source code |
public void start(String fileName) throws Throwable {
if (!isConfigured) {
return;
}
long tStart = System.currentTimeMillis();
boolean customUI = false;
try {
NimRODTheme nt = new NimRODTheme(getClass().getClassLoader().getResource("designer.theme"));
NimRODLookAndFeel nf = new NimRODLookAndFeel();
nf.setCurrentTheme(nt);
UIManager.setLookAndFeel(nf);
customUI = true;
} catch (Throwable t) {
t.printStackTrace();
}
if (!customUI) {
String lookAndFeelClassName = JaWEManager.getLookAndFeelClassName();
if (lookAndFeelClassName != null && (!lookAndFeelClassName.equals(""))) {
try {
UIManager.setLookAndFeel(lookAndFeelClassName);
} catch (Exception ex) {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}
}
}
//TODO: it's probably a bad idea to mess around with fonts. Probably this
//shouldn't be done unless an explicit L&F was choosen!
javax.swing.plaf.FontUIResource f;
try {
try {
f = new javax.swing.plaf.FontUIResource(JaWEManager.getFontName(), Font.PLAIN, JaWEManager.getFontSize());
} catch (Exception ex) {
ex.printStackTrace();
f = new javax.swing.plaf.FontUIResource("Label.font", Font.PLAIN, JaWEManager.getFontSize());
}
java.util.Enumeration keys = UIManager.getDefaults().keys();
while (keys.hasMoreElements()) {
Object key = keys.nextElement();
Object value = UIManager.get(key);
if (value instanceof javax.swing.plaf.FontUIResource) {
UIManager.put(key, f);
}
}
} catch (Exception ex) {
ex.printStackTrace();
}
JaWESplash splashScr = null;
if (showSplash) {
splashScr = new JaWESplash();
}
JaWEManager.getInstance().init();
long tEnd = System.currentTimeMillis();
if (loggingManager != null) {
loggingManager.info("JaWEManager -> " + getName() + " editor initialization is finished, it lasted " + (tEnd - tStart) + " ms");
loggingManager.info(getName() + " ready and waiting ...");
}
if (fileName != null) {
jaweController.openPackageFromFile(fileName);
}
if (splashScr != null) {
splashScr.dispose();
splashScr = null;
}
jaweController.showJaWEFrame();
}Example 3
| Project: OOjDREW-master File: PreferenceManager.java View source code |
public void preferenceChange(PreferenceChangeEvent evt) {
float newUIFontSize = config.getUIFontSize();
float newTextAreaFontSize = config.getTextAreaFontSize();
Enumeration<Object> keys = UIManager.getDefaults().keys();
while (keys.hasMoreElements()) {
Object key = keys.nextElement();
Object value = UIManager.get(key);
if (value instanceof javax.swing.plaf.FontUIResource) {
javax.swing.plaf.FontUIResource font = (javax.swing.plaf.FontUIResource) value;
FontUIResource newFont;
if (key.toString().equals("TextArea.font")) {
newFont = new FontUIResource(font.deriveFont(newTextAreaFontSize));
} else {
newFont = new FontUIResource(font.deriveFont(newUIFontSize));
}
UIManager.put(key, newFont);
}
}
try {
UIManager.setLookAndFeel(config.getLookAndFeel());
} catch (Exception e) {
e.printStackTrace();
}
}Example 4
| Project: grouper-client-master File: FontConverter.java View source code |
public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) {
// into <attributes>
reader.moveDown();
Map attributes = (Map) context.convertAnother(null, Map.class);
// out of </attributes>
reader.moveUp();
Font font = Font.getFont(attributes);
if (context.getRequiredType() == FontUIResource.class) {
return new FontUIResource(font);
} else {
return font;
}
}Example 5
| Project: mmlTools-master File: MabiIcco.java View source code |
private void initialize() {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
// font
String fontName = AppResource.appText("ui.font");
if (!fontName.equals("ui.font")) {
setUIFont(new javax.swing.plaf.FontUIResource(fontName, Font.PLAIN, 11));
}
// initialize
MabiDLS.getInstance().initializeMIDI();
notifyPreloader(new MabiIccoPreloaderNotification("OK\n", 20));
notifyPreloader(new MabiIccoPreloaderNotification(AppResource.appText("init.dls"), 20));
if (!loadDLSFiles(20, 70)) {
JOptionPane.showMessageDialog(null, AppResource.appText("error.needDls"), "ERROR", JOptionPane.ERROR_MESSAGE);
System.exit(1);
}
notifyPreloader(new MabiIccoPreloaderNotification("OK\n", 90));
} catch (ExceptionError | e) {
e.printStackTrace();
JOptionPane.showMessageDialog(null, e.getMessage(), "ERROR", JOptionPane.ERROR_MESSAGE);
System.exit(1);
}
EventQueue.invokeLater(() -> {
ActionDispatcher dispatcher = ActionDispatcher.getInstance();
MainFrame mainFrame = new MainFrame(dispatcher);
mainFrame.setTransferHandler(new FileTransferHandler(dispatcher));
notifyPreloader(new MabiIccoPreloaderNotification("", 100));
dispatcher.setMainFrame(mainFrame).initialize();
List<String> args = getParameters().getRaw();
if (dispatcher.recoveryCheck()) {
} else if (args.size() > 0) {
dispatcher.checkAndOpenMMLFile(new File(args.get(0)));
}
try {
notifyPreloader(new Preloader.StateChangeNotification(Preloader.StateChangeNotification.Type.BEFORE_START));
} catch (IllegalStateException e) {
}
mainFrame.setVisible(true);
});
}Example 6
| Project: musicalAgents-master File: MRAVisualiser.java View source code |
public static void setUIFont(javax.swing.plaf.FontUIResource f) { // // sets the default font for all Swing components. // ex. // setUIFont (new javax.swing.plaf.FontUIResource("Serif",Font.ITALIC,12)); // java.util.Enumeration keys = UIManager.getDefaults().keys(); while (keys.hasMoreElements()) { Object key = keys.nextElement(); Object value = UIManager.get(key); if (value instanceof javax.swing.plaf.FontUIResource) UIManager.put(key, f); } }
Example 7
| Project: rest-client-master File: Main.java View source code |
private static void setGlobalUIFontSize(final int fontSize) {
Font f = new Font(Font.DIALOG, Font.PLAIN, fontSize);
//UIManager.put("Label.font", f);
//UIManager.put("Button.font", f);
//UIManager.put("RadioButton.font", f);
ArrayList<String> excludes = new ArrayList<>();
//excludes.add("TitledBorder.font");
//excludes.add("MenuBar.font");
//excludes.add("MenuItem.font");
//excludes.add("MenuItem.acceleratorFont");
//excludes.add("Menu.font");
//excludes.add("TabbedPane.font");
excludes.add("");
Enumeration itr = UIManager.getDefaults().keys();
while (itr.hasMoreElements()) {
Object o = itr.nextElement();
if (o instanceof String) {
String key = (String) o;
Object value = UIManager.get(key);
if ((value instanceof javax.swing.plaf.FontUIResource) && (!excludes.contains(key))) {
LOG.fine(key);
UIManager.put(key, f);
}
}
}
}Example 8
| Project: spring-rich-client-master File: FontSizeAdjuster.java View source code |
public static void adjust(int amount) {
Object[] objs = UIManager.getLookAndFeel().getDefaults().keySet().toArray();
for (int i = 0; i < objs.length; i++) {
if (objs[i].toString().toUpperCase().indexOf("FONT") != -1) {
Font font = UIManager.getFont(objs[i]);
if (font != null) {
UIManager.put(objs[i], new FontUIResource(font.deriveFont((float) font.getSize() + amount)));
}
}
}
adjustment = adjustment + amount;
updateUI();
}Example 9
| Project: springrcp-master File: FontSizeAdjuster.java View source code |
public static void adjust(int amount) {
Object[] objs = UIManager.getLookAndFeel().getDefaults().keySet().toArray();
for (int i = 0; i < objs.length; i++) {
if (objs[i].toString().toUpperCase().indexOf("FONT") != -1) {
Font font = UIManager.getFont(objs[i]);
if (font != null) {
UIManager.put(objs[i], new FontUIResource(font.deriveFont((float) font.getSize() + amount)));
}
}
}
adjustment = adjustment + amount;
updateUI();
}Example 10
| Project: studio-master File: EntryPoint.java View source code |
public static void main(final String[] args) {
TimeZone.setDefault(TimeZone.getTimeZone("GMT"));
if (System.getProperty("os.name", "").contains("OS X")) {
System.setProperty("apple.laf.useScreenMenuBar", "true");
// System.setProperty("apple.awt.brushMetalLook", "true");
System.setProperty("apple.awt.showGrowBox", "true");
System.setProperty("com.apple.mrj.application.apple.menu.about.name", "Studio for kdb+");
System.setProperty("com.apple.mrj.application.live-resize", "true");
System.setProperty("com.apple.macos.smallTabs", "true");
System.setProperty("com.apple.mrj.application.growbox.intrudes", "false");
}
if (Config.getInstance().getLookAndFeel() != null) {
try {
UIManager.setLookAndFeel(Config.getInstance().getLookAndFeel());
} catch (Exception ex) {
ex.printStackTrace();
}
}
studio.ui.I18n.setLocale(Locale.getDefault());
// studio.ui.I18n.setLocale(new Locale("zh", "cn"));
/*if (!Config.getInstance().getAcceptedLicense()) {
LicensePanel panel = new LicensePanel();
Object[] options = new String[]{
"Accept","Do Not Accept"
};
int answer = JOptionPane.showOptionDialog(null,
panel,"Studio for kdb+",
JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE,
Studio.getImage(Config.imageBase + "32x32/question.png"), //do not use a custom Icon
options, //the titles of buttons
options[1]); //default button title
if (answer == JOptionPane.NO_OPTION)
System.exit(0);
Config.getInstance().setAcceptedLicense(Lm.buildDate);
}
*/
UIManager.put("Table.font", new javax.swing.plaf.FontUIResource("Monospaced", Font.PLAIN, UIManager.getFont("Table.font").getSize()));
System.setProperty("awt.useSystemAAFontSettings", "on");
System.setProperty("swing.aatext", "true");
ThreadGroup exceptionThreadGroup = new ExceptionGroup();
new Thread(exceptionThreadGroup, "Init thread") {
public void run() {
Studio.init(args);
}
}.start();
}Example 11
| Project: WebServices-master File: Main.java View source code |
private static void setGlobalUIFontSize(final int fontSize) {
Font f = new Font(Font.DIALOG, Font.PLAIN, fontSize);
//UIManager.put("Label.font", f);
//UIManager.put("Button.font", f);
//UIManager.put("RadioButton.font", f);
ArrayList<String> excludes = new ArrayList<>();
//excludes.add("TitledBorder.font");
//excludes.add("MenuBar.font");
//excludes.add("MenuItem.font");
//excludes.add("MenuItem.acceleratorFont");
//excludes.add("Menu.font");
//excludes.add("TabbedPane.font");
excludes.add("");
Enumeration itr = UIManager.getDefaults().keys();
while (itr.hasMoreElements()) {
Object o = itr.nextElement();
if (o instanceof String) {
String key = (String) o;
Object value = UIManager.get(key);
if ((value instanceof javax.swing.plaf.FontUIResource) && (!excludes.contains(key))) {
LOG.fine(key);
UIManager.put(key, f);
}
}
}
}Example 12
| Project: QuaquaOld-master File: Quaqua16SnowLeopardLookAndFeel.java View source code |
@Override
protected void initFontDefaults(UIDefaults table) {
super.initFontDefaults(table);
Object emphasizedSmallSystemFont = new UIDefaults.ProxyLazyValue("javax.swing.plaf.FontUIResource", null, new Object[] { "Lucida Grande", Font.BOLD, 11 });
Object[] uiDefaults = { "FileChooser.previewLabelFont", emphasizedSmallSystemFont };
putDefaults(table, uiDefaults);
}Example 13
| Project: flexdock-master File: TitlebarUI.java View source code |
@Override
public void installUI(JComponent c) {
super.installUI(c);
Dimension d = c.getPreferredSize();
d.height = getDefaultHeight();
c.setPreferredSize(d);
reconfigureActions(c);
if (font != null) {
Font current = c.getFont();
if (current == null || current instanceof UIResource) {
c.setFont(new FontUIResource(font));
}
}
}Example 14
| Project: jhotdraw-master File: PaletteLookAndFeel.java View source code |
@Override
protected void initComponentDefaults(UIDefaults table) {
super.initComponentDefaults(table);
// Add resource bundle to the table.
// Since this does not seem to work in sandboxed environments, we check
// whether we succeeded and - in case of failure - put the values in
// by ourselves.
table.addResourceBundle("org.jhotdraw.gui.Labels");
if (table.getString("ColorChooser.rgbSliders") == null) {
ResourceBundle rb = ResourceBundle.getBundle("org.jhotdraw.gui.Labels");
for (String key : rb.keySet()) {
table.put(key, rb.getObject(key));
}
}
// *** Shared Fonts
Integer fontPlain = Font.PLAIN;
Integer fontBold = Font.BOLD;
Object dialogPlain11 = new ProxyLazyValue("javax.swing.plaf.FontUIResource", null, new Object[] { "Dialog Sans", fontPlain, 11 });
Object dialogPlain12 = new ProxyLazyValue("javax.swing.plaf.FontUIResource", null, new Object[] { "Dialog Sans", fontPlain, 12 });
Object fieldPlain12 = new ProxyLazyValue("javax.swing.plaf.FontUIResource", null, new Object[] { "Verdana", fontPlain, 12 });
Object dialogBold12 = new ProxyLazyValue("javax.swing.plaf.FontUIResource", null, new Object[] { "Dialog", fontBold, 12 });
// *** Shared Colors
ColorUIResource black = new ColorUIResource(Color.black);
ColorUIResource control = new ColorUIResource(0xf0f0f0);
ColorUIResource controlText = black;
ColorUIResource selectionBackground = new ColorUIResource(0xb5d5ff);
ColorUIResource selectionForeground = black;
ColorUIResource listSelectionBackground = new ColorUIResource(0x3875d7);
Object focusCellHighlightBorder = new UIDefaults.ProxyLazyValue("javax.swing.plaf.BorderUIResource$LineBorderUIResource", // null,
new Object[] { listSelectionBackground });
// *** Shared Insets
InsetsUIResource zeroInsets = new InsetsUIResource(0, 0, 0, 0);
// *** Shared Borders
/*Object buttonBorder =
new ProxyLazyValue(
"org.jhotdraw.gui.plaf.palette.BackdropBorder$UIResource",
new Object[] {new PaletteButtonBorder()});*/
Object buttonBorder = new BackdropBorder.UIResource(new PaletteButtonBorder());
Object textBorder = new BackdropBorder.UIResource(new PaletteTextComponentBorder());
Object[] defaults = { // *** Fonts
"SmallSystemFont", dialogPlain11, // *** Buttons
"Button.font", dialogPlain12, "Button.background", control, "Button.foreground", controlText, "Button.border", buttonBorder, "Button.margin", zeroInsets, // *** FontChooser
"Button.background", control, "Button.foreground", controlText, "Button.border", buttonBorder, "Button.margin", zeroInsets, // class names of default choosers
"ColorChooser.font", dialogPlain11, "ColorChooser.defaultChoosers", new String[] { "org.jhotdraw.gui.plaf.palette.colorchooser.PaletteSwatchesChooser", "org.jhotdraw.gui.plaf.palette.colorchooser.PaletteColorWheelChooser", "org.jhotdraw.gui.plaf.palette.colorchooser.PaletteColorSlidersChooser" }, "ColorChooser.textSliderGap", 3, // *** FormattedTextField
"FormattedTextField.font", fieldPlain12, "FormattedTextField.background", control, "FormattedTextField.foreground", controlText, "FormattedTextField.border", textBorder, "FormattedTextField.margin", zeroInsets, "FormattedTextField.opaque", Boolean.TRUE, "FormattedTextField.errorIndicatorForeground", new ColorUIResource(0xfe4a41), "FormattedTextField.selectionBackground", selectionBackground, "FormattedTextField.selectionForeground", selectionForeground, // *** Labels
"Label.font", dialogPlain12, "Label.border", new UIDefaults.ProxyLazyValue("javax.swing.plaf.BorderUIResource$EmptyBorderUIResource", new Object[] { 0, 0, 0, 0 }), // *** Lists
"List.focusCellHighlightBorder", focusCellHighlightBorder, "List.cellRenderer", new UIDefaults.ProxyLazyValue("org.jhotdraw.gui.plaf.palette.PaletteListCellRenderer"), // *** Panels
"Panel.background", control, "Panel.foreground", controlText, "Panel.opaque", Boolean.TRUE, //
"Ribbon.border", //
new UIDefaults.ProxyLazyValue("javax.swing.border.MatteBorder", new Object[] { new Insets(1, 0, 0, 0), new Color(0x777777) }), //
"ScrollPane.border", //
new UIDefaults.ProxyLazyValue("javax.swing.border.MatteBorder", new Object[] { new Insets(1, 1, 1, 1), new Color(0xa5a5a5) }), // *** Slider
"Slider.background", control, "Slider.foreground", controlText, "Slider.horizontalSize", new DimensionUIResource(100, 20), "Slider.verticalSize", new DimensionUIResource(20, 100), "Slider.northThumb.small", new UIDefaults.ProxyLazyValue("org.jhotdraw.gui.plaf.palette.PaletteSliderThumbIcon", new Object[] { "/org/jhotdraw/gui/plaf/palette/images/Slider.northThumbs.small.png", 6, true }), "Slider.westThumb.small", new UIDefaults.ProxyLazyValue("org.jhotdraw.gui.plaf.palette.PaletteSliderThumbIcon", new Object[] { "/org/jhotdraw/gui/plaf/palette/images/Slider.westThumbs.small.png", 6, true }), // *** TabbedPane
"TabbedPane.font", dialogPlain12, "TabbedPane.selectedFont", dialogBold12, "TabbedPane.background", control, "TabbedPane.contentAreaColor", control, "TabbedPane.foreground", controlText, "TabbedPane.highlight", new ColorUIResource(0xa5a5a5), "TabbedPane.lightHighlight", new ColorUIResource(0xa5a5a5), "TabbedPane.shadow", new ColorUIResource(0xa5a5a5), "TabbedPane.darkShadow", new ColorUIResource(0x333333), // *** TextArea
"TextArea.selectionBackground", selectionBackground, "TextArea.selectionForeground", selectionForeground, // *** TextField
"TextField.font", fieldPlain12, "TextField.background", control, "TextField.foreground", controlText, "TextField.border", textBorder, "TextField.margin", zeroInsets, "TextField.opaque", Boolean.TRUE, "TextField.selectionBackground", selectionBackground, "TextField.selectionForeground", selectionForeground, // *** ToolBar
"ToolBar.font", dialogPlain12, "ToolBar.background", control, "ToolBar.foreground", controlText, "ToolBar.dockingBackground", control, // "ToolBar.dockingForeground", red,
"ToolBar.floatingBackground", control, //
"ToolBar.border", //
new UIDefaults.ProxyLazyValue("org.jhotdraw.gui.plaf.palette.PaletteToolBarBorder$UIResource") };
table.putDefaults(defaults);
}Example 15
| Project: kolmafia-master File: UIManagerExt.java View source code |
/**
* Returns a font from the defaults. If the value for {@code key} is not a
* {@code Font}, {@code defaultFont} is returned.
*
* @param key
* an {@code Object} specifying the font
* @param defaultFont
* the font to return if the font specified by {@code key}
* does not exist
* @return the {@code Font} object
* @throws NullPointerException
* if {@code key} or {@code defaultFont} is {@code null}
*/
public static Font getSafeFont(Object key, Font defaultFont) {
Contract.asNotNull(defaultFont, "defaultFont cannot be null");
Font safeFont = UIManager.getFont(key);
if (safeFont == null) {
safeFont = defaultFont;
}
if (!(safeFont instanceof UIResource)) {
safeFont = new FontUIResource(safeFont);
}
return safeFont;
}Example 16
| Project: openjdk-master File: X11FontManager.java View source code |
@Override protected FontUIResource getFontConfigFUIR(String family, int style, int size) { CompositeFont font2D = getFontConfigManager().getFontConfigFont(family, style); if (font2D == null) { // Not expected, just a precaution. return new FontUIResource(family, style, size); } /* The name of the font will be that of the physical font in slot, * but by setting the handle to that of the CompositeFont it * renders as that CompositeFont. * It also needs to be marked as a created font which is the * current mechanism to signal that deriveFont etc must copy * the handle from the original font. */ FontUIResource fuir = new FontUIResource(font2D.getFamilyName(null), style, size); FontAccess.getFontAccess().setFont2D(fuir, font2D.handle); FontAccess.getFontAccess().setCreatedFont(fuir); return fuir; }
Example 17
| Project: openjdk8-jdk-master File: X11FontManager.java View source code |
@Override protected FontUIResource getFontConfigFUIR(String family, int style, int size) { CompositeFont font2D = getFontConfigManager().getFontConfigFont(family, style); if (font2D == null) { // Not expected, just a precaution. return new FontUIResource(family, style, size); } /* The name of the font will be that of the physical font in slot, * but by setting the handle to that of the CompositeFont it * renders as that CompositeFont. * It also needs to be marked as a created font which is the * current mechanism to signal that deriveFont etc must copy * the handle from the original font. */ FontUIResource fuir = new FontUIResource(font2D.getFamilyName(null), style, size); FontAccess.getFontAccess().setFont2D(fuir, font2D.handle); FontAccess.getFontAccess().setCreatedFont(fuir); return fuir; }
Example 18
| Project: Scute-master File: UIManagerExt.java View source code |
/**
* Returns a font from the defaults. If the value for {@code key} is not a
* {@code Font}, {@code defaultFont} is returned.
*
* @param key
* an {@code Object} specifying the font
* @param defaultFont
* the font to return if the font specified by {@code key}
* does not exist
* @return the {@code Font} object
* @throws NullPointerException
* if {@code key} or {@code defaultFont} is {@code null}
*/
public static Font getSafeFont(Object key, Font defaultFont) {
Contract.asNotNull(defaultFont, "defaultFont cannot be null");
Font safeFont = UIManager.getFont(key);
if (safeFont == null) {
safeFont = defaultFont;
}
if (!(safeFont instanceof UIResource)) {
safeFont = new FontUIResource(safeFont);
}
return safeFont;
}Example 19
| Project: SikuliX-2014-master File: BasicTaskPaneUI.java View source code |
/**
* Gets current title height. Default value is 25 if not specified otherwise. Method checks
* provided component for user set font (!instanceof FontUIResource), if font is set, height
* will be calculated from font metrics instead of using internal preset height.
* @return Current title height.
*/
protected int getTitleHeight(Component c) {
if (c instanceof JXTaskPane) {
JXTaskPane taskPane = (JXTaskPane) c;
Font font = taskPane.getFont();
int height = titleHeight;
if (font != null && !(font instanceof FontUIResource)) {
height = Math.max(height, taskPane.getFontMetrics(font).getHeight());
}
Icon icon = taskPane.getIcon();
if (icon != null) {
height = Math.max(height, icon.getIconHeight() + 4);
}
return height;
}
return titleHeight;
}Example 20
| Project: swingx-master File: UIManagerExt.java View source code |
/**
* Returns a font from the defaults. If the value for {@code key} is not a
* {@code Font}, {@code defaultFont} is returned.
*
* @param key
* an {@code Object} specifying the font
* @param defaultFont
* the font to return if the font specified by {@code key}
* does not exist
* @return the {@code Font} object
* @throws NullPointerException
* if {@code key} or {@code defaultFont} is {@code null}
*/
public static Font getSafeFont(Object key, Font defaultFont) {
Contract.asNotNull(defaultFont, "defaultFont cannot be null");
Font safeFont = UIManager.getFont(key);
if (safeFont == null) {
safeFont = defaultFont;
}
if (!(safeFont instanceof UIResource)) {
safeFont = new FontUIResource(safeFont);
}
return safeFont;
}Example 21
| Project: xsimilarity-master File: Start.java View source code |
public static void InitGlobalFont(Font font) {
FontUIResource fontRes = new FontUIResource(font);
for (Enumeration<Object> keys = UIManager.getDefaults().keys(); keys.hasMoreElements(); ) {
Object key = keys.nextElement();
Object value = UIManager.get(key);
if (value instanceof FontUIResource) {
UIManager.put(key, fontRes);
}
}
}Example 22
| Project: bug-osgi-master File: Activator.java View source code |
public static void setUIFont(FontUIResource f) { for (Object key : UIManager.getDefaults().keySet()) { Object value = UIManager.get(key); if (value instanceof javax.swing.plaf.FontUIResource) { UIManager.put(key, f); } } List lookAndFeelSettings = new LinkedList(); for (Object key : new HashSet(UIManager.getLookAndFeelDefaults().keySet())) { Object value = UIManager.get(key); if (value instanceof javax.swing.plaf.FontUIResource) { lookAndFeelSettings.add(key); } } for (Object key : lookAndFeelSettings) { UIManager.put(key, f); } }
Example 23
| Project: Nor-master File: StartPOS.java View source code |
public static void setUIFont(javax.swing.plaf.FontUIResource f) { java.util.Enumeration keys = UIManager.getDefaults().keys(); while (keys.hasMoreElements()) { Object key = keys.nextElement(); Object value = UIManager.get(key); if (value != null && value instanceof javax.swing.plaf.FontUIResource) { UIManager.put(key, f); } } }
Example 24
| Project: nordpos-master File: StartPOS.java View source code |
public static void setUIFont(javax.swing.plaf.FontUIResource f) { java.util.Enumeration keys = UIManager.getDefaults().keys(); while (keys.hasMoreElements()) { Object key = keys.nextElement(); Object value = UIManager.get(key); if (value != null && value instanceof javax.swing.plaf.FontUIResource) { UIManager.put(key, f); } } }
Example 25
| Project: bither-desktop-java-master File: Themes.java View source code |
/**
* <p>Apply a default font size modifier</p>
*/
public static void initializeFontSize() {
// TODO Introduce a theme-aware font factory for components to use
// TODO Add this to the configuration in appearance for visually impaired users
float multiplier = 1.0f;
UIDefaults defaults = UIManager.getDefaults();
for (Enumeration e = defaults.keys(); e.hasMoreElements(); ) {
Object key = e.nextElement();
Object value = defaults.get(key);
if (value instanceof Font) {
Font font = (Font) value;
int newSize = Math.round(font.getSize() * multiplier);
if (value instanceof FontUIResource) {
defaults.put(key, new FontUIResource(font.getName(), font.getStyle(), newSize));
} else {
defaults.put(key, new Font(font.getName(), font.getStyle(), newSize));
}
}
}
}Example 26
| Project: JSqlIde-master File: ResultSetColumnModel.java View source code |
/**
* This function returns the pixel width of the average character as
* would be rendered using the intended font into the render component.
*/
private int getAverageCharacterWidth() {
Graphics2D g2 = (Graphics2D) renderComponent.getGraphics();
// Default
int result = 8;
FontUIResource fui = new FontUIResource(intendedFont);
FontRenderContext frc = g2.getFontRenderContext();
int widestLetterWidth = (int) fui.getStringBounds("W", frc).getWidth();
int narrowestLetterWidth = (int) fui.getStringBounds("I", frc).getWidth();
result = (widestLetterWidth + narrowestLetterWidth) / 2;
return result;
}Example 27
| Project: learning-bittorrent-master File: ResourceManager.java View source code |
/**
* Updates to the current theme.
*/
public void themeChanged() {
THEME_IMAGES.clear();
try {
if (ThemeSettings.isOtherTheme()) {
// in case this is using metal ...
UIManager.put("swing.boldMetal", Boolean.FALSE);
if (_defaultTheme != null)
MetalLookAndFeel.setCurrentTheme(_defaultTheme);
String other = ThemeSettings.getOtherLF();
UIManager.setLookAndFeel(other);
} else if (ThemeSettings.isNativeTheme()) {
if (CommonUtils.isWindows() && isPlasticWindowsAvailable()) {
try {
UIManager.setLookAndFeel("com.jgoodies.plaf.windows.ExtWindowsLookAndFeel");
} catch (NullPointerException npe) {
UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
}
} else
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
if (CommonUtils.isMacOSX()) {
if (!_fontReduced) {
_fontReduced = true;
reduceFont("Label.font");
reduceFont("Table.font");
}
UIManager.put("List.focusCellHighlightBorder", BorderFactory.createEmptyBorder(1, 1, 1, 1));
UIManager.put("ScrollPane.border", BorderFactory.createMatteBorder(1, 1, 1, 1, Color.lightGray));
}
} else {
if (isPlasticAvailable()) {
if (_defaultTheme == null)
_defaultTheme = getDefaultTheme();
LimePlasticTheme.installThisTheme();
UIManager.setLookAndFeel("com.jgoodies.plaf.plastic.PlasticXPLookAndFeel");
LimeLookAndFeel.installUIManagerDefaults();
} else {
UIManager.setLookAndFeel(new LimeLookAndFeel());
}
}
UIManager.put("Tree.leafIcon", UIManager.getIcon("Tree.closedIcon"));
// remove split pane borders
UIManager.put("SplitPane.border", BorderFactory.createEmptyBorder());
if (!CommonUtils.isMacOSX())
UIManager.put("Table.focusRowHighlightBorder", UIManager.get("Table.focusCellHighlightBorder"));
UIManager.put("Table.focusCellHighlightBorder", BorderFactory.createEmptyBorder(1, 1, 1, 1));
// Add a bolded text version of simple text.
Font normal = UIManager.getFont("Table.font");
FontUIResource bold = new FontUIResource(normal.getName(), Font.BOLD, normal.getSize());
UIManager.put("Table.font.bold", bold);
} catch (UnsupportedLookAndFeelException e) {
throw new ExceptionInInitializerError(e);
} catch (ClassNotFoundException e) {
throw new ExceptionInInitializerError(e);
} catch (InstantiationException e) {
throw new ExceptionInInitializerError(e);
} catch (IllegalAccessException e) {
throw new ExceptionInInitializerError(e);
}
}Example 28
| Project: multibit-hd-master File: ExceptionHandler.java View source code |
/**
* <p>Some exceptions are known to be caused by buggy JVM implementations across operating systems
* and their effects are confined to data transfer operations (e.g. pasting clipboard or focus
* transitions within dialogs).</p>
*
* <p>If, after careful study through the error reporting process, there is no known solution
* to the problem and <strong>it does not affect ongoing user operations</strong> then it can be
* entered here to avoid repetitive logging of a known "cannot fix" problem.</p>
*
* <p><strong>If in doubt leave it out.</strong> It is better to show the user an error reporting
* dialog and exit than it is for them to continue with an application in an unstable state due to
* not all necessary code having executed after an exception.</p>
*
* <p>When evaluating the exception must have a complete stack trace that does not originate from any
* non-JDK code. An automated check for this is built in.</p>
*
* @param t The Throwable to check
*
* @return True if the Throwable can be considered benign (ongoing operations will be OK)
*/
private static boolean isBenign(Throwable t) {
// Verify that no application code is involved
for (StackTraceElement stackTraceElement : t.getStackTrace()) {
if (stackTraceElement.getClassName().startsWith("org.multibit")) {
// We can detect this so note this in the error report
log.warn("Stack trace contains 'org.multibit'");
return false;
}
}
// Must be external code to be here
// Look for simple known exception messages
// These tend to be invariant across JVMs and allow for specific cases to be trapped
// rather than looking for a particular class in a stack trace
String message = t.getMessage();
if (message == null) {
// No information so assume the worst
return false;
}
// The application logic should not be affected
if (message.contains("Comparison method violates its general contract!")) {
log.warn("Detected TimSort exception. Treat as benign.");
return true;
}
// The application logic should not be affected
if (message.contains("Failed to retrieve atom name")) {
log.warn("Detected XlibWrapper exception. Treat as benign.");
return true;
}
// This is a Swing glitch that we can do nothing about
if (message.contains("javax.swing.plaf.FontUIResource cannot be cast to javax.swing.Painter")) {
log.warn("Detected FontUIResource cannot be cast to Painter exception. Treat as benign.");
return true;
}
// This is a Swing glitch that we can do nothing about
if (message.contains("sun.awt.image.BufImgSurfaceData cannot be cast to sun.java2d.xr.XRSurfaceData")) {
log.warn("Detected BufImgSurfaceData cannot be cast to XRSurfaceData exception. Treat as benign.");
return true;
}
// This is a Swing glitch that we can do nothing about
if (message.contains("sun.awt.Win32GraphicsConfig cannot be cast to sun.java2d.d3d.D3DGraphicsConfig")) {
log.warn("Detected Win32GraphicsConfig cannot be cast to D3DGraphicsConfig exception. Treat as benign.");
return true;
}
// This is a Swing glitch that we can do nothing about
if (message.contains("javax.swing.plaf.nimbus.DerivedColor$UIResource cannot be cast to java.awt.Font")) {
log.warn("Detected DerivedColor$UIResource cannot be cast to java.awt.Font exception. Treat as benign.");
return true;
}
// This is a Swing glitch that we can do nothing about
if (message.contains("java.lang.IllegalArgumentException: bad position: -1")) {
log.warn("Detected java.lang.IllegalArgumentException: bad position: -1 exception. Treat as benign.");
return true;
}
// This isn't really benign but as it is thrown on a PeerGroup executor thread we cannot intercept it anywhere else
if (message.contains("org.bitcoinj.net.discovery.PeerDiscoveryException: No peer discovery returned any results: check internet connection?")) {
log.warn("Detected org.bitcoinj.net.discovery.PeerDiscoveryException: No peer discovery returned any results: check internet connection? exception. Treat as benign.");
return true;
}
// Anything else is a problem
return false;
}Example 29
| Project: optaplanner-master File: SwingUtils.java View source code |
public static void increaseDefaultFont(float multiplier) {
for (Enumeration keys = UIManager.getDefaults().keys(); keys.hasMoreElements(); ) {
Object key = keys.nextElement();
Object value = UIManager.get(key);
if (value != null && value instanceof FontUIResource) {
FontUIResource fontUIResource = (FontUIResource) value;
UIManager.put(key, fontUIResource.deriveFont(fontUIResource.getSize() * multiplier));
}
}
}Example 30
| Project: Pixelitor-master File: UIManagerExt.java View source code |
/**
* Returns a font from the defaults. If the value for {@code key} is not a
* {@code Font}, {@code defaultFont} is returned.
*
* @param key an {@code Object} specifying the font
* @param defaultFont the font to return if the font specified by {@code key}
* does not exist
* @return the {@code Font} object
* @throws NullPointerException if {@code key} or {@code defaultFont} is {@code null}
*/
public static Font getSafeFont(Object key, Font defaultFont) {
Contract.asNotNull(defaultFont, "defaultFont cannot be null");
Font safeFont = UIManager.getFont(key);
if (safeFont == null) {
safeFont = defaultFont;
}
if (!(safeFont instanceof UIResource)) {
safeFont = new FontUIResource(safeFont);
}
return safeFont;
}Example 31
| Project: thinking-java-master File: UIUtils.java View source code |
/*########################################*/
public static void setUI() {
enableAntiAliasing();
// set LookAndFeel
try {
UIManager.setLookAndFeel(getLookAndFeel());
} catch (Exception ignore) {
}
// set DefaultFont
String bestFontFamily = getFontFamily(getBestFontFamilies());
for (Map.Entry<Object, Object> entry : UIManager.getDefaults().entrySet()) {
if (entry.getValue() instanceof FontUIResource) {
FontUIResource fontUIRes = (FontUIResource) entry.getValue();
entry.setValue(new FontUIResource(bestFontFamily, fontUIRes.getStyle(), getBestFontSize() > fontUIRes.getSize() ? getBestFontSize() : fontUIRes.getSize()));
}
}
}Example 32
| Project: Botnak-master File: AbstractTheme.java View source code |
public FontUIResource getControlTextFont() { if (controlFont == null) { if (JTattooUtilities.isLinux() && JTattooUtilities.isHiresScreen()) { controlFont = new FontUIResource(DIALOG, Font.BOLD, 14); } else { controlFont = new FontUIResource(DIALOG, Font.PLAIN, 12); } } return controlFont; }
Example 33
| Project: calibre2opds-master File: JTaskPaneGroupAddon.java View source code |
protected void addBasicDefaults(LookAndFeelAddons addon, List defaults) {
Font taskPaneFont = UIManager.getFont("Label.font");
if (taskPaneFont == null) {
taskPaneFont = new Font("Dialog", Font.PLAIN, 12);
}
taskPaneFont = taskPaneFont.deriveFont(Font.BOLD);
Color menuBackground = new ColorUIResource(SystemColor.menu);
defaults.addAll(Arrays.asList(new Object[] { JTaskPaneGroup.UI_CLASS_ID, "com.l2fprod.common.swing.plaf.basic.BasicTaskPaneGroupUI", "TaskPaneGroup.font", new FontUIResource(taskPaneFont), "TaskPaneGroup.background", UIManager.getColor("List.background"), "TaskPaneGroup.specialTitleBackground", new ColorUIResource(menuBackground.darker()), "TaskPaneGroup.titleBackgroundGradientStart", menuBackground, "TaskPaneGroup.titleBackgroundGradientEnd", menuBackground, "TaskPaneGroup.titleForeground", new ColorUIResource(SystemColor.menuText), "TaskPaneGroup.specialTitleForeground", new ColorUIResource(SystemColor.menuText).brighter(), "TaskPaneGroup.animate", Boolean.TRUE, "TaskPaneGroup.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "ENTER", "toggleExpanded", "SPACE", "toggleExpanded" }) }));
}Example 34
| Project: CodenameOne-master File: AWTConverters.java View source code |
public void register(ConverterRegistry registry) {
registry.addConverter(Dimension.class, String.class, this);
registry.addConverter(String.class, Dimension.class, this);
registry.addConverter(DimensionUIResource.class, String.class, this);
registry.addConverter(Insets.class, String.class, this);
registry.addConverter(String.class, Insets.class, this);
registry.addConverter(InsetsUIResource.class, String.class, this);
registry.addConverter(Point.class, String.class, this);
registry.addConverter(String.class, Point.class, this);
registry.addConverter(Rectangle.class, String.class, this);
registry.addConverter(String.class, Rectangle.class, this);
registry.addConverter(Font.class, String.class, this);
registry.addConverter(FontUIResource.class, String.class, this);
}Example 35
| Project: intellij-community-master File: LafManagerImpl.java View source code |
private void patchLafFonts(UIDefaults uiDefaults) {
//if (JBUI.isHiDPI()) {
// HashMap<Object, Font> newFonts = new HashMap<Object, Font>();
// for (Object key : uiDefaults.keySet().toArray()) {
// Object val = uiDefaults.get(key);
// if (val instanceof Font) {
// newFonts.put(key, JBFont.create((Font)val));
// }
// }
// for (Map.Entry<Object, Font> entry : newFonts.entrySet()) {
// uiDefaults.put(entry.getKey(), entry.getValue());
// }
//} else
UISettings uiSettings = UISettings.getInstance();
if (uiSettings.getOverrideLafFonts()) {
storeOriginalFontDefaults(uiDefaults);
initFontDefaults(uiDefaults, uiSettings.getFontSize(), new FontUIResource(uiSettings.getFontFace(), Font.PLAIN, uiSettings.getFontSize()));
JBUI.setUserScaleFactor(JBUI.getFontScale(uiSettings.getFontSize()));
} else {
restoreOriginalFontDefaults(uiDefaults);
}
}Example 36
| Project: jeboorker-master File: AWTConverters.java View source code |
public void register(ConverterRegistry registry) {
registry.addConverter(Dimension.class, String.class, this);
registry.addConverter(String.class, Dimension.class, this);
registry.addConverter(DimensionUIResource.class, String.class, this);
registry.addConverter(Insets.class, String.class, this);
registry.addConverter(String.class, Insets.class, this);
registry.addConverter(InsetsUIResource.class, String.class, this);
registry.addConverter(Point.class, String.class, this);
registry.addConverter(String.class, Point.class, this);
registry.addConverter(Rectangle.class, String.class, this);
registry.addConverter(String.class, Rectangle.class, this);
registry.addConverter(Font.class, String.class, this);
registry.addConverter(FontUIResource.class, String.class, this);
}Example 37
| Project: JTattoo-master File: AbstractTheme.java View source code |
public FontUIResource getControlTextFont() { if (controlFont == null) { if (JTattooUtilities.isLinux() && JTattooUtilities.isHiresScreen()) { controlFont = new FontUIResource(DIALOG, Font.BOLD, 14); } else { controlFont = new FontUIResource(DIALOG, Font.PLAIN, 12); } } return controlFont; }
Example 38
| Project: l2fprod-common-master File: AWTConverters.java View source code |
public void register(ConverterRegistry registry) {
registry.addConverter(Dimension.class, String.class, this);
registry.addConverter(String.class, Dimension.class, this);
registry.addConverter(DimensionUIResource.class, String.class, this);
registry.addConverter(Insets.class, String.class, this);
registry.addConverter(String.class, Insets.class, this);
registry.addConverter(InsetsUIResource.class, String.class, this);
registry.addConverter(Point.class, String.class, this);
registry.addConverter(String.class, Point.class, this);
registry.addConverter(Rectangle.class, String.class, this);
registry.addConverter(String.class, Rectangle.class, this);
registry.addConverter(Font.class, String.class, this);
registry.addConverter(FontUIResource.class, String.class, this);
}Example 39
| Project: neembuunow-master File: InitLookAndFeel.java View source code |
public static void init(Component jc) {
try {
colors();
toolTip();
scrollBar();
Fonts.initDefaultFont();
UIManager.put("Label.font", new FontUIResource(Fonts.MyriadPro.deriveFont(13f)));
if (jc == null) {
UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
} else {
SwingUtilities.updateComponentTreeUI(jc);
}
} catch (Exception lookandfeelexception) {
lookandfeelexception.printStackTrace(System.err);
}
}Example 40
| Project: netention-old1-master File: RunSelfBrowser.java View source code |
public static void adjustGlobalFontSize(Float percentChange, Component root) {
Enumeration keySet = UIManager.getDefaults().keys();
while (keySet.hasMoreElements()) {
Object key = keySet.nextElement();
Object value = UIManager.get(key);
if (value instanceof Font) {
Font f = (Font) value;
Float sizef = f.getSize2D() * percentChange;
int size = Math.round(sizef);
FontUIResource resf = new FontUIResource(f.getName(), f.getStyle(), size);
UIManager.put(key, resf);
}
}
SwingUtilities.updateComponentTreeUI(root);
}Example 41
| Project: openjpa-master File: SwingHelper.java View source code |
public static void setLookAndFeel(int fontSize) throws Exception {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
UIDefaults defaults = UIManager.getDefaults();
Enumeration<Object> keys = defaults.keys();
while (keys.hasMoreElements()) {
Object key = keys.nextElement();
if ((key instanceof String) && (((String) key).endsWith(".font"))) {
FontUIResource font = (FontUIResource) UIManager.get(key);
defaults.put(key, new FontUIResource(font.getFontName(), font.getStyle(), fontSize));
}
}
}Example 42
| Project: openjump-core-rels-master File: JUMPWorkbench.java View source code |
private static boolean setFont() throws Exception {
String test = I18N.get("ui.MenuNames.FILE");
boolean replaced = false;
Font font = null;
java.util.Enumeration keys = UIManager.getDefaults().keys();
while (keys.hasMoreElements()) {
Object key = keys.nextElement();
Object value = UIManager.get(key);
// loop over fontuires entries
if (value instanceof javax.swing.plaf.FontUIResource) {
FontUIResource fold = ((javax.swing.plaf.FontUIResource) value);
// can default font display test sentence?
if (fold.canDisplayUpTo(test) != -1) {
// fetch replacement candidate
if (font == null)
font = loadFonts()[0];
// copy attributes
Map attrs = fold.getAttributes();
// remove family attribute
java.text.AttributedCharacterIterator.Attribute fam = null;
for (Iterator iterator = attrs.keySet().iterator(); iterator.hasNext(); ) {
fam = (java.text.AttributedCharacterIterator.Attribute) iterator.next();
if (fam.toString().equals("java.awt.font.TextAttribute(family)")) {
break;
}
}
if (fam != null)
attrs.remove(fam);
// create the new fontuires
FontUIResource fnew = new javax.swing.plaf.FontUIResource(font.deriveFont(attrs));
// check if new font can display and set
if (fnew.canDisplayUpTo(test) == -1) {
UIManager.put(key, fnew);
replaced = true;
}
}
}
}
// replaced any?
return replaced;
}Example 43
| Project: opennars-master File: AWTConverters.java View source code |
public void register(ConverterRegistry registry) {
registry.addConverter(Dimension.class, String.class, this);
registry.addConverter(String.class, Dimension.class, this);
registry.addConverter(DimensionUIResource.class, String.class, this);
registry.addConverter(Insets.class, String.class, this);
registry.addConverter(String.class, Insets.class, this);
registry.addConverter(InsetsUIResource.class, String.class, this);
registry.addConverter(Point.class, String.class, this);
registry.addConverter(String.class, Point.class, this);
registry.addConverter(Rectangle.class, String.class, this);
registry.addConverter(String.class, Rectangle.class, this);
registry.addConverter(Font.class, String.class, this);
registry.addConverter(FontUIResource.class, String.class, this);
registry.addConverter(Color.class, String.class, this);
registry.addConverter(String.class, Color.class, this);
}Example 44
| Project: substance-master File: SubstanceSliderUI.java View source code |
/*
* (non-Javadoc)
*
* @see
* javax.swing.plaf.basic.BasicSliderUI#installDefaults(javax.swing.JSlider)
*/
@Override
protected void installDefaults(JSlider slider) {
super.installDefaults(slider);
Font f = slider.getFont();
if (f == null || f instanceof UIResource) {
slider.setFont(new FontUIResource(SubstanceLookAndFeel.getFontPolicy().getFontSet("Substance", null).getControlFont()));
}
int size = SubstanceSizeUtils.getSliderIconSize(SubstanceSizeUtils.getComponentFontSize(slider));
// System.out.println("Slider size : " + size);
this.horizontalIcon = SubstanceIconFactory.getSliderHorizontalIcon(size, false);
this.roundIcon = SubstanceIconFactory.getSliderRoundIcon(size);
this.verticalIcon = SubstanceIconFactory.getSliderVerticalIcon(size, false);
int focusIns = (int) Math.ceil(2.0 * SubstanceSizeUtils.getFocusStrokeWidth());
this.focusInsets = new Insets(focusIns, focusIns, focusIns, focusIns);
}Example 45
| Project: vassal-master File: ProgressDialogTest.java View source code |
@Override
public UIDefaults getDefaults() {
final float scale = 3f;
final UIDefaults defaults = super.getDefaults();
final Map<Object, Object> changes = new HashMap<Object, Object>();
for (Map.Entry<Object, Object> e : defaults.entrySet()) {
final Object key = e.getKey();
final Object val = e.getValue();
if (val instanceof FontUIResource) {
final FontUIResource ores = (FontUIResource) val;
final FontUIResource nres = new FontUIResource(ores.deriveFont(ores.getSize2D() * scale));
changes.put(key, nres);
System.out.println(key + " = " + nres);
} else if (val instanceof Font) {
final Font ofont = (Font) val;
final Font nfont = ofont.deriveFont(ofont.getSize2D() * scale);
changes.put(key, nfont);
System.out.println(key + " = " + nfont);
}
}
defaults.putAll(changes);
return defaults;
}Example 46
| Project: Amber-IDE-master File: UIUtil.java View source code |
/**
* Sets the default Font for the current UIManager
*
* @param fon the new Font
*/
public static void setUIFont(Font fon) {
FontUIResource f = new FontUIResource(fon);
Enumeration keys = UIManager.getDefaults().keys();
while (keys.hasMoreElements()) {
Object key = keys.nextElement();
Object value = UIManager.get(key);
if (value != null && value instanceof javax.swing.plaf.FontUIResource) {
UIManager.put(key, f);
}
}
for (Window w : Window.getWindows()) {
SwingUtilities.updateComponentTreeUI(w);
}
}Example 47
| Project: Weasis-master File: GeneralSetting.java View source code |
public static String setLookAndFeel(String look) {
// Do not display metal LAF in bold, it is ugly
//$NON-NLS-1$
UIManager.put("swing.boldMetal", Boolean.FALSE);
// Display slider value is set to false (already in all LAF by the panel title), used by GTK LAF
//$NON-NLS-1$
UIManager.put("Slider.paintValue", Boolean.FALSE);
String laf = getAvailableLookAndFeel(look);
try {
UIManager.setLookAndFeel(laf);
} catch (Exception e) {
laf = UIManager.getSystemLookAndFeelClassName();
LOGGER.error("Unable to set the Look&Feel", e);
}
// Fix font issue for displaying some Asiatic characters. Some L&F have special fonts.
//$NON-NLS-1$
setUIFont(new javax.swing.plaf.FontUIResource("SansSerif", Font.PLAIN, 12));
return laf;
}Example 48
| Project: borg_calendar-master File: NwFontChooserS.java View source code |
public static void setDefaultFont(Font f) {
FontUIResource fui = new FontUIResource(f);
Enumeration<Object> keys = UIManager.getDefaults().keys();
while (keys.hasMoreElements()) {
Object key = keys.nextElement();
Object value = UIManager.get(key);
if (value instanceof FontUIResource)
UIManager.put(key, fui);
}
}Example 49
| Project: ChromisPOS-master File: PromotionSupport.java View source code |
// Script support functions
// Display a message as a popup dialog
public void ShowMessage(String title, String message) {
// Get details of the original font before we change it otherwise all dialogboxes will use new settings
JOptionPane pane = new JOptionPane();
Font originalFont = pane.getFont();
UIManager.put("OptionPane.buttonFont", new FontUIResource(new Font("ARIAL", Font.PLAIN, 20)));
JLabel FontText = new JLabel(message);
JOptionPane newpane = new JOptionPane();
newpane.setMessage(FontText);
Dialog dlg = newpane.createDialog(title);
dlg.setVisible(true);
// Return to default settings
UIManager.put("OptionPane.buttonFont", new FontUIResource(new Font(originalFont.getName(), originalFont.getStyle(), originalFont.getSize())));
}Example 50
| Project: consulo-master File: LafManagerImpl.java View source code |
private void patchLafFonts(UIDefaults uiDefaults) {
//if (JBUI.isHiDPI()) {
// HashMap<Object, Font> newFonts = new HashMap<Object, Font>();
// for (Object key : uiDefaults.keySet().toArray()) {
// Object val = uiDefaults.get(key);
// if (val instanceof Font) {
// newFonts.put(key, JBFont.create((Font)val));
// }
// }
// for (Map.Entry<Object, Font> entry : newFonts.entrySet()) {
// uiDefaults.put(entry.getKey(), entry.getValue());
// }
//} else
UISettings uiSettings = UISettings.getInstance();
if (uiSettings.OVERRIDE_NONIDEA_LAF_FONTS) {
storeOriginalFontDefaults(uiDefaults);
JBUI.setUserScaleFactor(uiSettings.FONT_SIZE / UIUtil.DEF_SYSTEM_FONT_SIZE);
initFontDefaults(uiDefaults, uiSettings.FONT_SIZE, new FontUIResource(uiSettings.FONT_FACE, Font.PLAIN, uiSettings.FONT_SIZE));
} else {
restoreOriginalFontDefaults(uiDefaults);
}
}Example 51
| Project: freecol-android-master File: FreeColLookAndFeel.java View source code |
/**
* Installs a FreeColLookAndFeel as the default look and feel.
*
* @param fclaf The <code>FreeColLookAndFeel</code> to install.
* @param defaultFont A <code>Font</code> to use by default.
* @throws FreeColException if the installation fails.
*/
public static void install(FreeColLookAndFeel fclaf, Font defaultFont) throws FreeColException {
// try {
// UIManager.setLookAndFeel(fclaf);
// } catch (UnsupportedLookAndFeelException e) {
// throw new FreeColException(e.getMessage());
// }
//
// // Set the default font in all UI elements.
// UIDefaults u = UIManager.getDefaults();
// java.util.Enumeration<Object> keys = u.keys();
// while (keys.hasMoreElements()) {
// Object key = keys.nextElement();
// if (u.get(key) instanceof com.erik.repackaged.javax.swing.plaf.FontUIResource) {
// u.put(key, defaultFont);
// }
// }
}Example 52
| Project: Holmes-master File: SystrayService.java View source code |
/**
* Initializes UI manager.
*
* @return true on success
*/
private boolean initUIManager() {
boolean result = true;
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
// Add bold font for systray menu item
Font menuItemFont = getFont(MENU_ITEM_FONT);
if (menuItemFont != null) {
UIManager.put(MENU_ITEM_BOLD_FONT, new FontUIResource(menuItemFont.getFamily(), BOLD, menuItemFont.getSize()));
}
} catch (ReflectiveOperationExceptionUnsupportedLookAndFeelException | e) {
LOGGER.error(e.getMessage(), e);
result = false;
}
return result;
}Example 53
| Project: jdk7u-jdk-master File: X11FontManager.java View source code |
@Override protected FontUIResource getFontConfigFUIR(String family, int style, int size) { CompositeFont font2D = getFontConfigManager().getFontConfigFont(family, style); if (font2D == null) { // Not expected, just a precaution. return new FontUIResource(family, style, size); } /* The name of the font will be that of the physical font in slot, * but by setting the handle to that of the CompositeFont it * renders as that CompositeFont. * It also needs to be marked as a created font which is the * current mechanism to signal that deriveFont etc must copy * the handle from the original font. */ FontUIResource fuir = new FontUIResource(font2D.getFamilyName(null), style, size); FontAccess.getFontAccess().setFont2D(fuir, font2D.handle); FontAccess.getFontAccess().setCreatedFont(fuir); return fuir; }
Example 54
| Project: jide-oss-master File: WindowsDesktopProperty.java View source code |
/**
* Configures the value as appropriate for a defaults property in the UIDefaults table.
*/
protected Object configureValue(Object value) {
if (value != null) {
if (value instanceof Color) {
return new ColorUIResource((Color) value);
} else if (value instanceof Font) {
if (fontSize != -1 && fontStyle != -1f) {
return new FontUIResource(((Font) value).deriveFont(fontStyle, fontSize));
} else if (fontSize != -1) {
return new FontUIResource(((Font) value).deriveFont(fontSize));
} else if (fontStyle != -1f) {
return new FontUIResource(((Font) value).deriveFont(fontStyle));
} else {
return new FontUIResource((Font) value);
}
} else if (value instanceof UIDefaults.ProxyLazyValue) {
value = ((UIDefaults.ProxyLazyValue) value).createValue(null);
} else if (value instanceof UIDefaults.ActiveValue) {
value = ((UIDefaults.ActiveValue) value).createValue(null);
}
}
return value;
}Example 55
| Project: mymom-master File: FreeColLookAndFeel.java View source code |
/**
* Installs a FreeColLookAndFeel as the default look and feel.
*
* @param fclaf The <code>FreeColLookAndFeel</code> to install.
* @param defaultFont A <code>Font</code> to use by default.
* @throws FreeColException if the installation fails.
*/
public static void install(FreeColLookAndFeel fclaf, Font defaultFont) throws FreeColException {
try {
UIManager.setLookAndFeel(fclaf);
} catch (UnsupportedLookAndFeelException e) {
throw new FreeColException(e.getMessage());
}
// Set the default font in all UI elements.
UIDefaults u = UIManager.getDefaults();
java.util.Enumeration<Object> keys = u.keys();
while (keys.hasMoreElements()) {
Object key = keys.nextElement();
if (u.get(key) instanceof javax.swing.plaf.FontUIResource) {
u.put(key, defaultFont);
}
}
}Example 56
| Project: notwa-master File: MainWindow.java View source code |
private void startup() {
/*
* This solves the problem with TextArea font in windows
*/
UIManager.put("TextArea.font", new FontUIResource("monospaced", Font.PLAIN, 12));
/*
* Show dialog for inserting new ConnectionInfo
*/
if (Config.getInstance().getConnecionStrings().isEmpty()) {
this.invokeDatabaseDefinition(null);
}
/*
* Show login dialog
*/
this.invokeLogin(null);
/*
* Disable menu items that cannot be used until user is not logged
*/
this.setMenuEnabled(false);
}Example 57
| Project: ptii-master File: CustomerPanel.java View source code |
public static void main(String[] args) {
UIDefaults defaults = UIManager.getDefaults();
defaults.put("Label.font", new javax.swing.plaf.FontUIResource(new java.awt.Font("Arial", java.awt.Font.PLAIN, 12)));
defaults.put("ComboBox.background", new javax.swing.plaf.ColorUIResource(255, 255, 255));
CustomerPanel customerPanel = new CustomerPanel();
JFrame frame = new JFrame("Edit Customer");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().setLayout(new BorderLayout());
frame.getContentPane().add(customerPanel, BorderLayout.CENTER);
frame.setSize(600, 700);
frame.setVisible(true);
}Example 58
| Project: rapidminer-studio-master File: RapidLookAndFeel.java View source code |
@Override
protected void initComponentDefaults(UIDefaults table) {
super.initComponentDefaults(table);
Object fieldInputMap = new UIDefaults.LazyInputMap(new Object[] { CONTROL_ID + " C", DefaultEditorKit.copyAction, CONTROL_ID + " V", DefaultEditorKit.pasteAction, CONTROL_ID + " X", DefaultEditorKit.cutAction, "COPY", DefaultEditorKit.copyAction, "PASTE", DefaultEditorKit.pasteAction, "CUT", DefaultEditorKit.cutAction, "shift LEFT", DefaultEditorKit.selectionBackwardAction, "shift KP_LEFT", DefaultEditorKit.selectionBackwardAction, "shift RIGHT", DefaultEditorKit.selectionForwardAction, "shift KP_RIGHT", DefaultEditorKit.selectionForwardAction, CONTROL_ID + " LEFT", DefaultEditorKit.previousWordAction, CONTROL_ID + " KP_LEFT", DefaultEditorKit.previousWordAction, CONTROL_ID + " RIGHT", DefaultEditorKit.nextWordAction, CONTROL_ID + " KP_RIGHT", DefaultEditorKit.nextWordAction, CONTROL_ID + " shift LEFT", DefaultEditorKit.selectionPreviousWordAction, CONTROL_ID + " shift KP_LEFT", DefaultEditorKit.selectionPreviousWordAction, CONTROL_ID + " shift RIGHT", DefaultEditorKit.selectionNextWordAction, CONTROL_ID + " shift KP_RIGHT", DefaultEditorKit.selectionNextWordAction, CONTROL_ID + " A", DefaultEditorKit.selectAllAction, "HOME", DefaultEditorKit.beginLineAction, "END", DefaultEditorKit.endLineAction, "shift HOME", DefaultEditorKit.selectionBeginLineAction, "shift END", DefaultEditorKit.selectionEndLineAction, "BACK_SPACE", DefaultEditorKit.deletePrevCharAction, CONTROL_ID + " BACK_SPACE", DefaultEditorKit.deletePrevWordAction, "DELETE", DefaultEditorKit.deleteNextCharAction, CONTROL_ID + " DELETE", DefaultEditorKit.deleteNextWordAction, "RIGHT", DefaultEditorKit.forwardAction, "LEFT", DefaultEditorKit.backwardAction, "KP_RIGHT", DefaultEditorKit.forwardAction, "KP_LEFT", DefaultEditorKit.backwardAction, "ENTER", JTextField.notifyAction, CONTROL_ID + " BACK_SLASH", "unselect", CONTROL_ID + " shift O", "toggle-componentOrientation" });
Object multilineInputMap = new UIDefaults.LazyInputMap(new Object[] { CONTROL_ID + " C", DefaultEditorKit.copyAction, CONTROL_ID + " V", DefaultEditorKit.pasteAction, CONTROL_ID + " X", DefaultEditorKit.cutAction, "COPY", DefaultEditorKit.copyAction, "PASTE", DefaultEditorKit.pasteAction, "CUT", DefaultEditorKit.cutAction, "shift LEFT", DefaultEditorKit.selectionBackwardAction, "shift KP_LEFT", DefaultEditorKit.selectionBackwardAction, "shift RIGHT", DefaultEditorKit.selectionForwardAction, "shift KP_RIGHT", DefaultEditorKit.selectionForwardAction, CONTROL_ID + " LEFT", DefaultEditorKit.previousWordAction, CONTROL_ID + " KP_LEFT", DefaultEditorKit.previousWordAction, CONTROL_ID + " RIGHT", DefaultEditorKit.nextWordAction, CONTROL_ID + " KP_RIGHT", DefaultEditorKit.nextWordAction, CONTROL_ID + " shift LEFT", DefaultEditorKit.selectionPreviousWordAction, CONTROL_ID + " shift KP_LEFT", DefaultEditorKit.selectionPreviousWordAction, CONTROL_ID + " shift RIGHT", DefaultEditorKit.selectionNextWordAction, CONTROL_ID + " shift KP_RIGHT", DefaultEditorKit.selectionNextWordAction, CONTROL_ID + " A", DefaultEditorKit.selectAllAction, "HOME", DefaultEditorKit.beginLineAction, "END", DefaultEditorKit.endLineAction, "shift HOME", DefaultEditorKit.selectionBeginLineAction, "shift END", DefaultEditorKit.selectionEndLineAction, "UP", DefaultEditorKit.upAction, "KP_UP", DefaultEditorKit.upAction, "DOWN", DefaultEditorKit.downAction, "KP_DOWN", DefaultEditorKit.downAction, "PAGE_UP", DefaultEditorKit.pageUpAction, "PAGE_DOWN", DefaultEditorKit.pageDownAction, "shift PAGE_UP", "selection-page-up", "shift PAGE_DOWN", "selection-page-down", CONTROL_ID + " shift PAGE_UP", "selection-page-left", CONTROL_ID + " shift PAGE_DOWN", "selection-page-right", "shift UP", DefaultEditorKit.selectionUpAction, "shift KP_UP", DefaultEditorKit.selectionUpAction, "shift DOWN", DefaultEditorKit.selectionDownAction, "shift KP_DOWN", DefaultEditorKit.selectionDownAction, "ENTER", DefaultEditorKit.insertBreakAction, "BACK_SPACE", DefaultEditorKit.deletePrevCharAction, CONTROL_ID + " BACK_SPACE", DefaultEditorKit.deletePrevWordAction, "DELETE", DefaultEditorKit.deleteNextCharAction, CONTROL_ID + " DELETE", DefaultEditorKit.deleteNextWordAction, "RIGHT", DefaultEditorKit.forwardAction, "LEFT", DefaultEditorKit.backwardAction, "KP_RIGHT", DefaultEditorKit.forwardAction, "KP_LEFT", DefaultEditorKit.backwardAction, "TAB", DefaultEditorKit.insertTabAction, CONTROL_ID + " BACK_SLASH", "unselect", CONTROL_ID + " HOME", DefaultEditorKit.beginAction, CONTROL_ID + " END", DefaultEditorKit.endAction, CONTROL_ID + " shift HOME", DefaultEditorKit.selectionBeginAction, CONTROL_ID + " shift END", DefaultEditorKit.selectionEndAction, CONTROL_ID + " T", "next-link-action", CONTROL_ID + " shift T", "previous-link-action", CONTROL_ID + " SPACE", "activate-link-action", CONTROL_ID + " shift O", "toggle-componentOrientation" });
Object toolTipBorder = new UIDefaults.ProxyLazyValue("javax.swing.plaf.BorderUIResource$LineBorderUIResource", new Object[] { new ColorUIResource(100, 100, 100) });
Object focusCellHighlightBorder = new UIDefaults.ProxyLazyValue("javax.swing.plaf.BorderUIResource$LineBorderUIResource", new Object[] { Colors.TEXTFIELD_BORDER });
Object fontDialog12 = new UIDefaults.ProxyLazyValue("javax.swing.plaf.FontUIResource", null, new Object[] { "Dialog", Integer.valueOf(0), Integer.valueOf(12) });
Object fontDialog12Bold = new UIDefaults.ProxyLazyValue("javax.swing.plaf.FontUIResource", null, new Object[] { "Dialog", Integer.valueOf(Font.BOLD), Integer.valueOf(12) });
Object fontDialog11Bold = new UIDefaults.ProxyLazyValue("javax.swing.plaf.FontUIResource", null, new Object[] { "Dialog", Integer.valueOf(Font.BOLD), Integer.valueOf(11) });
ColorUIResource caretColor = new ColorUIResource(0, 25, 100);
Object textFieldMargin = new InsetsUIResource(4, 6, 4, 6);
Object tabbedpaneTabInsets = new InsetsUIResource(3, 0, 0, 0);
Object menuItemInsets = new InsetsUIResource(5, 0, 5, 0);
Object defaultDirectoryIcon = SwingTools.createImage("plaf/folder_open_24.png");
Object sortAscIcon = SwingTools.createImage("plaf/laf_sort_up.png");
Object sortDescIcon = SwingTools.createImage("plaf/laf_sort_down.png");
Integer zero = Integer.valueOf(0);
Integer one = Integer.valueOf(1);
Object sliderFocusInsets = new InsetsUIResource(2, 2, 2, 2);
Object[] defaults = { // Button
"Button.font", fontDialog12, "Button.background", COLORS.getCommonBackground(), "Button.foreground", Colors.TEXT_FOREGROUND, "Button.margin", new InsetsUIResource(10, 20, 10, 20), "Button.textShiftOffset", one, "Button.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released", "ENTER", "pressed", "released ENTER", "released" }), // ToggleButton
"ToggleButton.font", fontDialog12, "ToggleButton.background", COLORS.getCommonBackground(), "ToggleButton.foreground", Colors.TEXT_FOREGROUND, "ToggleButton.textShiftOffset", one, "ToggleButton.margin", textFieldMargin, "Button.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), // RadioButton
"RadioButton.font", fontDialog12, "RadioButton.background", COLORS.getCommonBackground(), "RadioButton.foreground", Colors.TEXT_FOREGROUND, "RadioButton.textShiftOffset", zero, "RadioButton.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released", "RETURN", "pressed" }), // CheckBox
"CheckBox.font", fontDialog12, "CheckBox.background", COLORS.getCommonBackground(), "CheckBox.foreground", Colors.TEXT_FOREGROUND, "CheckBox.textShiftOffset", zero, "CheckBox.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released", "RETURN", "pressed" }), // TextField
"TextField.selectionBackground", Colors.TEXT_HIGHLIGHT_BACKGROUND, // ComboBox
"ComboBox.font", fontDialog12, "ComboBox.selectionBackground", Colors.TEXT_HIGHLIGHT_BACKGROUND, "ComboBox.selectionForeground", Colors.TEXT_HIGHLIGHT_FOREGROUND, "ComboBox.background", COLORS.getCommonBackground(), "ComboBox.foreground", Colors.TEXT_FOREGROUND, "ComboBox.textShiftOffset", one, "ComboBox.disabledForeground", getInactiveSystemTextColor(), "ComboBox.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "hidePopup", "PAGE_UP", "pageUpPassThrough", "PAGE_DOWN", "pageDownPassThrough", "HOME", "homePassThrough", "END", "endPassThrough", "DOWN", "selectNext", "KP_DOWN", "selectNext", "alt DOWN", "togglePopup", "alt KP_DOWN", "togglePopup", "alt UP", "togglePopup", "alt KP_UP", "togglePopup", "SPACE", "spacePopup", "ENTER", "enterPressed", "UP", "selectPrevious", "KP_UP", "selectPrevious" }), // Filechooser
"FileChooser.defaultDirectoryIcon", defaultDirectoryIcon, "FileChooser.newFolderIcon", null, "FileChooser.upFolderIcon", null, "FileChooser.homeFolderIcon", null, "FileChooser.detailsViewIcon", null, "FileChooser.listViewIcon", null, "FileView.directoryIcon", null, "FileView.fileIcon", null, "FileView.computerIcon", null, "FileView.hardDriveIcon", null, "FileView.floppyDriveIcon", null, "FileChooser.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "cancelSelection", "BACK_SPACE", "Go Up", "ENTER", "approveSelection" }), // InternalFrame
"InternalFrame.titleFont", new FontUIResource("Dialog", 1, 12), "InternalFrame.activeTitleForeground", Colors.TEXT_FOREGROUND, "InternalFrame.inactiveTitleForeground", Colors.TEXT_FOREGROUND, "InternalFrame.closeIcon", SwingTools.createImage("plaf/close_icon.png"), "InternalFrame.rolloverCloseIcon", SwingTools.createImage("plaf/armed_close_icon.png"), "InternalFrame.maximizeIcon", SwingTools.createImage("plaf/maximize_icon.png"), "InternalFrame.rolloverMaximizeIcon", SwingTools.createImage("plaf/armed_maximize_icon.png"), "InternalFrame.minimizeIcon", SwingTools.createImage("plaf/minimize_icon.png"), "InternalFrame.rolloverMinimizeIcon", SwingTools.createImage("plaf/armed_minimize_icon.png"), "InternalFrame.iconifyIcon", SwingTools.createImage("plaf/iconify_icon.png"), "InternalFrame.rolloverIconifyIcon", SwingTools.createImage("plaf/armed_iconify_icon.png"), "InternalFrame.icon", SwingTools.createImage("plaf/internal_icon.png"), // DesktopIcon
"DesktopIcon.foreground", getControlTextColor(), "DesktopIcon.width", new Integer(140), "DesktopIcon.font", getMainFont(), // Desktop
"Desktop.background", COLORS.getDesktopBackgroundColor(), "Desktop.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { CONTROL_ID + " F5", "restore", CONTROL_ID + " F4", "close", CONTROL_ID + " F7", "move", CONTROL_ID + " F8", "resize", "RIGHT", "right", "KP_RIGHT", "right", "shift RIGHT", "shrinkRight", "shift KP_RIGHT", "shrinkRight", "LEFT", "left", "KP_LEFT", "left", "shift LEFT", "shrinkLeft", "shift KP_LEFT", "shrinkLeft", "UP", "up", "KP_UP", "up", "shift UP", "shrinkUp", "shift KP_UP", "shrinkUp", "DOWN", "down", "KP_DOWN", "down", "shift DOWN", "shrinkDown", "shift KP_DOWN", "shrinkDown", "ESCAPE", "escape", CONTROL_ID + " F9", "minimize", CONTROL_ID + " F10", "maximize", CONTROL_ID + " F6", "selectNextFrame", CONTROL_ID + " TAB", "selectNextFrame", CONTROL_ID + " alt F6", "selectNextFrame", "shift ctrl alt F6", "selectPreviousFrame", CONTROL_ID + " F12", "navigateNext", "shift ctrl F12", "navigatePrevious" }), // Label
"Label.font", fontDialog12, "Label.foreground", getSystemTextColor(), "Label.disabledForeground", getInactiveSystemTextColor(), "Label.background", Colors.PANEL_BACKGROUND, // List
"List.focusCellHighlightBorder", focusCellHighlightBorder, "List.font", fontDialog12, "List.background", Colors.WHITE, "List.selectionBackground", Colors.TEXT_HIGHLIGHT_BACKGROUND, "List.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { CONTROL_ID + " C", "copy", CONTROL_ID + " V", "paste", CONTROL_ID + " X", "cut", "COPY", "copy", "PASTE", "paste", "CUT", "cut", "UP", "selectPreviousRow", "KP_UP", "selectPreviousRow", "shift UP", "selectPreviousRowExtendSelection", "shift KP_UP", "selectPreviousRowExtendSelection", "DOWN", "selectNextRow", "KP_DOWN", "selectNextRow", "shift DOWN", "selectNextRowExtendSelection", "shift KP_DOWN", "selectNextRowExtendSelection", "LEFT", "selectPreviousColumn", "KP_LEFT", "selectPreviousColumn", "shift LEFT", "selectPreviousColumnExtendSelection", "shift KP_LEFT", "selectPreviousColumnExtendSelection", "RIGHT", "selectNextColumn", "KP_RIGHT", "selectNextColumn", "shift RIGHT", "selectNextColumnExtendSelection", "shift KP_RIGHT", "selectNextColumnExtendSelection", "HOME", "selectFirstRow", "shift HOME", "selectFirstRowExtendSelection", "END", "selectLastRow", "shift END", "selectLastRowExtendSelection", "PAGE_UP", "scrollUp", "shift PAGE_UP", "scrollUpExtendSelection", "PAGE_DOWN", "scrollDown", "shift PAGE_DOWN", "scrollDownExtendSelection", CONTROL_ID + " A", "selectAll", CONTROL_ID + " SLASH", "selectAll", CONTROL_ID + " BACK_SLASH", "clearSelection" }), // MenuBar
"MenuBar.font", fontDialog12, "MenuBar.windowBindings", new Object[] { "F10", "takeFocus" }, "MenuBar.selectionForeground", Colors.TEXT_HIGHLIGHT_FOREGROUND, // Menu Item
"MenuItem.font", fontDialog12, "MenuItem.margin", menuItemInsets, "MenuItem.acceleratorFont", fontDialog12, "MenuItem.selectionBackground", getMenuSelectedBack(), "MenuItem.selectionForeground", Colors.TEXT_HIGHLIGHT_FOREGROUND, "MenuItem.foreground", Colors.TEXT_HIGHLIGHT_FOREGROUND, "MenuItem.acceleratorForeground", Colors.TEXT_HIGHLIGHT_FOREGROUND, // RadioButtonMenuItem
"RadioButtonMenuItem.font", fontDialog12, "RadioButtonMenuItem.margin", menuItemInsets, "RadioButtonMenuItem.selectionBackground", getMenuSelectedBack(), "RadioButtonMenuItem.checkIcon", new UIDefaults.ProxyLazyValue("com.rapidminer.gui.look.icons.IconFactory", "getRadioButtonMenuItemIcon"), // CheckBoxMenuItem
"CheckBoxMenuItem.font", fontDialog12, "CheckBoxMenuItem.margin", menuItemInsets, "CheckBoxMenuItem.selectionBackground", getMenuSelectedBack(), "CheckBoxMenuItem.checkIcon", new UIDefaults.ProxyLazyValue("com.rapidminer.gui.look.icons.IconFactory", "getCheckBoxMenuItemIcon"), // Menus
"Menu.font", fontDialog12, "Menu.selectionBackground", getMenuSelectedBack(), "Menu.selectionForeground", Colors.TEXT_HIGHLIGHT_FOREGROUND, "Menu.margin", menuItemInsets, // PopupMenu
"PopupMenu.font", fontDialog12, "PopupMenu.selectionForeground", Colors.TEXT_HIGHLIGHT_FOREGROUND, // OptionPane
"OptionPane.font", fontDialog12, "OptionPane.informationIcon", SwingTools.createImage("icons/48/information.png"), "OptionPane.errorIcon", SwingTools.createImage("icons/48/error.png"), "OptionPane.questionIcon", SwingTools.createImage("icons/48/question.png"), "OptionPane.warningIcon", SwingTools.createImage("icons/48/sign_warning.png"), // Panel
"Panel.font", fontDialog12, // ProggressBar
"ProgressBar.foreground", new ColorUIResource(40, 40, 40), "ProgressBar.background", new ColorUIResource(240, 240, 240), "ProgressBar.font", new java.awt.Font("Dialog", 0, 10), "ProgressBar.cycleTime", new Integer(12000), // Separator
"Separator.foreground", Colors.TEXTFIELD_BORDER, // ScrollBar
"ScrollBar.border", null, "ScrollBar.background", getColors().getCommonBackground(), "ScrollBar.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "RIGHT", "positiveUnitIncrement", "KP_RIGHT", "positiveUnitIncrement", "DOWN", "positiveUnitIncrement", "KP_DOWN", "positiveUnitIncrement", "PAGE_DOWN", "positiveBlockIncrement", "LEFT", "negativeUnitIncrement", "KP_LEFT", "negativeUnitIncrement", "UP", "negativeUnitIncrement", "KP_UP", "negativeUnitIncrement", "PAGE_UP", "negativeBlockIncrement", "HOME", "minScroll", "END", "maxScroll" }), // ScrollPane
"ScrollPane.font", fontDialog12, "ScrollPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "RIGHT", "unitScrollRight", "KP_RIGHT", "unitScrollRight", "DOWN", "unitScrollDown", "KP_DOWN", "unitScrollDown", "LEFT", "unitScrollLeft", "KP_LEFT", "unitScrollLeft", "UP", "unitScrollUp", "KP_UP", "unitScrollUp", "PAGE_UP", "scrollUp", "PAGE_DOWN", "scrollDown", CONTROL_ID + " PAGE_UP", "scrollLeft", CONTROL_ID + " PAGE_DOWN", "scrollRight", CONTROL_ID + " HOME", "scrollHome", CONTROL_ID + " END", "scrollEnd" }), // ViewPort
"Viewport.font", fontDialog12, // Slider
"Slider.focusInsets", sliderFocusInsets, "Slider.font", fontDialog11Bold, "Slider.disabledForeground", getInactiveSystemTextColor(), "Slider.trackWidth", new Integer(7), "Slider.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "RIGHT", "positiveUnitIncrement", "KP_RIGHT", "positiveUnitIncrement", "DOWN", "negativeUnitIncrement", "KP_DOWN", "negativeUnitIncrement", "PAGE_DOWN", "negativeBlockIncrement", CONTROL_ID + " PAGE_DOWN", "negativeBlockIncrement", "LEFT", "negativeUnitIncrement", "KP_LEFT", "negativeUnitIncrement", "UP", "positiveUnitIncrement", "KP_UP", "positiveUnitIncrement", "PAGE_UP", "positiveBlockIncrement", CONTROL_ID + " PAGE_UP", "positiveBlockIncrement", "HOME", "minScroll", "END", "maxScroll" }), // Spinner
"Spinner.font", fontDialog12, "Spinner.background", COLORS.getCommonBackground(), "Spinner.margin", new InsetsUIResource(10, 10, 10, 10), "Spinner.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "UP", "increment", "KP_UP", "increment", "DOWN", "decrement", "KP_DOWN", "decrement" }), // SplitPane
"SplitPane.dividerSize", Integer.valueOf(5), "SplitPane.highlight", Colors.SPLITPANE_BORDER_FOCUS, "SplitPaneDivider.draggingColor", Colors.SPLITPANE_BORDER_FOCUS, "SplitPane.shadow", new ColorUIResource(200, 200, 200), "SplitPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "UP", "negativeIncrement", "DOWN", "positiveIncrement", "LEFT", "negativeIncrement", "RIGHT", "positiveIncrement", "KP_UP", "negativeIncrement", "KP_DOWN", "positiveIncrement", "KP_LEFT", "negativeIncrement", "KP_RIGHT", "positiveIncrement", "HOME", "selectMin", "END", "selectMax", "F8", "startResize", "F6", "toggleFocus", CONTROL_ID + " TAB", "focusOutForward", CONTROL_ID + " shift TAB", "focusOutBackward" }), "SplitPaneDivider.border", null, // TabbedPane
"TabbedPane.tabAreaInsets", tabbedpaneTabInsets, "TabbedPane.font", fontDialog12, "TabbedPane.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "RIGHT", "navigateRight", "KP_RIGHT", "navigateRight", "LEFT", "navigateLeft", "KP_LEFT", "navigateLeft", "UP", "navigateUp", "KP_UP", "navigateUp", "DOWN", "navigateDown", "KP_DOWN", "navigateDown", CONTROL_ID + " DOWN", "requestFocusForVisibleComponent", CONTROL_ID + " KP_DOWN", "requestFocusForVisibleComponent" }), "TabbedPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { CONTROL_ID + " PAGE_DOWN", "navigatePageDown", CONTROL_ID + " PAGE_UP", "navigatePageUp", CONTROL_ID + " UP", "requestFocus", CONTROL_ID + " KP_UP", "requestFocus" }), // Table
"Table.font", fontDialog12, "Table.background", Colors.WHITE, "Table.selectionForeground", Colors.TEXT_HIGHLIGHT_FOREGROUND, "Table.gridColor", Colors.TABLE_CELL_BORDER, "Table.focusCellForeground", Colors.TEXT_HIGHLIGHT_FOREGROUND, "Table.focusCellHighlightBorder", new LineBorderUIResource(Colors.TEXT_HIGHLIGHT_BACKGROUND), "Table.ascendingSortIcon", sortAscIcon, "Table.descendingSortIcon", sortDescIcon, "Table.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { CONTROL_ID + " C", "copy", CONTROL_ID + " V", "paste", CONTROL_ID + " X", "cut", "COPY", "copy", "PASTE", "paste", "CUT", "cut", "RIGHT", "selectNextColumn", "KP_RIGHT", "selectNextColumn", "LEFT", "selectPreviousColumn", "KP_LEFT", "selectPreviousColumn", "DOWN", "selectNextRow", "KP_DOWN", "selectNextRow", "UP", "selectPreviousRow", "KP_UP", "selectPreviousRow", "shift RIGHT", "selectNextColumnExtendSelection", "shift KP_RIGHT", "selectNextColumnExtendSelection", "shift LEFT", "selectPreviousColumnExtendSelection", "shift KP_LEFT", "selectPreviousColumnExtendSelection", "shift DOWN", "selectNextRowExtendSelection", "shift KP_DOWN", "selectNextRowExtendSelection", "shift UP", "selectPreviousRowExtendSelection", "shift KP_UP", "selectPreviousRowExtendSelection", "PAGE_UP", "scrollUpChangeSelection", "PAGE_DOWN", "scrollDownChangeSelection", "HOME", "selectFirstColumn", "END", "selectLastColumn", "shift PAGE_UP", "scrollUpExtendSelection", "shift PAGE_DOWN", "scrollDownExtendSelection", "shift HOME", "selectFirstColumnExtendSelection", "shift END", "selectLastColumnExtendSelection", CONTROL_ID + " PAGE_UP", "scrollLeftChangeSelection", CONTROL_ID + " PAGE_DOWN", "scrollRightChangeSelection", CONTROL_ID + " HOME", "selectFirstRow", CONTROL_ID + " END", "selectLastRow", CONTROL_ID + " shift PAGE_UP", "scrollRightExtendSelection", CONTROL_ID + " shift PAGE_DOWN", "scrollLeftExtendSelection", CONTROL_ID + " shift HOME", "selectFirstRowExtendSelection", CONTROL_ID + " shift END", "selectLastRowExtendSelection", "TAB", "selectNextColumnCell", "shift TAB", "selectPreviousColumnCell", "ENTER", "selectNextRowCell", "shift ENTER", "selectPreviousRowCell", CONTROL_ID + " A", "selectAll", "ESCAPE", "cancel", "F2", "startEditing" }), // TableHeader
"TableHeader.font", fontDialog12Bold, "TableHeader.background", Colors.PANEL_BACKGROUND, // TextField
"TextField.margin", textFieldMargin, "TextField.font", fontDialog12, "TextField.caretForeground", caretColor, "TextField.focusInputMap", fieldInputMap, "TextField.background", Colors.WHITE, "FormattedTextField.margin", textFieldMargin, "FormattedTextField.font", fontDialog12, "FormattedTextField.caretForeground", caretColor, "FormattedTextField.background", getWhiteBackground(), "FormattedTextField.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { CONTROL_ID + " C", DefaultEditorKit.copyAction, CONTROL_ID + " V", DefaultEditorKit.pasteAction, CONTROL_ID + " X", DefaultEditorKit.cutAction, "COPY", DefaultEditorKit.copyAction, "PASTE", DefaultEditorKit.pasteAction, "CUT", DefaultEditorKit.cutAction, "shift LEFT", DefaultEditorKit.selectionBackwardAction, "shift KP_LEFT", DefaultEditorKit.selectionBackwardAction, "shift RIGHT", DefaultEditorKit.selectionForwardAction, "shift KP_RIGHT", DefaultEditorKit.selectionForwardAction, CONTROL_ID + " LEFT", DefaultEditorKit.previousWordAction, CONTROL_ID + " KP_LEFT", DefaultEditorKit.previousWordAction, CONTROL_ID + " RIGHT", DefaultEditorKit.nextWordAction, CONTROL_ID + " KP_RIGHT", DefaultEditorKit.nextWordAction, CONTROL_ID + " shift LEFT", DefaultEditorKit.selectionPreviousWordAction, CONTROL_ID + " shift KP_LEFT", DefaultEditorKit.selectionPreviousWordAction, CONTROL_ID + " shift RIGHT", DefaultEditorKit.selectionNextWordAction, CONTROL_ID + " shift KP_RIGHT", DefaultEditorKit.selectionNextWordAction, CONTROL_ID + " A", DefaultEditorKit.selectAllAction, "HOME", DefaultEditorKit.beginLineAction, "END", DefaultEditorKit.endLineAction, "shift HOME", DefaultEditorKit.selectionBeginLineAction, "shift END", DefaultEditorKit.selectionEndLineAction, "BACK_SPACE", DefaultEditorKit.deletePrevCharAction, "DELETE", CONTROL_ID + " BACK_SPACE", DefaultEditorKit.deletePrevWordAction, DefaultEditorKit.deleteNextCharAction, CONTROL_ID + " DELETE", DefaultEditorKit.deleteNextWordAction, "RIGHT", DefaultEditorKit.forwardAction, "LEFT", DefaultEditorKit.backwardAction, "KP_RIGHT", DefaultEditorKit.forwardAction, "KP_LEFT", DefaultEditorKit.backwardAction, "ENTER", JTextField.notifyAction, CONTROL_ID + " BACK_SLASH", "unselect", CONTROL_ID + " shift O", "toggle-componentOrientation", "ESCAPE", "reset-field-edit", "UP", "increment", "KP_UP", "increment", "DOWN", "decrement", "KP_DOWN", "decrement" }), "PasswordField.margin", textFieldMargin, "PasswordField.font", fontDialog12, "PasswordField.caretForeground", caretColor, "PasswordField.focusInputMap", fieldInputMap, "PasswordField.background", Colors.WHITE, "EditorPane.margin", textFieldMargin, "EditorPane.font", fontDialog12, "EditorPane.caretForeground", caretColor, "EditorPane.focusInputMap", multilineInputMap, "EditorPane.background", Colors.WHITE, "TextPane.margin", textFieldMargin, "TextPane.font", fontDialog12, "TextPane.caretForeground", caretColor, "TextPane.focusInputMap", multilineInputMap, "TextPane.background", Colors.WHITE, "TextArea.margin", textFieldMargin, "TextArea.font", fontDialog12, "TextArea.caretForeground", caretColor, "TextArea.focusInputMap", multilineInputMap, "TextArea.background", Colors.WHITE, // TitledBorder
"TitledBorder.titleColor", Colors.TEXT_FOREGROUND, "TitledBorder.border", BorderFactory.createLineBorder(Colors.TAB_BORDER, 1), // ToolBar
"ToolBar.background", Colors.PANEL_BACKGROUND, "ToolBar.margin", new InsetsUIResource(0, 0, 0, 0), "ToolBar.dockingForeground", Color.ORANGE, "ToolBar.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "UP", "navigateUp", "KP_UP", "navigateUp", "DOWN", "navigateDown", "KP_DOWN", "navigateDown", "LEFT", "navigateLeft", "KP_LEFT", "navigateLeft", "RIGHT", "navigateRight", "KP_RIGHT", "navigateRight" }), // ToolTip
"ToolTip.font", fontDialog12, "tooltip.border", toolTipBorder, // Tree
"Tree.background", Colors.PANEL_BACKGROUND, "Tree.textBackground", Colors.PANEL_BACKGROUND, "Tree.font", fontDialog12, "Tree.selectionBorder", focusCellHighlightBorder, "Tree.rowHeight", 24, "Tree.selectionBackground", Colors.TEXT_HIGHLIGHT_BACKGROUND, "Tree.editorBorder", focusCellHighlightBorder, "Tree.paintLines", Boolean.FALSE, "Tree.rightChildIndent", 10, "Tree.selectionBorderColor", Colors.TEXTFIELD_BORDER, "Tree.openIcon", SwingTools.createImage("plaf/tree_open.png"), "Tree.closedIcon", SwingTools.createImage("plaf/tree_closed.png"), "Tree.leafIcon", SwingTools.createImage("plaf/tree_leaf.png"), "Tree.expandedIcon", SwingTools.createImage("plaf/laf_navigate_down.png"), "Tree.collapsedIcon", SwingTools.createImage("plaf/laf_navigate_right.png"), "Tree.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { CONTROL_ID + " C", "copy", CONTROL_ID + " V", "paste", CONTROL_ID + " X", "cut", "COPY", "copy", "PASTE", "paste", "CUT", "cut", "UP", "selectPrevious", "KP_UP", "selectPrevious", "shift UP", "selectPreviousExtendSelection", "shift KP_UP", "selectPreviousExtendSelection", "DOWN", "selectNext", "KP_DOWN", "selectNext", "shift DOWN", "selectNextExtendSelection", "shift KP_DOWN", "selectNextExtendSelection", "RIGHT", "selectChild", "KP_RIGHT", "selectChild", "LEFT", "selectParent", "KP_LEFT", "selectParent", "PAGE_UP", "scrollUpChangeSelection", "shift PAGE_UP", "scrollUpExtendSelection", "PAGE_DOWN", "scrollDownChangeSelection", "shift PAGE_DOWN", "scrollDownExtendSelection", "HOME", "selectFirst", "shift HOME", "selectFirstExtendSelection", "END", "selectLast", "shift END", "selectLastExtendSelection", "F2", "startEditing", CONTROL_ID + " A", "selectAll", CONTROL_ID + " SLASH", "selectAll", CONTROL_ID + " BACK_SLASH", "clearSelection", CONTROL_ID + " SPACE", "toggleSelectionPreserveAnchor", "shift SPACE", "extendSelection", CONTROL_ID + " HOME", "selectFirstChangeLead", CONTROL_ID + " END", "selectLastChangeLead", CONTROL_ID + " UP", "selectPreviousChangeLead", CONTROL_ID + " KP_UP", "selectPreviousChangeLead", CONTROL_ID + " DOWN", "selectNextChangeLead", CONTROL_ID + " KP_DOWN", "selectNextChangeLead", CONTROL_ID + " PAGE_DOWN", "scrollDownChangeLead", CONTROL_ID + " shift PAGE_DOWN", "scrollDownExtendSelection", CONTROL_ID + " PAGE_UP", "scrollUpChangeLead", CONTROL_ID + " shift PAGE_UP", "scrollUpExtendSelection", CONTROL_ID + " LEFT", "scrollLeft", CONTROL_ID + " KP_LEFT", "scrollLeft", CONTROL_ID + " RIGHT", "scrollRight", CONTROL_ID + " KP_RIGHT", "scrollRight", "SPACE", "toggleSelectionPreserveAnchor" }), "Tree.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "cancel" }) };
table.putDefaults(defaults);
getColors().addCustomEntriesToTable(table);
initBorderDefaults(table);
}Example 59
| Project: msInspect-master File: Localizer.java View source code |
/**
* Set the default font for all Swing components. This font will be used for all
* components instantiated after this method is called
* @param font
*/
public static void setSwingDefaultFont(Font font) {
_font = font;
FontUIResource f = new javax.swing.plaf.FontUIResource(font);
java.util.Enumeration keys = UIManager.getDefaults().keys();
while (keys.hasMoreElements()) {
Object key = keys.nextElement();
Object value = UIManager.get(key);
if (value instanceof FontUIResource) {
UIManager.put(key, f);
}
}
}Example 60
| Project: xowa-master File: GxwTextMemo_lang.java View source code |
public void ctor_MsTextBoxMultiline_() {
txt_box = new GxwTextBox_lang();
txt_box.ctor_MsTextBox_();
core = new GxwCore_host(GxwCore_lang.new_(this), txt_box.ctrlMgr);
this.setViewportView(txt_box);
txt_box.setLineWrap(true);
// else text will wrap in middle of words
txt_box.setWrapStyleWord(true);
this.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
this.setBorder(null);
txt_box.setBorder(BorderFactory.createLineBorder(Color.BLACK));
txt_box.setCaretColor(Color.BLACK);
txt_box.getCaret().setBlinkRate(0);
txt_box.setMargin(new Insets(0, 200, 200, 0));
OverrideKeyBindings();
InitUndoMgr();
// else highlighted selection will not be visible when text box loses focus
txt_box.setCaret(new javax.swing.text.DefaultCaret() {
public void setSelectionVisible(boolean vis) {
super.setSelectionVisible(true);
}
});
// this.setLayout(null);
// Object fontDefinition = new UIDefaults.ProxyLazyValue("javax.swing.plaf.FontUIResource", null, new Object[] { "dialog", new Integer(Font.PLAIN), new Integer(12) });
// java.util.Enumeration keys = UIManager.getDefaults().keys();
// while (keys.hasMoreElements()) {
// Object key = keys.nextElement();
// Object value = UIManager.get(key);
// if (value instanceof javax.swing.plaf.FontUIResource) {
// UIManager.put(key, fontDefinition);
// }
// }
}Example 61
| Project: ikvm-openjdk-master File: SynthParser.java View source code |
private void startFont(AttributeList attributes) throws SAXException {
Font font = null;
int style = Font.PLAIN;
int size = 0;
String id = null;
String name = null;
for (int i = attributes.getLength() - 1; i >= 0; i--) {
String key = attributes.getName(i);
if (key.equals(ATTRIBUTE_ID)) {
id = attributes.getValue(i);
} else if (key.equals(ATTRIBUTE_IDREF)) {
font = (Font) lookup(attributes.getValue(i), Font.class);
} else if (key.equals(ATTRIBUTE_NAME)) {
name = attributes.getValue(i);
} else if (key.equals(ATTRIBUTE_SIZE)) {
try {
size = Integer.parseInt(attributes.getValue(i));
} catch (NumberFormatException nfe) {
throw new SAXException("Invalid font size: " + attributes.getValue(i));
}
} else if (key.equals(ATTRIBUTE_STYLE)) {
StringTokenizer tok = new StringTokenizer(attributes.getValue(i));
while (tok.hasMoreTokens()) {
String token = tok.nextToken().intern();
if (token == "BOLD") {
style = ((style | Font.PLAIN) ^ Font.PLAIN) | Font.BOLD;
} else if (token == "ITALIC") {
style |= Font.ITALIC;
}
}
}
}
if (font == null) {
if (name == null) {
throw new SAXException("You must define a name for the font");
}
if (size == 0) {
throw new SAXException("You must define a size for the font");
}
font = new FontUIResource(name, style, size);
} else if (name != null || size != 0 || style != Font.PLAIN) {
throw new SAXException("Name, size and style are not for use " + "with idref");
}
register(id, font);
if (_stateInfo != null) {
_stateInfo.setFont(font);
} else if (_style != null) {
_style.setFont(font);
}
}Example 62
| Project: iranAdempiere-master File: PersianTheme.java View source code |
/** * Control Font (plain) * * @return font */ protected static FontUIResource _getControlTextFont() { if (controlFont == null) { try { controlFont = new FontUIResource(Font.getFont("swing.plaf.metal.controlFont", new Font(FONT_DEFAULT, Font.PLAIN, FONT_SIZE))); } catch (Exception e) { controlFont = new FontUIResource(FONT_DEFAULT, Font.PLAIN, FONT_SIZE); } } return controlFont; }
Example 63
| Project: jabref-master File: JabRefGUI.java View source code |
private void setLookAndFeel() {
try {
String lookFeel;
String systemLookFeel = UIManager.getSystemLookAndFeelClassName();
if (Globals.prefs.getBoolean(JabRefPreferences.USE_DEFAULT_LOOK_AND_FEEL)) {
// See https://github.com/JabRef/jabref/issues/393, https://github.com/JabRef/jabref/issues/638
if (System.getProperty("java.runtime.name").contains("OpenJDK")) {
// Metal L&F
lookFeel = UIManager.getCrossPlatformLookAndFeelClassName();
LOGGER.warn("There seem to be problems with OpenJDK and the default GTK Look&Feel. Using Metal L&F instead. Change to another L&F with caution.");
} else {
lookFeel = systemLookFeel;
}
} else {
lookFeel = Globals.prefs.get(JabRefPreferences.WIN_LOOK_AND_FEEL);
}
// FIXME: Open JDK problem
if (UIManager.getCrossPlatformLookAndFeelClassName().equals(lookFeel) && !System.getProperty("java.runtime.name").contains("OpenJDK")) {
// try to avoid ending up with the ugly Metal L&F
Plastic3DLookAndFeel lnf = new Plastic3DLookAndFeel();
MetalLookAndFeel.setCurrentTheme(new SkyBluer());
com.jgoodies.looks.Options.setPopupDropShadowEnabled(true);
UIManager.setLookAndFeel(lnf);
} else {
try {
UIManager.setLookAndFeel(lookFeel);
} catch (ClassNotFoundExceptionInstantiationException | IllegalAccessException | UnsupportedLookAndFeelException | e) {
UIManager.setLookAndFeel(systemLookFeel);
Globals.prefs.put(JabRefPreferences.WIN_LOOK_AND_FEEL, systemLookFeel);
JOptionPane.showMessageDialog(JabRefGUI.getMainFrame(), Localization.lang("Unable to find the requested look and feel and thus the default one is used."), Localization.lang("Warning"), JOptionPane.WARNING_MESSAGE);
LOGGER.warn("Unable to find requested look and feel", e);
}
}
} catch (Exception e) {
LOGGER.warn("Look and feel could not be set", e);
}
// In JabRef v2.8, we did it only on NON-Mac. Now, we try on all platforms
boolean overrideDefaultFonts = Globals.prefs.getBoolean(JabRefPreferences.OVERRIDE_DEFAULT_FONTS);
if (overrideDefaultFonts) {
int fontSize = Globals.prefs.getInt(JabRefPreferences.MENU_FONT_SIZE);
UIDefaults defaults = UIManager.getDefaults();
Enumeration<Object> keys = defaults.keys();
for (Object key : Collections.list(keys)) {
if ((key instanceof String) && ((String) key).endsWith(".font")) {
FontUIResource font = (FontUIResource) UIManager.get(key);
font = new FontUIResource(font.getName(), font.getStyle(), fontSize);
defaults.put(key, font);
}
}
}
}Example 64
| Project: JamVM-PH-master File: MetalLookAndFeel.java View source code |
/**
* Initializes the component defaults for the Metal Look & Feel.
*
* In particular this sets the following keys (the colors are given
* as RGB hex values):
*
* <table>
* <tr>
* <th>Key</th><th>Value</th>
* </tr><tr>
* <td>Button.background</td><td>0xcccccc</td>
* </tr><tr>
* <td>Button.border</td><td>{@link MetalBorders#getButtonBorder()}</td>
* </tr><tr>
* <td>Button.font</td><td>{@link #getControlTextFont}</td>
* </tr><tr>
* <td>Button.margin</td><td><code>new java.awt.Insets(2, 14, 2, 14)</code>
* </td>
* </tr><tr>
* <td>CheckBox.background</td><td>0xcccccc</td>
* </tr><tr>
* <td>CheckBoxMenuItem.background</td><td>0xcccccc</td>
* </tr><tr>
* <td>ToolBar.background</td><td>0xcccccc</td>
* </tr><tr>
* <td>Panel.background</td><td>0xcccccc</td>
* </tr><tr>
* <td>Slider.background</td><td>0xcccccc</td>
* </tr><tr>
* <td>OptionPane.background</td><td>0xcccccc</td>
* </tr><tr>
* <td>ProgressBar.background</td><td>0xcccccc</td>
* </tr><tr>
* <td>TabbedPane.background</td><td>0xcccccc</td>
* </tr><tr>
* <td>Label.background</td><td>0xcccccc</td>
* </tr><tr>
* <td>Label.font</td><td>{@link #getControlTextFont}</td>
* </tr><tr>
* <td>Menu.background</td><td>0xcccccc</td>
* </tr><tr>
* <td>MenuBar.background</td><td>0xcccccc</td>
* </tr><tr>
* <td>MenuItem.background</td><td>0xcccccc</td>
* </tr><tr>
* <td>ScrollBar.background</td><td>0xcccccc</td>
* </tr><tr>
* <td>PopupMenu.border</td>
* <td><code>new javax.swing.plaf.metal.MetalBorders.PopupMenuBorder()</td>
* </tr><tr>
* </table>
*
* @param defaults the UIDefaults instance to which the values are added
*/
protected void initComponentDefaults(UIDefaults defaults) {
super.initComponentDefaults(defaults);
Object[] myDefaults = new Object[] { "Button.background", getControl(), "Button.border", MetalBorders.getButtonBorder(), "Button.darkShadow", getControlDarkShadow(), "Button.disabledText", getInactiveControlTextColor(), "Button.focus", getFocusColor(), "Button.font", getControlTextFont(), "Button.foreground", getControlTextColor(), "Button.highlight", getControlHighlight(), "Button.light", getControlHighlight(), "Button.margin", new InsetsUIResource(2, 14, 2, 14), "Button.select", getControlShadow(), "Button.shadow", getControlShadow(), "CheckBox.background", getControl(), "CheckBox.border", MetalBorders.getButtonBorder(), "CheckBox.disabledText", getInactiveControlTextColor(), "CheckBox.focus", getFocusColor(), "CheckBox.font", getControlTextFont(), "CheckBox.foreground", getControlTextColor(), "CheckBox.icon", new UIDefaults.ProxyLazyValue("javax.swing.plaf.metal.MetalCheckBoxIcon"), "CheckBox.checkIcon", new UIDefaults.ProxyLazyValue("javax.swing.plaf.metal.MetalCheckBoxIcon"), "Checkbox.select", getControlShadow(), "CheckBoxMenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 10), "CheckBoxMenuItem.acceleratorForeground", getAcceleratorForeground(), "CheckBoxMenuItem.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "CheckBoxMenuItem.background", getMenuBackground(), "CheckBoxMenuItem.borderPainted", Boolean.TRUE, "CheckBoxMenuItem.commandSound", "sounds/MenuItemCommand.wav", "CheckBoxMenuItem.checkIcon", MetalIconFactory.getCheckBoxMenuItemIcon(), "CheckBoxMenuItem.disabledForeground", getMenuDisabledForeground(), "CheckBoxMenuItem.font", getMenuTextFont(), "CheckBoxMenuItem.foreground", getMenuForeground(), "CheckBoxMenuItem.selectionBackground", getMenuSelectedBackground(), "CheckBoxMenuItem.selectionForeground", getMenuSelectedForeground(), "ColorChooser.background", getControl(), "ColorChooser.foreground", getControlTextColor(), "ColorChooser.rgbBlueMnemonic", new Integer(0), "ColorChooser.rgbGreenMnemonic", new Integer(0), "ColorChooser.rgbRedMnemonic", new Integer(0), "ColorChooser.swatchesDefaultRecentColor", getControl(), "ComboBox.background", getControl(), "ComboBox.buttonBackground", getControl(), "ComboBox.buttonDarkShadow", getControlDarkShadow(), "ComboBox.buttonHighlight", getControlHighlight(), "ComboBox.buttonShadow", getControlShadow(), "ComboBox.disabledBackground", getControl(), "ComboBox.disabledForeground", getInactiveSystemTextColor(), "ComboBox.font", getControlTextFont(), "ComboBox.foreground", getControlTextColor(), "ComboBox.selectionBackground", getPrimaryControlShadow(), "ComboBox.selectionForeground", getControlTextColor(), "Desktop.background", getDesktopColor(), "DesktopIcon.background", getControl(), "DesktopIcon.foreground", getControlTextColor(), "DesktopIcon.width", new Integer(160), "DesktopIcon.border", MetalBorders.getDesktopIconBorder(), "DesktopIcon.font", getControlTextFont(), "EditorPane.background", getWindowBackground(), "EditorPane.caretForeground", getUserTextColor(), "EditorPane.font", getControlTextFont(), "EditorPane.foreground", getUserTextColor(), "EditorPane.inactiveForeground", getInactiveSystemTextColor(), "EditorPane.selectionBackground", getTextHighlightColor(), "EditorPane.selectionForeground", getHighlightedTextColor(), "FormattedTextField.background", getWindowBackground(), "FormattedTextField.border", new BorderUIResource(MetalBorders.getTextFieldBorder()), "FormattedTextField.caretForeground", getUserTextColor(), "FormattedTextField.font", new FontUIResource("Dialog", Font.PLAIN, 12), "FormattedTextField.foreground", getUserTextColor(), "FormattedTextField.inactiveBackground", getControl(), "FormattedTextField.inactiveForeground", getInactiveSystemTextColor(), "FormattedTextField.selectionBackground", getTextHighlightColor(), "FormattedTextField.selectionForeground", getHighlightedTextColor(), "FileChooser.upFolderIcon", MetalIconFactory.getFileChooserUpFolderIcon(), "FileChooser.listViewIcon", MetalIconFactory.getFileChooserListViewIcon(), "FileChooser.newFolderIcon", MetalIconFactory.getFileChooserNewFolderIcon(), "FileChooser.homeFolderIcon", MetalIconFactory.getFileChooserHomeFolderIcon(), "FileChooser.detailsViewIcon", MetalIconFactory.getFileChooserDetailViewIcon(), "FileChooser.fileNameLabelMnemonic", new Integer(78), "FileChooser.filesOfTypeLabelMnemonic", new Integer(84), "FileChooser.lookInLabelMnemonic", new Integer(73), "FileView.computerIcon", MetalIconFactory.getTreeComputerIcon(), "FileView.directoryIcon", MetalIconFactory.getTreeFolderIcon(), "FileView.fileIcon", MetalIconFactory.getTreeLeafIcon(), "FileView.floppyDriveIcon", MetalIconFactory.getTreeFloppyDriveIcon(), "FileView.hardDriveIcon", MetalIconFactory.getTreeHardDriveIcon(), "InternalFrame.activeTitleBackground", getWindowTitleBackground(), "InternalFrame.activeTitleForeground", getWindowTitleForeground(), "InternalFrame.border", new MetalBorders.InternalFrameBorder(), "InternalFrame.borderColor", getControl(), "InternalFrame.borderDarkShadow", getControlDarkShadow(), "InternalFrame.borderHighlight", getControlHighlight(), "InternalFrame.borderLight", getControlHighlight(), "InternalFrame.borderShadow", getControlShadow(), "InternalFrame.icon", MetalIconFactory.getInternalFrameDefaultMenuIcon(), "InternalFrame.closeIcon", MetalIconFactory.getInternalFrameCloseIcon(16), "InternalFrame.closeSound", "sounds/FrameClose.wav", "InternalFrame.inactiveTitleBackground", getWindowTitleInactiveBackground(), "InternalFrame.inactiveTitleForeground", getWindowTitleInactiveForeground(), "InternalFrame.maximizeIcon", MetalIconFactory.getInternalFrameMaximizeIcon(16), "InternalFrame.maximizeSound", "sounds/FrameMaximize.wav", "InternalFrame.iconifyIcon", MetalIconFactory.getInternalFrameMinimizeIcon(16), "InternalFrame.minimizeSound", "sounds/FrameMinimize.wav", "InternalFrame.paletteBorder", new MetalBorders.PaletteBorder(), "InternalFrame.paletteCloseIcon", new MetalIconFactory.PaletteCloseIcon(), "InternalFrame.paletteTitleHeight", new Integer(11), "InternalFrame.restoreDownSound", "sounds/FrameRestoreDown.wav", "InternalFrame.restoreUpSound", "sounds/FrameRestoreUp.wav", "Label.background", getControl(), "Label.disabledForeground", getInactiveSystemTextColor(), "Label.disabledShadow", getControlShadow(), "Label.font", getControlTextFont(), "Label.foreground", getSystemTextColor(), "List.font", getControlTextFont(), "List.background", getWindowBackground(), "List.foreground", getUserTextColor(), "List.selectionBackground", getTextHighlightColor(), "List.selectionForeground", getHighlightedTextColor(), "List.focusCellHighlightBorder", new LineBorderUIResource(MetalLookAndFeel.getFocusColor()), "Menu.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 10), "Menu.acceleratorForeground", getAcceleratorForeground(), "Menu.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "Menu.arrowIcon", MetalIconFactory.getMenuArrowIcon(), "Menu.background", getMenuBackground(), "Menu.border", new MetalBorders.MenuItemBorder(), "Menu.borderPainted", Boolean.TRUE, "MenuItem.commandSound", "sounds/MenuItemCommand.wav", "Menu.disabledForeground", getMenuDisabledForeground(), "Menu.font", getMenuTextFont(), "Menu.foreground", getMenuForeground(), "Menu.selectionBackground", getMenuSelectedBackground(), "Menu.selectionForeground", getMenuSelectedForeground(), "Menu.submenuPopupOffsetX", new Integer(-4), "Menu.submenuPopupOffsetY", new Integer(-3), "MenuBar.background", getMenuBackground(), "MenuBar.border", new MetalBorders.MenuBarBorder(), "MenuBar.font", getMenuTextFont(), "MenuBar.foreground", getMenuForeground(), "MenuBar.highlight", getControlHighlight(), "MenuBar.shadow", getControlShadow(), "MenuItem.acceleratorDelimiter", "-", "MenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 10), "MenuItem.acceleratorForeground", getAcceleratorForeground(), "MenuItem.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "MenuItem.arrowIcon", MetalIconFactory.getMenuItemArrowIcon(), "MenuItem.background", getMenuBackground(), "MenuItem.border", new MetalBorders.MenuItemBorder(), "MenuItem.borderPainted", Boolean.TRUE, "MenuItem.disabledForeground", getMenuDisabledForeground(), "MenuItem.font", getMenuTextFont(), "MenuItem.foreground", getMenuForeground(), "MenuItem.selectionBackground", getMenuSelectedBackground(), "MenuItem.selectionForeground", getMenuSelectedForeground(), "OptionPane.background", getControl(), "OptionPane.errorSound", "sounds/OptionPaneError.wav", "OptionPane.informationSound", "sounds/OptionPaneInformation.wav", "OptionPane.questionSound", "sounds/OptionPaneQuestion.wav", "OptionPane.warningSound", "sounds/OptionPaneWarning.wav", "OptionPane.errorDialog.border.background", new ColorUIResource(153, 51, 51), "OptionPane.errorDialog.titlePane.background", new ColorUIResource(255, 153, 153), "OptionPane.errorDialog.titlePane.foreground", new ColorUIResource(51, 0, 0), "OptionPane.errorDialog.titlePane.shadow", new ColorUIResource(204, 102, 102), "OptionPane.foreground", getControlTextColor(), "OptionPane.messageForeground", getControlTextColor(), "OptionPane.questionDialog.border.background", new ColorUIResource(51, 102, 51), "OptionPane.questionDialog.titlePane.background", new ColorUIResource(153, 204, 153), "OptionPane.questionDialog.titlePane.foreground", new ColorUIResource(0, 51, 0), "OptionPane.questionDialog.titlePane.shadow", new ColorUIResource(102, 153, 102), "OptionPane.warningDialog.border.background", new ColorUIResource(153, 102, 51), "OptionPane.warningDialog.titlePane.background", new ColorUIResource(255, 204, 153), "OptionPane.warningDialog.titlePane.foreground", new ColorUIResource(102, 51, 0), "OptionPane.warningDialog.titlePane.shadow", new ColorUIResource(204, 153, 102), "Panel.background", getControl(), "Panel.foreground", getUserTextColor(), "PasswordField.background", getWindowBackground(), "PasswordField.border", new BorderUIResource(MetalBorders.getTextFieldBorder()), "PasswordField.caretForeground", getUserTextColor(), "PasswordField.foreground", getUserTextColor(), "PasswordField.font", new FontUIResource("Dialog", Font.PLAIN, 12), "PasswordField.inactiveBackground", getControl(), "PasswordField.inactiveForeground", getInactiveSystemTextColor(), "PasswordField.selectionBackground", getTextHighlightColor(), "PasswordField.selectionForeground", getHighlightedTextColor(), "PopupMenu.background", getMenuBackground(), "PopupMenu.border", new MetalBorders.PopupMenuBorder(), "PopupMenu.font", getMenuTextFont(), "PopupMenu.foreground", getMenuForeground(), "PopupMenu.popupSound", "sounds/PopupMenuPopup.wav", "ProgressBar.background", getControl(), "ProgressBar.border", new BorderUIResource.LineBorderUIResource(getControlDarkShadow(), 1), "ProgressBar.font", getControlTextFont(), "ProgressBar.foreground", getPrimaryControlShadow(), "ProgressBar.selectionBackground", getPrimaryControlDarkShadow(), "ProgressBar.selectionForeground", getControl(), "RadioButton.background", getControl(), "RadioButton.darkShadow", getControlDarkShadow(), "RadioButton.disabledText", getInactiveControlTextColor(), "RadioButton.icon", new UIDefaults.LazyValue() {
public Object createValue(UIDefaults def) {
return MetalIconFactory.getRadioButtonIcon();
}
}, "RadioButton.focus", MetalLookAndFeel.getFocusColor(), "RadioButton.font", MetalLookAndFeel.getControlTextFont(), "RadioButton.foreground", getControlTextColor(), "RadioButton.highlight", getControlHighlight(), "RadioButton.light", getControlHighlight(), "RadioButton.select", getControlShadow(), "RadioButton.shadow", getControlShadow(), "RadioButtonMenuItem.acceleratorFont", new Font("Dialog", Font.PLAIN, 10), "RadioButtonMenuItem.acceleratorForeground", getAcceleratorForeground(), "RadioButtonMenuItem.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "RadioButtonMenuItem.background", getMenuBackground(), "RadioButtonMenuItem.border", new MetalBorders.MenuItemBorder(), "RadioButtonMenuItem.borderPainted", Boolean.TRUE, "RadioButtonMenuItem.checkIcon", MetalIconFactory.getRadioButtonMenuItemIcon(), "RadioButtonMenuItem.commandSound", "sounds/MenuItemCommand.wav", "RadioButtonMenuItem.disabledForeground", getMenuDisabledForeground(), "RadioButtonMenuItem.font", getMenuTextFont(), "RadioButtonMenuItem.foreground", getMenuForeground(), "RadioButtonMenuItem.margin", new InsetsUIResource(2, 2, 2, 2), "RadioButtonMenuItem.selectionBackground", MetalLookAndFeel.getMenuSelectedBackground(), "RadioButtonMenuItem.selectionForeground", MetalLookAndFeel.getMenuSelectedForeground(), "ScrollBar.allowsAbsolutePositioning", Boolean.TRUE, "ScrollBar.background", getControl(), "ScrollBar.darkShadow", getControlDarkShadow(), "ScrollBar.foreground", getControl(), "ScrollBar.highlight", getControlHighlight(), "ScrollBar.shadow", getControlShadow(), "ScrollBar.thumb", getPrimaryControlShadow(), "ScrollBar.thumbDarkShadow", getControlDarkShadow(), "ScrollBar.thumbHighlight", getPrimaryControl(), "ScrollBar.thumbShadow", getPrimaryControlDarkShadow(), "ScrollBar.track", getControl(), "ScrollBar.trackHighlight", getControlDarkShadow(), "ScrollBar.width", new Integer(17), "ScrollPane.background", getControl(), "ScrollPane.border", new MetalBorders.ScrollPaneBorder(), "ScrollPane.foreground", getControlTextColor(), "Separator.background", getSeparatorBackground(), "Separator.foreground", getSeparatorForeground(), "Separator.highlight", getControlHighlight(), "Separator.shadow", getControlShadow(), "Slider.background", getControl(), "Slider.focus", getFocusColor(), "Slider.focusInsets", new InsetsUIResource(0, 0, 0, 0), "Slider.foreground", getPrimaryControlShadow(), "Slider.highlight", getControlHighlight(), "Slider.horizontalThumbIcon", MetalIconFactory.getHorizontalSliderThumbIcon(), "Slider.majorTickLength", new Integer(6), "Slider.shadow", getControlShadow(), "Slider.trackWidth", new Integer(7), "Slider.verticalThumbIcon", MetalIconFactory.getVerticalSliderThumbIcon(), "Spinner.arrowButtonInsets", new InsetsUIResource(0, 0, 0, 0), "Spinner.background", getControl(), "Spinner.border", MetalBorders.getTextFieldBorder(), "Spinner.font", getControlTextFont(), "Spinner.foreground", getControl(), "SplitPane.background", getControl(), "SplitPane.darkShadow", getControlDarkShadow(), "SplitPane.dividerFocusColor", getPrimaryControl(), "SplitPane.dividerSize", new Integer(10), "SplitPane.highlight", getControlHighlight(), "SplitPane.shadow", getControlShadow(), "SplitPaneDivider.draggingColor", Color.DARK_GRAY, "TabbedPane.background", getControlShadow(), "TabbedPane.contentBorderInsets", new InsetsUIResource(2, 2, 3, 3), "TabbedPane.contentOpaque", Boolean.TRUE, "TabbedPane.darkShadow", getControlDarkShadow(), "TabbedPane.focus", getPrimaryControlDarkShadow(), "TabbedPane.font", getControlTextFont(), "TabbedPane.foreground", getControlTextColor(), "TabbedPane.highlight", getControlHighlight(), "TabbedPane.light", getControl(), // overridden in OceanTheme
"TabbedPane.selected", // overridden in OceanTheme
getControl(), "TabbedPane.selectHighlight", getControlHighlight(), "TabbedPane.selectedTabPadInsets", new InsetsUIResource(2, 2, 2, 1), "TabbedPane.shadow", getControlShadow(), // overridden in OceanTheme
"TabbedPane.tabAreaBackground", // overridden in OceanTheme
getControl(), // dito
"TabbedPane.tabAreaInsets", // dito
new InsetsUIResource(4, 2, 0, 6), "TabbedPane.tabInsets", new InsetsUIResource(0, 9, 1, 9), "Table.background", getWindowBackground(), "Table.focusCellBackground", getWindowBackground(), "Table.focusCellForeground", getControlTextColor(), "Table.foreground", getControlTextColor(), "Table.focusCellHighlightBorder", new BorderUIResource.LineBorderUIResource(getFocusColor()), "Table.focusCellBackground", getWindowBackground(), "Table.gridColor", getControlDarkShadow(), "Table.selectionBackground", new ColorUIResource(204, 204, 255), "Table.selectionForeground", new ColorUIResource(0, 0, 0), "TableHeader.background", getControl(), "TableHeader.cellBorder", new MetalBorders.TableHeaderBorder(), "TableHeader.foreground", getControlTextColor(), "TextArea.background", getWindowBackground(), "TextArea.caretForeground", getUserTextColor(), "TextArea.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TextArea.foreground", getUserTextColor(), "TextArea.inactiveForeground", getInactiveSystemTextColor(), "TextArea.selectionBackground", getTextHighlightColor(), "TextArea.selectionForeground", getHighlightedTextColor(), "TextField.background", getWindowBackground(), "TextField.border", new BorderUIResource(MetalBorders.getTextFieldBorder()), "TextField.caretForeground", getUserTextColor(), "TextField.darkShadow", getControlDarkShadow(), "TextField.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TextField.foreground", getUserTextColor(), "TextField.highlight", getControlHighlight(), "TextField.inactiveBackground", getControl(), "TextField.inactiveForeground", getInactiveSystemTextColor(), "TextField.light", getControlHighlight(), "TextField.selectionBackground", getTextHighlightColor(), "TextField.selectionForeground", getHighlightedTextColor(), "TextField.shadow", getControlShadow(), "TextPane.background", getWindowBackground(), "TextPane.caretForeground", getUserTextColor(), "TextPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TextPane.foreground", getUserTextColor(), "TextPane.inactiveForeground", getInactiveSystemTextColor(), "TextPane.selectionBackground", getTextHighlightColor(), "TextPane.selectionForeground", getHighlightedTextColor(), "TitledBorder.border", new LineBorderUIResource(getPrimaryControl(), 1), "TitledBorder.font", getControlTextFont(), "TitledBorder.titleColor", getSystemTextColor(), "ToggleButton.background", getControl(), "ToggleButton.border", MetalBorders.getToggleButtonBorder(), "ToggleButton.darkShadow", getControlDarkShadow(), "ToggleButton.disabledText", getInactiveControlTextColor(), "ToggleButton.focus", getFocusColor(), "ToggleButton.font", getControlTextFont(), "ToggleButton.foreground", getControlTextColor(), "ToggleButton.highlight", getControlHighlight(), "ToggleButton.light", getControlHighlight(), "ToggleButton.margin", new InsetsUIResource(2, 14, 2, 14), "ToggleButton.select", getControlShadow(), "ToggleButton.shadow", getControlShadow(), "ToolBar.background", getMenuBackground(), "ToolBar.darkShadow", getControlDarkShadow(), "ToolBar.dockingBackground", getMenuBackground(), "ToolBar.dockingForeground", getPrimaryControlDarkShadow(), "ToolBar.floatingBackground", getMenuBackground(), "ToolBar.floatingForeground", getPrimaryControl(), "ToolBar.font", getMenuTextFont(), "ToolBar.foreground", getMenuForeground(), "ToolBar.highlight", getControlHighlight(), "ToolBar.light", getControlHighlight(), "ToolBar.shadow", getControlShadow(), "ToolBar.border", new MetalBorders.ToolBarBorder(), "ToolBar.rolloverBorder", MetalBorders.getToolbarButtonBorder(), "ToolBar.nonrolloverBorder", MetalBorders.getToolbarButtonBorder(), "ToolTip.background", getPrimaryControl(), "ToolTip.backgroundInactive", getControl(), "ToolTip.border", new BorderUIResource.LineBorderUIResource(getPrimaryControlDarkShadow(), 1), "ToolTip.borderInactive", new BorderUIResource.LineBorderUIResource(getControlDarkShadow(), 1), "ToolTip.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ToolTip.foreground", getPrimaryControlInfo(), "ToolTip.foregroundInactive", getControlDarkShadow(), "ToolTip.hideAccelerator", Boolean.FALSE, "Tree.background", getWindowBackground(), "Tree.closedIcon", MetalIconFactory.getTreeFolderIcon(), "Tree.collapsedIcon", MetalIconFactory.getTreeControlIcon(true), "Tree.expandedIcon", MetalIconFactory.getTreeControlIcon(false), "Tree.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Tree.foreground", getUserTextColor(), "Tree.hash", getPrimaryControl(), "Tree.leafIcon", MetalIconFactory.getTreeLeafIcon(), "Tree.leftChildIndent", new Integer(7), "Tree.line", getPrimaryControl(), "Tree.openIcon", MetalIconFactory.getTreeFolderIcon(), "Tree.rightChildIndent", new Integer(13), "Tree.rowHeight", new Integer(0), "Tree.scrollsOnExpand", Boolean.TRUE, "Tree.selectionBackground", getTextHighlightColor(), "Tree.selectionBorder", new BorderUIResource.LineBorderUIResource(new Color(102, 102, 153)), "Tree.selectionBorderColor", getFocusColor(), "Tree.selectionForeground", getHighlightedTextColor(), "Tree.textBackground", getWindowBackground(), "Tree.textForeground", getUserTextColor(), "Viewport.background", getControl(), "Viewport.foreground", getUserTextColor() };
defaults.putDefaults(myDefaults);
}Example 65
| Project: JavaX-master File: GameMakerView.java View source code |
//---------------- GUI ----------------------------------//
/**
*
*/
private void initGUI() {
PortingUtils.prerequisiteChecking();
// add an example custom theme
BasicOffice2003Theme theme = new BasicOffice2003Theme("Custom");
theme.setBaseColor(new Color(50, 190, 150), true, "default");
((Office2003Painter) Office2003Painter.getInstance()).addTheme(theme);
LookAndFeelFactory.installDefaultLookAndFeelAndExtension();
LookAndFeelFactory.UIDefaultsCustomizer uiDefaultsCustomizer = new LookAndFeelFactory.UIDefaultsCustomizer() {
public void customize(UIDefaults defaults) {
ThemePainter painter = (ThemePainter) UIDefaultsLookup.get("Theme.painter");
defaults.put("OptionPaneUI", "com.jidesoft.plaf.basic.BasicJideOptionPaneUI");
// show banner or not. default is true
defaults.put("OptionPane.showBanner", Boolean.TRUE);
defaults.put("OptionPane.bannerIcon", JideIconsFactory.getImageIcon(JideIconsFactory.JIDE50));
defaults.put("OptionPane.bannerFontSize", 13);
defaults.put("OptionPane.bannerFontStyle", Font.BOLD);
defaults.put("OptionPane.bannerMaxCharsPerLine", 60);
// you should adjust this if banner background is not the default gradient paint
defaults.put("OptionPane.bannerForeground", painter != null ? painter.getOptionPaneBannerForeground() : null);
// use default border
defaults.put("OptionPane.bannerBorder", null);
// set both bannerBackgroundDk and // set both bannerBackgroundLt to null if you don't want gradient
defaults.put("OptionPane.bannerBackgroundDk", painter != null ? painter.getOptionPaneBannerDk() : null);
defaults.put("OptionPane.bannerBackgroundLt", painter != null ? painter.getOptionPaneBannerLt() : null);
// default is true
defaults.put("OptionPane.bannerBackgroundDirection", Boolean.TRUE);
// optionally, you can set a Paint object for BannerPanel. If so, the three UIDefaults related to banner background above will be ignored.
defaults.put("OptionPane.bannerBackgroundPaint", null);
defaults.put("OptionPane.buttonAreaBorder", BorderFactory.createEmptyBorder(6, 6, 6, 6));
defaults.put("OptionPane.buttonOrientation", SwingConstants.RIGHT);
}
};
uiDefaultsCustomizer.customize(UIManager.getDefaults());
UIManager.put("ToolTip.border", new BorderUIResource(new CompoundBorder(new RoundLineBorder(Color.WHITE, 1, 8, 8), new EmptyBorder(3, 3, 3, 3))));
UIManager.put("ToolTip.foreground", new ColorUIResource(Color.WHITE));
UIManager.put("ToolTip.font", new FontUIResource(UIUtils.TEXT_FONT));
ToolTipManager.sharedInstance().setInitialDelay(100);
ToolTipManager.sharedInstance().setReshowDelay(500);
mainFrame = new JFrame(getResourceMap().getString("Application.title"));
mainFrame.setJMenuBar(createMenubar());
mainFrame.add(createToolBar(), BorderLayout.NORTH);
mainFrame.add(createMainPanel(), BorderLayout.CENTER);
mainFrame.add(createStatusBar(), BorderLayout.SOUTH);
mainFrame.setSize(defaultWidth, defaultHeight);
mainFrame.setLocationRelativeTo(null);
mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setFrame(mainFrame);
fileChooser = new JFileChooser();
fileChooser.setCurrentDirectory(new File(getProperty("LastOpenDir")));
}Example 66
| Project: JCGO-master File: MetalLookAndFeel.java View source code |
/**
* Initializes the component defaults for the Metal Look & Feel.
*
* In particular this sets the following keys (the colors are given
* as RGB hex values):
*
* <table>
* <tr>
* <th>Key</th><th>Value</th>
* </tr><tr>
* <td>Button.background</td><td>0xcccccc</td>
* </tr><tr>
* <td>Button.border</td><td>{@link MetalBorders#getButtonBorder()}</td>
* </tr><tr>
* <td>Button.font</td><td>{@link #getControlTextFont}</td>
* </tr><tr>
* <td>Button.margin</td><td><code>new java.awt.Insets(2, 14, 2, 14)</code>
* </td>
* </tr><tr>
* <td>CheckBox.background</td><td>0xcccccc</td>
* </tr><tr>
* <td>CheckBoxMenuItem.background</td><td>0xcccccc</td>
* </tr><tr>
* <td>ToolBar.background</td><td>0xcccccc</td>
* </tr><tr>
* <td>Panel.background</td><td>0xcccccc</td>
* </tr><tr>
* <td>Slider.background</td><td>0xcccccc</td>
* </tr><tr>
* <td>OptionPane.background</td><td>0xcccccc</td>
* </tr><tr>
* <td>ProgressBar.background</td><td>0xcccccc</td>
* </tr><tr>
* <td>TabbedPane.background</td><td>0xcccccc</td>
* </tr><tr>
* <td>Label.background</td><td>0xcccccc</td>
* </tr><tr>
* <td>Label.font</td><td>{@link #getControlTextFont}</td>
* </tr><tr>
* <td>Menu.background</td><td>0xcccccc</td>
* </tr><tr>
* <td>MenuBar.background</td><td>0xcccccc</td>
* </tr><tr>
* <td>MenuItem.background</td><td>0xcccccc</td>
* </tr><tr>
* <td>ScrollBar.background</td><td>0xcccccc</td>
* </tr><tr>
* <td>PopupMenu.border</td>
* <td><code>new javax.swing.plaf.metal.MetalBorders.PopupMenuBorder()</td>
* </tr><tr>
* </table>
*
* @param defaults the UIDefaults instance to which the values are added
*/
protected void initComponentDefaults(UIDefaults defaults) {
super.initComponentDefaults(defaults);
Object metalCheckBoxIconLazyVal = new UIDefaults.LazyValue() {
public Object createValue(UIDefaults def) {
return new MetalCheckBoxIcon();
}
};
Object[] myDefaults = new Object[] { "Button.background", getControl(), "Button.border", MetalBorders.getButtonBorder(), "Button.darkShadow", getControlDarkShadow(), "Button.disabledText", getInactiveControlTextColor(), "Button.focus", getFocusColor(), "Button.font", getControlTextFont(), "Button.foreground", getControlTextColor(), "Button.highlight", getControlHighlight(), "Button.light", getControlHighlight(), "Button.margin", new InsetsUIResource(2, 14, 2, 14), "Button.select", getControlShadow(), "Button.shadow", getControlShadow(), "CheckBox.background", getControl(), "CheckBox.border", MetalBorders.getButtonBorder(), "CheckBox.disabledText", getInactiveControlTextColor(), "CheckBox.focus", getFocusColor(), "CheckBox.font", getControlTextFont(), "CheckBox.foreground", getControlTextColor(), "CheckBox.icon", metalCheckBoxIconLazyVal, "CheckBox.checkIcon", metalCheckBoxIconLazyVal, "Checkbox.select", getControlShadow(), "CheckBoxMenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 10), "CheckBoxMenuItem.acceleratorForeground", getAcceleratorForeground(), "CheckBoxMenuItem.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "CheckBoxMenuItem.background", getMenuBackground(), "CheckBoxMenuItem.borderPainted", Boolean.TRUE, "CheckBoxMenuItem.commandSound", "sounds/MenuItemCommand.wav", "CheckBoxMenuItem.checkIcon", MetalIconFactory.getCheckBoxMenuItemIcon(), "CheckBoxMenuItem.disabledForeground", getMenuDisabledForeground(), "CheckBoxMenuItem.font", getMenuTextFont(), "CheckBoxMenuItem.foreground", getMenuForeground(), "CheckBoxMenuItem.selectionBackground", getMenuSelectedBackground(), "CheckBoxMenuItem.selectionForeground", getMenuSelectedForeground(), "ColorChooser.background", getControl(), "ColorChooser.foreground", getControlTextColor(), "ColorChooser.rgbBlueMnemonic", new Integer(0), "ColorChooser.rgbGreenMnemonic", new Integer(0), "ColorChooser.rgbRedMnemonic", new Integer(0), "ColorChooser.swatchesDefaultRecentColor", getControl(), "ComboBox.background", getControl(), "ComboBox.buttonBackground", getControl(), "ComboBox.buttonDarkShadow", getControlDarkShadow(), "ComboBox.buttonHighlight", getControlHighlight(), "ComboBox.buttonShadow", getControlShadow(), "ComboBox.disabledBackground", getControl(), "ComboBox.disabledForeground", getInactiveSystemTextColor(), "ComboBox.font", getControlTextFont(), "ComboBox.foreground", getControlTextColor(), "ComboBox.selectionBackground", getPrimaryControlShadow(), "ComboBox.selectionForeground", getControlTextColor(), "Desktop.background", getDesktopColor(), "DesktopIcon.background", getControl(), "DesktopIcon.foreground", getControlTextColor(), "DesktopIcon.width", new Integer(160), "DesktopIcon.border", MetalBorders.getDesktopIconBorder(), "DesktopIcon.font", getControlTextFont(), "EditorPane.background", getWindowBackground(), "EditorPane.caretForeground", getUserTextColor(), "EditorPane.font", getControlTextFont(), "EditorPane.foreground", getUserTextColor(), "EditorPane.inactiveForeground", getInactiveSystemTextColor(), "EditorPane.selectionBackground", getTextHighlightColor(), "EditorPane.selectionForeground", getHighlightedTextColor(), "FormattedTextField.background", getWindowBackground(), "FormattedTextField.border", new BorderUIResource(MetalBorders.getTextFieldBorder()), "FormattedTextField.caretForeground", getUserTextColor(), "FormattedTextField.font", new FontUIResource("Dialog", Font.PLAIN, 12), "FormattedTextField.foreground", getUserTextColor(), "FormattedTextField.inactiveBackground", getControl(), "FormattedTextField.inactiveForeground", getInactiveSystemTextColor(), "FormattedTextField.selectionBackground", getTextHighlightColor(), "FormattedTextField.selectionForeground", getHighlightedTextColor(), "FileChooser.upFolderIcon", MetalIconFactory.getFileChooserUpFolderIcon(), "FileChooser.listViewIcon", MetalIconFactory.getFileChooserListViewIcon(), "FileChooser.newFolderIcon", MetalIconFactory.getFileChooserNewFolderIcon(), "FileChooser.homeFolderIcon", MetalIconFactory.getFileChooserHomeFolderIcon(), "FileChooser.detailsViewIcon", MetalIconFactory.getFileChooserDetailViewIcon(), "FileChooser.fileNameLabelMnemonic", new Integer(78), "FileChooser.filesOfTypeLabelMnemonic", new Integer(84), "FileChooser.lookInLabelMnemonic", new Integer(73), "FileView.computerIcon", MetalIconFactory.getTreeComputerIcon(), "FileView.directoryIcon", MetalIconFactory.getTreeFolderIcon(), "FileView.fileIcon", MetalIconFactory.getTreeLeafIcon(), "FileView.floppyDriveIcon", MetalIconFactory.getTreeFloppyDriveIcon(), "FileView.hardDriveIcon", MetalIconFactory.getTreeHardDriveIcon(), "InternalFrame.activeTitleBackground", getWindowTitleBackground(), "InternalFrame.activeTitleForeground", getWindowTitleForeground(), "InternalFrame.border", new MetalBorders.InternalFrameBorder(), "InternalFrame.borderColor", getControl(), "InternalFrame.borderDarkShadow", getControlDarkShadow(), "InternalFrame.borderHighlight", getControlHighlight(), "InternalFrame.borderLight", getControlHighlight(), "InternalFrame.borderShadow", getControlShadow(), "InternalFrame.icon", MetalIconFactory.getInternalFrameDefaultMenuIcon(), "InternalFrame.closeIcon", MetalIconFactory.getInternalFrameCloseIcon(16), "InternalFrame.closeSound", "sounds/FrameClose.wav", "InternalFrame.inactiveTitleBackground", getWindowTitleInactiveBackground(), "InternalFrame.inactiveTitleForeground", getWindowTitleInactiveForeground(), "InternalFrame.maximizeIcon", MetalIconFactory.getInternalFrameMaximizeIcon(16), "InternalFrame.maximizeSound", "sounds/FrameMaximize.wav", "InternalFrame.iconifyIcon", MetalIconFactory.getInternalFrameMinimizeIcon(16), "InternalFrame.minimizeSound", "sounds/FrameMinimize.wav", "InternalFrame.paletteBorder", new MetalBorders.PaletteBorder(), "InternalFrame.paletteCloseIcon", new MetalIconFactory.PaletteCloseIcon(), "InternalFrame.paletteTitleHeight", new Integer(11), "InternalFrame.restoreDownSound", "sounds/FrameRestoreDown.wav", "InternalFrame.restoreUpSound", "sounds/FrameRestoreUp.wav", "Label.background", getControl(), "Label.disabledForeground", getInactiveSystemTextColor(), "Label.disabledShadow", getControlShadow(), "Label.font", getControlTextFont(), "Label.foreground", getSystemTextColor(), "List.font", getControlTextFont(), "List.background", getWindowBackground(), "List.foreground", getUserTextColor(), "List.selectionBackground", getTextHighlightColor(), "List.selectionForeground", getHighlightedTextColor(), "List.focusCellHighlightBorder", new LineBorderUIResource(MetalLookAndFeel.getFocusColor()), "Menu.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 10), "Menu.acceleratorForeground", getAcceleratorForeground(), "Menu.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "Menu.arrowIcon", MetalIconFactory.getMenuArrowIcon(), "Menu.background", getMenuBackground(), "Menu.border", new MetalBorders.MenuItemBorder(), "Menu.borderPainted", Boolean.TRUE, "MenuItem.commandSound", "sounds/MenuItemCommand.wav", "Menu.disabledForeground", getMenuDisabledForeground(), "Menu.font", getMenuTextFont(), "Menu.foreground", getMenuForeground(), "Menu.selectionBackground", getMenuSelectedBackground(), "Menu.selectionForeground", getMenuSelectedForeground(), "Menu.submenuPopupOffsetX", new Integer(-4), "Menu.submenuPopupOffsetY", new Integer(-3), "MenuBar.background", getMenuBackground(), "MenuBar.border", new MetalBorders.MenuBarBorder(), "MenuBar.font", getMenuTextFont(), "MenuBar.foreground", getMenuForeground(), "MenuBar.highlight", getControlHighlight(), "MenuBar.shadow", getControlShadow(), "MenuItem.acceleratorDelimiter", "-", "MenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 10), "MenuItem.acceleratorForeground", getAcceleratorForeground(), "MenuItem.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "MenuItem.arrowIcon", MetalIconFactory.getMenuItemArrowIcon(), "MenuItem.background", getMenuBackground(), "MenuItem.border", new MetalBorders.MenuItemBorder(), "MenuItem.borderPainted", Boolean.TRUE, "MenuItem.disabledForeground", getMenuDisabledForeground(), "MenuItem.font", getMenuTextFont(), "MenuItem.foreground", getMenuForeground(), "MenuItem.selectionBackground", getMenuSelectedBackground(), "MenuItem.selectionForeground", getMenuSelectedForeground(), "OptionPane.background", getControl(), "OptionPane.errorSound", "sounds/OptionPaneError.wav", "OptionPane.informationSound", "sounds/OptionPaneInformation.wav", "OptionPane.questionSound", "sounds/OptionPaneQuestion.wav", "OptionPane.warningSound", "sounds/OptionPaneWarning.wav", "OptionPane.errorDialog.border.background", new ColorUIResource(153, 51, 51), "OptionPane.errorDialog.titlePane.background", new ColorUIResource(255, 153, 153), "OptionPane.errorDialog.titlePane.foreground", new ColorUIResource(51, 0, 0), "OptionPane.errorDialog.titlePane.shadow", new ColorUIResource(204, 102, 102), "OptionPane.foreground", getControlTextColor(), "OptionPane.messageForeground", getControlTextColor(), "OptionPane.questionDialog.border.background", new ColorUIResource(51, 102, 51), "OptionPane.questionDialog.titlePane.background", new ColorUIResource(153, 204, 153), "OptionPane.questionDialog.titlePane.foreground", new ColorUIResource(0, 51, 0), "OptionPane.questionDialog.titlePane.shadow", new ColorUIResource(102, 153, 102), "OptionPane.warningDialog.border.background", new ColorUIResource(153, 102, 51), "OptionPane.warningDialog.titlePane.background", new ColorUIResource(255, 204, 153), "OptionPane.warningDialog.titlePane.foreground", new ColorUIResource(102, 51, 0), "OptionPane.warningDialog.titlePane.shadow", new ColorUIResource(204, 153, 102), "Panel.background", getControl(), "Panel.foreground", getUserTextColor(), "PasswordField.background", getWindowBackground(), "PasswordField.border", new BorderUIResource(MetalBorders.getTextFieldBorder()), "PasswordField.caretForeground", getUserTextColor(), "PasswordField.foreground", getUserTextColor(), "PasswordField.font", new FontUIResource("Dialog", Font.PLAIN, 12), "PasswordField.inactiveBackground", getControl(), "PasswordField.inactiveForeground", getInactiveSystemTextColor(), "PasswordField.selectionBackground", getTextHighlightColor(), "PasswordField.selectionForeground", getHighlightedTextColor(), "PopupMenu.background", getMenuBackground(), "PopupMenu.border", new MetalBorders.PopupMenuBorder(), "PopupMenu.font", getMenuTextFont(), "PopupMenu.foreground", getMenuForeground(), "PopupMenu.popupSound", "sounds/PopupMenuPopup.wav", "ProgressBar.background", getControl(), "ProgressBar.border", new BorderUIResource.LineBorderUIResource(getControlDarkShadow(), 1), "ProgressBar.font", getControlTextFont(), "ProgressBar.foreground", getPrimaryControlShadow(), "ProgressBar.selectionBackground", getPrimaryControlDarkShadow(), "ProgressBar.selectionForeground", getControl(), "RadioButton.background", getControl(), "RadioButton.darkShadow", getControlDarkShadow(), "RadioButton.disabledText", getInactiveControlTextColor(), "RadioButton.icon", new UIDefaults.LazyValue() {
public Object createValue(UIDefaults def) {
return MetalIconFactory.getRadioButtonIcon();
}
}, "RadioButton.focus", MetalLookAndFeel.getFocusColor(), "RadioButton.font", MetalLookAndFeel.getControlTextFont(), "RadioButton.foreground", getControlTextColor(), "RadioButton.highlight", getControlHighlight(), "RadioButton.light", getControlHighlight(), "RadioButton.select", getControlShadow(), "RadioButton.shadow", getControlShadow(), "RadioButtonMenuItem.acceleratorFont", new Font("Dialog", Font.PLAIN, 10), "RadioButtonMenuItem.acceleratorForeground", getAcceleratorForeground(), "RadioButtonMenuItem.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "RadioButtonMenuItem.background", getMenuBackground(), "RadioButtonMenuItem.border", new MetalBorders.MenuItemBorder(), "RadioButtonMenuItem.borderPainted", Boolean.TRUE, "RadioButtonMenuItem.checkIcon", MetalIconFactory.getRadioButtonMenuItemIcon(), "RadioButtonMenuItem.commandSound", "sounds/MenuItemCommand.wav", "RadioButtonMenuItem.disabledForeground", getMenuDisabledForeground(), "RadioButtonMenuItem.font", getMenuTextFont(), "RadioButtonMenuItem.foreground", getMenuForeground(), "RadioButtonMenuItem.margin", new InsetsUIResource(2, 2, 2, 2), "RadioButtonMenuItem.selectionBackground", MetalLookAndFeel.getMenuSelectedBackground(), "RadioButtonMenuItem.selectionForeground", MetalLookAndFeel.getMenuSelectedForeground(), "ScrollBar.allowsAbsolutePositioning", Boolean.TRUE, "ScrollBar.background", getControl(), "ScrollBar.darkShadow", getControlDarkShadow(), "ScrollBar.foreground", getControl(), "ScrollBar.highlight", getControlHighlight(), "ScrollBar.shadow", getControlShadow(), "ScrollBar.thumb", getPrimaryControlShadow(), "ScrollBar.thumbDarkShadow", getControlDarkShadow(), "ScrollBar.thumbHighlight", getPrimaryControl(), "ScrollBar.thumbShadow", getPrimaryControlDarkShadow(), "ScrollBar.track", getControl(), "ScrollBar.trackHighlight", getControlDarkShadow(), "ScrollBar.width", new Integer(17), "ScrollPane.background", getControl(), "ScrollPane.border", new MetalBorders.ScrollPaneBorder(), "ScrollPane.foreground", getControlTextColor(), "Separator.background", getSeparatorBackground(), "Separator.foreground", getSeparatorForeground(), "Separator.highlight", getControlHighlight(), "Separator.shadow", getControlShadow(), "Slider.background", getControl(), "Slider.focus", getFocusColor(), "Slider.focusInsets", new InsetsUIResource(0, 0, 0, 0), "Slider.foreground", getPrimaryControlShadow(), "Slider.highlight", getControlHighlight(), "Slider.horizontalThumbIcon", MetalIconFactory.getHorizontalSliderThumbIcon(), "Slider.majorTickLength", new Integer(6), "Slider.shadow", getControlShadow(), "Slider.trackWidth", new Integer(7), "Slider.verticalThumbIcon", MetalIconFactory.getVerticalSliderThumbIcon(), "Spinner.arrowButtonInsets", new InsetsUIResource(0, 0, 0, 0), "Spinner.background", getControl(), "Spinner.border", MetalBorders.getTextFieldBorder(), "Spinner.font", getControlTextFont(), "Spinner.foreground", getControl(), "SplitPane.background", getControl(), "SplitPane.darkShadow", getControlDarkShadow(), "SplitPane.dividerFocusColor", getPrimaryControl(), "SplitPane.dividerSize", new Integer(10), "SplitPane.highlight", getControlHighlight(), "SplitPane.shadow", getControlShadow(), "SplitPaneDivider.draggingColor", Color.DARK_GRAY, "TabbedPane.background", getControlShadow(), "TabbedPane.contentBorderInsets", new InsetsUIResource(2, 2, 3, 3), "TabbedPane.contentOpaque", Boolean.TRUE, "TabbedPane.darkShadow", getControlDarkShadow(), "TabbedPane.focus", getPrimaryControlDarkShadow(), "TabbedPane.font", getControlTextFont(), "TabbedPane.foreground", getControlTextColor(), "TabbedPane.highlight", getControlHighlight(), "TabbedPane.light", getControl(), // overridden in OceanTheme
"TabbedPane.selected", // overridden in OceanTheme
getControl(), "TabbedPane.selectHighlight", getControlHighlight(), "TabbedPane.selectedTabPadInsets", new InsetsUIResource(2, 2, 2, 1), "TabbedPane.shadow", getControlShadow(), // overridden in OceanTheme
"TabbedPane.tabAreaBackground", // overridden in OceanTheme
getControl(), // dito
"TabbedPane.tabAreaInsets", // dito
new InsetsUIResource(4, 2, 0, 6), "TabbedPane.tabInsets", new InsetsUIResource(0, 9, 1, 9), "Table.background", getWindowBackground(), "Table.focusCellBackground", getWindowBackground(), "Table.focusCellForeground", getControlTextColor(), "Table.foreground", getControlTextColor(), "Table.focusCellHighlightBorder", new BorderUIResource.LineBorderUIResource(getFocusColor()), "Table.focusCellBackground", getWindowBackground(), "Table.gridColor", getControlDarkShadow(), "Table.selectionBackground", new ColorUIResource(204, 204, 255), "Table.selectionForeground", new ColorUIResource(0, 0, 0), "TableHeader.background", getControl(), "TableHeader.cellBorder", new MetalBorders.TableHeaderBorder(), "TableHeader.foreground", getControlTextColor(), "TextArea.background", getWindowBackground(), "TextArea.caretForeground", getUserTextColor(), "TextArea.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TextArea.foreground", getUserTextColor(), "TextArea.inactiveForeground", getInactiveSystemTextColor(), "TextArea.selectionBackground", getTextHighlightColor(), "TextArea.selectionForeground", getHighlightedTextColor(), "TextField.background", getWindowBackground(), "TextField.border", new BorderUIResource(MetalBorders.getTextFieldBorder()), "TextField.caretForeground", getUserTextColor(), "TextField.darkShadow", getControlDarkShadow(), "TextField.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TextField.foreground", getUserTextColor(), "TextField.highlight", getControlHighlight(), "TextField.inactiveBackground", getControl(), "TextField.inactiveForeground", getInactiveSystemTextColor(), "TextField.light", getControlHighlight(), "TextField.selectionBackground", getTextHighlightColor(), "TextField.selectionForeground", getHighlightedTextColor(), "TextField.shadow", getControlShadow(), "TextPane.background", getWindowBackground(), "TextPane.caretForeground", getUserTextColor(), "TextPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TextPane.foreground", getUserTextColor(), "TextPane.inactiveForeground", getInactiveSystemTextColor(), "TextPane.selectionBackground", getTextHighlightColor(), "TextPane.selectionForeground", getHighlightedTextColor(), "TitledBorder.border", new LineBorderUIResource(getPrimaryControl(), 1), "TitledBorder.font", getControlTextFont(), "TitledBorder.titleColor", getSystemTextColor(), "ToggleButton.background", getControl(), "ToggleButton.border", MetalBorders.getToggleButtonBorder(), "ToggleButton.darkShadow", getControlDarkShadow(), "ToggleButton.disabledText", getInactiveControlTextColor(), "ToggleButton.focus", getFocusColor(), "ToggleButton.font", getControlTextFont(), "ToggleButton.foreground", getControlTextColor(), "ToggleButton.highlight", getControlHighlight(), "ToggleButton.light", getControlHighlight(), "ToggleButton.margin", new InsetsUIResource(2, 14, 2, 14), "ToggleButton.select", getControlShadow(), "ToggleButton.shadow", getControlShadow(), "ToolBar.background", getMenuBackground(), "ToolBar.darkShadow", getControlDarkShadow(), "ToolBar.dockingBackground", getMenuBackground(), "ToolBar.dockingForeground", getPrimaryControlDarkShadow(), "ToolBar.floatingBackground", getMenuBackground(), "ToolBar.floatingForeground", getPrimaryControl(), "ToolBar.font", getMenuTextFont(), "ToolBar.foreground", getMenuForeground(), "ToolBar.highlight", getControlHighlight(), "ToolBar.light", getControlHighlight(), "ToolBar.shadow", getControlShadow(), "ToolBar.border", new MetalBorders.ToolBarBorder(), "ToolBar.rolloverBorder", MetalBorders.getToolbarButtonBorder(), "ToolBar.nonrolloverBorder", MetalBorders.getToolbarButtonBorder(), "ToolTip.background", getPrimaryControl(), "ToolTip.backgroundInactive", getControl(), "ToolTip.border", new BorderUIResource.LineBorderUIResource(getPrimaryControlDarkShadow(), 1), "ToolTip.borderInactive", new BorderUIResource.LineBorderUIResource(getControlDarkShadow(), 1), "ToolTip.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ToolTip.foreground", getPrimaryControlInfo(), "ToolTip.foregroundInactive", getControlDarkShadow(), "ToolTip.hideAccelerator", Boolean.FALSE, "Tree.background", getWindowBackground(), "Tree.closedIcon", MetalIconFactory.getTreeFolderIcon(), "Tree.collapsedIcon", MetalIconFactory.getTreeControlIcon(true), "Tree.expandedIcon", MetalIconFactory.getTreeControlIcon(false), "Tree.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Tree.foreground", getUserTextColor(), "Tree.hash", getPrimaryControl(), "Tree.leafIcon", MetalIconFactory.getTreeLeafIcon(), "Tree.leftChildIndent", new Integer(7), "Tree.line", getPrimaryControl(), "Tree.openIcon", MetalIconFactory.getTreeFolderIcon(), "Tree.rightChildIndent", new Integer(13), "Tree.rowHeight", new Integer(0), "Tree.scrollsOnExpand", Boolean.TRUE, "Tree.selectionBackground", getTextHighlightColor(), "Tree.selectionBorder", new BorderUIResource.LineBorderUIResource(new Color(102, 102, 153)), "Tree.selectionBorderColor", getFocusColor(), "Tree.selectionForeground", getHighlightedTextColor(), "Tree.textBackground", getWindowBackground(), "Tree.textForeground", getUserTextColor(), "Viewport.background", getControl(), "Viewport.foreground", getUserTextColor() };
defaults.putDefaults(myDefaults);
}Example 67
| Project: JContextExplorer-master File: Jpan_Menu.java View source code |
//exploratory method - change font of all components to a standard? private static void setUIFont(javax.swing.plaf.FontUIResource f) { java.util.Enumeration keys = UIManager.getDefaults().keys(); while (keys.hasMoreElements()) { Object key = keys.nextElement(); Object value = UIManager.get(key); if (value instanceof javax.swing.plaf.FontUIResource) { UIManager.put(key, f); } } }
Example 68
| Project: JDK-master File: SynthParser.java View source code |
private void startFont(Attributes attributes) throws SAXException {
Font font = null;
int style = Font.PLAIN;
int size = 0;
String id = null;
String name = null;
for (int i = attributes.getLength() - 1; i >= 0; i--) {
String key = attributes.getQName(i);
if (key.equals(ATTRIBUTE_ID)) {
id = attributes.getValue(i);
} else if (key.equals(ATTRIBUTE_IDREF)) {
font = (Font) lookup(attributes.getValue(i), Font.class);
} else if (key.equals(ATTRIBUTE_NAME)) {
name = attributes.getValue(i);
} else if (key.equals(ATTRIBUTE_SIZE)) {
try {
size = Integer.parseInt(attributes.getValue(i));
} catch (NumberFormatException nfe) {
throw new SAXException("Invalid font size: " + attributes.getValue(i));
}
} else if (key.equals(ATTRIBUTE_STYLE)) {
StringTokenizer tok = new StringTokenizer(attributes.getValue(i));
while (tok.hasMoreTokens()) {
String token = tok.nextToken().intern();
if (token == "BOLD") {
style = ((style | Font.PLAIN) ^ Font.PLAIN) | Font.BOLD;
} else if (token == "ITALIC") {
style |= Font.ITALIC;
}
}
}
}
if (font == null) {
if (name == null) {
throw new SAXException("You must define a name for the font");
}
if (size == 0) {
throw new SAXException("You must define a size for the font");
}
font = new FontUIResource(name, style, size);
} else if (name != null || size != 0 || style != Font.PLAIN) {
throw new SAXException("Name, size and style are not for use " + "with idref");
}
register(id, font);
if (_stateInfo != null) {
_stateInfo.setFont(font);
} else if (_style != null) {
_style.setFont(font);
}
}Example 69
| Project: ManagedRuntimeInitiative-master File: SynthParser.java View source code |
private void startFont(AttributeList attributes) throws SAXException {
Font font = null;
int style = Font.PLAIN;
int size = 0;
String id = null;
String name = null;
for (int i = attributes.getLength() - 1; i >= 0; i--) {
String key = attributes.getName(i);
if (key.equals(ATTRIBUTE_ID)) {
id = attributes.getValue(i);
} else if (key.equals(ATTRIBUTE_IDREF)) {
font = (Font) lookup(attributes.getValue(i), Font.class);
} else if (key.equals(ATTRIBUTE_NAME)) {
name = attributes.getValue(i);
} else if (key.equals(ATTRIBUTE_SIZE)) {
try {
size = Integer.parseInt(attributes.getValue(i));
} catch (NumberFormatException nfe) {
throw new SAXException("Invalid font size: " + attributes.getValue(i));
}
} else if (key.equals(ATTRIBUTE_STYLE)) {
StringTokenizer tok = new StringTokenizer(attributes.getValue(i));
while (tok.hasMoreTokens()) {
String token = tok.nextToken().intern();
if (token == "BOLD") {
style = ((style | Font.PLAIN) ^ Font.PLAIN) | Font.BOLD;
} else if (token == "ITALIC") {
style |= Font.ITALIC;
}
}
}
}
if (font == null) {
if (name == null) {
throw new SAXException("You must define a name for the font");
}
if (size == 0) {
throw new SAXException("You must define a size for the font");
}
font = new FontUIResource(name, style, size);
} else if (name != null || size != 0 || style != Font.PLAIN) {
throw new SAXException("Name, size and style are not for use " + "with idref");
}
register(id, font);
if (_stateInfo != null) {
_stateInfo.setFont(font);
} else if (_style != null) {
_style.setFont(font);
}
}Example 70
| Project: wordcorr-master File: MainFrame.java View source code |
/**
* Set the default font for the application.
**/
public void setDefaultFont(Font f) {
FontUIResource font = new FontUIResource(f);
java.util.Enumeration keys = UIManager.getDefaults().keys();
while (keys.hasMoreElements()) {
Object key = keys.nextElement();
Object value = UIManager.get(key);
if (value instanceof FontUIResource) {
UIManager.put(key, font);
}
}
SwingUtilities.updateComponentTreeUI(this);
}Example 71
| Project: mobac-ext-master File: MainGUI.java View source code |
// MP: update all UI components' default font to custom font
public static void setDefaultFontOfAllUIComponents(Font defaultFont) {
if (defaultFont != null) {
// register custom font to application,system font will return false
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
ge.registerFont(defaultFont);
// update all UI's font settings
javax.swing.plaf.FontUIResource fontRes = new javax.swing.plaf.FontUIResource(defaultFont);
Enumeration<Object> keys = UIManager.getDefaults().keys();
while (keys.hasMoreElements()) {
Object key = keys.nextElement();
Object value = UIManager.get(key);
if (value instanceof javax.swing.plaf.FontUIResource) {
UIManager.put(key, fontRes);
}
}
}
}Example 72
| Project: MOBAC-master File: MainGUI.java View source code |
// MP: update all UI components' default font to custom font
public static void setDefaultFontOfAllUIComponents(Font defaultFont) {
if (defaultFont != null) {
// register custom font to application,system font will return false
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
ge.registerFont(defaultFont);
// update all UI's font settings
javax.swing.plaf.FontUIResource fontRes = new javax.swing.plaf.FontUIResource(defaultFont);
Enumeration<Object> keys = UIManager.getDefaults().keys();
while (keys.hasMoreElements()) {
Object key = keys.nextElement();
Object value = UIManager.get(key);
if (value instanceof javax.swing.plaf.FontUIResource) {
UIManager.put(key, fontRes);
}
}
}
}Example 73
| Project: nmedit-master File: JTNM1Context.java View source code |
@Override
protected void setDefaults(UIDefaults uidefaults) {
FontUIResource baseFont = new FontUIResource("SansSerif", Font.PLAIN, 9);
uidefaults.put(DISPLAY_AXIS_COLOR_KEY, new ColorUIResource(0x000000));
uidefaults.put(DISPLAY_SHAPE_FILL_COLOR_KEY, new ColorUIResource(0xC0D0C0));
uidefaults.put(DISPLAY_SHAPE_OUTLINE_COLOR_KEY, new ColorUIResource(0xC0C0C0));
uidefaults.put(JTSlider.uiClassID, JTNM1SliderUI.class.getName());
uidefaults.put(JTKnob.uiClassID, JTNM1KnobUI.class.getName());
uidefaults.put(JTNM1ResetButton.uiClassID, JTNM1ResetButtonUI.class.getName());
uidefaults.put(JTConnector.uiClassID, JTBasicConnectorUI.class.getName());
uidefaults.put(JTButtonControl.uiClassID, JTBasicButtonControlUI.class.getName());
uidefaults.put(JTButtonControlUI.BORDER_KEY, JTNM1BorderFactory.createNordEditor311RaisedButtonBorder());
uidefaults.put(JTButtonControlUI.SELECTED_BORDER_KEY, JTNM1BorderFactory.createNordEditor311LoweredButtonBorder());
uidefaults.put(JTButtonControlUI.BACKGROUND_KEY, new ColorUIResource(0xB0B0B0));
uidefaults.put(JTButtonControlUI.BACKGROUND_STATE_KEY, new ColorUIResource(0xC4F6ED));
uidefaults.put(JTButtonControlUI.BACKGROUND_SELECTED_KEY, new ColorUIResource(0xC6CCDE));
uidefaults.put(DNDLayer.DND_BOUNDINGBOX_BORDER, new BorderUIResource(new BoundingBoxBorder()));
uidefaults.put(JTLight.uiClassId, JTBasicLightUI.class.getName());
uidefaults.put(JTLightUI.BORDER_KEY, new BorderUIResource(JTNM1BorderFactory.createNordEditor311Border()));
uidefaults.put(JTImage.uiClassID, JTImageUI.class.getName());
uidefaults.put(JTLabel.uiClassID, JTLabelUI.class.getName());
uidefaults.put(JTLabelUI.fontKey, baseFont);
uidefaults.put(JTTextDisplay.uiClassID, JTTextDisplayUI.class.getName());
uidefaults.put(JTTextDisplayUI.borderKey, new BorderUIResource(JTNM1BorderFactory.createNordEditor311Border()));
uidefaults.put(JTDisplay.uiClassID, JTDisplayUI.class.getName());
uidefaults.put(JTDisplayUI.BACKGROUND_KEY, new ColorUIResource(0x008080));
uidefaults.put(JTDisplayUI.FOREGROUND_KEY, new ColorUIResource(0x00ff00));
uidefaults.put(JTDisplayUI.BORDER_KEY, new BorderUIResource(JTNM1BorderFactory.createNordEditor311Border()));
uidefaults.put(JTModule.uiClassID, JTModuleUI.class.getName());
uidefaults.put(JTModuleUI.moduleFont, baseFont);
uidefaults.put(JTEqMidDisplay.uiClassID, JTDisplayUI.class.getName());
uidefaults.put(JTEqShelvingDisplay.uiClassID, JTDisplayUI.class.getName());
uidefaults.put(JTPhaserDisplay.uiClassID, JTDisplayUI.class.getName());
uidefaults.put(JTFilterEDisplay.uiClassID, JTDisplayUI.class.getName());
uidefaults.put(VocoderDisplay.uiClassID, JTDisplayUI.class.getName());
uidefaults.put(JTFilterFDisplay.uiClassID, JTDisplayUI.class.getName());
uidefaults.put(LFODisplay.uiClassID, JTDisplayUI.class.getName());
uidefaults.put(JTCompressorDisplay.uiClassID, JTDisplayUI.class.getName());
uidefaults.put(NoteVelScaleDisplay.uiClassID, JTDisplayUI.class.getName());
uidefaults.put(JTEnvelopeDisplay.uiClassID, JTDisplayUI.class.getName());
uidefaults.put(WaveWrapDisp.uiClassID, JTDisplayUI.class.getName());
uidefaults.put(ClipDisp.uiClassID, JTDisplayUI.class.getName());
uidefaults.put(NMScrollbar.ScrollBarUIClassID, JTBasicSliderScrollbarUI.class.getName());
Border moduleBorder = BorderFactory.createRaisedBevelBorder();
Border selectionBorder = new SimpleSelectionBorder(moduleBorder, Color.decode("#CC6600"));
uidefaults.put(JTModuleUI.moduleBorder, new BorderUIResource(moduleBorder));
uidefaults.put(JTModuleUI.moduleSelectionBorder, new BorderUIResource(selectionBorder));
uidefaults.put(JTModuleContainer.uiClassId, JTModuleContainerUI.class.getName());
uidefaults.put(JTModuleContainerUI.backgroundKey, new ColorUIResource(0x81818D));
uidefaults.put(JTModuleContainerUI.DnDAllowedKey, Boolean.TRUE);
uidefaults.put(JTModuleContainerUI.baseFontKey, baseFont);
uidefaults.put(JTNM1SliderUI.sliderGripSizeKey, 3);
uidefaults.put(JTNM1SliderUI.sliderBackgroundColorKey, new ColorUIResource(0xDCDCDC));
uidefaults.put(JTNM1SliderUI.sliderGripColorKey, new ColorUIResource(0xC4C4C4));
uidefaults.put(JTNM1SliderUI.sliderGripBorderLightColorKey, new ColorUIResource(0x909090));
uidefaults.put(JTNM1SliderUI.sliderGripBorderDarkColorKey, new ColorUIResource(0x3D3D3D));
uidefaults.put(JTNM1SliderUI.sliderGripColorKey, new ColorUIResource(0xC4C4C4));
uidefaults.put(JTNM1SliderUI.sliderBackgroundColorKey, new ColorUIResource(0xDCDCDE));
uidefaults.put(JTNM1SliderUI.borderKey, new BorderUIResource(JTNM1BorderFactory.createNordEditor311Border()));
uidefaults.put(NoteSeqEditorUI.borderKey, new BorderUIResource(JTNM1BorderFactory.createNordEditor311Border()));
uidefaults.put(NMNoteSeqEditor.uiClassID, NoteSeqEditorUI.class.getName());
uidefaults.put("module.background", new ColorUIResource(0xC0C0C0));
uidefaults.put("module.background$1", new ColorUIResource(0xE5777A));
uidefaults.put("module.background$2", new ColorUIResource(0xE7D14B));
uidefaults.put("module.background$3", new ColorUIResource(0x93D162));
uidefaults.put("module.background$4", new ColorUIResource(0x69D6C7));
uidefaults.put("module.background$5", new ColorUIResource(0x74A0D4));
uidefaults.put("module.background$6", new ColorUIResource(0xD673C7));
uidefaults.put("morph.color$0", new ColorUIResource(0xCB4F4F));
uidefaults.put("morph.color$1", new ColorUIResource(0x9AC889));
uidefaults.put("morph.color$2", new ColorUIResource(0x5A5FB3));
uidefaults.put("morph.color$3", new ColorUIResource(0xE5DE45));
}Example 74
| Project: nmonvisualizer-master File: NMONVisualizerGui.java View source code |
public static void main(final String[] args) throws Exception {
javax.swing.UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
String temp = System.getProperty("fontSize");
if (temp != null) {
try {
int fontSize = Integer.parseInt(temp);
javax.swing.UIManager.getLookAndFeelDefaults().put("defaultFont", new javax.swing.plaf.FontUIResource(new java.awt.Font("Dialog", java.awt.Font.PLAIN, fontSize)));
} catch (NumberFormatException nfe) {
System.err.println("ignoring -DfontSize=" + temp + "; it must be an integer");
}
}
SwingUtilities.invokeLater(new Runnable() {
public void run() {
try {
NMONVisualizerGui gui = new NMONVisualizerGui();
gui.getMainFrame().setVisible(true);
if (args.length > 0) {
gui.logger.info("starting with files {}", java.util.Arrays.toString(args));
File[] files = new File[args.length];
for (int i = 0; i < args.length; i++) {
files[i] = new File(args[i]);
}
List<String> toParse = new java.util.ArrayList<String>();
gui.logger.debug("parsing files {}", toParse);
FileHelper.recurseDirectories(files, CombinedFileFilter.getInstance(false), toParse);
new Thread(new ParserRunner(gui, toParse, gui.getDisplayTimeZone()), getClass().getName() + " Parser").start();
}
} catch (Exception e) {
e.printStackTrace();
}
}
});
}Example 75
| Project: ComplexRapidMiner-master File: RapidLookAndFeel.java View source code |
protected void initComponentDefaults(UIDefaults table) {
super.initComponentDefaults(table);
Object fieldInputMap = new UIDefaults.LazyInputMap(new Object[] { "ctrl C", DefaultEditorKit.copyAction, "ctrl V", DefaultEditorKit.pasteAction, "ctrl X", DefaultEditorKit.cutAction, "COPY", DefaultEditorKit.copyAction, "PASTE", DefaultEditorKit.pasteAction, "CUT", DefaultEditorKit.cutAction, "shift LEFT", DefaultEditorKit.selectionBackwardAction, "shift KP_LEFT", DefaultEditorKit.selectionBackwardAction, "shift RIGHT", DefaultEditorKit.selectionForwardAction, "shift KP_RIGHT", DefaultEditorKit.selectionForwardAction, "ctrl LEFT", DefaultEditorKit.previousWordAction, "ctrl KP_LEFT", DefaultEditorKit.previousWordAction, "ctrl RIGHT", DefaultEditorKit.nextWordAction, "ctrl KP_RIGHT", DefaultEditorKit.nextWordAction, "ctrl shift LEFT", DefaultEditorKit.selectionPreviousWordAction, "ctrl shift KP_LEFT", DefaultEditorKit.selectionPreviousWordAction, "ctrl shift RIGHT", DefaultEditorKit.selectionNextWordAction, "ctrl shift KP_RIGHT", DefaultEditorKit.selectionNextWordAction, "ctrl A", DefaultEditorKit.selectAllAction, "HOME", DefaultEditorKit.beginLineAction, "END", DefaultEditorKit.endLineAction, "shift HOME", DefaultEditorKit.selectionBeginLineAction, "shift END", DefaultEditorKit.selectionEndLineAction, "typed \010", DefaultEditorKit.deletePrevCharAction, "DELETE", DefaultEditorKit.deleteNextCharAction, "RIGHT", DefaultEditorKit.forwardAction, "LEFT", DefaultEditorKit.backwardAction, "KP_RIGHT", DefaultEditorKit.forwardAction, "KP_LEFT", DefaultEditorKit.backwardAction, "ENTER", JTextField.notifyAction, "ctrl BACK_SLASH", "unselect", "control shift O", "toggle-componentOrientation" });
Object multilineInputMap = new UIDefaults.LazyInputMap(new Object[] { "ctrl C", DefaultEditorKit.copyAction, "ctrl V", DefaultEditorKit.pasteAction, "ctrl X", DefaultEditorKit.cutAction, "COPY", DefaultEditorKit.copyAction, "PASTE", DefaultEditorKit.pasteAction, "CUT", DefaultEditorKit.cutAction, "shift LEFT", DefaultEditorKit.selectionBackwardAction, "shift KP_LEFT", DefaultEditorKit.selectionBackwardAction, "shift RIGHT", DefaultEditorKit.selectionForwardAction, "shift KP_RIGHT", DefaultEditorKit.selectionForwardAction, "ctrl LEFT", DefaultEditorKit.previousWordAction, "ctrl KP_LEFT", DefaultEditorKit.previousWordAction, "ctrl RIGHT", DefaultEditorKit.nextWordAction, "ctrl KP_RIGHT", DefaultEditorKit.nextWordAction, "ctrl shift LEFT", DefaultEditorKit.selectionPreviousWordAction, "ctrl shift KP_LEFT", DefaultEditorKit.selectionPreviousWordAction, "ctrl shift RIGHT", DefaultEditorKit.selectionNextWordAction, "ctrl shift KP_RIGHT", DefaultEditorKit.selectionNextWordAction, "ctrl A", DefaultEditorKit.selectAllAction, "HOME", DefaultEditorKit.beginLineAction, "END", DefaultEditorKit.endLineAction, "shift HOME", DefaultEditorKit.selectionBeginLineAction, "shift END", DefaultEditorKit.selectionEndLineAction, "UP", DefaultEditorKit.upAction, "KP_UP", DefaultEditorKit.upAction, "DOWN", DefaultEditorKit.downAction, "KP_DOWN", DefaultEditorKit.downAction, "PAGE_UP", DefaultEditorKit.pageUpAction, "PAGE_DOWN", DefaultEditorKit.pageDownAction, "shift PAGE_UP", "selection-page-up", "shift PAGE_DOWN", "selection-page-down", "ctrl shift PAGE_UP", "selection-page-left", "ctrl shift PAGE_DOWN", "selection-page-right", "shift UP", DefaultEditorKit.selectionUpAction, "shift KP_UP", DefaultEditorKit.selectionUpAction, "shift DOWN", DefaultEditorKit.selectionDownAction, "shift KP_DOWN", DefaultEditorKit.selectionDownAction, "ENTER", DefaultEditorKit.insertBreakAction, "typed \010", DefaultEditorKit.deletePrevCharAction, "DELETE", DefaultEditorKit.deleteNextCharAction, "RIGHT", DefaultEditorKit.forwardAction, "LEFT", DefaultEditorKit.backwardAction, "KP_RIGHT", DefaultEditorKit.forwardAction, "KP_LEFT", DefaultEditorKit.backwardAction, "TAB", DefaultEditorKit.insertTabAction, "ctrl BACK_SLASH", "unselect", "ctrl HOME", DefaultEditorKit.beginAction, "ctrl END", DefaultEditorKit.endAction, "ctrl shift HOME", DefaultEditorKit.selectionBeginAction, "ctrl shift END", DefaultEditorKit.selectionEndAction, "ctrl T", "next-link-action", "ctrl shift T", "previous-link-action", "ctrl SPACE", "activate-link-action", "control shift O", "toggle-componentOrientation" });
Object toolTipBorder = new UIDefaults.ProxyLazyValue("javax.swing.plaf.BorderUIResource$LineBorderUIResource", new Object[] { new ColorUIResource(100, 100, 100) });
Object focusCellHighlightBorder = new UIDefaults.ProxyLazyValue("javax.swing.plaf.BorderUIResource$LineBorderUIResource", new Object[] { COLORS.getTextHighlightBackColor().darker() });
Object fontDialog12 = new UIDefaults.ProxyLazyValue("javax.swing.plaf.FontUIResource", null, new Object[] { "Dialog", Integer.valueOf(0), Integer.valueOf(12) });
ColorUIResource caretColor = new ColorUIResource(0, 25, 100);
Object textFieldMargin = new InsetsUIResource(4, 6, 4, 6);
Object tabbedpaneTabInsets = new InsetsUIResource(3, 10, 0, 10);
Object defaultDirectoryIcon = SwingTools.createImage("plaf/folder.png");
Integer zero = Integer.valueOf(0);
Integer one = Integer.valueOf(1);
Object sliderFocusInsets = new InsetsUIResource(2, 2, 2, 2);
Object[] defaults = { // Button
"Button.font", fontDialog12, "Button.background", COLORS.getCommonBackground(), "Button.foreground", COLORS.getCommonForeground(), "Button.margin", new InsetsUIResource(10, 20, 10, 20), "Button.textShiftOffset", one, "Button.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released", "ENTER", "pressed", "released ENTER", "released" }), // ToggleButton
"ToggleButton.font", fontDialog12, "ToggleButton.background", COLORS.getCommonBackground(), "ToggleButton.foreground", COLORS.getCommonForeground(), "ToggleButton.textShiftOffset", one, "ToggleButton.margin", textFieldMargin, "Button.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), // RadioButton
"RadioButton.font", fontDialog12, "RadioButton.background", COLORS.getCommonBackground(), "RadioButton.foreground", COLORS.getCommonForeground(), "RadioButton.textShiftOffset", zero, "RadioButton.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released", "RETURN", "pressed" }), // CheckBox
"CheckBox.font", fontDialog12, "CheckBox.background", COLORS.getCommonBackground(), "CheckBox.foreground", COLORS.getCommonForeground(), "CheckBox.textShiftOffset", zero, "CheckBox.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released", "RETURN", "pressed" }), // ComboBox
"ComboBox.font", fontDialog12, "ComboBox.background", COLORS.getCommonBackground(), "ComboBox.foreground", COLORS.getCommonForeground(), "ComboBox.textShiftOffset", one, "ComboBox.disabledForeground", getInactiveSystemTextColor(), "ComboBox.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "hidePopup", "PAGE_UP", "pageUpPassThrough", "PAGE_DOWN", "pageDownPassThrough", "HOME", "homePassThrough", "END", "endPassThrough", "DOWN", "selectNext", "KP_DOWN", "selectNext", "alt DOWN", "togglePopup", "alt KP_DOWN", "togglePopup", "alt UP", "togglePopup", "alt KP_UP", "togglePopup", "SPACE", "spacePopup", "ENTER", "enterPressed", "UP", "selectPrevious", "KP_UP", "selectPrevious" }), //Filechooser
"FileChooser.defaultDirectoryIcon", defaultDirectoryIcon, "FileChooser.newFolderIcon", null, "FileChooser.upFolderIcon", null, "FileChooser.homeFolderIcon", null, "FileChooser.detailsViewIcon", null, "FileChooser.listViewIcon", null, "FileView.directoryIcon", null, "FileView.fileIcon", null, "FileView.computerIcon", null, "FileView.hardDriveIcon", null, "FileView.floppyDriveIcon", null, "FileChooser.ChangeViewNormalIcon", SwingTools.createImage("plaf/fc/fc_change_1.png"), "FileChooser.ChangeViewHighlightedIcon", SwingTools.createImage("plaf/fc/fc_change_2.png"), "FileChooser.BookmarksAddNormalIcon", SwingTools.createImage("plaf/fc/fc_bookmark_1.png"), "FileChooser.BookmarksAddHighlightedIcon", SwingTools.createImage("plaf/fc/fc_bookmark_2.png"), "FileChooser.HomeNormalIcon", SwingTools.createImage("plaf/fc/fc_home_1.png"), "FileChooser.HomeHighlightedIcon", SwingTools.createImage("plaf/fc/fc_home_2.png"), "FileChooser.HomeDisabledIcon", SwingTools.createImage("plaf/fc/fc_home_3.png"), "FileChooser.NewFolderNormalIcon", SwingTools.createImage("plaf/fc/fc_new_1.png"), "FileChooser.NewFolderHighlightedIcon", SwingTools.createImage("plaf/fc/fc_new_2.png"), "FileChooser.NewFolderDisabledIcon", SwingTools.createImage("plaf/fc/fc_new_3.png"), "FileChooser.UpFolderNormalIcon", SwingTools.createImage("plaf/fc/fc_up_1.png"), "FileChooser.UpFolderHighlightedIcon", SwingTools.createImage("plaf/fc/fc_up_2.png"), "FileChooser.UpFolderDisabledIcon", SwingTools.createImage("plaf/fc/fc_up_3.png"), "FileChooser.BackFolderNormalIcon", SwingTools.createImage("plaf/fc/fc_back1.png"), "FileChooser.BackFolderHighlightedIcon", SwingTools.createImage("plaf/fc/fc_back2.png"), "FileChooser.BackFolderDisabledIcon", SwingTools.createImage("plaf/fc/fc_back3.png"), "FileChooser.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "cancelSelection", "BACK_SPACE", "Go Up", "ENTER", "approveSelection" }), //InternalFrame
"InternalFrame.titleFont", new FontUIResource("Dialog", 1, 14), "InternalFrame.activeTitleForeground", Colors.getWhite(), "InternalFrame.inactiveTitleForeground", Colors.getWhite(), "InternalFrame.closeIcon", SwingTools.createImage("plaf/close_icon.png"), "InternalFrame.rolloverCloseIcon", SwingTools.createImage("plaf/armed_close_icon.png"), "InternalFrame.maximizeIcon", SwingTools.createImage("plaf/maximize_icon.png"), "InternalFrame.rolloverMaximizeIcon", SwingTools.createImage("plaf/armed_maximize_icon.png"), "InternalFrame.minimizeIcon", SwingTools.createImage("plaf/minimize_icon.png"), "InternalFrame.rolloverMinimizeIcon", SwingTools.createImage("plaf/armed_minimize_icon.png"), "InternalFrame.iconifyIcon", SwingTools.createImage("plaf/iconify_icon.png"), "InternalFrame.rolloverIconifyIcon", SwingTools.createImage("plaf/armed_iconify_icon.png"), "InternalFrame.icon", SwingTools.createImage("plaf/internal_icon.png"), //DesktopIcon
"DesktopIcon.foreground", getControlTextColor(), "DesktopIcon.width", new Integer(140), "DesktopIcon.font", getMainFont(), //Desktop
"Desktop.background", COLORS.getDesktopBackgroundColor(), "Desktop.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ctrl F5", "restore", "ctrl F4", "close", "ctrl F7", "move", "ctrl F8", "resize", "RIGHT", "right", "KP_RIGHT", "right", "shift RIGHT", "shrinkRight", "shift KP_RIGHT", "shrinkRight", "LEFT", "left", "KP_LEFT", "left", "shift LEFT", "shrinkLeft", "shift KP_LEFT", "shrinkLeft", "UP", "up", "KP_UP", "up", "shift UP", "shrinkUp", "shift KP_UP", "shrinkUp", "DOWN", "down", "KP_DOWN", "down", "shift DOWN", "shrinkDown", "shift KP_DOWN", "shrinkDown", "ESCAPE", "escape", "ctrl F9", "minimize", "ctrl F10", "maximize", "ctrl F6", "selectNextFrame", "ctrl TAB", "selectNextFrame", "ctrl alt F6", "selectNextFrame", "shift ctrl alt F6", "selectPreviousFrame", "ctrl F12", "navigateNext", "shift ctrl F12", "navigatePrevious" }), //Label
"Label.font", fontDialog12, "Label.foreground", getSystemTextColor(), "Label.disabledForeground", getInactiveSystemTextColor(), "Label.background", COLORS.getCommonBackground(), //List
"List.focusCellHighlightBorder", focusCellHighlightBorder, "List.font", fontDialog12, "List.background", Colors.getWhite(), "List.selectionBackground", COLORS.getTextHighlightBackColor(), "List.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "ctrl C", "copy", "ctrl V", "paste", "ctrl X", "cut", "COPY", "copy", "PASTE", "paste", "CUT", "cut", "UP", "selectPreviousRow", "KP_UP", "selectPreviousRow", "shift UP", "selectPreviousRowExtendSelection", "shift KP_UP", "selectPreviousRowExtendSelection", "DOWN", "selectNextRow", "KP_DOWN", "selectNextRow", "shift DOWN", "selectNextRowExtendSelection", "shift KP_DOWN", "selectNextRowExtendSelection", "LEFT", "selectPreviousColumn", "KP_LEFT", "selectPreviousColumn", "shift LEFT", "selectPreviousColumnExtendSelection", "shift KP_LEFT", "selectPreviousColumnExtendSelection", "RIGHT", "selectNextColumn", "KP_RIGHT", "selectNextColumn", "shift RIGHT", "selectNextColumnExtendSelection", "shift KP_RIGHT", "selectNextColumnExtendSelection", "HOME", "selectFirstRow", "shift HOME", "selectFirstRowExtendSelection", "END", "selectLastRow", "shift END", "selectLastRowExtendSelection", "PAGE_UP", "scrollUp", "shift PAGE_UP", "scrollUpExtendSelection", "PAGE_DOWN", "scrollDown", "shift PAGE_DOWN", "scrollDownExtendSelection", "ctrl A", "selectAll", "ctrl SLASH", "selectAll", "ctrl BACK_SLASH", "clearSelection" }), //MenuBar
"MenuBar.font", fontDialog12, "MenuBar.windowBindings", new Object[] { "F10", "takeFocus" }, //Menu Item
"MenuItem.font", fontDialog12, "MenuItem.acceleratorFont", fontDialog12, "MenuItem.selectionBackground", getMenuSelectedBack(), //RadioButtonMenuItem
"RadioButtonMenuItem.font", fontDialog12, "RadioButtonMenuItem.selectionBackground", getMenuSelectedBack(), "RadioButtonMenuItem.checkIcon", new UIDefaults.ProxyLazyValue("com.rapidminer.gui.look.icons.IconFactory", "getRadioButtonMenuItemIcon"), //CheckBoxMenuItem
"CheckBoxMenuItem.font", fontDialog12, "CheckBoxMenuItem.selectionBackground", getMenuSelectedBack(), "CheckBoxMenuItem.checkIcon", new UIDefaults.ProxyLazyValue("com.rapidminer.gui.look.icons.IconFactory", "getCheckBoxMenuItemIcon"), //Menus
"Menu.font", fontDialog12, "Menu.selectionBackground", getMenuSelectedBack(), //PopupMenu
"PopupMenu.font", fontDialog12, //OptionPane
"OptionPane.font", fontDialog12, "OptionPane.informationIcon", SwingTools.createImage("plaf/information.png"), "OptionPane.errorIcon", SwingTools.createImage("plaf/error.png"), "OptionPane.questionIcon", SwingTools.createImage("plaf/question.png"), "OptionPane.warningIcon", SwingTools.createImage("plaf/warning.png"), //Panel
"Panel.font", fontDialog12, //ProggressBar
"ProgressBar.foreground", new ColorUIResource(40, 40, 40), "ProgressBar.background", new ColorUIResource(240, 240, 240), "ProgressBar.font", new java.awt.Font("Dialog", 0, 11), //ScrollBar
"ScrollBar.border", null, "ScrollBar.background", getColors().getCommonBackground(), "ScrollBar.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "RIGHT", "positiveUnitIncrement", "KP_RIGHT", "positiveUnitIncrement", "DOWN", "positiveUnitIncrement", "KP_DOWN", "positiveUnitIncrement", "PAGE_DOWN", "positiveBlockIncrement", "LEFT", "negativeUnitIncrement", "KP_LEFT", "negativeUnitIncrement", "UP", "negativeUnitIncrement", "KP_UP", "negativeUnitIncrement", "PAGE_UP", "negativeBlockIncrement", "HOME", "minScroll", "END", "maxScroll" }), //ScrollPane
"ScrollPane.font", fontDialog12, "ScrollPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "RIGHT", "unitScrollRight", "KP_RIGHT", "unitScrollRight", "DOWN", "unitScrollDown", "KP_DOWN", "unitScrollDown", "LEFT", "unitScrollLeft", "KP_LEFT", "unitScrollLeft", "UP", "unitScrollUp", "KP_UP", "unitScrollUp", "PAGE_UP", "scrollUp", "PAGE_DOWN", "scrollDown", "ctrl PAGE_UP", "scrollLeft", "ctrl PAGE_DOWN", "scrollRight", "ctrl HOME", "scrollHome", "ctrl END", "scrollEnd" }), //ViewPort
"Viewport.font", fontDialog12, //Slider
"Slider.focusInsets", sliderFocusInsets, "Slider.disabledForeground", getInactiveSystemTextColor(), "Slider.majorColor", new ColorUIResource(100, 100, 100), "Slider.minorColor", new ColorUIResource(180, 180, 180), "Slider.majorDisabledColor", new ColorUIResource(180, 180, 180), "Slider.minorDisabledColor", new ColorUIResource(220, 220, 220), "Slider.trackWidth", new Integer(7), "Slider.majorTickLength", new Integer(6), "Slider.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "RIGHT", "positiveUnitIncrement", "KP_RIGHT", "positiveUnitIncrement", "DOWN", "negativeUnitIncrement", "KP_DOWN", "negativeUnitIncrement", "PAGE_DOWN", "negativeBlockIncrement", "ctrl PAGE_DOWN", "negativeBlockIncrement", "LEFT", "negativeUnitIncrement", "KP_LEFT", "negativeUnitIncrement", "UP", "positiveUnitIncrement", "KP_UP", "positiveUnitIncrement", "PAGE_UP", "positiveBlockIncrement", "ctrl PAGE_UP", "positiveBlockIncrement", "HOME", "minScroll", "END", "maxScroll" }), //Spinner
"Spinner.font", fontDialog12, "Spinner.background", COLORS.getCommonBackground(), "Spinner.margin", new InsetsUIResource(10, 10, 10, 10), "Spinner.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "UP", "increment", "KP_UP", "increment", "DOWN", "decrement", "KP_DOWN", "decrement" }), //SplitPane
"SplitPane.dividerSize", new Integer(9), "SplitPane.highlight", new ColorUIResource(250, 250, 250), "SplitPane.shadow", new ColorUIResource(200, 200, 200), "SplitPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "UP", "negativeIncrement", "DOWN", "positiveIncrement", "LEFT", "negativeIncrement", "RIGHT", "positiveIncrement", "KP_UP", "negativeIncrement", "KP_DOWN", "positiveIncrement", "KP_LEFT", "negativeIncrement", "KP_RIGHT", "positiveIncrement", "HOME", "selectMin", "END", "selectMax", "F8", "startResize", "F6", "toggleFocus", "ctrl TAB", "focusOutForward", "ctrl shift TAB", "focusOutBackward" }), "SplitPaneDivider.border", null, //TabbedPane
"TabbedPane.tabAreaInsets", tabbedpaneTabInsets, "TabbedPane.font", fontDialog12, "TabbedPane.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "RIGHT", "navigateRight", "KP_RIGHT", "navigateRight", "LEFT", "navigateLeft", "KP_LEFT", "navigateLeft", "UP", "navigateUp", "KP_UP", "navigateUp", "DOWN", "navigateDown", "KP_DOWN", "navigateDown", "ctrl DOWN", "requestFocusForVisibleComponent", "ctrl KP_DOWN", "requestFocusForVisibleComponent" }), "TabbedPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ctrl PAGE_DOWN", "navigatePageDown", "ctrl PAGE_UP", "navigatePageUp", "ctrl UP", "requestFocus", "ctrl KP_UP", "requestFocus" }), //Table
"Table.font", fontDialog12, "Table.background", Colors.getWhite(), "Table.selectionForeground", getUserTextColor(), "Table.gridColor", new ColorUIResource(200, 200, 200), "Table.focusCellForeground", getHighlightedTextColor(), "Table.focusCellHighlightBorder", new LineBorderUIResource(COLORS.getTextHighlightBackColor().brighter()), "Table.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ctrl C", "copy", "ctrl V", "paste", "ctrl X", "cut", "COPY", "copy", "PASTE", "paste", "CUT", "cut", "RIGHT", "selectNextColumn", "KP_RIGHT", "selectNextColumn", "LEFT", "selectPreviousColumn", "KP_LEFT", "selectPreviousColumn", "DOWN", "selectNextRow", "KP_DOWN", "selectNextRow", "UP", "selectPreviousRow", "KP_UP", "selectPreviousRow", "shift RIGHT", "selectNextColumnExtendSelection", "shift KP_RIGHT", "selectNextColumnExtendSelection", "shift LEFT", "selectPreviousColumnExtendSelection", "shift KP_LEFT", "selectPreviousColumnExtendSelection", "shift DOWN", "selectNextRowExtendSelection", "shift KP_DOWN", "selectNextRowExtendSelection", "shift UP", "selectPreviousRowExtendSelection", "shift KP_UP", "selectPreviousRowExtendSelection", "PAGE_UP", "scrollUpChangeSelection", "PAGE_DOWN", "scrollDownChangeSelection", "HOME", "selectFirstColumn", "END", "selectLastColumn", "shift PAGE_UP", "scrollUpExtendSelection", "shift PAGE_DOWN", "scrollDownExtendSelection", "shift HOME", "selectFirstColumnExtendSelection", "shift END", "selectLastColumnExtendSelection", "ctrl PAGE_UP", "scrollLeftChangeSelection", "ctrl PAGE_DOWN", "scrollRightChangeSelection", "ctrl HOME", "selectFirstRow", "ctrl END", "selectLastRow", "ctrl shift PAGE_UP", "scrollRightExtendSelection", "ctrl shift PAGE_DOWN", "scrollLeftExtendSelection", "ctrl shift HOME", "selectFirstRowExtendSelection", "ctrl shift END", "selectLastRowExtendSelection", "TAB", "selectNextColumnCell", "shift TAB", "selectPreviousColumnCell", "ENTER", "selectNextRowCell", "shift ENTER", "selectPreviousRowCell", "ctrl A", "selectAll", "ESCAPE", "cancel", "F2", "startEditing" }), //TableHeader
"TableHeader.font", fontDialog12, "TableHeader.background", getColors().getCommonBackground(), //TextField
"TextField.margin", textFieldMargin, "TextField.font", fontDialog12, "TextField.caretForeground", caretColor, "TextField.focusInputMap", fieldInputMap, "TextField.background", Colors.getWhite(), "FormattedTextField.margin", textFieldMargin, "FormattedTextField.font", fontDialog12, "FormattedTextField.caretForeground", caretColor, "FormattedTextField.background", getWhiteBackground(), "FormattedTextField.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "ctrl C", DefaultEditorKit.copyAction, "ctrl V", DefaultEditorKit.pasteAction, "ctrl X", DefaultEditorKit.cutAction, "COPY", DefaultEditorKit.copyAction, "PASTE", DefaultEditorKit.pasteAction, "CUT", DefaultEditorKit.cutAction, "shift LEFT", DefaultEditorKit.selectionBackwardAction, "shift KP_LEFT", DefaultEditorKit.selectionBackwardAction, "shift RIGHT", DefaultEditorKit.selectionForwardAction, "shift KP_RIGHT", DefaultEditorKit.selectionForwardAction, "ctrl LEFT", DefaultEditorKit.previousWordAction, "ctrl KP_LEFT", DefaultEditorKit.previousWordAction, "ctrl RIGHT", DefaultEditorKit.nextWordAction, "ctrl KP_RIGHT", DefaultEditorKit.nextWordAction, "ctrl shift LEFT", DefaultEditorKit.selectionPreviousWordAction, "ctrl shift KP_LEFT", DefaultEditorKit.selectionPreviousWordAction, "ctrl shift RIGHT", DefaultEditorKit.selectionNextWordAction, "ctrl shift KP_RIGHT", DefaultEditorKit.selectionNextWordAction, "ctrl A", DefaultEditorKit.selectAllAction, "HOME", DefaultEditorKit.beginLineAction, "END", DefaultEditorKit.endLineAction, "shift HOME", DefaultEditorKit.selectionBeginLineAction, "shift END", DefaultEditorKit.selectionEndLineAction, "typed \010", DefaultEditorKit.deletePrevCharAction, "DELETE", DefaultEditorKit.deleteNextCharAction, "RIGHT", DefaultEditorKit.forwardAction, "LEFT", DefaultEditorKit.backwardAction, "KP_RIGHT", DefaultEditorKit.forwardAction, "KP_LEFT", DefaultEditorKit.backwardAction, "ENTER", JTextField.notifyAction, "ctrl BACK_SLASH", "unselect", "control shift O", "toggle-componentOrientation", "ESCAPE", "reset-field-edit", "UP", "increment", "KP_UP", "increment", "DOWN", "decrement", "KP_DOWN", "decrement" }), "PasswordField.margin", textFieldMargin, "PasswordField.font", fontDialog12, "PasswordField.caretForeground", caretColor, "PasswordField.focusInputMap", fieldInputMap, "PasswordField.background", Colors.getWhite(), "EditorPane.margin", textFieldMargin, "EditorPane.font", fontDialog12, "EditorPane.caretForeground", caretColor, "EditorPane.focusInputMap", multilineInputMap, "EditorPane.background", Colors.getWhite(), "TextPane.margin", textFieldMargin, "TextPane.font", fontDialog12, "TextPane.caretForeground", caretColor, "TextPane.focusInputMap", multilineInputMap, "TextPane.background", Colors.getWhite(), "TextArea.margin", textFieldMargin, "TextArea.font", fontDialog12, "TextArea.caretForeground", caretColor, "TextArea.focusInputMap", multilineInputMap, "TextArea.background", Colors.getWhite(), //TitledBorder
"TitledBorder.font", Colors.getWhite(), //ToolBar
"ToolBar.background", COLORS.getToolbarColors()[0], "ToolBar.margin", new InsetsUIResource(0, 0, 0, 0), "ToolBar.dockingForeground", Color.ORANGE, "ToolBar.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "UP", "navigateUp", "KP_UP", "navigateUp", "DOWN", "navigateDown", "KP_DOWN", "navigateDown", "LEFT", "navigateLeft", "KP_LEFT", "navigateLeft", "RIGHT", "navigateRight", "KP_RIGHT", "navigateRight" }), //ToolTip
"ToolTip.font", fontDialog12, "tooltip.border", toolTipBorder, //Tree
"Tree.background", getWhiteBackground(), "Tree.font", fontDialog12, "Tree.selectionBorder", focusCellHighlightBorder, "Tree.editorBorder", focusCellHighlightBorder, "Tree.line", new ColorUIResource(220, 220, 220), "Tree.selectionBorderColor", COLORS.getTextHighlightBackColor().brighter(), "Tree.openIcon", SwingTools.createImage("plaf/tree_open.png"), "Tree.closedIcon", SwingTools.createImage("plaf/tree_closed.png"), "Tree.leafIcon", SwingTools.createImage("plaf/tree_leaf.png"), "Tree.expandedIcon", SwingTools.createImage("plaf/tree_expanded.png"), "Tree.collapsedIcon", SwingTools.createImage("plaf/tree_collapsed.png"), "Tree.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "ctrl C", "copy", "ctrl V", "paste", "ctrl X", "cut", "COPY", "copy", "PASTE", "paste", "CUT", "cut", "UP", "selectPrevious", "KP_UP", "selectPrevious", "shift UP", "selectPreviousExtendSelection", "shift KP_UP", "selectPreviousExtendSelection", "DOWN", "selectNext", "KP_DOWN", "selectNext", "shift DOWN", "selectNextExtendSelection", "shift KP_DOWN", "selectNextExtendSelection", "RIGHT", "selectChild", "KP_RIGHT", "selectChild", "LEFT", "selectParent", "KP_LEFT", "selectParent", "PAGE_UP", "scrollUpChangeSelection", "shift PAGE_UP", "scrollUpExtendSelection", "PAGE_DOWN", "scrollDownChangeSelection", "shift PAGE_DOWN", "scrollDownExtendSelection", "HOME", "selectFirst", "shift HOME", "selectFirstExtendSelection", "END", "selectLast", "shift END", "selectLastExtendSelection", "F2", "startEditing", "ctrl A", "selectAll", "ctrl SLASH", "selectAll", "ctrl BACK_SLASH", "clearSelection", "ctrl SPACE", "toggleSelectionPreserveAnchor", "shift SPACE", "extendSelection", "ctrl HOME", "selectFirstChangeLead", "ctrl END", "selectLastChangeLead", "ctrl UP", "selectPreviousChangeLead", "ctrl KP_UP", "selectPreviousChangeLead", "ctrl DOWN", "selectNextChangeLead", "ctrl KP_DOWN", "selectNextChangeLead", "ctrl PAGE_DOWN", "scrollDownChangeLead", "ctrl shift PAGE_DOWN", "scrollDownExtendSelection", "ctrl PAGE_UP", "scrollUpChangeLead", "ctrl shift PAGE_UP", "scrollUpExtendSelection", "ctrl LEFT", "scrollLeft", "ctrl KP_LEFT", "scrollLeft", "ctrl RIGHT", "scrollRight", "ctrl KP_RIGHT", "scrollRight", "SPACE", "toggleSelectionPreserveAnchor" }), "Tree.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "cancel" }) };
table.putDefaults(defaults);
getColors().addCustomEntriesToTable(table);
initBorderDefaults(table);
}Example 76
| Project: persistit-master File: AdminUI.java View source code |
private void setupFrame() {
_defaultFont = new FontUIResource("Dialog", Font.PLAIN, 12);
_boldFont = new FontUIResource("Dialog", Font.BOLD, 12);
_fixedFont = new FontUIResource("Monospaced", Font.PLAIN, 12);
_persistitAccentColor = new Color(119, 17, 34);
final String lnfClassName = getProperty("lnf");
boolean lafLoaded = false;
if (lnfClassName != null && lnfClassName.length() > 0) {
try {
final Class lnfClass = Class.forName(lnfClassName);
Method setPropertyMethod = null;
final Enumeration props = _bundle.getKeys();
while (props.hasMoreElements()) {
final String propName = (String) props.nextElement();
if (propName.startsWith("lnf.")) {
final String propValue = _bundle.getString(propName);
if (setPropertyMethod == null) {
setPropertyMethod = lnfClass.getMethod("setProperty", new Class[] { String.class, String.class });
}
setPropertyMethod.invoke(null, new Object[] { propName, propValue });
}
}
final javax.swing.LookAndFeel lnf = (javax.swing.LookAndFeel) lnfClass.newInstance();
javax.swing.UIManager.setLookAndFeel(lnf);
lafLoaded = true;
} catch (final Exception ex) {
System.err.println("Could not load LnF class " + lnfClassName);
ex.printStackTrace();
}
}
if (!lafLoaded) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (final Exception e) {
}
}
setUIFont(_defaultFont);
_percentageFormat = new DecimalFormat(getProperty("PERCENTAGE_FORMAT"));
_dateFormat = new SimpleDateFormat(getProperty("DATE_FORMAT"));
_timeFormat = new DecimalFormat(getProperty("TIME_FORMAT"));
_longFormat = new DecimalFormat(getProperty("LONG_FORMAT"));
_integerFormat = new DecimalFormat(getProperty("INTEGER_FORMAT"));
_fileLocationFormat = getProperty("FILE_LOCATION_FORMAT");
_waitingMessage = getProperty("WaitingMessage");
_nullMessage = getProperty("NullMessage");
_taskStates = new String[7];
for (int state = 0; state < 7; state++) {
_taskStates[state] = getProperty("TaskState." + state);
}
_tabbedPane = new JTabbedPane();
_frame.getContentPane().add(_tabbedPane);
_frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
_frame.addWindowListener(new WindowAdapter() {
@Override
public void windowClosed(final WindowEvent we) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
// if (_frame != null)
// {
//
// Will restore normal operation to
// target Persistit instance
//
setManagement(null);
close();
// }
}
});
}
});
setupMenu();
setupTabbedPanes();
_tabbedPane.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(final ChangeEvent ce) {
handleTabChanged();
}
});
handleTabChanged();
refreshMenuEnableState();
final Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
setFrameTitle(null);
_frame.pack();
_frame.setLocation((screenSize.width - _frame.getWidth()) / 2, (screenSize.height - _frame.getHeight()) / 2);
_frame.setVisible(true);
}Example 77
| Project: rapidminer-5-master File: RapidLookAndFeel.java View source code |
@Override
protected void initComponentDefaults(UIDefaults table) {
super.initComponentDefaults(table);
Object fieldInputMap = new UIDefaults.LazyInputMap(new Object[] { "ctrl C", DefaultEditorKit.copyAction, "ctrl V", DefaultEditorKit.pasteAction, "ctrl X", DefaultEditorKit.cutAction, "COPY", DefaultEditorKit.copyAction, "PASTE", DefaultEditorKit.pasteAction, "CUT", DefaultEditorKit.cutAction, "shift LEFT", DefaultEditorKit.selectionBackwardAction, "shift KP_LEFT", DefaultEditorKit.selectionBackwardAction, "shift RIGHT", DefaultEditorKit.selectionForwardAction, "shift KP_RIGHT", DefaultEditorKit.selectionForwardAction, "ctrl LEFT", DefaultEditorKit.previousWordAction, "ctrl KP_LEFT", DefaultEditorKit.previousWordAction, "ctrl RIGHT", DefaultEditorKit.nextWordAction, "ctrl KP_RIGHT", DefaultEditorKit.nextWordAction, "ctrl shift LEFT", DefaultEditorKit.selectionPreviousWordAction, "ctrl shift KP_LEFT", DefaultEditorKit.selectionPreviousWordAction, "ctrl shift RIGHT", DefaultEditorKit.selectionNextWordAction, "ctrl shift KP_RIGHT", DefaultEditorKit.selectionNextWordAction, "ctrl A", DefaultEditorKit.selectAllAction, "HOME", DefaultEditorKit.beginLineAction, "END", DefaultEditorKit.endLineAction, "shift HOME", DefaultEditorKit.selectionBeginLineAction, "shift END", DefaultEditorKit.selectionEndLineAction, "typed \010", DefaultEditorKit.deletePrevCharAction, "DELETE", DefaultEditorKit.deleteNextCharAction, "RIGHT", DefaultEditorKit.forwardAction, "LEFT", DefaultEditorKit.backwardAction, "KP_RIGHT", DefaultEditorKit.forwardAction, "KP_LEFT", DefaultEditorKit.backwardAction, "ENTER", JTextField.notifyAction, "ctrl BACK_SLASH", "unselect", "control shift O", "toggle-componentOrientation" });
Object multilineInputMap = new UIDefaults.LazyInputMap(new Object[] { "ctrl C", DefaultEditorKit.copyAction, "ctrl V", DefaultEditorKit.pasteAction, "ctrl X", DefaultEditorKit.cutAction, "COPY", DefaultEditorKit.copyAction, "PASTE", DefaultEditorKit.pasteAction, "CUT", DefaultEditorKit.cutAction, "shift LEFT", DefaultEditorKit.selectionBackwardAction, "shift KP_LEFT", DefaultEditorKit.selectionBackwardAction, "shift RIGHT", DefaultEditorKit.selectionForwardAction, "shift KP_RIGHT", DefaultEditorKit.selectionForwardAction, "ctrl LEFT", DefaultEditorKit.previousWordAction, "ctrl KP_LEFT", DefaultEditorKit.previousWordAction, "ctrl RIGHT", DefaultEditorKit.nextWordAction, "ctrl KP_RIGHT", DefaultEditorKit.nextWordAction, "ctrl shift LEFT", DefaultEditorKit.selectionPreviousWordAction, "ctrl shift KP_LEFT", DefaultEditorKit.selectionPreviousWordAction, "ctrl shift RIGHT", DefaultEditorKit.selectionNextWordAction, "ctrl shift KP_RIGHT", DefaultEditorKit.selectionNextWordAction, "ctrl A", DefaultEditorKit.selectAllAction, "HOME", DefaultEditorKit.beginLineAction, "END", DefaultEditorKit.endLineAction, "shift HOME", DefaultEditorKit.selectionBeginLineAction, "shift END", DefaultEditorKit.selectionEndLineAction, "UP", DefaultEditorKit.upAction, "KP_UP", DefaultEditorKit.upAction, "DOWN", DefaultEditorKit.downAction, "KP_DOWN", DefaultEditorKit.downAction, "PAGE_UP", DefaultEditorKit.pageUpAction, "PAGE_DOWN", DefaultEditorKit.pageDownAction, "shift PAGE_UP", "selection-page-up", "shift PAGE_DOWN", "selection-page-down", "ctrl shift PAGE_UP", "selection-page-left", "ctrl shift PAGE_DOWN", "selection-page-right", "shift UP", DefaultEditorKit.selectionUpAction, "shift KP_UP", DefaultEditorKit.selectionUpAction, "shift DOWN", DefaultEditorKit.selectionDownAction, "shift KP_DOWN", DefaultEditorKit.selectionDownAction, "ENTER", DefaultEditorKit.insertBreakAction, "typed \010", DefaultEditorKit.deletePrevCharAction, "DELETE", DefaultEditorKit.deleteNextCharAction, "RIGHT", DefaultEditorKit.forwardAction, "LEFT", DefaultEditorKit.backwardAction, "KP_RIGHT", DefaultEditorKit.forwardAction, "KP_LEFT", DefaultEditorKit.backwardAction, "TAB", DefaultEditorKit.insertTabAction, "ctrl BACK_SLASH", "unselect", "ctrl HOME", DefaultEditorKit.beginAction, "ctrl END", DefaultEditorKit.endAction, "ctrl shift HOME", DefaultEditorKit.selectionBeginAction, "ctrl shift END", DefaultEditorKit.selectionEndAction, "ctrl T", "next-link-action", "ctrl shift T", "previous-link-action", "ctrl SPACE", "activate-link-action", "control shift O", "toggle-componentOrientation" });
Object toolTipBorder = new UIDefaults.ProxyLazyValue("javax.swing.plaf.BorderUIResource$LineBorderUIResource", new Object[] { new ColorUIResource(100, 100, 100) });
Object focusCellHighlightBorder = new UIDefaults.ProxyLazyValue("javax.swing.plaf.BorderUIResource$LineBorderUIResource", new Object[] { COLORS.getTextHighlightBackColor().darker() });
Object fontDialog12 = new UIDefaults.ProxyLazyValue("javax.swing.plaf.FontUIResource", null, new Object[] { "Dialog", Integer.valueOf(0), Integer.valueOf(12) });
ColorUIResource caretColor = new ColorUIResource(0, 25, 100);
Object textFieldMargin = new InsetsUIResource(4, 6, 4, 6);
Object tabbedpaneTabInsets = new InsetsUIResource(3, 10, 0, 10);
Object defaultDirectoryIcon = SwingTools.createImage("plaf/folder.png");
Integer zero = Integer.valueOf(0);
Integer one = Integer.valueOf(1);
Object sliderFocusInsets = new InsetsUIResource(2, 2, 2, 2);
Object[] defaults = { // Button
"Button.font", fontDialog12, "Button.background", COLORS.getCommonBackground(), "Button.foreground", COLORS.getCommonForeground(), "Button.margin", new InsetsUIResource(10, 20, 10, 20), "Button.textShiftOffset", one, "Button.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released", "ENTER", "pressed", "released ENTER", "released" }), // ToggleButton
"ToggleButton.font", fontDialog12, "ToggleButton.background", COLORS.getCommonBackground(), "ToggleButton.foreground", COLORS.getCommonForeground(), "ToggleButton.textShiftOffset", one, "ToggleButton.margin", textFieldMargin, "Button.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), // RadioButton
"RadioButton.font", fontDialog12, "RadioButton.background", COLORS.getCommonBackground(), "RadioButton.foreground", COLORS.getCommonForeground(), "RadioButton.textShiftOffset", zero, "RadioButton.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released", "RETURN", "pressed" }), // CheckBox
"CheckBox.font", fontDialog12, "CheckBox.background", COLORS.getCommonBackground(), "CheckBox.foreground", COLORS.getCommonForeground(), "CheckBox.textShiftOffset", zero, "CheckBox.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released", "RETURN", "pressed" }), //TextField
"TextField.selectionBackground", COLORS.getTextHighlightBackColor(), // ComboBox
"ComboBox.font", fontDialog12, "ComboBox.selectionBackground", COLORS.getTextHighlightBackColor(), "ComboBox.selectionForeground", getHighlightedTextColor(), "ComboBox.background", COLORS.getCommonBackground(), "ComboBox.foreground", COLORS.getCommonForeground(), "ComboBox.textShiftOffset", one, "ComboBox.disabledForeground", getInactiveSystemTextColor(), "ComboBox.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "hidePopup", "PAGE_UP", "pageUpPassThrough", "PAGE_DOWN", "pageDownPassThrough", "HOME", "homePassThrough", "END", "endPassThrough", "DOWN", "selectNext", "KP_DOWN", "selectNext", "alt DOWN", "togglePopup", "alt KP_DOWN", "togglePopup", "alt UP", "togglePopup", "alt KP_UP", "togglePopup", "SPACE", "spacePopup", "ENTER", "enterPressed", "UP", "selectPrevious", "KP_UP", "selectPrevious" }), //Filechooser
"FileChooser.defaultDirectoryIcon", defaultDirectoryIcon, "FileChooser.newFolderIcon", null, "FileChooser.upFolderIcon", null, "FileChooser.homeFolderIcon", null, "FileChooser.detailsViewIcon", null, "FileChooser.listViewIcon", null, "FileView.directoryIcon", null, "FileView.fileIcon", null, "FileView.computerIcon", null, "FileView.hardDriveIcon", null, "FileView.floppyDriveIcon", null, "FileChooser.ChangeViewNormalIcon", SwingTools.createImage("plaf/fc/fc_change_1.png"), "FileChooser.ChangeViewHighlightedIcon", SwingTools.createImage("plaf/fc/fc_change_2.png"), "FileChooser.BookmarksAddNormalIcon", SwingTools.createImage("plaf/fc/fc_bookmark_1.png"), "FileChooser.BookmarksAddHighlightedIcon", SwingTools.createImage("plaf/fc/fc_bookmark_2.png"), "FileChooser.HomeNormalIcon", SwingTools.createImage("plaf/fc/fc_home_1.png"), "FileChooser.HomeHighlightedIcon", SwingTools.createImage("plaf/fc/fc_home_2.png"), "FileChooser.HomeDisabledIcon", SwingTools.createImage("plaf/fc/fc_home_3.png"), "FileChooser.NewFolderNormalIcon", SwingTools.createImage("plaf/fc/fc_new_1.png"), "FileChooser.NewFolderHighlightedIcon", SwingTools.createImage("plaf/fc/fc_new_2.png"), "FileChooser.NewFolderDisabledIcon", SwingTools.createImage("plaf/fc/fc_new_3.png"), "FileChooser.UpFolderNormalIcon", SwingTools.createImage("plaf/fc/fc_up_1.png"), "FileChooser.UpFolderHighlightedIcon", SwingTools.createImage("plaf/fc/fc_up_2.png"), "FileChooser.UpFolderDisabledIcon", SwingTools.createImage("plaf/fc/fc_up_3.png"), "FileChooser.BackFolderNormalIcon", SwingTools.createImage("plaf/fc/fc_back1.png"), "FileChooser.BackFolderHighlightedIcon", SwingTools.createImage("plaf/fc/fc_back2.png"), "FileChooser.BackFolderDisabledIcon", SwingTools.createImage("plaf/fc/fc_back3.png"), "FileChooser.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "cancelSelection", "BACK_SPACE", "Go Up", "ENTER", "approveSelection" }), //InternalFrame
"InternalFrame.titleFont", new FontUIResource("Dialog", 1, 12), "InternalFrame.activeTitleForeground", Colors.getBlack(), "InternalFrame.inactiveTitleForeground", Colors.getBlack(), "InternalFrame.closeIcon", SwingTools.createImage("plaf/close_icon.png"), "InternalFrame.rolloverCloseIcon", SwingTools.createImage("plaf/armed_close_icon.png"), "InternalFrame.maximizeIcon", SwingTools.createImage("plaf/maximize_icon.png"), "InternalFrame.rolloverMaximizeIcon", SwingTools.createImage("plaf/armed_maximize_icon.png"), "InternalFrame.minimizeIcon", SwingTools.createImage("plaf/minimize_icon.png"), "InternalFrame.rolloverMinimizeIcon", SwingTools.createImage("plaf/armed_minimize_icon.png"), "InternalFrame.iconifyIcon", SwingTools.createImage("plaf/iconify_icon.png"), "InternalFrame.rolloverIconifyIcon", SwingTools.createImage("plaf/armed_iconify_icon.png"), "InternalFrame.icon", SwingTools.createImage("plaf/internal_icon.png"), //DesktopIcon
"DesktopIcon.foreground", getControlTextColor(), "DesktopIcon.width", new Integer(140), "DesktopIcon.font", getMainFont(), //Desktop
"Desktop.background", COLORS.getDesktopBackgroundColor(), "Desktop.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ctrl F5", "restore", "ctrl F4", "close", "ctrl F7", "move", "ctrl F8", "resize", "RIGHT", "right", "KP_RIGHT", "right", "shift RIGHT", "shrinkRight", "shift KP_RIGHT", "shrinkRight", "LEFT", "left", "KP_LEFT", "left", "shift LEFT", "shrinkLeft", "shift KP_LEFT", "shrinkLeft", "UP", "up", "KP_UP", "up", "shift UP", "shrinkUp", "shift KP_UP", "shrinkUp", "DOWN", "down", "KP_DOWN", "down", "shift DOWN", "shrinkDown", "shift KP_DOWN", "shrinkDown", "ESCAPE", "escape", "ctrl F9", "minimize", "ctrl F10", "maximize", "ctrl F6", "selectNextFrame", "ctrl TAB", "selectNextFrame", "ctrl alt F6", "selectNextFrame", "shift ctrl alt F6", "selectPreviousFrame", "ctrl F12", "navigateNext", "shift ctrl F12", "navigatePrevious" }), //Label
"Label.font", fontDialog12, "Label.foreground", getSystemTextColor(), "Label.disabledForeground", getInactiveSystemTextColor(), "Label.background", COLORS.getCommonBackground(), //List
"List.focusCellHighlightBorder", focusCellHighlightBorder, "List.font", fontDialog12, "List.background", Colors.getWhite(), "List.selectionBackground", COLORS.getTextHighlightBackColor(), "List.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "ctrl C", "copy", "ctrl V", "paste", "ctrl X", "cut", "COPY", "copy", "PASTE", "paste", "CUT", "cut", "UP", "selectPreviousRow", "KP_UP", "selectPreviousRow", "shift UP", "selectPreviousRowExtendSelection", "shift KP_UP", "selectPreviousRowExtendSelection", "DOWN", "selectNextRow", "KP_DOWN", "selectNextRow", "shift DOWN", "selectNextRowExtendSelection", "shift KP_DOWN", "selectNextRowExtendSelection", "LEFT", "selectPreviousColumn", "KP_LEFT", "selectPreviousColumn", "shift LEFT", "selectPreviousColumnExtendSelection", "shift KP_LEFT", "selectPreviousColumnExtendSelection", "RIGHT", "selectNextColumn", "KP_RIGHT", "selectNextColumn", "shift RIGHT", "selectNextColumnExtendSelection", "shift KP_RIGHT", "selectNextColumnExtendSelection", "HOME", "selectFirstRow", "shift HOME", "selectFirstRowExtendSelection", "END", "selectLastRow", "shift END", "selectLastRowExtendSelection", "PAGE_UP", "scrollUp", "shift PAGE_UP", "scrollUpExtendSelection", "PAGE_DOWN", "scrollDown", "shift PAGE_DOWN", "scrollDownExtendSelection", "ctrl A", "selectAll", "ctrl SLASH", "selectAll", "ctrl BACK_SLASH", "clearSelection" }), //MenuBar
"MenuBar.font", fontDialog12, "MenuBar.windowBindings", new Object[] { "F10", "takeFocus" }, //Menu Item
"MenuItem.font", fontDialog12, "MenuItem.acceleratorFont", fontDialog12, "MenuItem.selectionBackground", getMenuSelectedBack(), //RadioButtonMenuItem
"RadioButtonMenuItem.font", fontDialog12, "RadioButtonMenuItem.selectionBackground", getMenuSelectedBack(), "RadioButtonMenuItem.checkIcon", new UIDefaults.ProxyLazyValue("com.rapidminer.gui.look.icons.IconFactory", "getRadioButtonMenuItemIcon"), //CheckBoxMenuItem
"CheckBoxMenuItem.font", fontDialog12, "CheckBoxMenuItem.selectionBackground", getMenuSelectedBack(), "CheckBoxMenuItem.checkIcon", new UIDefaults.ProxyLazyValue("com.rapidminer.gui.look.icons.IconFactory", "getCheckBoxMenuItemIcon"), //Menus
"Menu.font", fontDialog12, "Menu.selectionBackground", getMenuSelectedBack(), //PopupMenu
"PopupMenu.font", fontDialog12, //OptionPane
"OptionPane.font", fontDialog12, "OptionPane.informationIcon", SwingTools.createImage("plaf/information.png"), "OptionPane.errorIcon", SwingTools.createImage("plaf/error.png"), "OptionPane.questionIcon", SwingTools.createImage("plaf/question.png"), "OptionPane.warningIcon", SwingTools.createImage("plaf/warning.png"), //Panel
"Panel.font", fontDialog12, //ProggressBar
"ProgressBar.foreground", new ColorUIResource(40, 40, 40), "ProgressBar.background", new ColorUIResource(240, 240, 240), "ProgressBar.font", new java.awt.Font("Dialog", 0, 11), //ScrollBar
"ScrollBar.border", null, "ScrollBar.background", getColors().getCommonBackground(), "ScrollBar.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "RIGHT", "positiveUnitIncrement", "KP_RIGHT", "positiveUnitIncrement", "DOWN", "positiveUnitIncrement", "KP_DOWN", "positiveUnitIncrement", "PAGE_DOWN", "positiveBlockIncrement", "LEFT", "negativeUnitIncrement", "KP_LEFT", "negativeUnitIncrement", "UP", "negativeUnitIncrement", "KP_UP", "negativeUnitIncrement", "PAGE_UP", "negativeBlockIncrement", "HOME", "minScroll", "END", "maxScroll" }), //ScrollPane
"ScrollPane.font", fontDialog12, "ScrollPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "RIGHT", "unitScrollRight", "KP_RIGHT", "unitScrollRight", "DOWN", "unitScrollDown", "KP_DOWN", "unitScrollDown", "LEFT", "unitScrollLeft", "KP_LEFT", "unitScrollLeft", "UP", "unitScrollUp", "KP_UP", "unitScrollUp", "PAGE_UP", "scrollUp", "PAGE_DOWN", "scrollDown", "ctrl PAGE_UP", "scrollLeft", "ctrl PAGE_DOWN", "scrollRight", "ctrl HOME", "scrollHome", "ctrl END", "scrollEnd" }), //ViewPort
"Viewport.font", fontDialog12, //Slider
"Slider.focusInsets", sliderFocusInsets, "Slider.disabledForeground", getInactiveSystemTextColor(), "Slider.majorColor", new ColorUIResource(100, 100, 100), "Slider.minorColor", new ColorUIResource(180, 180, 180), "Slider.majorDisabledColor", new ColorUIResource(180, 180, 180), "Slider.minorDisabledColor", new ColorUIResource(220, 220, 220), "Slider.trackWidth", new Integer(7), "Slider.majorTickLength", new Integer(6), "Slider.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "RIGHT", "positiveUnitIncrement", "KP_RIGHT", "positiveUnitIncrement", "DOWN", "negativeUnitIncrement", "KP_DOWN", "negativeUnitIncrement", "PAGE_DOWN", "negativeBlockIncrement", "ctrl PAGE_DOWN", "negativeBlockIncrement", "LEFT", "negativeUnitIncrement", "KP_LEFT", "negativeUnitIncrement", "UP", "positiveUnitIncrement", "KP_UP", "positiveUnitIncrement", "PAGE_UP", "positiveBlockIncrement", "ctrl PAGE_UP", "positiveBlockIncrement", "HOME", "minScroll", "END", "maxScroll" }), //Spinner
"Spinner.font", fontDialog12, "Spinner.background", COLORS.getCommonBackground(), "Spinner.margin", new InsetsUIResource(10, 10, 10, 10), "Spinner.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "UP", "increment", "KP_UP", "increment", "DOWN", "decrement", "KP_DOWN", "decrement" }), //SplitPane
"SplitPane.dividerSize", Integer.valueOf(9), "SplitPane.highlight", new ColorUIResource(250, 250, 250), "SplitPane.shadow", new ColorUIResource(200, 200, 200), "SplitPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "UP", "negativeIncrement", "DOWN", "positiveIncrement", "LEFT", "negativeIncrement", "RIGHT", "positiveIncrement", "KP_UP", "negativeIncrement", "KP_DOWN", "positiveIncrement", "KP_LEFT", "negativeIncrement", "KP_RIGHT", "positiveIncrement", "HOME", "selectMin", "END", "selectMax", "F8", "startResize", "F6", "toggleFocus", "ctrl TAB", "focusOutForward", "ctrl shift TAB", "focusOutBackward" }), "SplitPaneDivider.border", null, //TabbedPane
"TabbedPane.tabAreaInsets", tabbedpaneTabInsets, "TabbedPane.font", fontDialog12, "TabbedPane.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "RIGHT", "navigateRight", "KP_RIGHT", "navigateRight", "LEFT", "navigateLeft", "KP_LEFT", "navigateLeft", "UP", "navigateUp", "KP_UP", "navigateUp", "DOWN", "navigateDown", "KP_DOWN", "navigateDown", "ctrl DOWN", "requestFocusForVisibleComponent", "ctrl KP_DOWN", "requestFocusForVisibleComponent" }), "TabbedPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ctrl PAGE_DOWN", "navigatePageDown", "ctrl PAGE_UP", "navigatePageUp", "ctrl UP", "requestFocus", "ctrl KP_UP", "requestFocus" }), //Table
"Table.font", fontDialog12, "Table.background", Colors.getWhite(), "Table.selectionForeground", getUserTextColor(), "Table.gridColor", new ColorUIResource(200, 200, 200), "Table.focusCellForeground", getHighlightedTextColor(), "Table.focusCellHighlightBorder", new LineBorderUIResource(COLORS.getTextHighlightBackColor().brighter()), "Table.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ctrl C", "copy", "ctrl V", "paste", "ctrl X", "cut", "COPY", "copy", "PASTE", "paste", "CUT", "cut", "RIGHT", "selectNextColumn", "KP_RIGHT", "selectNextColumn", "LEFT", "selectPreviousColumn", "KP_LEFT", "selectPreviousColumn", "DOWN", "selectNextRow", "KP_DOWN", "selectNextRow", "UP", "selectPreviousRow", "KP_UP", "selectPreviousRow", "shift RIGHT", "selectNextColumnExtendSelection", "shift KP_RIGHT", "selectNextColumnExtendSelection", "shift LEFT", "selectPreviousColumnExtendSelection", "shift KP_LEFT", "selectPreviousColumnExtendSelection", "shift DOWN", "selectNextRowExtendSelection", "shift KP_DOWN", "selectNextRowExtendSelection", "shift UP", "selectPreviousRowExtendSelection", "shift KP_UP", "selectPreviousRowExtendSelection", "PAGE_UP", "scrollUpChangeSelection", "PAGE_DOWN", "scrollDownChangeSelection", "HOME", "selectFirstColumn", "END", "selectLastColumn", "shift PAGE_UP", "scrollUpExtendSelection", "shift PAGE_DOWN", "scrollDownExtendSelection", "shift HOME", "selectFirstColumnExtendSelection", "shift END", "selectLastColumnExtendSelection", "ctrl PAGE_UP", "scrollLeftChangeSelection", "ctrl PAGE_DOWN", "scrollRightChangeSelection", "ctrl HOME", "selectFirstRow", "ctrl END", "selectLastRow", "ctrl shift PAGE_UP", "scrollRightExtendSelection", "ctrl shift PAGE_DOWN", "scrollLeftExtendSelection", "ctrl shift HOME", "selectFirstRowExtendSelection", "ctrl shift END", "selectLastRowExtendSelection", "TAB", "selectNextColumnCell", "shift TAB", "selectPreviousColumnCell", "ENTER", "selectNextRowCell", "shift ENTER", "selectPreviousRowCell", "ctrl A", "selectAll", "ESCAPE", "cancel", "F2", "startEditing" }), //TableHeader
"TableHeader.font", fontDialog12, "TableHeader.background", getColors().getCommonBackground(), //TextField
"TextField.margin", textFieldMargin, "TextField.font", fontDialog12, "TextField.caretForeground", caretColor, "TextField.focusInputMap", fieldInputMap, "TextField.background", Colors.getWhite(), "FormattedTextField.margin", textFieldMargin, "FormattedTextField.font", fontDialog12, "FormattedTextField.caretForeground", caretColor, "FormattedTextField.background", getWhiteBackground(), "FormattedTextField.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "ctrl C", DefaultEditorKit.copyAction, "ctrl V", DefaultEditorKit.pasteAction, "ctrl X", DefaultEditorKit.cutAction, "COPY", DefaultEditorKit.copyAction, "PASTE", DefaultEditorKit.pasteAction, "CUT", DefaultEditorKit.cutAction, "shift LEFT", DefaultEditorKit.selectionBackwardAction, "shift KP_LEFT", DefaultEditorKit.selectionBackwardAction, "shift RIGHT", DefaultEditorKit.selectionForwardAction, "shift KP_RIGHT", DefaultEditorKit.selectionForwardAction, "ctrl LEFT", DefaultEditorKit.previousWordAction, "ctrl KP_LEFT", DefaultEditorKit.previousWordAction, "ctrl RIGHT", DefaultEditorKit.nextWordAction, "ctrl KP_RIGHT", DefaultEditorKit.nextWordAction, "ctrl shift LEFT", DefaultEditorKit.selectionPreviousWordAction, "ctrl shift KP_LEFT", DefaultEditorKit.selectionPreviousWordAction, "ctrl shift RIGHT", DefaultEditorKit.selectionNextWordAction, "ctrl shift KP_RIGHT", DefaultEditorKit.selectionNextWordAction, "ctrl A", DefaultEditorKit.selectAllAction, "HOME", DefaultEditorKit.beginLineAction, "END", DefaultEditorKit.endLineAction, "shift HOME", DefaultEditorKit.selectionBeginLineAction, "shift END", DefaultEditorKit.selectionEndLineAction, "typed \010", DefaultEditorKit.deletePrevCharAction, "DELETE", DefaultEditorKit.deleteNextCharAction, "RIGHT", DefaultEditorKit.forwardAction, "LEFT", DefaultEditorKit.backwardAction, "KP_RIGHT", DefaultEditorKit.forwardAction, "KP_LEFT", DefaultEditorKit.backwardAction, "ENTER", JTextField.notifyAction, "ctrl BACK_SLASH", "unselect", "control shift O", "toggle-componentOrientation", "ESCAPE", "reset-field-edit", "UP", "increment", "KP_UP", "increment", "DOWN", "decrement", "KP_DOWN", "decrement" }), "PasswordField.margin", textFieldMargin, "PasswordField.font", fontDialog12, "PasswordField.caretForeground", caretColor, "PasswordField.focusInputMap", fieldInputMap, "PasswordField.background", Colors.getWhite(), "EditorPane.margin", textFieldMargin, "EditorPane.font", fontDialog12, "EditorPane.caretForeground", caretColor, "EditorPane.focusInputMap", multilineInputMap, "EditorPane.background", Colors.getWhite(), "TextPane.margin", textFieldMargin, "TextPane.font", fontDialog12, "TextPane.caretForeground", caretColor, "TextPane.focusInputMap", multilineInputMap, "TextPane.background", Colors.getWhite(), "TextArea.margin", textFieldMargin, "TextArea.font", fontDialog12, "TextArea.caretForeground", caretColor, "TextArea.focusInputMap", multilineInputMap, "TextArea.background", Colors.getWhite(), //TitledBorder
"TitledBorder.font", Colors.getWhite(), //ToolBar
"ToolBar.background", COLORS.getToolbarColors()[0], "ToolBar.margin", new InsetsUIResource(0, 0, 0, 0), "ToolBar.dockingForeground", Color.ORANGE, "ToolBar.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "UP", "navigateUp", "KP_UP", "navigateUp", "DOWN", "navigateDown", "KP_DOWN", "navigateDown", "LEFT", "navigateLeft", "KP_LEFT", "navigateLeft", "RIGHT", "navigateRight", "KP_RIGHT", "navigateRight" }), //ToolTip
"ToolTip.font", fontDialog12, "tooltip.border", toolTipBorder, //Tree
"Tree.background", getWhiteBackground(), "Tree.font", fontDialog12, "Tree.selectionBorder", focusCellHighlightBorder, // HERE
"Tree.selectionBackground", COLORS.getTextHighlightBackColor(), "Tree.editorBorder", focusCellHighlightBorder, "Tree.line", new ColorUIResource(220, 220, 220), "Tree.selectionBorderColor", COLORS.getTextHighlightBackColor().brighter(), "Tree.openIcon", SwingTools.createImage("plaf/tree_open.png"), "Tree.closedIcon", SwingTools.createImage("plaf/tree_closed.png"), "Tree.leafIcon", SwingTools.createImage("plaf/tree_leaf.png"), "Tree.expandedIcon", SwingTools.createImage("plaf/tree_expanded.png"), "Tree.collapsedIcon", SwingTools.createImage("plaf/tree_collapsed.png"), "Tree.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "ctrl C", "copy", "ctrl V", "paste", "ctrl X", "cut", "COPY", "copy", "PASTE", "paste", "CUT", "cut", "UP", "selectPrevious", "KP_UP", "selectPrevious", "shift UP", "selectPreviousExtendSelection", "shift KP_UP", "selectPreviousExtendSelection", "DOWN", "selectNext", "KP_DOWN", "selectNext", "shift DOWN", "selectNextExtendSelection", "shift KP_DOWN", "selectNextExtendSelection", "RIGHT", "selectChild", "KP_RIGHT", "selectChild", "LEFT", "selectParent", "KP_LEFT", "selectParent", "PAGE_UP", "scrollUpChangeSelection", "shift PAGE_UP", "scrollUpExtendSelection", "PAGE_DOWN", "scrollDownChangeSelection", "shift PAGE_DOWN", "scrollDownExtendSelection", "HOME", "selectFirst", "shift HOME", "selectFirstExtendSelection", "END", "selectLast", "shift END", "selectLastExtendSelection", "F2", "startEditing", "ctrl A", "selectAll", "ctrl SLASH", "selectAll", "ctrl BACK_SLASH", "clearSelection", "ctrl SPACE", "toggleSelectionPreserveAnchor", "shift SPACE", "extendSelection", "ctrl HOME", "selectFirstChangeLead", "ctrl END", "selectLastChangeLead", "ctrl UP", "selectPreviousChangeLead", "ctrl KP_UP", "selectPreviousChangeLead", "ctrl DOWN", "selectNextChangeLead", "ctrl KP_DOWN", "selectNextChangeLead", "ctrl PAGE_DOWN", "scrollDownChangeLead", "ctrl shift PAGE_DOWN", "scrollDownExtendSelection", "ctrl PAGE_UP", "scrollUpChangeLead", "ctrl shift PAGE_UP", "scrollUpExtendSelection", "ctrl LEFT", "scrollLeft", "ctrl KP_LEFT", "scrollLeft", "ctrl RIGHT", "scrollRight", "ctrl KP_RIGHT", "scrollRight", "SPACE", "toggleSelectionPreserveAnchor" }), "Tree.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "cancel" }) };
table.putDefaults(defaults);
getColors().addCustomEntriesToTable(table);
initBorderDefaults(table);
}Example 78
| Project: rapidminer-vega-master File: RapidLookAndFeel.java View source code |
@Override
protected void initComponentDefaults(UIDefaults table) {
super.initComponentDefaults(table);
Object fieldInputMap = new UIDefaults.LazyInputMap(new Object[] { "ctrl C", DefaultEditorKit.copyAction, "ctrl V", DefaultEditorKit.pasteAction, "ctrl X", DefaultEditorKit.cutAction, "COPY", DefaultEditorKit.copyAction, "PASTE", DefaultEditorKit.pasteAction, "CUT", DefaultEditorKit.cutAction, "shift LEFT", DefaultEditorKit.selectionBackwardAction, "shift KP_LEFT", DefaultEditorKit.selectionBackwardAction, "shift RIGHT", DefaultEditorKit.selectionForwardAction, "shift KP_RIGHT", DefaultEditorKit.selectionForwardAction, "ctrl LEFT", DefaultEditorKit.previousWordAction, "ctrl KP_LEFT", DefaultEditorKit.previousWordAction, "ctrl RIGHT", DefaultEditorKit.nextWordAction, "ctrl KP_RIGHT", DefaultEditorKit.nextWordAction, "ctrl shift LEFT", DefaultEditorKit.selectionPreviousWordAction, "ctrl shift KP_LEFT", DefaultEditorKit.selectionPreviousWordAction, "ctrl shift RIGHT", DefaultEditorKit.selectionNextWordAction, "ctrl shift KP_RIGHT", DefaultEditorKit.selectionNextWordAction, "ctrl A", DefaultEditorKit.selectAllAction, "HOME", DefaultEditorKit.beginLineAction, "END", DefaultEditorKit.endLineAction, "shift HOME", DefaultEditorKit.selectionBeginLineAction, "shift END", DefaultEditorKit.selectionEndLineAction, "typed \010", DefaultEditorKit.deletePrevCharAction, "DELETE", DefaultEditorKit.deleteNextCharAction, "RIGHT", DefaultEditorKit.forwardAction, "LEFT", DefaultEditorKit.backwardAction, "KP_RIGHT", DefaultEditorKit.forwardAction, "KP_LEFT", DefaultEditorKit.backwardAction, "ENTER", JTextField.notifyAction, "ctrl BACK_SLASH", "unselect", "control shift O", "toggle-componentOrientation" });
Object multilineInputMap = new UIDefaults.LazyInputMap(new Object[] { "ctrl C", DefaultEditorKit.copyAction, "ctrl V", DefaultEditorKit.pasteAction, "ctrl X", DefaultEditorKit.cutAction, "COPY", DefaultEditorKit.copyAction, "PASTE", DefaultEditorKit.pasteAction, "CUT", DefaultEditorKit.cutAction, "shift LEFT", DefaultEditorKit.selectionBackwardAction, "shift KP_LEFT", DefaultEditorKit.selectionBackwardAction, "shift RIGHT", DefaultEditorKit.selectionForwardAction, "shift KP_RIGHT", DefaultEditorKit.selectionForwardAction, "ctrl LEFT", DefaultEditorKit.previousWordAction, "ctrl KP_LEFT", DefaultEditorKit.previousWordAction, "ctrl RIGHT", DefaultEditorKit.nextWordAction, "ctrl KP_RIGHT", DefaultEditorKit.nextWordAction, "ctrl shift LEFT", DefaultEditorKit.selectionPreviousWordAction, "ctrl shift KP_LEFT", DefaultEditorKit.selectionPreviousWordAction, "ctrl shift RIGHT", DefaultEditorKit.selectionNextWordAction, "ctrl shift KP_RIGHT", DefaultEditorKit.selectionNextWordAction, "ctrl A", DefaultEditorKit.selectAllAction, "HOME", DefaultEditorKit.beginLineAction, "END", DefaultEditorKit.endLineAction, "shift HOME", DefaultEditorKit.selectionBeginLineAction, "shift END", DefaultEditorKit.selectionEndLineAction, "UP", DefaultEditorKit.upAction, "KP_UP", DefaultEditorKit.upAction, "DOWN", DefaultEditorKit.downAction, "KP_DOWN", DefaultEditorKit.downAction, "PAGE_UP", DefaultEditorKit.pageUpAction, "PAGE_DOWN", DefaultEditorKit.pageDownAction, "shift PAGE_UP", "selection-page-up", "shift PAGE_DOWN", "selection-page-down", "ctrl shift PAGE_UP", "selection-page-left", "ctrl shift PAGE_DOWN", "selection-page-right", "shift UP", DefaultEditorKit.selectionUpAction, "shift KP_UP", DefaultEditorKit.selectionUpAction, "shift DOWN", DefaultEditorKit.selectionDownAction, "shift KP_DOWN", DefaultEditorKit.selectionDownAction, "ENTER", DefaultEditorKit.insertBreakAction, "typed \010", DefaultEditorKit.deletePrevCharAction, "DELETE", DefaultEditorKit.deleteNextCharAction, "RIGHT", DefaultEditorKit.forwardAction, "LEFT", DefaultEditorKit.backwardAction, "KP_RIGHT", DefaultEditorKit.forwardAction, "KP_LEFT", DefaultEditorKit.backwardAction, "TAB", DefaultEditorKit.insertTabAction, "ctrl BACK_SLASH", "unselect", "ctrl HOME", DefaultEditorKit.beginAction, "ctrl END", DefaultEditorKit.endAction, "ctrl shift HOME", DefaultEditorKit.selectionBeginAction, "ctrl shift END", DefaultEditorKit.selectionEndAction, "ctrl T", "next-link-action", "ctrl shift T", "previous-link-action", "ctrl SPACE", "activate-link-action", "control shift O", "toggle-componentOrientation" });
Object toolTipBorder = new UIDefaults.ProxyLazyValue("javax.swing.plaf.BorderUIResource$LineBorderUIResource", new Object[] { new ColorUIResource(100, 100, 100) });
Object focusCellHighlightBorder = new UIDefaults.ProxyLazyValue("javax.swing.plaf.BorderUIResource$LineBorderUIResource", new Object[] { COLORS.getTextHighlightBackColor().darker() });
Object fontDialog12 = new UIDefaults.ProxyLazyValue("javax.swing.plaf.FontUIResource", null, new Object[] { "Dialog", Integer.valueOf(0), Integer.valueOf(12) });
ColorUIResource caretColor = new ColorUIResource(0, 25, 100);
Object textFieldMargin = new InsetsUIResource(4, 6, 4, 6);
Object tabbedpaneTabInsets = new InsetsUIResource(3, 10, 0, 10);
Object defaultDirectoryIcon = SwingTools.createImage("plaf/folder.png");
Integer zero = Integer.valueOf(0);
Integer one = Integer.valueOf(1);
Object sliderFocusInsets = new InsetsUIResource(2, 2, 2, 2);
Object[] defaults = { // Button
"Button.font", fontDialog12, "Button.background", COLORS.getCommonBackground(), "Button.foreground", COLORS.getCommonForeground(), "Button.margin", new InsetsUIResource(10, 20, 10, 20), "Button.textShiftOffset", one, "Button.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released", "ENTER", "pressed", "released ENTER", "released" }), // ToggleButton
"ToggleButton.font", fontDialog12, "ToggleButton.background", COLORS.getCommonBackground(), "ToggleButton.foreground", COLORS.getCommonForeground(), "ToggleButton.textShiftOffset", one, "ToggleButton.margin", textFieldMargin, "Button.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), // RadioButton
"RadioButton.font", fontDialog12, "RadioButton.background", COLORS.getCommonBackground(), "RadioButton.foreground", COLORS.getCommonForeground(), "RadioButton.textShiftOffset", zero, "RadioButton.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released", "RETURN", "pressed" }), // CheckBox
"CheckBox.font", fontDialog12, "CheckBox.background", COLORS.getCommonBackground(), "CheckBox.foreground", COLORS.getCommonForeground(), "CheckBox.textShiftOffset", zero, "CheckBox.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released", "RETURN", "pressed" }), // ComboBox
"ComboBox.font", fontDialog12, "ComboBox.background", COLORS.getCommonBackground(), "ComboBox.foreground", COLORS.getCommonForeground(), "ComboBox.textShiftOffset", one, "ComboBox.disabledForeground", getInactiveSystemTextColor(), "ComboBox.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "hidePopup", "PAGE_UP", "pageUpPassThrough", "PAGE_DOWN", "pageDownPassThrough", "HOME", "homePassThrough", "END", "endPassThrough", "DOWN", "selectNext", "KP_DOWN", "selectNext", "alt DOWN", "togglePopup", "alt KP_DOWN", "togglePopup", "alt UP", "togglePopup", "alt KP_UP", "togglePopup", "SPACE", "spacePopup", "ENTER", "enterPressed", "UP", "selectPrevious", "KP_UP", "selectPrevious" }), //Filechooser
"FileChooser.defaultDirectoryIcon", defaultDirectoryIcon, "FileChooser.newFolderIcon", null, "FileChooser.upFolderIcon", null, "FileChooser.homeFolderIcon", null, "FileChooser.detailsViewIcon", null, "FileChooser.listViewIcon", null, "FileView.directoryIcon", null, "FileView.fileIcon", null, "FileView.computerIcon", null, "FileView.hardDriveIcon", null, "FileView.floppyDriveIcon", null, "FileChooser.ChangeViewNormalIcon", SwingTools.createImage("plaf/fc/fc_change_1.png"), "FileChooser.ChangeViewHighlightedIcon", SwingTools.createImage("plaf/fc/fc_change_2.png"), "FileChooser.BookmarksAddNormalIcon", SwingTools.createImage("plaf/fc/fc_bookmark_1.png"), "FileChooser.BookmarksAddHighlightedIcon", SwingTools.createImage("plaf/fc/fc_bookmark_2.png"), "FileChooser.HomeNormalIcon", SwingTools.createImage("plaf/fc/fc_home_1.png"), "FileChooser.HomeHighlightedIcon", SwingTools.createImage("plaf/fc/fc_home_2.png"), "FileChooser.HomeDisabledIcon", SwingTools.createImage("plaf/fc/fc_home_3.png"), "FileChooser.NewFolderNormalIcon", SwingTools.createImage("plaf/fc/fc_new_1.png"), "FileChooser.NewFolderHighlightedIcon", SwingTools.createImage("plaf/fc/fc_new_2.png"), "FileChooser.NewFolderDisabledIcon", SwingTools.createImage("plaf/fc/fc_new_3.png"), "FileChooser.UpFolderNormalIcon", SwingTools.createImage("plaf/fc/fc_up_1.png"), "FileChooser.UpFolderHighlightedIcon", SwingTools.createImage("plaf/fc/fc_up_2.png"), "FileChooser.UpFolderDisabledIcon", SwingTools.createImage("plaf/fc/fc_up_3.png"), "FileChooser.BackFolderNormalIcon", SwingTools.createImage("plaf/fc/fc_back1.png"), "FileChooser.BackFolderHighlightedIcon", SwingTools.createImage("plaf/fc/fc_back2.png"), "FileChooser.BackFolderDisabledIcon", SwingTools.createImage("plaf/fc/fc_back3.png"), "FileChooser.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "cancelSelection", "BACK_SPACE", "Go Up", "ENTER", "approveSelection" }), //InternalFrame
"InternalFrame.titleFont", new FontUIResource("Dialog", 1, 12), "InternalFrame.activeTitleForeground", Colors.getBlack(), "InternalFrame.inactiveTitleForeground", Colors.getBlack(), "InternalFrame.closeIcon", SwingTools.createImage("plaf/close_icon.png"), "InternalFrame.rolloverCloseIcon", SwingTools.createImage("plaf/armed_close_icon.png"), "InternalFrame.maximizeIcon", SwingTools.createImage("plaf/maximize_icon.png"), "InternalFrame.rolloverMaximizeIcon", SwingTools.createImage("plaf/armed_maximize_icon.png"), "InternalFrame.minimizeIcon", SwingTools.createImage("plaf/minimize_icon.png"), "InternalFrame.rolloverMinimizeIcon", SwingTools.createImage("plaf/armed_minimize_icon.png"), "InternalFrame.iconifyIcon", SwingTools.createImage("plaf/iconify_icon.png"), "InternalFrame.rolloverIconifyIcon", SwingTools.createImage("plaf/armed_iconify_icon.png"), "InternalFrame.icon", SwingTools.createImage("plaf/internal_icon.png"), //DesktopIcon
"DesktopIcon.foreground", getControlTextColor(), "DesktopIcon.width", new Integer(140), "DesktopIcon.font", getMainFont(), //Desktop
"Desktop.background", COLORS.getDesktopBackgroundColor(), "Desktop.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ctrl F5", "restore", "ctrl F4", "close", "ctrl F7", "move", "ctrl F8", "resize", "RIGHT", "right", "KP_RIGHT", "right", "shift RIGHT", "shrinkRight", "shift KP_RIGHT", "shrinkRight", "LEFT", "left", "KP_LEFT", "left", "shift LEFT", "shrinkLeft", "shift KP_LEFT", "shrinkLeft", "UP", "up", "KP_UP", "up", "shift UP", "shrinkUp", "shift KP_UP", "shrinkUp", "DOWN", "down", "KP_DOWN", "down", "shift DOWN", "shrinkDown", "shift KP_DOWN", "shrinkDown", "ESCAPE", "escape", "ctrl F9", "minimize", "ctrl F10", "maximize", "ctrl F6", "selectNextFrame", "ctrl TAB", "selectNextFrame", "ctrl alt F6", "selectNextFrame", "shift ctrl alt F6", "selectPreviousFrame", "ctrl F12", "navigateNext", "shift ctrl F12", "navigatePrevious" }), //Label
"Label.font", fontDialog12, "Label.foreground", getSystemTextColor(), "Label.disabledForeground", getInactiveSystemTextColor(), "Label.background", COLORS.getCommonBackground(), //List
"List.focusCellHighlightBorder", focusCellHighlightBorder, "List.font", fontDialog12, "List.background", Colors.getWhite(), "List.selectionBackground", COLORS.getTextHighlightBackColor(), "List.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "ctrl C", "copy", "ctrl V", "paste", "ctrl X", "cut", "COPY", "copy", "PASTE", "paste", "CUT", "cut", "UP", "selectPreviousRow", "KP_UP", "selectPreviousRow", "shift UP", "selectPreviousRowExtendSelection", "shift KP_UP", "selectPreviousRowExtendSelection", "DOWN", "selectNextRow", "KP_DOWN", "selectNextRow", "shift DOWN", "selectNextRowExtendSelection", "shift KP_DOWN", "selectNextRowExtendSelection", "LEFT", "selectPreviousColumn", "KP_LEFT", "selectPreviousColumn", "shift LEFT", "selectPreviousColumnExtendSelection", "shift KP_LEFT", "selectPreviousColumnExtendSelection", "RIGHT", "selectNextColumn", "KP_RIGHT", "selectNextColumn", "shift RIGHT", "selectNextColumnExtendSelection", "shift KP_RIGHT", "selectNextColumnExtendSelection", "HOME", "selectFirstRow", "shift HOME", "selectFirstRowExtendSelection", "END", "selectLastRow", "shift END", "selectLastRowExtendSelection", "PAGE_UP", "scrollUp", "shift PAGE_UP", "scrollUpExtendSelection", "PAGE_DOWN", "scrollDown", "shift PAGE_DOWN", "scrollDownExtendSelection", "ctrl A", "selectAll", "ctrl SLASH", "selectAll", "ctrl BACK_SLASH", "clearSelection" }), //MenuBar
"MenuBar.font", fontDialog12, "MenuBar.windowBindings", new Object[] { "F10", "takeFocus" }, //Menu Item
"MenuItem.font", fontDialog12, "MenuItem.acceleratorFont", fontDialog12, "MenuItem.selectionBackground", getMenuSelectedBack(), //RadioButtonMenuItem
"RadioButtonMenuItem.font", fontDialog12, "RadioButtonMenuItem.selectionBackground", getMenuSelectedBack(), "RadioButtonMenuItem.checkIcon", new UIDefaults.ProxyLazyValue("com.rapidminer.gui.look.icons.IconFactory", "getRadioButtonMenuItemIcon"), //CheckBoxMenuItem
"CheckBoxMenuItem.font", fontDialog12, "CheckBoxMenuItem.selectionBackground", getMenuSelectedBack(), "CheckBoxMenuItem.checkIcon", new UIDefaults.ProxyLazyValue("com.rapidminer.gui.look.icons.IconFactory", "getCheckBoxMenuItemIcon"), //Menus
"Menu.font", fontDialog12, "Menu.selectionBackground", getMenuSelectedBack(), //PopupMenu
"PopupMenu.font", fontDialog12, //OptionPane
"OptionPane.font", fontDialog12, "OptionPane.informationIcon", SwingTools.createImage("plaf/information.png"), "OptionPane.errorIcon", SwingTools.createImage("plaf/error.png"), "OptionPane.questionIcon", SwingTools.createImage("plaf/question.png"), "OptionPane.warningIcon", SwingTools.createImage("plaf/warning.png"), //Panel
"Panel.font", fontDialog12, //ProggressBar
"ProgressBar.foreground", new ColorUIResource(40, 40, 40), "ProgressBar.background", new ColorUIResource(240, 240, 240), "ProgressBar.font", new java.awt.Font("Dialog", 0, 11), //ScrollBar
"ScrollBar.border", null, "ScrollBar.background", getColors().getCommonBackground(), "ScrollBar.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "RIGHT", "positiveUnitIncrement", "KP_RIGHT", "positiveUnitIncrement", "DOWN", "positiveUnitIncrement", "KP_DOWN", "positiveUnitIncrement", "PAGE_DOWN", "positiveBlockIncrement", "LEFT", "negativeUnitIncrement", "KP_LEFT", "negativeUnitIncrement", "UP", "negativeUnitIncrement", "KP_UP", "negativeUnitIncrement", "PAGE_UP", "negativeBlockIncrement", "HOME", "minScroll", "END", "maxScroll" }), //ScrollPane
"ScrollPane.font", fontDialog12, "ScrollPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "RIGHT", "unitScrollRight", "KP_RIGHT", "unitScrollRight", "DOWN", "unitScrollDown", "KP_DOWN", "unitScrollDown", "LEFT", "unitScrollLeft", "KP_LEFT", "unitScrollLeft", "UP", "unitScrollUp", "KP_UP", "unitScrollUp", "PAGE_UP", "scrollUp", "PAGE_DOWN", "scrollDown", "ctrl PAGE_UP", "scrollLeft", "ctrl PAGE_DOWN", "scrollRight", "ctrl HOME", "scrollHome", "ctrl END", "scrollEnd" }), //ViewPort
"Viewport.font", fontDialog12, //Slider
"Slider.focusInsets", sliderFocusInsets, "Slider.disabledForeground", getInactiveSystemTextColor(), "Slider.majorColor", new ColorUIResource(100, 100, 100), "Slider.minorColor", new ColorUIResource(180, 180, 180), "Slider.majorDisabledColor", new ColorUIResource(180, 180, 180), "Slider.minorDisabledColor", new ColorUIResource(220, 220, 220), "Slider.trackWidth", new Integer(7), "Slider.majorTickLength", new Integer(6), "Slider.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "RIGHT", "positiveUnitIncrement", "KP_RIGHT", "positiveUnitIncrement", "DOWN", "negativeUnitIncrement", "KP_DOWN", "negativeUnitIncrement", "PAGE_DOWN", "negativeBlockIncrement", "ctrl PAGE_DOWN", "negativeBlockIncrement", "LEFT", "negativeUnitIncrement", "KP_LEFT", "negativeUnitIncrement", "UP", "positiveUnitIncrement", "KP_UP", "positiveUnitIncrement", "PAGE_UP", "positiveBlockIncrement", "ctrl PAGE_UP", "positiveBlockIncrement", "HOME", "minScroll", "END", "maxScroll" }), //Spinner
"Spinner.font", fontDialog12, "Spinner.background", COLORS.getCommonBackground(), "Spinner.margin", new InsetsUIResource(10, 10, 10, 10), "Spinner.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "UP", "increment", "KP_UP", "increment", "DOWN", "decrement", "KP_DOWN", "decrement" }), //SplitPane
"SplitPane.dividerSize", Integer.valueOf(9), "SplitPane.highlight", new ColorUIResource(250, 250, 250), "SplitPane.shadow", new ColorUIResource(200, 200, 200), "SplitPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "UP", "negativeIncrement", "DOWN", "positiveIncrement", "LEFT", "negativeIncrement", "RIGHT", "positiveIncrement", "KP_UP", "negativeIncrement", "KP_DOWN", "positiveIncrement", "KP_LEFT", "negativeIncrement", "KP_RIGHT", "positiveIncrement", "HOME", "selectMin", "END", "selectMax", "F8", "startResize", "F6", "toggleFocus", "ctrl TAB", "focusOutForward", "ctrl shift TAB", "focusOutBackward" }), "SplitPaneDivider.border", null, //TabbedPane
"TabbedPane.tabAreaInsets", tabbedpaneTabInsets, "TabbedPane.font", fontDialog12, "TabbedPane.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "RIGHT", "navigateRight", "KP_RIGHT", "navigateRight", "LEFT", "navigateLeft", "KP_LEFT", "navigateLeft", "UP", "navigateUp", "KP_UP", "navigateUp", "DOWN", "navigateDown", "KP_DOWN", "navigateDown", "ctrl DOWN", "requestFocusForVisibleComponent", "ctrl KP_DOWN", "requestFocusForVisibleComponent" }), "TabbedPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ctrl PAGE_DOWN", "navigatePageDown", "ctrl PAGE_UP", "navigatePageUp", "ctrl UP", "requestFocus", "ctrl KP_UP", "requestFocus" }), //Table
"Table.font", fontDialog12, "Table.background", Colors.getWhite(), "Table.selectionForeground", getUserTextColor(), "Table.gridColor", new ColorUIResource(200, 200, 200), "Table.focusCellForeground", getHighlightedTextColor(), "Table.focusCellHighlightBorder", new LineBorderUIResource(COLORS.getTextHighlightBackColor().brighter()), "Table.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ctrl C", "copy", "ctrl V", "paste", "ctrl X", "cut", "COPY", "copy", "PASTE", "paste", "CUT", "cut", "RIGHT", "selectNextColumn", "KP_RIGHT", "selectNextColumn", "LEFT", "selectPreviousColumn", "KP_LEFT", "selectPreviousColumn", "DOWN", "selectNextRow", "KP_DOWN", "selectNextRow", "UP", "selectPreviousRow", "KP_UP", "selectPreviousRow", "shift RIGHT", "selectNextColumnExtendSelection", "shift KP_RIGHT", "selectNextColumnExtendSelection", "shift LEFT", "selectPreviousColumnExtendSelection", "shift KP_LEFT", "selectPreviousColumnExtendSelection", "shift DOWN", "selectNextRowExtendSelection", "shift KP_DOWN", "selectNextRowExtendSelection", "shift UP", "selectPreviousRowExtendSelection", "shift KP_UP", "selectPreviousRowExtendSelection", "PAGE_UP", "scrollUpChangeSelection", "PAGE_DOWN", "scrollDownChangeSelection", "HOME", "selectFirstColumn", "END", "selectLastColumn", "shift PAGE_UP", "scrollUpExtendSelection", "shift PAGE_DOWN", "scrollDownExtendSelection", "shift HOME", "selectFirstColumnExtendSelection", "shift END", "selectLastColumnExtendSelection", "ctrl PAGE_UP", "scrollLeftChangeSelection", "ctrl PAGE_DOWN", "scrollRightChangeSelection", "ctrl HOME", "selectFirstRow", "ctrl END", "selectLastRow", "ctrl shift PAGE_UP", "scrollRightExtendSelection", "ctrl shift PAGE_DOWN", "scrollLeftExtendSelection", "ctrl shift HOME", "selectFirstRowExtendSelection", "ctrl shift END", "selectLastRowExtendSelection", "TAB", "selectNextColumnCell", "shift TAB", "selectPreviousColumnCell", "ENTER", "selectNextRowCell", "shift ENTER", "selectPreviousRowCell", "ctrl A", "selectAll", "ESCAPE", "cancel", "F2", "startEditing" }), //TableHeader
"TableHeader.font", fontDialog12, "TableHeader.background", getColors().getCommonBackground(), //TextField
"TextField.margin", textFieldMargin, "TextField.font", fontDialog12, "TextField.caretForeground", caretColor, "TextField.focusInputMap", fieldInputMap, "TextField.background", Colors.getWhite(), "FormattedTextField.margin", textFieldMargin, "FormattedTextField.font", fontDialog12, "FormattedTextField.caretForeground", caretColor, "FormattedTextField.background", getWhiteBackground(), "FormattedTextField.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "ctrl C", DefaultEditorKit.copyAction, "ctrl V", DefaultEditorKit.pasteAction, "ctrl X", DefaultEditorKit.cutAction, "COPY", DefaultEditorKit.copyAction, "PASTE", DefaultEditorKit.pasteAction, "CUT", DefaultEditorKit.cutAction, "shift LEFT", DefaultEditorKit.selectionBackwardAction, "shift KP_LEFT", DefaultEditorKit.selectionBackwardAction, "shift RIGHT", DefaultEditorKit.selectionForwardAction, "shift KP_RIGHT", DefaultEditorKit.selectionForwardAction, "ctrl LEFT", DefaultEditorKit.previousWordAction, "ctrl KP_LEFT", DefaultEditorKit.previousWordAction, "ctrl RIGHT", DefaultEditorKit.nextWordAction, "ctrl KP_RIGHT", DefaultEditorKit.nextWordAction, "ctrl shift LEFT", DefaultEditorKit.selectionPreviousWordAction, "ctrl shift KP_LEFT", DefaultEditorKit.selectionPreviousWordAction, "ctrl shift RIGHT", DefaultEditorKit.selectionNextWordAction, "ctrl shift KP_RIGHT", DefaultEditorKit.selectionNextWordAction, "ctrl A", DefaultEditorKit.selectAllAction, "HOME", DefaultEditorKit.beginLineAction, "END", DefaultEditorKit.endLineAction, "shift HOME", DefaultEditorKit.selectionBeginLineAction, "shift END", DefaultEditorKit.selectionEndLineAction, "typed \010", DefaultEditorKit.deletePrevCharAction, "DELETE", DefaultEditorKit.deleteNextCharAction, "RIGHT", DefaultEditorKit.forwardAction, "LEFT", DefaultEditorKit.backwardAction, "KP_RIGHT", DefaultEditorKit.forwardAction, "KP_LEFT", DefaultEditorKit.backwardAction, "ENTER", JTextField.notifyAction, "ctrl BACK_SLASH", "unselect", "control shift O", "toggle-componentOrientation", "ESCAPE", "reset-field-edit", "UP", "increment", "KP_UP", "increment", "DOWN", "decrement", "KP_DOWN", "decrement" }), "PasswordField.margin", textFieldMargin, "PasswordField.font", fontDialog12, "PasswordField.caretForeground", caretColor, "PasswordField.focusInputMap", fieldInputMap, "PasswordField.background", Colors.getWhite(), "EditorPane.margin", textFieldMargin, "EditorPane.font", fontDialog12, "EditorPane.caretForeground", caretColor, "EditorPane.focusInputMap", multilineInputMap, "EditorPane.background", Colors.getWhite(), "TextPane.margin", textFieldMargin, "TextPane.font", fontDialog12, "TextPane.caretForeground", caretColor, "TextPane.focusInputMap", multilineInputMap, "TextPane.background", Colors.getWhite(), "TextArea.margin", textFieldMargin, "TextArea.font", fontDialog12, "TextArea.caretForeground", caretColor, "TextArea.focusInputMap", multilineInputMap, "TextArea.background", Colors.getWhite(), //TitledBorder
"TitledBorder.font", Colors.getWhite(), //ToolBar
"ToolBar.background", COLORS.getToolbarColors()[0], "ToolBar.margin", new InsetsUIResource(0, 0, 0, 0), "ToolBar.dockingForeground", Color.ORANGE, "ToolBar.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "UP", "navigateUp", "KP_UP", "navigateUp", "DOWN", "navigateDown", "KP_DOWN", "navigateDown", "LEFT", "navigateLeft", "KP_LEFT", "navigateLeft", "RIGHT", "navigateRight", "KP_RIGHT", "navigateRight" }), //ToolTip
"ToolTip.font", fontDialog12, "tooltip.border", toolTipBorder, //Tree
"Tree.background", getWhiteBackground(), "Tree.font", fontDialog12, "Tree.selectionBorder", focusCellHighlightBorder, "Tree.editorBorder", focusCellHighlightBorder, "Tree.line", new ColorUIResource(220, 220, 220), "Tree.selectionBorderColor", COLORS.getTextHighlightBackColor().brighter(), "Tree.openIcon", SwingTools.createImage("plaf/tree_open.png"), "Tree.closedIcon", SwingTools.createImage("plaf/tree_closed.png"), "Tree.leafIcon", SwingTools.createImage("plaf/tree_leaf.png"), "Tree.expandedIcon", SwingTools.createImage("plaf/tree_expanded.png"), "Tree.collapsedIcon", SwingTools.createImage("plaf/tree_collapsed.png"), "Tree.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "ctrl C", "copy", "ctrl V", "paste", "ctrl X", "cut", "COPY", "copy", "PASTE", "paste", "CUT", "cut", "UP", "selectPrevious", "KP_UP", "selectPrevious", "shift UP", "selectPreviousExtendSelection", "shift KP_UP", "selectPreviousExtendSelection", "DOWN", "selectNext", "KP_DOWN", "selectNext", "shift DOWN", "selectNextExtendSelection", "shift KP_DOWN", "selectNextExtendSelection", "RIGHT", "selectChild", "KP_RIGHT", "selectChild", "LEFT", "selectParent", "KP_LEFT", "selectParent", "PAGE_UP", "scrollUpChangeSelection", "shift PAGE_UP", "scrollUpExtendSelection", "PAGE_DOWN", "scrollDownChangeSelection", "shift PAGE_DOWN", "scrollDownExtendSelection", "HOME", "selectFirst", "shift HOME", "selectFirstExtendSelection", "END", "selectLast", "shift END", "selectLastExtendSelection", "F2", "startEditing", "ctrl A", "selectAll", "ctrl SLASH", "selectAll", "ctrl BACK_SLASH", "clearSelection", "ctrl SPACE", "toggleSelectionPreserveAnchor", "shift SPACE", "extendSelection", "ctrl HOME", "selectFirstChangeLead", "ctrl END", "selectLastChangeLead", "ctrl UP", "selectPreviousChangeLead", "ctrl KP_UP", "selectPreviousChangeLead", "ctrl DOWN", "selectNextChangeLead", "ctrl KP_DOWN", "selectNextChangeLead", "ctrl PAGE_DOWN", "scrollDownChangeLead", "ctrl shift PAGE_DOWN", "scrollDownExtendSelection", "ctrl PAGE_UP", "scrollUpChangeLead", "ctrl shift PAGE_UP", "scrollUpExtendSelection", "ctrl LEFT", "scrollLeft", "ctrl KP_LEFT", "scrollLeft", "ctrl RIGHT", "scrollRight", "ctrl KP_RIGHT", "scrollRight", "SPACE", "toggleSelectionPreserveAnchor" }), "Tree.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "cancel" }) };
table.putDefaults(defaults);
getColors().addCustomEntriesToTable(table);
initBorderDefaults(table);
}Example 79
| Project: classlib6-master File: SynthParser.java View source code |
private void startFont(AttributeList attributes) throws SAXException {
Font font = null;
int style = Font.PLAIN;
int size = 0;
String id = null;
String name = null;
for (int i = attributes.getLength() - 1; i >= 0; i--) {
String key = attributes.getName(i);
if (key.equals(ATTRIBUTE_ID)) {
id = attributes.getValue(i);
} else if (key.equals(ATTRIBUTE_IDREF)) {
font = (Font) lookup(attributes.getValue(i), Font.class);
} else if (key.equals(ATTRIBUTE_NAME)) {
name = attributes.getValue(i);
} else if (key.equals(ATTRIBUTE_SIZE)) {
try {
size = Integer.parseInt(attributes.getValue(i));
} catch (NumberFormatException nfe) {
throw new SAXException("Invalid font size: " + attributes.getValue(i));
}
} else if (key.equals(ATTRIBUTE_STYLE)) {
StringTokenizer tok = new StringTokenizer(attributes.getValue(i));
while (tok.hasMoreTokens()) {
String token = tok.nextToken().intern();
if (token == "BOLD") {
style = ((style | Font.PLAIN) ^ Font.PLAIN) | Font.BOLD;
} else if (token == "ITALIC") {
style |= Font.ITALIC;
}
}
}
}
if (font == null) {
if (name == null) {
throw new SAXException("You must define a name for the font");
}
if (size == 0) {
throw new SAXException("You must define a size for the font");
}
font = new FontUIResource(name, style, size);
} else if (name != null || size != 0 || style != Font.PLAIN) {
throw new SAXException("Name, size and style are not for use " + "with idref");
}
register(id, font);
if (_stateInfo != null) {
_stateInfo.setFont(font);
} else if (_style != null) {
_style.setFont(font);
}
}Example 80
| Project: property-db-master File: BasicLookAndFeel.java View source code |
/** {@collect.stats}
* Populates {@code table} with the defaults for the basic look and
* feel.
*
* @param table the {@code UIDefaults} to add the values to
* @throws NullPointerException if {@code table} is {@code null}
*/
protected void initComponentDefaults(UIDefaults table) {
initResourceBundle(table);
// *** Shared Integers
Integer fiveHundred = new Integer(500);
// *** Shared Longs
Long oneThousand = new Long(1000);
// *** Shared Fonts
Integer twelve = new Integer(12);
Integer fontPlain = new Integer(Font.PLAIN);
Integer fontBold = new Integer(Font.BOLD);
Object dialogPlain12 = new SwingLazyValue("javax.swing.plaf.FontUIResource", null, new Object[] { Font.DIALOG, fontPlain, twelve });
Object serifPlain12 = new SwingLazyValue("javax.swing.plaf.FontUIResource", null, new Object[] { Font.SERIF, fontPlain, twelve });
Object sansSerifPlain12 = new SwingLazyValue("javax.swing.plaf.FontUIResource", null, new Object[] { Font.SANS_SERIF, fontPlain, twelve });
Object monospacedPlain12 = new SwingLazyValue("javax.swing.plaf.FontUIResource", null, new Object[] { Font.MONOSPACED, fontPlain, twelve });
Object dialogBold12 = new SwingLazyValue("javax.swing.plaf.FontUIResource", null, new Object[] { Font.DIALOG, fontBold, twelve });
// *** Shared Colors
ColorUIResource red = new ColorUIResource(Color.red);
ColorUIResource black = new ColorUIResource(Color.black);
ColorUIResource white = new ColorUIResource(Color.white);
ColorUIResource yellow = new ColorUIResource(Color.yellow);
ColorUIResource gray = new ColorUIResource(Color.gray);
ColorUIResource lightGray = new ColorUIResource(Color.lightGray);
ColorUIResource darkGray = new ColorUIResource(Color.darkGray);
ColorUIResource scrollBarTrack = new ColorUIResource(224, 224, 224);
Color control = table.getColor("control");
Color controlDkShadow = table.getColor("controlDkShadow");
Color controlHighlight = table.getColor("controlHighlight");
Color controlLtHighlight = table.getColor("controlLtHighlight");
Color controlShadow = table.getColor("controlShadow");
Color controlText = table.getColor("controlText");
Color menu = table.getColor("menu");
Color menuText = table.getColor("menuText");
Color textHighlight = table.getColor("textHighlight");
Color textHighlightText = table.getColor("textHighlightText");
Color textInactiveText = table.getColor("textInactiveText");
Color textText = table.getColor("textText");
Color window = table.getColor("window");
// *** Shared Insets
InsetsUIResource zeroInsets = new InsetsUIResource(0, 0, 0, 0);
InsetsUIResource twoInsets = new InsetsUIResource(2, 2, 2, 2);
InsetsUIResource threeInsets = new InsetsUIResource(3, 3, 3, 3);
// *** Shared Borders
Object marginBorder = new SwingLazyValue("javax.swing.plaf.basic.BasicBorders$MarginBorder");
Object etchedBorder = new SwingLazyValue("javax.swing.plaf.BorderUIResource", "getEtchedBorderUIResource");
Object loweredBevelBorder = new SwingLazyValue("javax.swing.plaf.BorderUIResource", "getLoweredBevelBorderUIResource");
Object popupMenuBorder = new SwingLazyValue("javax.swing.plaf.basic.BasicBorders", "getInternalFrameBorder");
Object blackLineBorder = new SwingLazyValue("javax.swing.plaf.BorderUIResource", "getBlackLineBorderUIResource");
Object focusCellHighlightBorder = new SwingLazyValue("javax.swing.plaf.BorderUIResource$LineBorderUIResource", null, new Object[] { yellow });
Object noFocusBorder = new BorderUIResource.EmptyBorderUIResource(1, 1, 1, 1);
Object tableHeaderBorder = new SwingLazyValue("javax.swing.plaf.BorderUIResource$BevelBorderUIResource", null, new Object[] { new Integer(BevelBorder.RAISED), controlLtHighlight, control, controlDkShadow, controlShadow });
// *** Button value objects
Object buttonBorder = new SwingLazyValue("javax.swing.plaf.basic.BasicBorders", "getButtonBorder");
Object buttonToggleBorder = new SwingLazyValue("javax.swing.plaf.basic.BasicBorders", "getToggleButtonBorder");
Object radioButtonBorder = new SwingLazyValue("javax.swing.plaf.basic.BasicBorders", "getRadioButtonBorder");
// *** FileChooser / FileView value objects
Object newFolderIcon = SwingUtilities2.makeIcon(getClass(), BasicLookAndFeel.class, "icons/NewFolder.gif");
Object upFolderIcon = SwingUtilities2.makeIcon(getClass(), BasicLookAndFeel.class, "icons/UpFolder.gif");
Object homeFolderIcon = SwingUtilities2.makeIcon(getClass(), BasicLookAndFeel.class, "icons/HomeFolder.gif");
Object detailsViewIcon = SwingUtilities2.makeIcon(getClass(), BasicLookAndFeel.class, "icons/DetailsView.gif");
Object listViewIcon = SwingUtilities2.makeIcon(getClass(), BasicLookAndFeel.class, "icons/ListView.gif");
Object directoryIcon = SwingUtilities2.makeIcon(getClass(), BasicLookAndFeel.class, "icons/Directory.gif");
Object fileIcon = SwingUtilities2.makeIcon(getClass(), BasicLookAndFeel.class, "icons/File.gif");
Object computerIcon = SwingUtilities2.makeIcon(getClass(), BasicLookAndFeel.class, "icons/Computer.gif");
Object hardDriveIcon = SwingUtilities2.makeIcon(getClass(), BasicLookAndFeel.class, "icons/HardDrive.gif");
Object floppyDriveIcon = SwingUtilities2.makeIcon(getClass(), BasicLookAndFeel.class, "icons/FloppyDrive.gif");
// *** InternalFrame value objects
Object internalFrameBorder = new SwingLazyValue("javax.swing.plaf.basic.BasicBorders", "getInternalFrameBorder");
// *** List value objects
Object listCellRendererActiveValue = new UIDefaults.ActiveValue() {
public Object createValue(UIDefaults table) {
return new DefaultListCellRenderer.UIResource();
}
};
// *** Menus value objects
Object menuBarBorder = new SwingLazyValue("javax.swing.plaf.basic.BasicBorders", "getMenuBarBorder");
Object menuItemCheckIcon = new SwingLazyValue("javax.swing.plaf.basic.BasicIconFactory", "getMenuItemCheckIcon");
Object menuItemArrowIcon = new SwingLazyValue("javax.swing.plaf.basic.BasicIconFactory", "getMenuItemArrowIcon");
Object menuArrowIcon = new SwingLazyValue("javax.swing.plaf.basic.BasicIconFactory", "getMenuArrowIcon");
Object checkBoxIcon = new SwingLazyValue("javax.swing.plaf.basic.BasicIconFactory", "getCheckBoxIcon");
Object radioButtonIcon = new SwingLazyValue("javax.swing.plaf.basic.BasicIconFactory", "getRadioButtonIcon");
Object checkBoxMenuItemIcon = new SwingLazyValue("javax.swing.plaf.basic.BasicIconFactory", "getCheckBoxMenuItemIcon");
Object radioButtonMenuItemIcon = new SwingLazyValue("javax.swing.plaf.basic.BasicIconFactory", "getRadioButtonMenuItemIcon");
Object menuItemAcceleratorDelimiter = new String("+");
// *** OptionPane value objects
Object optionPaneMinimumSize = new DimensionUIResource(262, 90);
Integer zero = new Integer(0);
Object zeroBorder = new SwingLazyValue("javax.swing.plaf.BorderUIResource$EmptyBorderUIResource", new Object[] { zero, zero, zero, zero });
Integer ten = new Integer(10);
Object optionPaneBorder = new SwingLazyValue("javax.swing.plaf.BorderUIResource$EmptyBorderUIResource", new Object[] { ten, ten, twelve, ten });
Object optionPaneButtonAreaBorder = new SwingLazyValue("javax.swing.plaf.BorderUIResource$EmptyBorderUIResource", new Object[] { new Integer(6), zero, zero, zero });
// *** ProgessBar value objects
Object progressBarBorder = new SwingLazyValue("javax.swing.plaf.basic.BasicBorders", "getProgressBarBorder");
// ** ScrollBar value objects
Object minimumThumbSize = new DimensionUIResource(8, 8);
Object maximumThumbSize = new DimensionUIResource(4096, 4096);
// ** Slider value objects
Object sliderFocusInsets = twoInsets;
Object toolBarSeparatorSize = new DimensionUIResource(10, 10);
// *** SplitPane value objects
Object splitPaneBorder = new SwingLazyValue("javax.swing.plaf.basic.BasicBorders", "getSplitPaneBorder");
Object splitPaneDividerBorder = new SwingLazyValue("javax.swing.plaf.basic.BasicBorders", "getSplitPaneDividerBorder");
// ** TabbedBane value objects
Object tabbedPaneTabInsets = new InsetsUIResource(0, 4, 1, 4);
Object tabbedPaneTabPadInsets = new InsetsUIResource(2, 2, 2, 1);
Object tabbedPaneTabAreaInsets = new InsetsUIResource(3, 2, 0, 2);
Object tabbedPaneContentBorderInsets = new InsetsUIResource(2, 2, 3, 3);
// *** Text value objects
Object textFieldBorder = new SwingLazyValue("javax.swing.plaf.basic.BasicBorders", "getTextFieldBorder");
Object editorMargin = threeInsets;
Object caretBlinkRate = fiveHundred;
Integer four = new Integer(4);
Object[] allAuditoryCues = new Object[] { "CheckBoxMenuItem.commandSound", "InternalFrame.closeSound", "InternalFrame.maximizeSound", "InternalFrame.minimizeSound", "InternalFrame.restoreDownSound", "InternalFrame.restoreUpSound", "MenuItem.commandSound", "OptionPane.errorSound", "OptionPane.informationSound", "OptionPane.questionSound", "OptionPane.warningSound", "PopupMenu.popupSound", "RadioButtonMenuItem.commandSound" };
Object[] noAuditoryCues = new Object[] { "mute" };
// *** Component Defaults
Object[] defaults = { // *** Auditory Feedback
"AuditoryCues.cueList", allAuditoryCues, "AuditoryCues.allAuditoryCues", allAuditoryCues, "AuditoryCues.noAuditoryCues", noAuditoryCues, // L&Fs that want auditory feedback NEED to override playList.
"AuditoryCues.playList", null, // *** Buttons
"Button.defaultButtonFollowsFocus", Boolean.TRUE, "Button.font", dialogPlain12, "Button.background", control, "Button.foreground", controlText, "Button.shadow", controlShadow, "Button.darkShadow", controlDkShadow, "Button.light", controlHighlight, "Button.highlight", controlLtHighlight, "Button.border", buttonBorder, "Button.margin", new InsetsUIResource(2, 14, 2, 14), "Button.textIconGap", four, "Button.textShiftOffset", zero, "Button.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released", "ENTER", "pressed", "released ENTER", "released" }), "ToggleButton.font", dialogPlain12, "ToggleButton.background", control, "ToggleButton.foreground", controlText, "ToggleButton.shadow", controlShadow, "ToggleButton.darkShadow", controlDkShadow, "ToggleButton.light", controlHighlight, "ToggleButton.highlight", controlLtHighlight, "ToggleButton.border", buttonToggleBorder, "ToggleButton.margin", new InsetsUIResource(2, 14, 2, 14), "ToggleButton.textIconGap", four, "ToggleButton.textShiftOffset", zero, "ToggleButton.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), "RadioButton.font", dialogPlain12, "RadioButton.background", control, "RadioButton.foreground", controlText, "RadioButton.shadow", controlShadow, "RadioButton.darkShadow", controlDkShadow, "RadioButton.light", controlHighlight, "RadioButton.highlight", controlLtHighlight, "RadioButton.border", radioButtonBorder, "RadioButton.margin", twoInsets, "RadioButton.textIconGap", four, "RadioButton.textShiftOffset", zero, "RadioButton.icon", radioButtonIcon, "RadioButton.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released", "RETURN", "pressed" }), "CheckBox.font", dialogPlain12, "CheckBox.background", control, "CheckBox.foreground", controlText, "CheckBox.border", radioButtonBorder, "CheckBox.margin", twoInsets, "CheckBox.textIconGap", four, "CheckBox.textShiftOffset", zero, "CheckBox.icon", checkBoxIcon, "CheckBox.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), "FileChooser.useSystemExtensionHiding", Boolean.FALSE, // *** ColorChooser
"ColorChooser.font", dialogPlain12, "ColorChooser.background", control, "ColorChooser.foreground", controlText, "ColorChooser.swatchesSwatchSize", new Dimension(10, 10), "ColorChooser.swatchesRecentSwatchSize", new Dimension(10, 10), "ColorChooser.swatchesDefaultRecentColor", control, // *** ComboBox
"ComboBox.font", sansSerifPlain12, "ComboBox.background", window, "ComboBox.foreground", textText, "ComboBox.buttonBackground", control, "ComboBox.buttonShadow", controlShadow, "ComboBox.buttonDarkShadow", controlDkShadow, "ComboBox.buttonHighlight", controlLtHighlight, "ComboBox.selectionBackground", textHighlight, "ComboBox.selectionForeground", textHighlightText, "ComboBox.disabledBackground", control, "ComboBox.disabledForeground", textInactiveText, "ComboBox.timeFactor", oneThousand, "ComboBox.isEnterSelectablePopup", Boolean.FALSE, "ComboBox.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "hidePopup", "PAGE_UP", "pageUpPassThrough", "PAGE_DOWN", "pageDownPassThrough", "HOME", "homePassThrough", "END", "endPassThrough", "ENTER", "enterPressed" }), "FileChooser.newFolderIcon", newFolderIcon, "FileChooser.upFolderIcon", upFolderIcon, "FileChooser.homeFolderIcon", homeFolderIcon, "FileChooser.detailsViewIcon", detailsViewIcon, "FileChooser.listViewIcon", listViewIcon, "FileChooser.readOnly", Boolean.FALSE, "FileChooser.usesSingleFilePane", Boolean.FALSE, "FileChooser.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "cancelSelection", "F5", "refresh" }), "FileView.directoryIcon", directoryIcon, "FileView.fileIcon", fileIcon, "FileView.computerIcon", computerIcon, "FileView.hardDriveIcon", hardDriveIcon, "FileView.floppyDriveIcon", floppyDriveIcon, // *** InternalFrame
"InternalFrame.titleFont", dialogBold12, "InternalFrame.borderColor", control, "InternalFrame.borderShadow", controlShadow, "InternalFrame.borderDarkShadow", controlDkShadow, "InternalFrame.borderHighlight", controlLtHighlight, "InternalFrame.borderLight", controlHighlight, "InternalFrame.border", internalFrameBorder, "InternalFrame.icon", SwingUtilities2.makeIcon(getClass(), BasicLookAndFeel.class, "icons/JavaCup16.png"), /* Default frame icons are undefined for Basic. */
"InternalFrame.maximizeIcon", new SwingLazyValue("javax.swing.plaf.basic.BasicIconFactory", "createEmptyFrameIcon"), "InternalFrame.minimizeIcon", new SwingLazyValue("javax.swing.plaf.basic.BasicIconFactory", "createEmptyFrameIcon"), "InternalFrame.iconifyIcon", new SwingLazyValue("javax.swing.plaf.basic.BasicIconFactory", "createEmptyFrameIcon"), "InternalFrame.closeIcon", new SwingLazyValue("javax.swing.plaf.basic.BasicIconFactory", "createEmptyFrameIcon"), // InternalFrame Auditory Cue Mappings
"InternalFrame.closeSound", null, "InternalFrame.maximizeSound", null, "InternalFrame.minimizeSound", null, "InternalFrame.restoreDownSound", null, "InternalFrame.restoreUpSound", null, "InternalFrame.activeTitleBackground", table.get("activeCaption"), "InternalFrame.activeTitleForeground", table.get("activeCaptionText"), "InternalFrame.inactiveTitleBackground", table.get("inactiveCaption"), "InternalFrame.inactiveTitleForeground", table.get("inactiveCaptionText"), "InternalFrame.windowBindings", new Object[] { "shift ESCAPE", "showSystemMenu", "ctrl SPACE", "showSystemMenu", "ESCAPE", "hideSystemMenu" }, "InternalFrameTitlePane.iconifyButtonOpacity", Boolean.TRUE, "InternalFrameTitlePane.maximizeButtonOpacity", Boolean.TRUE, "InternalFrameTitlePane.closeButtonOpacity", Boolean.TRUE, "DesktopIcon.border", internalFrameBorder, "Desktop.minOnScreenInsets", threeInsets, "Desktop.background", table.get("desktop"), "Desktop.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ctrl F5", "restore", "ctrl F4", "close", "ctrl F7", "move", "ctrl F8", "resize", "RIGHT", "right", "KP_RIGHT", "right", "shift RIGHT", "shrinkRight", "shift KP_RIGHT", "shrinkRight", "LEFT", "left", "KP_LEFT", "left", "shift LEFT", "shrinkLeft", "shift KP_LEFT", "shrinkLeft", "UP", "up", "KP_UP", "up", "shift UP", "shrinkUp", "shift KP_UP", "shrinkUp", "DOWN", "down", "KP_DOWN", "down", "shift DOWN", "shrinkDown", "shift KP_DOWN", "shrinkDown", "ESCAPE", "escape", "ctrl F9", "minimize", "ctrl F10", "maximize", "ctrl F6", "selectNextFrame", "ctrl TAB", "selectNextFrame", "ctrl alt F6", "selectNextFrame", "shift ctrl alt F6", "selectPreviousFrame", "ctrl F12", "navigateNext", "shift ctrl F12", "navigatePrevious" }), // *** Label
"Label.font", dialogPlain12, "Label.background", control, "Label.foreground", controlText, "Label.disabledForeground", white, "Label.disabledShadow", controlShadow, "Label.border", null, // *** List
"List.font", dialogPlain12, "List.background", window, "List.foreground", textText, "List.selectionBackground", textHighlight, "List.selectionForeground", textHighlightText, "List.noFocusBorder", noFocusBorder, "List.focusCellHighlightBorder", focusCellHighlightBorder, "List.dropLineColor", controlShadow, "List.border", null, "List.cellRenderer", listCellRendererActiveValue, "List.timeFactor", oneThousand, "List.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "ctrl C", "copy", "ctrl V", "paste", "ctrl X", "cut", "COPY", "copy", "PASTE", "paste", "CUT", "cut", "control INSERT", "copy", "shift INSERT", "paste", "shift DELETE", "cut", "UP", "selectPreviousRow", "KP_UP", "selectPreviousRow", "shift UP", "selectPreviousRowExtendSelection", "shift KP_UP", "selectPreviousRowExtendSelection", "ctrl shift UP", "selectPreviousRowExtendSelection", "ctrl shift KP_UP", "selectPreviousRowExtendSelection", "ctrl UP", "selectPreviousRowChangeLead", "ctrl KP_UP", "selectPreviousRowChangeLead", "DOWN", "selectNextRow", "KP_DOWN", "selectNextRow", "shift DOWN", "selectNextRowExtendSelection", "shift KP_DOWN", "selectNextRowExtendSelection", "ctrl shift DOWN", "selectNextRowExtendSelection", "ctrl shift KP_DOWN", "selectNextRowExtendSelection", "ctrl DOWN", "selectNextRowChangeLead", "ctrl KP_DOWN", "selectNextRowChangeLead", "LEFT", "selectPreviousColumn", "KP_LEFT", "selectPreviousColumn", "shift LEFT", "selectPreviousColumnExtendSelection", "shift KP_LEFT", "selectPreviousColumnExtendSelection", "ctrl shift LEFT", "selectPreviousColumnExtendSelection", "ctrl shift KP_LEFT", "selectPreviousColumnExtendSelection", "ctrl LEFT", "selectPreviousColumnChangeLead", "ctrl KP_LEFT", "selectPreviousColumnChangeLead", "RIGHT", "selectNextColumn", "KP_RIGHT", "selectNextColumn", "shift RIGHT", "selectNextColumnExtendSelection", "shift KP_RIGHT", "selectNextColumnExtendSelection", "ctrl shift RIGHT", "selectNextColumnExtendSelection", "ctrl shift KP_RIGHT", "selectNextColumnExtendSelection", "ctrl RIGHT", "selectNextColumnChangeLead", "ctrl KP_RIGHT", "selectNextColumnChangeLead", "HOME", "selectFirstRow", "shift HOME", "selectFirstRowExtendSelection", "ctrl shift HOME", "selectFirstRowExtendSelection", "ctrl HOME", "selectFirstRowChangeLead", "END", "selectLastRow", "shift END", "selectLastRowExtendSelection", "ctrl shift END", "selectLastRowExtendSelection", "ctrl END", "selectLastRowChangeLead", "PAGE_UP", "scrollUp", "shift PAGE_UP", "scrollUpExtendSelection", "ctrl shift PAGE_UP", "scrollUpExtendSelection", "ctrl PAGE_UP", "scrollUpChangeLead", "PAGE_DOWN", "scrollDown", "shift PAGE_DOWN", "scrollDownExtendSelection", "ctrl shift PAGE_DOWN", "scrollDownExtendSelection", "ctrl PAGE_DOWN", "scrollDownChangeLead", "ctrl A", "selectAll", "ctrl SLASH", "selectAll", "ctrl BACK_SLASH", "clearSelection", "SPACE", "addToSelection", "ctrl SPACE", "toggleAndAnchor", "shift SPACE", "extendTo", "ctrl shift SPACE", "moveSelectionTo" }), "List.focusInputMap.RightToLeft", new UIDefaults.LazyInputMap(new Object[] { "LEFT", "selectNextColumn", "KP_LEFT", "selectNextColumn", "shift LEFT", "selectNextColumnExtendSelection", "shift KP_LEFT", "selectNextColumnExtendSelection", "ctrl shift LEFT", "selectNextColumnExtendSelection", "ctrl shift KP_LEFT", "selectNextColumnExtendSelection", "ctrl LEFT", "selectNextColumnChangeLead", "ctrl KP_LEFT", "selectNextColumnChangeLead", "RIGHT", "selectPreviousColumn", "KP_RIGHT", "selectPreviousColumn", "shift RIGHT", "selectPreviousColumnExtendSelection", "shift KP_RIGHT", "selectPreviousColumnExtendSelection", "ctrl shift RIGHT", "selectPreviousColumnExtendSelection", "ctrl shift KP_RIGHT", "selectPreviousColumnExtendSelection", "ctrl RIGHT", "selectPreviousColumnChangeLead", "ctrl KP_RIGHT", "selectPreviousColumnChangeLead" }), // *** Menus
"MenuBar.font", dialogPlain12, "MenuBar.background", menu, "MenuBar.foreground", menuText, "MenuBar.shadow", controlShadow, "MenuBar.highlight", controlLtHighlight, "MenuBar.border", menuBarBorder, "MenuBar.windowBindings", new Object[] { "F10", "takeFocus" }, "MenuItem.font", dialogPlain12, "MenuItem.acceleratorFont", dialogPlain12, "MenuItem.background", menu, "MenuItem.foreground", menuText, "MenuItem.selectionForeground", textHighlightText, "MenuItem.selectionBackground", textHighlight, "MenuItem.disabledForeground", null, "MenuItem.acceleratorForeground", menuText, "MenuItem.acceleratorSelectionForeground", textHighlightText, "MenuItem.acceleratorDelimiter", menuItemAcceleratorDelimiter, "MenuItem.border", marginBorder, "MenuItem.borderPainted", Boolean.FALSE, "MenuItem.margin", twoInsets, "MenuItem.checkIcon", menuItemCheckIcon, "MenuItem.arrowIcon", menuItemArrowIcon, "MenuItem.commandSound", null, "RadioButtonMenuItem.font", dialogPlain12, "RadioButtonMenuItem.acceleratorFont", dialogPlain12, "RadioButtonMenuItem.background", menu, "RadioButtonMenuItem.foreground", menuText, "RadioButtonMenuItem.selectionForeground", textHighlightText, "RadioButtonMenuItem.selectionBackground", textHighlight, "RadioButtonMenuItem.disabledForeground", null, "RadioButtonMenuItem.acceleratorForeground", menuText, "RadioButtonMenuItem.acceleratorSelectionForeground", textHighlightText, "RadioButtonMenuItem.border", marginBorder, "RadioButtonMenuItem.borderPainted", Boolean.FALSE, "RadioButtonMenuItem.margin", twoInsets, "RadioButtonMenuItem.checkIcon", radioButtonMenuItemIcon, "RadioButtonMenuItem.arrowIcon", menuItemArrowIcon, "RadioButtonMenuItem.commandSound", null, "CheckBoxMenuItem.font", dialogPlain12, "CheckBoxMenuItem.acceleratorFont", dialogPlain12, "CheckBoxMenuItem.background", menu, "CheckBoxMenuItem.foreground", menuText, "CheckBoxMenuItem.selectionForeground", textHighlightText, "CheckBoxMenuItem.selectionBackground", textHighlight, "CheckBoxMenuItem.disabledForeground", null, "CheckBoxMenuItem.acceleratorForeground", menuText, "CheckBoxMenuItem.acceleratorSelectionForeground", textHighlightText, "CheckBoxMenuItem.border", marginBorder, "CheckBoxMenuItem.borderPainted", Boolean.FALSE, "CheckBoxMenuItem.margin", twoInsets, "CheckBoxMenuItem.checkIcon", checkBoxMenuItemIcon, "CheckBoxMenuItem.arrowIcon", menuItemArrowIcon, "CheckBoxMenuItem.commandSound", null, "Menu.font", dialogPlain12, "Menu.acceleratorFont", dialogPlain12, "Menu.background", menu, "Menu.foreground", menuText, "Menu.selectionForeground", textHighlightText, "Menu.selectionBackground", textHighlight, "Menu.disabledForeground", null, "Menu.acceleratorForeground", menuText, "Menu.acceleratorSelectionForeground", textHighlightText, "Menu.border", marginBorder, "Menu.borderPainted", Boolean.FALSE, "Menu.margin", twoInsets, "Menu.checkIcon", menuItemCheckIcon, "Menu.arrowIcon", menuArrowIcon, "Menu.menuPopupOffsetX", new Integer(0), "Menu.menuPopupOffsetY", new Integer(0), "Menu.submenuPopupOffsetX", new Integer(0), "Menu.submenuPopupOffsetY", new Integer(0), "Menu.shortcutKeys", new int[] { KeyEvent.ALT_MASK }, "Menu.crossMenuMnemonic", Boolean.TRUE, // hide the entire structure of open menu and its submenus
"Menu.cancelMode", "hideLastSubmenu", // the menu itself will be unselect with the next cancel action
"Menu.preserveTopLevelSelection", Boolean.FALSE, // PopupMenu
"PopupMenu.font", dialogPlain12, "PopupMenu.background", menu, "PopupMenu.foreground", menuText, "PopupMenu.border", popupMenuBorder, // Internal Frame Auditory Cue Mappings
"PopupMenu.popupSound", null, // selected.
"PopupMenu.selectedWindowInputMapBindings", new Object[] { "ESCAPE", "cancel", "DOWN", "selectNext", "KP_DOWN", "selectNext", "UP", "selectPrevious", "KP_UP", "selectPrevious", "LEFT", "selectParent", "KP_LEFT", "selectParent", "RIGHT", "selectChild", "KP_RIGHT", "selectChild", "ENTER", "return", "ctrl ENTER", "return", "SPACE", "return" }, "PopupMenu.selectedWindowInputMapBindings.RightToLeft", new Object[] { "LEFT", "selectChild", "KP_LEFT", "selectChild", "RIGHT", "selectParent", "KP_RIGHT", "selectParent" }, "PopupMenu.consumeEventOnClose", Boolean.FALSE, // OptionPane.buttonFont, which defines the font for the buttons.
"OptionPane.font", dialogPlain12, "OptionPane.background", control, "OptionPane.foreground", controlText, "OptionPane.messageForeground", controlText, "OptionPane.border", optionPaneBorder, "OptionPane.messageAreaBorder", zeroBorder, "OptionPane.buttonAreaBorder", optionPaneButtonAreaBorder, "OptionPane.minimumSize", optionPaneMinimumSize, "OptionPane.errorIcon", SwingUtilities2.makeIcon(getClass(), BasicLookAndFeel.class, "icons/Error.gif"), "OptionPane.informationIcon", SwingUtilities2.makeIcon(getClass(), BasicLookAndFeel.class, "icons/Inform.gif"), "OptionPane.warningIcon", SwingUtilities2.makeIcon(getClass(), BasicLookAndFeel.class, "icons/Warn.gif"), "OptionPane.questionIcon", SwingUtilities2.makeIcon(getClass(), BasicLookAndFeel.class, "icons/Question.gif"), "OptionPane.windowBindings", new Object[] { "ESCAPE", "close" }, // OptionPane Auditory Cue Mappings
"OptionPane.errorSound", null, // Info and Plain
"OptionPane.informationSound", // Info and Plain
null, "OptionPane.questionSound", null, "OptionPane.warningSound", null, "OptionPane.buttonClickThreshhold", fiveHundred, // *** Panel
"Panel.font", dialogPlain12, "Panel.background", control, "Panel.foreground", textText, // *** ProgressBar
"ProgressBar.font", dialogPlain12, "ProgressBar.foreground", textHighlight, "ProgressBar.background", control, "ProgressBar.selectionForeground", control, "ProgressBar.selectionBackground", textHighlight, "ProgressBar.border", progressBarBorder, "ProgressBar.cellLength", new Integer(1), "ProgressBar.cellSpacing", zero, "ProgressBar.repaintInterval", new Integer(50), "ProgressBar.cycleTime", new Integer(3000), "ProgressBar.horizontalSize", new DimensionUIResource(146, 12), "ProgressBar.verticalSize", new DimensionUIResource(12, 146), // DEPRECATED - DO NOT USE!
"Separator.shadow", // DEPRECATED - DO NOT USE!
controlShadow, // DEPRECATED - DO NOT USE!
"Separator.highlight", // DEPRECATED - DO NOT USE!
controlLtHighlight, "Separator.background", controlLtHighlight, "Separator.foreground", controlShadow, // *** ScrollBar/ScrollPane/Viewport
"ScrollBar.background", scrollBarTrack, "ScrollBar.foreground", control, "ScrollBar.track", table.get("scrollbar"), "ScrollBar.trackHighlight", controlDkShadow, "ScrollBar.thumb", control, "ScrollBar.thumbHighlight", controlLtHighlight, "ScrollBar.thumbDarkShadow", controlDkShadow, "ScrollBar.thumbShadow", controlShadow, "ScrollBar.border", null, "ScrollBar.minimumThumbSize", minimumThumbSize, "ScrollBar.maximumThumbSize", maximumThumbSize, "ScrollBar.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "RIGHT", "positiveUnitIncrement", "KP_RIGHT", "positiveUnitIncrement", "DOWN", "positiveUnitIncrement", "KP_DOWN", "positiveUnitIncrement", "PAGE_DOWN", "positiveBlockIncrement", "LEFT", "negativeUnitIncrement", "KP_LEFT", "negativeUnitIncrement", "UP", "negativeUnitIncrement", "KP_UP", "negativeUnitIncrement", "PAGE_UP", "negativeBlockIncrement", "HOME", "minScroll", "END", "maxScroll" }), "ScrollBar.ancestorInputMap.RightToLeft", new UIDefaults.LazyInputMap(new Object[] { "RIGHT", "negativeUnitIncrement", "KP_RIGHT", "negativeUnitIncrement", "LEFT", "positiveUnitIncrement", "KP_LEFT", "positiveUnitIncrement" }), "ScrollBar.width", new Integer(16), "ScrollPane.font", dialogPlain12, "ScrollPane.background", control, "ScrollPane.foreground", controlText, "ScrollPane.border", textFieldBorder, "ScrollPane.viewportBorder", null, "ScrollPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "RIGHT", "unitScrollRight", "KP_RIGHT", "unitScrollRight", "DOWN", "unitScrollDown", "KP_DOWN", "unitScrollDown", "LEFT", "unitScrollLeft", "KP_LEFT", "unitScrollLeft", "UP", "unitScrollUp", "KP_UP", "unitScrollUp", "PAGE_UP", "scrollUp", "PAGE_DOWN", "scrollDown", "ctrl PAGE_UP", "scrollLeft", "ctrl PAGE_DOWN", "scrollRight", "ctrl HOME", "scrollHome", "ctrl END", "scrollEnd" }), "ScrollPane.ancestorInputMap.RightToLeft", new UIDefaults.LazyInputMap(new Object[] { "ctrl PAGE_UP", "scrollRight", "ctrl PAGE_DOWN", "scrollLeft" }), "Viewport.font", dialogPlain12, "Viewport.background", control, "Viewport.foreground", textText, // *** Slider
"Slider.font", dialogPlain12, "Slider.foreground", control, "Slider.background", control, "Slider.highlight", controlLtHighlight, "Slider.tickColor", Color.black, "Slider.shadow", controlShadow, "Slider.focus", controlDkShadow, "Slider.border", null, "Slider.horizontalSize", new Dimension(200, 21), "Slider.verticalSize", new Dimension(21, 200), "Slider.minimumHorizontalSize", new Dimension(36, 21), "Slider.minimumVerticalSize", new Dimension(21, 36), "Slider.focusInsets", sliderFocusInsets, "Slider.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "RIGHT", "positiveUnitIncrement", "KP_RIGHT", "positiveUnitIncrement", "DOWN", "negativeUnitIncrement", "KP_DOWN", "negativeUnitIncrement", "PAGE_DOWN", "negativeBlockIncrement", "LEFT", "negativeUnitIncrement", "KP_LEFT", "negativeUnitIncrement", "UP", "positiveUnitIncrement", "KP_UP", "positiveUnitIncrement", "PAGE_UP", "positiveBlockIncrement", "HOME", "minScroll", "END", "maxScroll" }), "Slider.focusInputMap.RightToLeft", new UIDefaults.LazyInputMap(new Object[] { "RIGHT", "negativeUnitIncrement", "KP_RIGHT", "negativeUnitIncrement", "LEFT", "positiveUnitIncrement", "KP_LEFT", "positiveUnitIncrement" }), // *** Spinner
"Spinner.font", monospacedPlain12, "Spinner.background", control, "Spinner.foreground", control, "Spinner.border", textFieldBorder, "Spinner.arrowButtonBorder", null, "Spinner.arrowButtonInsets", null, "Spinner.arrowButtonSize", new Dimension(16, 5), "Spinner.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "UP", "increment", "KP_UP", "increment", "DOWN", "decrement", "KP_DOWN", "decrement" }), "Spinner.editorBorderPainted", Boolean.FALSE, "Spinner.editorAlignment", JTextField.TRAILING, // *** SplitPane
"SplitPane.background", control, "SplitPane.highlight", controlLtHighlight, "SplitPane.shadow", controlShadow, "SplitPane.darkShadow", controlDkShadow, "SplitPane.border", splitPaneBorder, "SplitPane.dividerSize", new Integer(7), "SplitPaneDivider.border", splitPaneDividerBorder, "SplitPaneDivider.draggingColor", darkGray, "SplitPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "UP", "negativeIncrement", "DOWN", "positiveIncrement", "LEFT", "negativeIncrement", "RIGHT", "positiveIncrement", "KP_UP", "negativeIncrement", "KP_DOWN", "positiveIncrement", "KP_LEFT", "negativeIncrement", "KP_RIGHT", "positiveIncrement", "HOME", "selectMin", "END", "selectMax", "F8", "startResize", "F6", "toggleFocus", "ctrl TAB", "focusOutForward", "ctrl shift TAB", "focusOutBackward" }), // *** TabbedPane
"TabbedPane.font", dialogPlain12, "TabbedPane.background", control, "TabbedPane.foreground", controlText, "TabbedPane.highlight", controlLtHighlight, "TabbedPane.light", controlHighlight, "TabbedPane.shadow", controlShadow, "TabbedPane.darkShadow", controlDkShadow, "TabbedPane.selected", null, "TabbedPane.focus", controlText, "TabbedPane.textIconGap", four, // which is zero by default
"TabbedPane.tabsOverlapBorder", Boolean.FALSE, "TabbedPane.selectionFollowsFocus", Boolean.TRUE, "TabbedPane.labelShift", 1, "TabbedPane.selectedLabelShift", -1, "TabbedPane.tabInsets", tabbedPaneTabInsets, "TabbedPane.selectedTabPadInsets", tabbedPaneTabPadInsets, "TabbedPane.tabAreaInsets", tabbedPaneTabAreaInsets, "TabbedPane.contentBorderInsets", tabbedPaneContentBorderInsets, "TabbedPane.tabRunOverlay", new Integer(2), "TabbedPane.tabsOpaque", Boolean.TRUE, "TabbedPane.contentOpaque", Boolean.TRUE, "TabbedPane.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "RIGHT", "navigateRight", "KP_RIGHT", "navigateRight", "LEFT", "navigateLeft", "KP_LEFT", "navigateLeft", "UP", "navigateUp", "KP_UP", "navigateUp", "DOWN", "navigateDown", "KP_DOWN", "navigateDown", "ctrl DOWN", "requestFocusForVisibleComponent", "ctrl KP_DOWN", "requestFocusForVisibleComponent" }), "TabbedPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ctrl PAGE_DOWN", "navigatePageDown", "ctrl PAGE_UP", "navigatePageUp", "ctrl UP", "requestFocus", "ctrl KP_UP", "requestFocus" }), // *** Table
"Table.font", dialogPlain12, // cell text color
"Table.foreground", // cell text color
controlText, // cell background color
"Table.background", // cell background color
window, "Table.selectionForeground", textHighlightText, "Table.selectionBackground", textHighlight, "Table.dropLineColor", controlShadow, "Table.dropLineShortColor", black, // grid line color
"Table.gridColor", // grid line color
gray, "Table.focusCellBackground", window, "Table.focusCellForeground", controlText, "Table.focusCellHighlightBorder", focusCellHighlightBorder, "Table.scrollPaneBorder", loweredBevelBorder, "Table.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ctrl C", "copy", "ctrl V", "paste", "ctrl X", "cut", "COPY", "copy", "PASTE", "paste", "CUT", "cut", "control INSERT", "copy", "shift INSERT", "paste", "shift DELETE", "cut", "RIGHT", "selectNextColumn", "KP_RIGHT", "selectNextColumn", "shift RIGHT", "selectNextColumnExtendSelection", "shift KP_RIGHT", "selectNextColumnExtendSelection", "ctrl shift RIGHT", "selectNextColumnExtendSelection", "ctrl shift KP_RIGHT", "selectNextColumnExtendSelection", "ctrl RIGHT", "selectNextColumnChangeLead", "ctrl KP_RIGHT", "selectNextColumnChangeLead", "LEFT", "selectPreviousColumn", "KP_LEFT", "selectPreviousColumn", "shift LEFT", "selectPreviousColumnExtendSelection", "shift KP_LEFT", "selectPreviousColumnExtendSelection", "ctrl shift LEFT", "selectPreviousColumnExtendSelection", "ctrl shift KP_LEFT", "selectPreviousColumnExtendSelection", "ctrl LEFT", "selectPreviousColumnChangeLead", "ctrl KP_LEFT", "selectPreviousColumnChangeLead", "DOWN", "selectNextRow", "KP_DOWN", "selectNextRow", "shift DOWN", "selectNextRowExtendSelection", "shift KP_DOWN", "selectNextRowExtendSelection", "ctrl shift DOWN", "selectNextRowExtendSelection", "ctrl shift KP_DOWN", "selectNextRowExtendSelection", "ctrl DOWN", "selectNextRowChangeLead", "ctrl KP_DOWN", "selectNextRowChangeLead", "UP", "selectPreviousRow", "KP_UP", "selectPreviousRow", "shift UP", "selectPreviousRowExtendSelection", "shift KP_UP", "selectPreviousRowExtendSelection", "ctrl shift UP", "selectPreviousRowExtendSelection", "ctrl shift KP_UP", "selectPreviousRowExtendSelection", "ctrl UP", "selectPreviousRowChangeLead", "ctrl KP_UP", "selectPreviousRowChangeLead", "HOME", "selectFirstColumn", "shift HOME", "selectFirstColumnExtendSelection", "ctrl shift HOME", "selectFirstRowExtendSelection", "ctrl HOME", "selectFirstRow", "END", "selectLastColumn", "shift END", "selectLastColumnExtendSelection", "ctrl shift END", "selectLastRowExtendSelection", "ctrl END", "selectLastRow", "PAGE_UP", "scrollUpChangeSelection", "shift PAGE_UP", "scrollUpExtendSelection", "ctrl shift PAGE_UP", "scrollLeftExtendSelection", "ctrl PAGE_UP", "scrollLeftChangeSelection", "PAGE_DOWN", "scrollDownChangeSelection", "shift PAGE_DOWN", "scrollDownExtendSelection", "ctrl shift PAGE_DOWN", "scrollRightExtendSelection", "ctrl PAGE_DOWN", "scrollRightChangeSelection", "TAB", "selectNextColumnCell", "shift TAB", "selectPreviousColumnCell", "ENTER", "selectNextRowCell", "shift ENTER", "selectPreviousRowCell", "ctrl A", "selectAll", "ctrl SLASH", "selectAll", "ctrl BACK_SLASH", "clearSelection", "ESCAPE", "cancel", "F2", "startEditing", "SPACE", "addToSelection", "ctrl SPACE", "toggleAndAnchor", "shift SPACE", "extendTo", "ctrl shift SPACE", "moveSelectionTo", "F8", "focusHeader" }), "Table.ancestorInputMap.RightToLeft", new UIDefaults.LazyInputMap(new Object[] { "RIGHT", "selectPreviousColumn", "KP_RIGHT", "selectPreviousColumn", "shift RIGHT", "selectPreviousColumnExtendSelection", "shift KP_RIGHT", "selectPreviousColumnExtendSelection", "ctrl shift RIGHT", "selectPreviousColumnExtendSelection", "ctrl shift KP_RIGHT", "selectPreviousColumnExtendSelection", "ctrl RIGHT", "selectPreviousColumnChangeLead", "ctrl KP_RIGHT", "selectPreviousColumnChangeLead", "LEFT", "selectNextColumn", "KP_LEFT", "selectNextColumn", "shift LEFT", "selectNextColumnExtendSelection", "shift KP_LEFT", "selectNextColumnExtendSelection", "ctrl shift LEFT", "selectNextColumnExtendSelection", "ctrl shift KP_LEFT", "selectNextColumnExtendSelection", "ctrl LEFT", "selectNextColumnChangeLead", "ctrl KP_LEFT", "selectNextColumnChangeLead", "ctrl PAGE_UP", "scrollRightChangeSelection", "ctrl PAGE_DOWN", "scrollLeftChangeSelection", "ctrl shift PAGE_UP", "scrollRightExtendSelection", "ctrl shift PAGE_DOWN", "scrollLeftExtendSelection" }), "Table.ascendingSortIcon", new SwingLazyValue("sun.swing.icon.SortArrowIcon", null, new Object[] { Boolean.TRUE, "Table.sortIconColor" }), "Table.descendingSortIcon", new SwingLazyValue("sun.swing.icon.SortArrowIcon", null, new Object[] { Boolean.FALSE, "Table.sortIconColor" }), "Table.sortIconColor", controlShadow, "TableHeader.font", dialogPlain12, // header text color
"TableHeader.foreground", // header text color
controlText, // header background
"TableHeader.background", // header background
control, "TableHeader.cellBorder", tableHeaderBorder, // like text component bg
"TableHeader.focusCellBackground", // like text component bg
table.getColor("text"), "TableHeader.focusCellForeground", null, "TableHeader.focusCellBorder", null, "TableHeader.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "toggleSortOrder", "LEFT", "selectColumnToLeft", "KP_LEFT", "selectColumnToLeft", "RIGHT", "selectColumnToRight", "KP_RIGHT", "selectColumnToRight", "alt LEFT", "moveColumnLeft", "alt KP_LEFT", "moveColumnLeft", "alt RIGHT", "moveColumnRight", "alt KP_RIGHT", "moveColumnRight", "alt shift LEFT", "resizeLeft", "alt shift KP_LEFT", "resizeLeft", "alt shift RIGHT", "resizeRight", "alt shift KP_RIGHT", "resizeRight", "ESCAPE", "focusTable" }), // *** Text
"TextField.font", sansSerifPlain12, "TextField.background", window, "TextField.foreground", textText, "TextField.shadow", controlShadow, "TextField.darkShadow", controlDkShadow, "TextField.light", controlHighlight, "TextField.highlight", controlLtHighlight, "TextField.inactiveForeground", textInactiveText, "TextField.inactiveBackground", control, "TextField.selectionBackground", textHighlight, "TextField.selectionForeground", textHighlightText, "TextField.caretForeground", textText, "TextField.caretBlinkRate", caretBlinkRate, "TextField.border", textFieldBorder, "TextField.margin", zeroInsets, "FormattedTextField.font", sansSerifPlain12, "FormattedTextField.background", window, "FormattedTextField.foreground", textText, "FormattedTextField.inactiveForeground", textInactiveText, "FormattedTextField.inactiveBackground", control, "FormattedTextField.selectionBackground", textHighlight, "FormattedTextField.selectionForeground", textHighlightText, "FormattedTextField.caretForeground", textText, "FormattedTextField.caretBlinkRate", caretBlinkRate, "FormattedTextField.border", textFieldBorder, "FormattedTextField.margin", zeroInsets, "FormattedTextField.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "ctrl C", DefaultEditorKit.copyAction, "ctrl V", DefaultEditorKit.pasteAction, "ctrl X", DefaultEditorKit.cutAction, "COPY", DefaultEditorKit.copyAction, "PASTE", DefaultEditorKit.pasteAction, "CUT", DefaultEditorKit.cutAction, "control INSERT", DefaultEditorKit.copyAction, "shift INSERT", DefaultEditorKit.pasteAction, "shift DELETE", DefaultEditorKit.cutAction, "shift LEFT", DefaultEditorKit.selectionBackwardAction, "shift KP_LEFT", DefaultEditorKit.selectionBackwardAction, "shift RIGHT", DefaultEditorKit.selectionForwardAction, "shift KP_RIGHT", DefaultEditorKit.selectionForwardAction, "ctrl LEFT", DefaultEditorKit.previousWordAction, "ctrl KP_LEFT", DefaultEditorKit.previousWordAction, "ctrl RIGHT", DefaultEditorKit.nextWordAction, "ctrl KP_RIGHT", DefaultEditorKit.nextWordAction, "ctrl shift LEFT", DefaultEditorKit.selectionPreviousWordAction, "ctrl shift KP_LEFT", DefaultEditorKit.selectionPreviousWordAction, "ctrl shift RIGHT", DefaultEditorKit.selectionNextWordAction, "ctrl shift KP_RIGHT", DefaultEditorKit.selectionNextWordAction, "ctrl A", DefaultEditorKit.selectAllAction, "HOME", DefaultEditorKit.beginLineAction, "END", DefaultEditorKit.endLineAction, "shift HOME", DefaultEditorKit.selectionBeginLineAction, "shift END", DefaultEditorKit.selectionEndLineAction, "BACK_SPACE", DefaultEditorKit.deletePrevCharAction, "shift BACK_SPACE", DefaultEditorKit.deletePrevCharAction, "ctrl H", DefaultEditorKit.deletePrevCharAction, "DELETE", DefaultEditorKit.deleteNextCharAction, "ctrl DELETE", DefaultEditorKit.deleteNextWordAction, "ctrl BACK_SPACE", DefaultEditorKit.deletePrevWordAction, "RIGHT", DefaultEditorKit.forwardAction, "LEFT", DefaultEditorKit.backwardAction, "KP_RIGHT", DefaultEditorKit.forwardAction, "KP_LEFT", DefaultEditorKit.backwardAction, "ENTER", JTextField.notifyAction, "ctrl BACK_SLASH", "unselect", "control shift O", "toggle-componentOrientation", "ESCAPE", "reset-field-edit", "UP", "increment", "KP_UP", "increment", "DOWN", "decrement", "KP_DOWN", "decrement" }), "PasswordField.font", monospacedPlain12, "PasswordField.background", window, "PasswordField.foreground", textText, "PasswordField.inactiveForeground", textInactiveText, "PasswordField.inactiveBackground", control, "PasswordField.selectionBackground", textHighlight, "PasswordField.selectionForeground", textHighlightText, "PasswordField.caretForeground", textText, "PasswordField.caretBlinkRate", caretBlinkRate, "PasswordField.border", textFieldBorder, "PasswordField.margin", zeroInsets, "PasswordField.echoChar", '*', "TextArea.font", monospacedPlain12, "TextArea.background", window, "TextArea.foreground", textText, "TextArea.inactiveForeground", textInactiveText, "TextArea.selectionBackground", textHighlight, "TextArea.selectionForeground", textHighlightText, "TextArea.caretForeground", textText, "TextArea.caretBlinkRate", caretBlinkRate, "TextArea.border", marginBorder, "TextArea.margin", zeroInsets, "TextPane.font", serifPlain12, "TextPane.background", white, "TextPane.foreground", textText, "TextPane.selectionBackground", textHighlight, "TextPane.selectionForeground", textHighlightText, "TextPane.caretForeground", textText, "TextPane.caretBlinkRate", caretBlinkRate, "TextPane.inactiveForeground", textInactiveText, "TextPane.border", marginBorder, "TextPane.margin", editorMargin, "EditorPane.font", serifPlain12, "EditorPane.background", white, "EditorPane.foreground", textText, "EditorPane.selectionBackground", textHighlight, "EditorPane.selectionForeground", textHighlightText, "EditorPane.caretForeground", textText, "EditorPane.caretBlinkRate", caretBlinkRate, "EditorPane.inactiveForeground", textInactiveText, "EditorPane.border", marginBorder, "EditorPane.margin", editorMargin, "html.pendingImage", SwingUtilities2.makeIcon(getClass(), BasicLookAndFeel.class, "icons/image-delayed.png"), "html.missingImage", SwingUtilities2.makeIcon(getClass(), BasicLookAndFeel.class, "icons/image-failed.png"), // *** TitledBorder
"TitledBorder.font", dialogPlain12, "TitledBorder.titleColor", controlText, "TitledBorder.border", etchedBorder, // *** ToolBar
"ToolBar.font", dialogPlain12, "ToolBar.background", control, "ToolBar.foreground", controlText, "ToolBar.shadow", controlShadow, "ToolBar.darkShadow", controlDkShadow, "ToolBar.light", controlHighlight, "ToolBar.highlight", controlLtHighlight, "ToolBar.dockingBackground", control, "ToolBar.dockingForeground", red, "ToolBar.floatingBackground", control, "ToolBar.floatingForeground", darkGray, "ToolBar.border", etchedBorder, "ToolBar.separatorSize", toolBarSeparatorSize, "ToolBar.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "UP", "navigateUp", "KP_UP", "navigateUp", "DOWN", "navigateDown", "KP_DOWN", "navigateDown", "LEFT", "navigateLeft", "KP_LEFT", "navigateLeft", "RIGHT", "navigateRight", "KP_RIGHT", "navigateRight" }), // *** ToolTips
"ToolTip.font", sansSerifPlain12, "ToolTip.background", table.get("info"), "ToolTip.foreground", table.get("infoText"), "ToolTip.border", blackLineBorder, // the application has an active window
"ToolTipManager.enableToolTipMode", "allWindows", // *** Tree
"Tree.paintLines", Boolean.TRUE, "Tree.lineTypeDashed", Boolean.FALSE, "Tree.font", dialogPlain12, "Tree.background", window, "Tree.foreground", textText, "Tree.hash", gray, "Tree.textForeground", textText, "Tree.textBackground", table.get("text"), "Tree.selectionForeground", textHighlightText, "Tree.selectionBackground", textHighlight, "Tree.selectionBorderColor", black, "Tree.dropLineColor", controlShadow, "Tree.editorBorder", blackLineBorder, "Tree.leftChildIndent", new Integer(7), "Tree.rightChildIndent", new Integer(13), "Tree.rowHeight", new Integer(16), "Tree.scrollsOnExpand", Boolean.TRUE, "Tree.openIcon", SwingUtilities2.makeIcon(getClass(), BasicLookAndFeel.class, "icons/TreeOpen.gif"), "Tree.closedIcon", SwingUtilities2.makeIcon(getClass(), BasicLookAndFeel.class, "icons/TreeClosed.gif"), "Tree.leafIcon", SwingUtilities2.makeIcon(getClass(), BasicLookAndFeel.class, "icons/TreeLeaf.gif"), "Tree.expandedIcon", null, "Tree.collapsedIcon", null, "Tree.changeSelectionWithFocus", Boolean.TRUE, "Tree.drawsFocusBorderAroundIcon", Boolean.FALSE, "Tree.timeFactor", oneThousand, "Tree.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "ctrl C", "copy", "ctrl V", "paste", "ctrl X", "cut", "COPY", "copy", "PASTE", "paste", "CUT", "cut", "control INSERT", "copy", "shift INSERT", "paste", "shift DELETE", "cut", "UP", "selectPrevious", "KP_UP", "selectPrevious", "shift UP", "selectPreviousExtendSelection", "shift KP_UP", "selectPreviousExtendSelection", "ctrl shift UP", "selectPreviousExtendSelection", "ctrl shift KP_UP", "selectPreviousExtendSelection", "ctrl UP", "selectPreviousChangeLead", "ctrl KP_UP", "selectPreviousChangeLead", "DOWN", "selectNext", "KP_DOWN", "selectNext", "shift DOWN", "selectNextExtendSelection", "shift KP_DOWN", "selectNextExtendSelection", "ctrl shift DOWN", "selectNextExtendSelection", "ctrl shift KP_DOWN", "selectNextExtendSelection", "ctrl DOWN", "selectNextChangeLead", "ctrl KP_DOWN", "selectNextChangeLead", "RIGHT", "selectChild", "KP_RIGHT", "selectChild", "LEFT", "selectParent", "KP_LEFT", "selectParent", "PAGE_UP", "scrollUpChangeSelection", "shift PAGE_UP", "scrollUpExtendSelection", "ctrl shift PAGE_UP", "scrollUpExtendSelection", "ctrl PAGE_UP", "scrollUpChangeLead", "PAGE_DOWN", "scrollDownChangeSelection", "shift PAGE_DOWN", "scrollDownExtendSelection", "ctrl shift PAGE_DOWN", "scrollDownExtendSelection", "ctrl PAGE_DOWN", "scrollDownChangeLead", "HOME", "selectFirst", "shift HOME", "selectFirstExtendSelection", "ctrl shift HOME", "selectFirstExtendSelection", "ctrl HOME", "selectFirstChangeLead", "END", "selectLast", "shift END", "selectLastExtendSelection", "ctrl shift END", "selectLastExtendSelection", "ctrl END", "selectLastChangeLead", "F2", "startEditing", "ctrl A", "selectAll", "ctrl SLASH", "selectAll", "ctrl BACK_SLASH", "clearSelection", "ctrl LEFT", "scrollLeft", "ctrl KP_LEFT", "scrollLeft", "ctrl RIGHT", "scrollRight", "ctrl KP_RIGHT", "scrollRight", "SPACE", "addToSelection", "ctrl SPACE", "toggleAndAnchor", "shift SPACE", "extendTo", "ctrl shift SPACE", "moveSelectionTo" }), "Tree.focusInputMap.RightToLeft", new UIDefaults.LazyInputMap(new Object[] { "RIGHT", "selectParent", "KP_RIGHT", "selectParent", "LEFT", "selectChild", "KP_LEFT", "selectChild" }), "Tree.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "cancel" }), // focused JComponent
"RootPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "shift F10", "postPopup", "CONTEXT_MENU", "postPopup" }), // button set on the rootpane.
"RootPane.defaultButtonWindowKeyBindings", new Object[] { "ENTER", "press", "released ENTER", "release", "ctrl ENTER", "press", "ctrl released ENTER", "release" } };
table.putDefaults(defaults);
}Example 81
| Project: bobbin-master File: TDA.java View source code |
/**
* tries the native look and feel on mac and windows and metal on unix (gtk still isn't looking that nice, even in
* 1.6)
*/
private void setupLookAndFeel() {
setUIFont(new FontUIResource(DEFAULT_FONT, Font.PLAIN, FONT_SIZE));
try {
for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (Exception e) {
e.printStackTrace();
}
}Example 82
| Project: Calendar-Application-master File: ContactPanel.java View source code |
public void initView() {
setBorder(new EtchedBorder());
setFont(new FontUIResource(new Font("Arial", Font.PLAIN, 10)));
Contact c = m_contact;
URL iconURL = getClass().getResource("/images/contact2.png");
m_icon = new JLabel(new ImageIcon(iconURL));
m_icon.setPreferredSize(new Dimension(50, 50));
m_name_label = new JLabel(c.GetName());
m_dob_label = new JLabel(makeDobText(c));
m_website_label = new JLabel(c.GetWebsite());
m_phone_left = new JButton("<");
m_phone_right = new JButton(">");
m_email_left = new JButton("<");
m_email_right = new JButton(">");
m_phone_left.setMargin(new Insets(0, 0, 0, 0));
m_phone_left.setPreferredSize(new Dimension(40, 25));
m_phone_right.setMargin(new Insets(0, 0, 0, 0));
m_phone_right.setPreferredSize(new Dimension(40, 25));
m_email_left.setMargin(new Insets(0, 0, 0, 0));
m_email_right.setMargin(new Insets(0, 0, 0, 0));
m_email_left.setPreferredSize(new Dimension(40, 25));
m_email_right.setPreferredSize(new Dimension(40, 25));
m_a_phone_label = new ArrayList<String>();
m_a_phone_value = new ArrayList<String>();
m_a_phone_label.add(new String(" Phone: "));
m_a_phone_label.add(new String(" Mobile Phone: "));
m_a_phone_label.add(new String(" Work Phone: "));
m_a_phone_value.add(new String(c.GetLandphone()));
m_a_phone_value.add(new String(c.GetMobilephone()));
m_a_phone_value.add(new String(c.GetWorkphone()));
m_a_email_label = new ArrayList<String>();
m_a_email_value = new ArrayList<String>();
m_a_email_label.add(new String(" Email: "));
m_a_email_label.add(new String(" Work Email: "));
m_a_email_value.add(new String(c.GetEmail()));
m_a_email_value.add(new String(c.GetWorkemail()));
m_phone_label = new JLabel(m_a_phone_label.get(m_phone_idx));
m_phone_value = new JLabel(m_a_phone_value.get(m_phone_idx));
m_email_label = new JLabel(m_a_email_label.get(m_email_idx));
m_email_value = new JLabel(m_a_email_value.get(m_email_idx));
//m_add_button = new JButton("Add");
m_edit_button = new JButton("Edit");
m_delete_button = new JButton("Delete");
m_phone_left.addActionListener(this);
m_phone_right.addActionListener(this);
m_email_left.addActionListener(this);
m_email_right.addActionListener(this);
//m_edit_button.setBorder(null);
m_edit_button.setIcon(new ImageIcon(getClass().getResource("/images/edit_20.png")));
//m_delete_button.setBorder(null);
m_delete_button.setIcon(new ImageIcon(getClass().getResource("/images/delete_20.png")));
m_edit_button.addActionListener(this);
m_delete_button.addActionListener(this);
m_name_label.setFont(new FontUIResource("Arial", Font.PLAIN, 14));
m_dob_label.setFont(new FontUIResource("Arial", Font.ITALIC, 10));
m_phone_left.setMargin(new Insets(0, 0, 0, 0));
m_phone_right.setMargin(new Insets(0, 0, 0, 0));
m_email_left.setMargin(new Insets(0, 0, 0, 0));
m_email_right.setMargin(new Insets(0, 0, 0, 0));
m_name_field = new JTextField(5);
m_dob_field = new JDateChooser();
m_dob_field.setPreferredSize(new Dimension(100, 30));
m_website_field = new JTextField(5);
m_landphone_field = new JTextField(5);
m_mobilephone_field = new JTextField(5);
m_workphone_field = new JTextField(5);
m_email_field = new JTextField(5);
m_workemail_field = new JTextField(5);
m_mode = ContactPanel.VIEW_MODE;
renderView();
}Example 83
| Project: flamingo-master File: FlamingoUtilities.java View source code |
/**
* Gets the component font.
*
* @param comp
* Component.
* @param keys
* {@link UIManager} keys.
* @return If the component is not <code>null</code>, its font is returned.
* Otherwise the first entry in {@link UIManager} which is a
* {@link Font} is returned.
*/
public static FontUIResource getFont(Component comp, String... keys) {
if (comp != null) {
Font compFont = comp.getFont();
if ((compFont != null) && !(compFont instanceof UIResource)) {
return new FontUIResource(compFont);
}
}
for (String key : keys) {
Font font = UIManager.getFont(key);
if (font != null) {
if (font instanceof UIResource)
return (FontUIResource) font;
else
return new FontUIResource(font);
}
}
return null;
}Example 84
| Project: ganttproject-master File: UIFacadeImpl.java View source code |
private void updateFonts() {
if (myOriginalFonts.isEmpty()) {
UIDefaults defaults = UIManager.getDefaults();
for (Enumeration<Object> keys = defaults.keys(); keys.hasMoreElements(); ) {
String key = String.valueOf(keys.nextElement());
Object obj = UIManager.get(key);
if (obj instanceof Font) {
Font f = (Font) obj;
myOriginalFonts.put(key, f);
}
}
}
FontSpec currentSpec = myAppFontOption.getValue();
float dpiScale = myDpiOption.getValue().floatValue() / DEFAULT_DPI;
if (currentSpec != null && (!currentSpec.equals(myLastFontSpec) || dpiScale != myLastScale)) {
for (Map.Entry<String, Font> font : myOriginalFonts.entrySet()) {
float newSize = (font.getValue().getSize() * currentSpec.getSize().getFactor() * dpiScale);
Font newFont;
if (Strings.isNullOrEmpty(currentSpec.getFamily())) {
newFont = font.getValue().deriveFont(newSize);
} else {
newFont = new FontUIResource(currentSpec.getFamily(), font.getValue().getStyle(), (int) newSize);
}
UIManager.put(font.getKey(), newFont);
}
myLastFontSpec = currentSpec;
myLastScale = dpiScale;
}
}Example 85
| Project: HueImmersive-master File: UserInterface.java View source code |
private // set style - Required to look identical on each platform
void setLookAndFeel() {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
UIManager.put("Label.font", new FontUIResource("Tahoma", Font.PLAIN, 11));
UIManager.put("Button.font", new FontUIResource("Tahoma", Font.PLAIN, 11));
UIManager.put("MenuBar.font", new FontUIResource("Segoe UI", Font.PLAIN, 12));
UIManager.put("MenuItem.font", new FontUIResource("Segoe UI", Font.PLAIN, 12));
UIManager.put("Panel.font", new FontUIResource("Tahoma", Font.PLAIN, 11));
UIManager.put("ToggleButton.font", new FontUIResource("Tahoma", Font.PLAIN, 11));
UIManager.put("RadioButton.font", new FontUIResource("Tahoma", Font.PLAIN, 11));
UIManager.put("CheckBox.font", new FontUIResource("Tahoma", Font.PLAIN, 11));
UIManager.put("ColorChooser.font", new FontUIResource("Dialog.plain", Font.PLAIN, 12));
UIManager.put("ComboBox.font", new FontUIResource("Tahoma", Font.PLAIN, 11));
UIManager.put("List.font", new FontUIResource("Tahoma", Font.PLAIN, 11));
UIManager.put("RadioButtonMenuItem.font", new FontUIResource("Segoe UI", Font.PLAIN, 12));
UIManager.put("CheckBoxMenuItem.font", new FontUIResource("Segoe UI", Font.PLAIN, 12));
UIManager.put("Menu.font", new FontUIResource("Segoe UI", Font.PLAIN, 12));
UIManager.put("PopupMenu.font", new FontUIResource("Segoe UI", Font.PLAIN, 12));
UIManager.put("OptionPane.font", new FontUIResource("Segoe UI", Font.PLAIN, 12));
UIManager.put("ProgressBar.font", new FontUIResource("Tahoma", Font.PLAIN, 11));
UIManager.put("ScrollPane.font", new FontUIResource("Tahoma", Font.PLAIN, 11));
UIManager.put("Viewport.font", new FontUIResource("Tahoma", Font.PLAIN, 11));
UIManager.put("TabbedPane.font", new FontUIResource("Tahoma", Font.PLAIN, 11));
UIManager.put("Table.font", new FontUIResource("Tahoma", Font.PLAIN, 11));
UIManager.put("TableHeader.font", new FontUIResource("Tahoma", Font.PLAIN, 11));
UIManager.put("TextField.font", new FontUIResource("Tahoma", Font.PLAIN, 11));
UIManager.put("PasswordField.font", new FontUIResource("Tahoma", Font.PLAIN, 11));
UIManager.put("TextArea.font", new FontUIResource("Monospaced.plain", Font.PLAIN, 13));
UIManager.put("TextPane.font", new FontUIResource("Tahoma", Font.PLAIN, 11));
UIManager.put("EditorPane.font", new FontUIResource("Tahoma", Font.PLAIN, 11));
UIManager.put("TitledBorder.font", new FontUIResource("Tahoma", Font.PLAIN, 11));
UIManager.put("ToolBar.font", new FontUIResource("Segoe UI", Font.PLAIN, 12));
UIManager.put("ToolTip.font", new FontUIResource("Segoe UI", Font.PLAIN, 12));
UIManager.put("Tree.font", new FontUIResource("Tahoma", Font.PLAIN, 11));
} catch (Exception e) {
Debug.exception(e);
}
}Example 86
| Project: josm-master File: GuiHelper.java View source code |
/**
* Sets a global font for all UI, replacing default font of current look and feel.
* @param name Font name. It is up to the caller to make sure the font exists
* @throws IllegalArgumentException if name is null
* @since 7896
*/
public static void setUIFont(String name) {
CheckParameterUtil.ensureParameterNotNull(name, "name");
Main.info("Setting " + name + " as the default UI font");
Enumeration<?> keys = UIManager.getDefaults().keys();
while (keys.hasMoreElements()) {
Object key = keys.nextElement();
Object value = UIManager.get(key);
if (value instanceof FontUIResource) {
FontUIResource fui = (FontUIResource) value;
UIManager.put(key, new FontUIResource(name, fui.getStyle(), fui.getSize()));
}
}
}Example 87
| Project: lcmc-master File: Application.java View source code |
/**
* Resize all fonts. Must be called before GUI is started.
* @param scale in percent 100% - is the same size.
*/
public void resizeFonts(int scale) {
if (scale == 100) {
return;
}
if (scale < 5) {
scale = 5;
}
if (scale > 10000) {
scale = 10000;
}
for (final Enumeration<Object> e = UIManager.getDefaults().keys(); e.hasMoreElements(); ) {
final Object key = e.nextElement();
final Object value = UIManager.get(key);
if (value instanceof Font) {
final Font f = (Font) value;
UIManager.put(key, new FontUIResource(f.getName(), f.getStyle(), scaled(f.getSize())));
}
}
}Example 88
| Project: org.openscada.external-master File: LookAndFeelHandler.java View source code |
/**
* Changes the currently active Swing look&feel to use the given font
* as primary font for everything.
* @param awtFont A font.
*/
protected void updateLookAndFeelFonts(final java.awt.Font awtFont) {
assert awtFont != null;
// On AWT event thread
assert EventQueue.isDispatchThread();
// The FontUIResource class marks the font as replaceable by the look and feel
// implementation if font settings are later changed.
final FontUIResource fontResource = new FontUIResource(awtFont);
// Assign the new font to the relevant L&F font properties. These are
// the properties that are initially assigned to the system font
// under the Windows look and feel.
// TODO: It's possible that other platforms will need other assignments.
// TODO: This does not handle fonts other than the "system" font.
// TODO: Swing does not render the Vista default Segoe UI font well.
// Other fonts may change, and the Swing L&F may not be adjusting.
//$NON-NLS-1$
UIManager.put("Button.font", fontResource);
//$NON-NLS-1$
UIManager.put("CheckBox.font", fontResource);
//$NON-NLS-1$
UIManager.put("ComboBox.font", fontResource);
//$NON-NLS-1$
UIManager.put("EditorPane.font", fontResource);
//$NON-NLS-1$
UIManager.put("Label.font", fontResource);
//$NON-NLS-1$
UIManager.put("List.font", fontResource);
//$NON-NLS-1$
UIManager.put("Panel.font", fontResource);
//$NON-NLS-1$
UIManager.put("ProgressBar.font", fontResource);
//$NON-NLS-1$
UIManager.put("RadioButton.font", fontResource);
//$NON-NLS-1$
UIManager.put("ScrollPane.font", fontResource);
//$NON-NLS-1$
UIManager.put("TabbedPane.font", fontResource);
//$NON-NLS-1$
UIManager.put("Table.font", fontResource);
//$NON-NLS-1$
UIManager.put("TableHeader.font", fontResource);
//$NON-NLS-1$
UIManager.put("TextField.font", fontResource);
//$NON-NLS-1$
UIManager.put("TextPane.font", fontResource);
//$NON-NLS-1$
UIManager.put("TitledBorder.font", fontResource);
//$NON-NLS-1$
UIManager.put("ToggleButton.font", fontResource);
//$NON-NLS-1$
UIManager.put("TreeFont.font", fontResource);
//$NON-NLS-1$
UIManager.put("ViewportFont.font", fontResource);
}Example 89
| Project: tigervnc-master File: VncViewer.java View source code |
public static void setLookAndFeel() {
try {
if (os.startsWith("mac os x")) {
Class appClass = Class.forName("com.apple.eawt.Application");
Method getApplication = appClass.getMethod("getApplication", (Class[]) null);
Object app = getApplication.invoke(appClass);
Class paramTypes[] = new Class[1];
paramTypes[0] = Image.class;
Method setDockIconImage = appClass.getMethod("setDockIconImage", paramTypes);
setDockIconImage.invoke(app, VncViewer.logoImage);
}
// Use Nimbus LookAndFeel if it's available, otherwise fallback
// to the native laf, or Metal if no native laf is available.
String laf = System.getProperty("swing.defaultlaf");
if (laf == null) {
LookAndFeelInfo[] installedLafs = UIManager.getInstalledLookAndFeels();
for (int i = 0; i < installedLafs.length; i++) {
if (installedLafs[i].getName().equals("Nimbus"))
laf = installedLafs[i].getClassName();
}
if (laf == null)
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}
UIManager.setLookAndFeel(laf);
if (UIManager.getLookAndFeel().getName().equals("Metal")) {
UIManager.put("swing.boldMetal", Boolean.FALSE);
Enumeration<Object> keys = UIManager.getDefaults().keys();
while (keys.hasMoreElements()) {
Object key = keys.nextElement();
Object value = UIManager.get(key);
if (value instanceof FontUIResource) {
String name = ((FontUIResource) value).getName();
int style = ((FontUIResource) value).getStyle();
int size = ((FontUIResource) value).getSize() - 1;
FontUIResource f = new FontUIResource(name, style, size);
UIManager.put(key, f);
}
}
} else if (UIManager.getLookAndFeel().getName().equals("Nimbus")) {
Font f = UIManager.getFont("TitledBorder.font");
String name = f.getName();
int style = f.getStyle();
int size = f.getSize() - 2;
FontUIResource r = new FontUIResource(name, style, size);
UIManager.put("TitledBorder.font", r);
}
} catch (java.lang.Exception e) {
vlog.info(e.toString());
}
}Example 90
| Project: WaarpXmlEditor-master File: XAmple.java View source code |
static void assignDefaultFont() {
Properties props = new Properties();
InputStream in = null;
String fontName = null;
int fontSize = 12;
try {
File file = new File(FILE_GUI);
if (!file.exists())
return;
in = new FileInputStream(file);
props.load(in);
fontName = props.getProperty(FONT_NAME);
if (fontName == null || fontName.length() == 0)
return;
try {
fontSize = Integer.parseInt(props.getProperty(FONT_SIZE, "12"));
} catch (Exception ignore) {
}
} catch (Exception ex) {
ex.printStackTrace();
return;
} finally {
try {
in.close();
} catch (Exception ignore) {
}
}
Font font = new Font(fontName, Font.PLAIN, fontSize);
Enumeration keys = UIManager.getDefaults().keys();
while (keys.hasMoreElements()) {
Object key = keys.nextElement();
Object value = UIManager.get(key);
if (value instanceof javax.swing.plaf.FontUIResource)
UIManager.put(key, font);
}
}Example 91
| Project: all-inhonmodman-master File: ManagerCtrl.java View source code |
private void initViewComponents(ManagerGUI view) {
try {
changeFonts(new FontUIResource("Dialog", Font.PLAIN, 14));
} catch (Exception e) {
logger.warn("Font 'Dialog' doesn't exist in system fonts.");
}
// Set up last window position
if (model.getGuiRectangle() != null) {
view.setBounds(model.getGuiRectangle());
}
// Load last column order and widths for details view
DetailsView detailsView = (DetailsView) view.getModsTable().getView(ModsTable.ViewType.DETAILS);
if (detailsView != null && model.getColumnsOrder() != null && !model.getColumnsOrder().isEmpty()) {
detailsView.deserializeColumnOrder(model.getColumnsOrder());
}
if (detailsView != null && model.getColumnsWidth() != null) {
int i = 0;
Iterator<Integer> it = model.getColumnsWidth().iterator();
while (it.hasNext()) {
int width = it.next();
detailsView.setColumnWidth(i, width);
++i;
}
}
// Update table
view.getModsTable().getCurrentView().getComponent().repaint();
// Add listeners to view components
view.buttonAddModAddActionListener(new AddModListener());
view.buttonEnableModAddActionListener(new EnableModListener());
view.popupMenuItemEnableDisableModAddActionListener(new EnableModListener());
view.itemApplyModsAddActionListener(new ApplyModsListener());
view.itemApplyAndLaunchAddActionListener(new ApplyAndLaunchListener());
view.itemUnapplyAllModsAddActionListener(new UnapplyAllModsListener());
view.itemOpenModFolderAddActionListener(new OpenModFolderListener());
view.itemVisitForumThreadAddActionListener(new VisitForumThreadListener());
// ----- DetailsView bug Disable ------
view.itemViewDetailsAddActionListener(new ViewChangeListener(ModsTable.ViewType.DETAILS));
view.itemViewIconsAddActionListener(new ViewChangeListener(ModsTable.ViewType.ICONS));
view.itemViewTilesAddActionListener(new ViewChangeListener(ModsTable.ViewType.TILES));
view.itemViewDetailedIconsAddActionListener(new ViewChangeListener(ModsTable.ViewType.DETAILED_ICONS));
view.itemUseSmallIconsAddActionListener(new SmallIconsListener());
view.itemExportOverviewAddActionListener(new ExportOverviewListener());
view.itemExitAddActionListener(new ExitListener());
view.buttonVisitWebsiteAddActionListener(new VisitWebsiteListener());
view.popupMenuItemVisitWebsiteAddActionListener(new VisitWebsiteListener());
view.buttonApplyLafAddActionListener(new ApplyLafListener());
view.buttonApplyLanguageAddActionListener(new ApplyLanguageListener());
view.buttonOkAddActionListener(new PrefsOkListener());
view.buttonCancelAddActionListener(new PrefsCancelListener());
view.buttonHonFolderAddActionListener(new ChooseFolderHonListener());
view.buttonDevelopingModAddActionListener(new ChooseFolderDevelopingModListener());
view.buttonUpdateModActionListener(new UpdateModListener());
view.popupMenuItemUpdateModAddActionListener(new UpdateModListener());
view.buttonModsFolderAddActionListener(new ChooseFolderModsListener());
view.itemDownloadModUpdates(new DownloadModUpdatesListener());
// DetailsView bug Disable
if (detailsView != null) {
((JTable) detailsView.getComponent()).getColumnModel().addColumnModelListener(new Columns2Listener());
}
view.addComponentListener(new ComponentEventListener());
view.getItemRefreshManager().addActionListener(new RefreshManagerListener());
view.getButtonViewChagelog().addActionListener(new ButtonViewModChangelogListener());
view.popupMenuItemViewChangelogAddActionListener(new ButtonViewModChangelogListener());
view.popupItemMenuDeleteModAddActionListener(new DeleteModListener());
view.getButtonViewModDetails().addActionListener(new ButtonViewModChangelogListener());
view.getButtonLaunchHon().addActionListener(new ApplyAndLaunchListener());
view.itemImportFromOldModManagerAddActionListener(new ImportModsFromOldModManager());
view.getModsTable().addKeyListener(new ModTableKeyListener());
// Add file drop functionality
new FileDrop(view, new DropListener());
// Load the user's chosen view
if (model.getViewType().equals(ManagerOptions.ViewType.DETAILED_ICONS)) {
view.getItemViewDetailedIcons().doClick();
} else if (model.getViewType().equals(ManagerOptions.ViewType.DETAILS)) {
// Little hack for the L10n bug while developing
try {
view.getItemViewDetails().doClick();
} catch (NullPointerException e) {
view.getItemViewIcons().doClick();
}
} else if (model.getViewType().equals(ManagerOptions.ViewType.ICONS)) {
view.getItemViewIcons().doClick();
} else if (model.getViewType().equals(ManagerOptions.ViewType.TILES)) {
view.getItemViewTiles().doClick();
}
// Load the user's small icons preference.
if (model.usingSmallIcons()) {
view.getItemUseSmallIcons().doClick();
}
try {
view.setStatusMessage("<html><font color=#009900>" + (model.getAppliedMods().size()) + "</font>/<font color=#0033cc>" + (model.getMods().size()) + "</font> " + L10n.getString("status.modsenabled") + " - Version: " + Game.getInstance().getVersion() + "</html>", false);
} catch (Exception ex) {
view.setStatusMessage("<html><font color=#009900>" + (model.getAppliedMods().size()) + "</font>/<font color=#0033cc>" + (model.getMods().size()) + "</font> " + L10n.getString("status.modsenabled") + "</html>", false);
}
}Example 92
| Project: AliView-master File: AliView.java View source code |
public static void setUIFontSize(float newSize) {
Enumeration<Object> keys = UIManager.getLookAndFeelDefaults().keys();
while (keys.hasMoreElements()) {
Object key = keys.nextElement();
Object value = UIManager.get(key);
if (value != null && value instanceof Font) {
// logger.info(key + " " + value);
Font derivFont = ((Font) value).deriveFont(newSize);
FontUIResource fontRes = new FontUIResource(derivFont);
// logger.info(key + " " + fontRes);
UIManager.getLookAndFeelDefaults().put(key, fontRes);
}
}
}Example 93
| Project: atlasframework-master File: BasicMapLayerLegendPaneUI.java View source code |
/** * Gets current title height. Default value is 25 if not specified * otherwise. Method checks provided component for user set font * (!instanceof FontUIResource), if font is set, height will be calculated * from font metrics instead of using internal preset height. * * @return Current title height. */ protected int getTitleHeight(Component c) { if (c instanceof JXTaskPane) { JXTaskPane taskPane = (JXTaskPane) c; Font font = taskPane.getFont(); int height = titleHeight; if (font != null && !(font instanceof FontUIResource)) { height = taskPane.getFontMetrics(font).getHeight(); } Icon icon = taskPane.getIcon(); if (icon != null) { height = Math.max(height, icon.getIconHeight() + 4); } return height; } return titleHeight; }
Example 94
| Project: batik-master File: Main.java View source code |
public int handleOption(int i) {
int size = Integer.parseInt(arguments[++i]);
Font font = new Font("Dialog", Font.PLAIN, size);
FontUIResource fontRes = new FontUIResource(font);
UIManager.put("CheckBox.font", fontRes);
UIManager.put("PopupMenu.font", fontRes);
UIManager.put("TextPane.font", fontRes);
UIManager.put("MenuItem.font", fontRes);
UIManager.put("ComboBox.font", fontRes);
UIManager.put("Button.font", fontRes);
UIManager.put("Tree.font", fontRes);
UIManager.put("ScrollPane.font", fontRes);
UIManager.put("TabbedPane.font", fontRes);
UIManager.put("EditorPane.font", fontRes);
UIManager.put("TitledBorder.font", fontRes);
UIManager.put("Menu.font", fontRes);
UIManager.put("TextArea.font", fontRes);
UIManager.put("OptionPane.font", fontRes);
UIManager.put("DesktopIcon.font", fontRes);
UIManager.put("MenuBar.font", fontRes);
UIManager.put("ToolBar.font", fontRes);
UIManager.put("RadioButton.font", fontRes);
UIManager.put("RadioButtonMenuItem.font", fontRes);
UIManager.put("ToggleButton.font", fontRes);
UIManager.put("ToolTip.font", fontRes);
UIManager.put("ProgressBar.font", fontRes);
UIManager.put("TableHeader.font", fontRes);
UIManager.put("Panel.font", fontRes);
UIManager.put("List.font", fontRes);
UIManager.put("ColorChooser.font", fontRes);
UIManager.put("PasswordField.font", fontRes);
UIManager.put("TextField.font", fontRes);
UIManager.put("Table.font", fontRes);
UIManager.put("Label.font", fontRes);
UIManager.put("InternalFrameTitlePane.font", fontRes);
UIManager.put("CheckBoxMenuItem.font", fontRes);
return i;
}Example 95
| Project: DTAPlot-master File: DTAPlot.java View source code |
public static void initializeFontSize(int scale) {
float multiplier = scale / 100.0f;
UIDefaults defaults = UIManager.getDefaults();
int i = 0;
for (Enumeration e = defaults.keys(); e.hasMoreElements(); i++) {
Object key = e.nextElement();
Object value = defaults.get(key);
if (value instanceof Font) {
Font font = (Font) value;
int newSize = Math.round(font.getSize() * multiplier);
if (value instanceof FontUIResource) {
UIManager.put(key, new FontUIResource(font.getName(), font.getStyle(), newSize));
} else {
UIManager.put(key, new Font(font.getName(), font.getStyle(), newSize));
}
}
}
}Example 96
| Project: jabref-2.9.2-master File: JabRef.java View source code |
private void setLookAndFeel() {
try {
String systemLnF;
// * Fallback to the System Look & Fell
if (Globals.prefs.getBoolean("useDefaultLookAndFeel")) {
systemLnF = UIManager.getSystemLookAndFeelClassName();
} else {
systemLnF = Globals.prefs.get("lookAndFeel");
}
// At all cost, avoid ending up with the Metal look and feel:
if (systemLnF.equals("javax.swing.plaf.metal.MetalLookAndFeel")) {
Plastic3DLookAndFeel lnf = new Plastic3DLookAndFeel();
Plastic3DLookAndFeel.setCurrentTheme(new SkyBluer());
com.jgoodies.looks.Options.setPopupDropShadowEnabled(true);
UIManager.setLookAndFeel(lnf);
} else {
UIManager.setLookAndFeel(systemLnF);
}
} catch (Exception e) {
e.printStackTrace();
}
// In JabRef v2.8, we did it only on NON-Mac. Now, we try on all platforms
boolean overrideDefaultFonts = Globals.prefs.getBoolean("overrideDefaultFonts");
if (overrideDefaultFonts) {
int fontSize = Globals.prefs.getInt("menuFontSize");
UIDefaults defaults = UIManager.getDefaults();
Enumeration<Object> keys = defaults.keys();
Double zoomLevel = null;
while (keys.hasMoreElements()) {
Object key = keys.nextElement();
if ((key instanceof String) && (((String) key).endsWith(".font"))) {
FontUIResource font = (FontUIResource) UIManager.get(key);
if (zoomLevel == null) {
// zoomLevel not yet set, calculate it based on the first found font
zoomLevel = new Double(fontSize) / new Double(font.getSize());
}
font = new FontUIResource(font.getName(), font.getStyle(), fontSize);
defaults.put(key, font);
}
}
if (zoomLevel != null) {
GUIGlobals.zoomLevel = zoomLevel;
}
}
}Example 97
| Project: jpexs-decompiler-master File: View.java View source code |
/**
* Sets windows Look and Feel
*/
public static void setLookAndFeel() {
// Save default font for Chinese characters
final Font defaultFont = (new JLabel()).getFont();
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (UnsupportedLookAndFeelExceptionClassNotFoundException | InstantiationException | IllegalAccessException | ignored) {
}
try {
LookAndFeel oldLookAndFeel = UIManager.getLookAndFeel();
if (!(oldLookAndFeel instanceof SubstanceOfficeBlue2007LookAndFeel)) {
UIManager.setLookAndFeel(new SubstanceOfficeBlue2007LookAndFeel());
oldLookAndFeel.uninitialize();
}
SubstanceSkin currentSkin = SubstanceLookAndFeel.getCurrentSkin();
if (currentSkin != null) {
String currentSkinName = currentSkin.getClass().getName();
String newSkinName = Configuration.guiSkin.get();
if (!currentSkinName.equals(newSkinName)) {
SubstanceLookAndFeel.setSkin(newSkinName);
}
} else {
Logger.getLogger(View.class.getName()).log(Level.SEVERE, "Current skin is null");
SubstanceLookAndFeel.setSkin("com.jpexs.decompiler.flash.gui.OceanicSkin");
}
//This works for not changing labels color and not changing Dialogs title
UIManager.put(SubstanceLookAndFeel.COLORIZATION_FACTOR, 0.999);
UIManager.put("Tree.expandedIcon", getIcon("expand16"));
UIManager.put("Tree.collapsedIcon", getIcon("collapse16"));
UIManager.put("ColorChooserUI", BasicColorChooserUI.class.getName());
UIManager.put("ColorChooser.swatchesRecentSwatchSize", new Dimension(20, 20));
UIManager.put("ColorChooser.swatchesSwatchSize", new Dimension(20, 20));
UIManager.put("RibbonApplicationMenuPopupPanelUI", MyRibbonApplicationMenuPopupPanelUI.class.getName());
UIManager.put("RibbonApplicationMenuButtonUI", MyRibbonApplicationMenuButtonUI.class.getName());
UIManager.put("ProgressBarUI", MyProgressBarUI.class.getName());
UIManager.put("TextField.background", Color.white);
UIManager.put("FormattedTextField.background", Color.white);
UIManager.put("CommandButtonUI", MyCommandButtonUI.class.getName());
if (defaultFontPolicy == null) {
defaultFontPolicy = SubstanceLookAndFeel.getFontPolicy();
}
FontPolicy pol = defaultFontPolicy;
final FontSet fs = pol.getFontSet("Substance", null);
double fontSizeMultiplier = Configuration.guiFontSizeMultiplier.get();
// Restore default font for chinese characters
SubstanceLookAndFeel.setFontPolicy(new FontPolicy() {
private final FontSet fontSet = new FontSet() {
private FontUIResource controlFont;
private FontUIResource menuFont;
private FontUIResource titleFont;
private FontUIResource windowTitleFont;
private FontUIResource smallFont;
private FontUIResource messageFont;
private int getFontSize(int defaultFontSize) {
return (int) (defaultFontSize * fontSizeMultiplier);
}
@Override
public FontUIResource getControlFont() {
if (controlFont == null) {
FontUIResource f = fs.getControlFont();
controlFont = new FontUIResource(defaultFont.getName(), f.getStyle(), getFontSize(f.getSize()));
}
return controlFont;
}
@Override
public FontUIResource getMenuFont() {
if (menuFont == null) {
FontUIResource f = fs.getMenuFont();
menuFont = new FontUIResource(defaultFont.getName(), f.getStyle(), getFontSize(f.getSize()));
}
return menuFont;
}
@Override
public FontUIResource getTitleFont() {
if (titleFont == null) {
FontUIResource f = fs.getTitleFont();
titleFont = new FontUIResource(defaultFont.getName(), f.getStyle(), getFontSize(f.getSize()));
}
return titleFont;
}
@Override
public FontUIResource getWindowTitleFont() {
if (windowTitleFont == null) {
FontUIResource f = fs.getWindowTitleFont();
windowTitleFont = new FontUIResource(defaultFont.getName(), f.getStyle(), getFontSize(f.getSize()));
}
return windowTitleFont;
}
@Override
public FontUIResource getSmallFont() {
if (smallFont == null) {
FontUIResource f = fs.getSmallFont();
smallFont = new FontUIResource(defaultFont.getName(), f.getStyle(), getFontSize(f.getSize()));
}
return smallFont;
}
@Override
public FontUIResource getMessageFont() {
if (messageFont == null) {
FontUIResource f = fs.getMessageFont();
messageFont = new FontUIResource(defaultFont.getName(), f.getStyle(), getFontSize(f.getSize()));
}
return messageFont;
}
};
@Override
public FontSet getFontSet(String string, UIDefaults uid) {
return fontSet;
}
});
} catch (UnsupportedLookAndFeelException ex) {
Logger.getLogger(View.class.getName()).log(Level.SEVERE, null, ex);
}
UIManager.put(SubstanceLookAndFeel.TABBED_PANE_CONTENT_BORDER_KIND, SubstanceConstants.TabContentPaneBorderKind.SINGLE_FULL);
JFrame.setDefaultLookAndFeelDecorated(true);
JDialog.setDefaultLookAndFeelDecorated(true);
}Example 98
| Project: Triana-master File: ApplicationFrame.java View source code |
/**
* Initialise the application
*/
public static ApplicationFrame initTriana(String args[]) {
// todo: this is crap, use andrew's UI stuff
// Andrew Sept 2010: Done - 6 years on... :-)
UIDefaults uiDefaults = UIManager.getDefaults();
Object font = ((FontUIResource) uiDefaults.get("TextArea.font")).deriveFont((float) 11);
Enumeration enumeration = uiDefaults.keys();
while (enumeration.hasMoreElements()) {
Object key = enumeration.nextElement();
if (key.toString().endsWith("font")) {
uiDefaults.put(key, font);
}
}
String myOSName = Locations.os();
if (myOSName.equals("windows")) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {
}
} else {
if (!myOSName.equals("osx")) {
try {
MetalLookAndFeel.setCurrentTheme(new OceanTheme());
UIManager.setLookAndFeel(new MetalLookAndFeel());
} catch (Exception e) {
}
}
}
ApplicationFrame app = new ApplicationFrame("Triana");
app.init(args);
return app;
}Example 99
| Project: vroom-master File: NovoaRun.java View source code |
private static void setupFonts(float size) {
// UIManager.put("TextField.font", new FontUIResource("Arial", Font.PLAIN, 17));
UIDefaults defaults = UIManager.getDefaults();
Enumeration<?> keys = defaults.keys();
while (keys.hasMoreElements()) {
Object key = keys.nextElement();
Object value = defaults.get(key);
if (value != null && value instanceof Font) {
UIManager.put(key, null);
Font font = UIManager.getFont(key);
if (font != null) {
UIManager.put(key, new FontUIResource(font.deriveFont(size)));
}
System.out.println(key);
}
}
}Example 100
| Project: haskell-java-parser-master File: BasicLookAndFeel.java View source code |
/**
* initComponentDefaults
* @param defaults TODO
*/
protected void initComponentDefaults(UIDefaults defaults) {
Object[] uiDefaults;
// The default Look and Feel happens to use these three purple shades
// extensively.
Color lightPurple = new Color(0xCC, 0xCC, 0xFF);
Color midPurple = new Color(0x99, 0x99, 0xCC);
Color darkPurple = new Color(0x66, 0x66, 0x99);
uiDefaults = new Object[] { "AbstractUndoableEdit.undoText", "Undo", "AbstractUndoableEdit.redoText", "Redo", "Button.background", new ColorUIResource(Color.lightGray), "Button.border", BorderUIResource.getEtchedBorderUIResource(), "Button.darkShadow", new ColorUIResource(Color.darkGray), "Button.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), "Button.focus", midPurple, "Button.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Button.foreground", new ColorUIResource(Color.black), "Button.highlight", new ColorUIResource(Color.white), "Button.light", new ColorUIResource(Color.lightGray.brighter()), "Button.margin", new InsetsUIResource(2, 14, 2, 14), "Button.shadow", new ColorUIResource(Color.gray), "Button.textIconGap", new Integer(4), "Button.textShiftOffset", new Integer(0), "CheckBox.background", new ColorUIResource(Color.lightGray), "CheckBox.border", new BorderUIResource.CompoundBorderUIResource(null, null), "CheckBox.darkShadow", new ColorUIResource(Color.darkGray), "CheckBox.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), "CheckBox.font", new FontUIResource("Dialog", Font.PLAIN, 12), "CheckBox.foreground", new ColorUIResource(Color.black), "CheckBox.highlight", new ColorUIResource(Color.white), "CheckBox.icon", BasicIconFactory.getCheckBoxIcon(), "CheckBox.light", new ColorUIResource(Color.lightGray.brighter()), "CheckBox.margin", new InsetsUIResource(2, 2, 2, 2), "CheckBox.shadow", new ColorUIResource(Color.gray), "CheckBox.textIconGap", new Integer(4), "CheckBox.textShiftOffset", new Integer(0), "CheckBoxMenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12), "CheckBoxMenuItem.acceleratorForeground", new ColorUIResource(Color.black), "CheckBoxMenuItem.acceleratorSelectionForeground", new ColorUIResource(Color.white), "CheckBoxMenuItem.arrowIcon", BasicIconFactory.getMenuItemArrowIcon(), "CheckBoxMenuItem.background", new ColorUIResource(Color.lightGray), "CheckBoxMenuItem.border", new BasicBorders.MarginBorder(), "CheckBoxMenuItem.borderPainted", Boolean.FALSE, "CheckBoxMenuItem.checkIcon", BasicIconFactory.getCheckBoxMenuItemIcon(), "CheckBoxMenuItem.font", new FontUIResource("Dialog", Font.PLAIN, 12), "CheckBoxMenuItem.foreground", new ColorUIResource(Color.black), "CheckBoxMenuItem.margin", new InsetsUIResource(2, 2, 2, 2), "CheckBoxMenuItem.selectionBackground", new ColorUIResource(lightPurple), "CheckBoxMenuItem.selectionForeground", new ColorUIResource(Color.black), "ColorChooser.background", new ColorUIResource(Color.lightGray), "ColorChooser.cancelText", "Cancel", "ColorChooser.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ColorChooser.foreground", new ColorUIResource(Color.black), "ColorChooser.hsbBlueText", "B", "ColorChooser.hsbBrightnessText", "B", "ColorChooser.hsbGreenText", "G", "ColorChooser.hsbHueText", "H", "ColorChooser.hsbNameText", "HSB", "ColorChooser.hsbRedText", "R", "ColorChooser.hsbSaturationText", "S", "ColorChooser.okText", "OK", "ColorChooser.previewText", "Preview", "ColorChooser.resetText", "Reset", "ColorChooser.rgbBlueMnemonic", new Integer(66), "ColorChooser.rgbBlueText", "Blue", "ColorChooser.rgbGreenMnemonic", new Integer(71), "ColorChooser.rgbGreenText", "Green", "ColorChooser.rgbNameText", "RGB", "ColorChooser.rgbRedMnemonic", new Integer(82), "ColorChooser.rgbRedText", "Red", "ColorChooser.sampleText", "Sample Text Sample Text", "ColorChooser.swatchesDefaultRecentColor", new ColorUIResource(Color.lightGray), "ColorChooser.swatchesNameText", "Swatches", "ColorChooser.swatchesRecentSwatchSize", new Dimension(10, 10), "ColorChooser.swatchesRecentText", "Recent:", "ColorChooser.swatchesSwatchSize", new Dimension(10, 10), "ComboBox.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "hidePopup", "PAGE_UP", "pageUpPassThrough", "PAGE_DOWN", "pageDownPassThrough", "HOME", "homePassThrough", "END", "endPassThrough" }), "ComboBox.background", new ColorUIResource(Color.white), "ComboBox.disabledBackground", new ColorUIResource(Color.lightGray), "ComboBox.disabledForeground", new ColorUIResource(Color.gray), "ComboBox.font", new FontUIResource("SansSerif", Font.PLAIN, 12), "ComboBox.foreground", new ColorUIResource(Color.black), "ComboBox.selectionBackground", new ColorUIResource(lightPurple), "ComboBox.selectionForeground", new ColorUIResource(Color.black), "Desktop.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "KP_LEFT", "left", "KP_RIGHT", "right", "ctrl F5", "restore", "LEFT", "left", "ctrl alt F6", "selectNextFrame", "UP", "up", "ctrl F6", "selectNextFrame", "RIGHT", "right", "DOWN", "down", "ctrl F7", "move", "ctrl F8", "resize", "ESCAPE", "escape", "ctrl TAB", "selectNextFrame", "ctrl F9", "minimize", "KP_UP", "up", "ctrl F4", "close", "KP_DOWN", "down", "ctrl F10", "maximize", "ctrl alt shift F6", "selectPreviousFrame" }), "Desktop.background", new ColorUIResource(175, 163, 236), "DesktopIcon.border", new BorderUIResource.CompoundBorderUIResource(null, null), "EditorPane.background", new ColorUIResource(Color.white), "EditorPane.border", new BasicBorders.MarginBorder(), "EditorPane.caretBlinkRate", new Integer(500), "EditorPane.caretForeground", new ColorUIResource(Color.red), "EditorPane.font", new FontUIResource("Serif", Font.PLAIN, 12), "EditorPane.foreground", new ColorUIResource(Color.black), "EditorPane.inactiveForeground", new ColorUIResource(Color.gray), "EditorPane.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), "caret-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), "caret-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0), "page-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0), "page-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "insert-break"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0), "insert-tab") }, "EditorPane.margin", new InsetsUIResource(3, 3, 3, 3), "EditorPane.selectionBackground", new ColorUIResource(Color.lightGray), "EditorPane.selectionForeground", new ColorUIResource(Color.white), "FileChooser.acceptAllFileFilterText", "All Files (*.*)", "FileChooser.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "cancelSelection" }), "FileChooser.cancelButtonMnemonic", new Integer(67), "FileChooser.cancelButtonText", "Cancel", "FileChooser.cancelButtonToolTipText", "Abort file chooser dialog", // XXX Don't use gif
"FileChooser.detailsViewIcon", new IconUIResource(new ImageIcon("icons/DetailsView.gif")), "FileChooser.directoryDescriptionText", "Directory", "FileChooser.fileDescriptionText", "Generic File", "FileChooser.helpButtonMnemonic", new Integer(72), "FileChooser.helpButtonText", "Help", "FileChooser.helpButtonToolTipText", "FileChooser help", // XXX Don't use gif
"FileChooser.homeFolderIcon", new IconUIResource(new ImageIcon("icons/HomeFolder.gif")), // XXX Don't use gif
"FileChooser.listViewIcon", new IconUIResource(new ImageIcon("icons/ListView.gif")), "FileChooser.newFolderErrorSeparator", ":", "FileChooser.newFolderErrorText", "Error creating new folder", // XXX Don't use gif
"FileChooser.newFolderIcon", new IconUIResource(new ImageIcon("icons/NewFolder.gif")), "FileChooser.openButtonMnemonic", new Integer(79), "FileChooser.openButtonText", "Open", "FileChooser.openButtonToolTipText", "Open selected file", "FileChooser.saveButtonMnemonic", new Integer(83), "FileChooser.saveButtonText", "Save", "FileChooser.saveButtonToolTipText", "Save selected file", // XXX Don't use gif
"FileChooser.upFolderIcon", new IconUIResource(new ImageIcon("icons/UpFolder.gif")), "FileChooser.updateButtonMnemonic", new Integer(85), "FileChooser.updateButtonText", "Update", "FileChooser.updateButtonToolTipText", "Update directory listing", // XXX Don't use gif
"FileView.computerIcon", new IconUIResource(new ImageIcon("icons/Computer.gif")), // XXX Don't use gif
"FileView.directoryIcon", new IconUIResource(new ImageIcon("icons/Directory.gif")), // XXX Don't use gif
"FileView.fileIcon", new IconUIResource(new ImageIcon("icons/File.gif")), // XXX Don't use gif
"FileView.floppyDriveIcon", new IconUIResource(new ImageIcon("icons/Floppy.gif")), // XXX Don't use gif
"FileView.hardDriveIcon", new IconUIResource(new ImageIcon("icons/HardDrive.gif")), "FocusManagerClassName", "TODO", "FormView.resetButtonText", "Reset", "FormView.submitButtonText", "Submit Query", "InternalFrame.activeTitleBackground", new ColorUIResource(162, 167, 241), "InternalFrame.activeTitleForeground", new ColorUIResource(Color.black), "InternalFrame.border", new BorderUIResource.CompoundBorderUIResource(null, null), "InternalFrame.closeIcon", BasicIconFactory.createEmptyFrameIcon(), // XXX Don't use gif
"InternalFrame.icon", new IconUIResource(new ImageIcon("icons/JavaCup.gif")), "InternalFrame.iconifyIcon", BasicIconFactory.createEmptyFrameIcon(), "InternalFrame.inactiveTitleBackground", new ColorUIResource(Color.lightGray), "InternalFrame.inactiveTitleForeground", new ColorUIResource(Color.black), "InternalFrame.maximizeIcon", BasicIconFactory.createEmptyFrameIcon(), "InternalFrame.minimizeIcon", BasicIconFactory.createEmptyFrameIcon(), "InternalFrame.titleFont", new FontUIResource("Dialog", Font.PLAIN, 12), "InternalFrame.windowBindings", new Object[] { "shift ESCAPE", "showSystemMenu", "ctrl SPACE", "showSystemMenu", "ESCAPE", "showSystemMenu" }, "Label.background", new ColorUIResource(Color.lightGray), "Label.disabledForeground", new ColorUIResource(Color.white), "Label.disabledShadow", new ColorUIResource(Color.gray), "Label.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Label.foreground", new ColorUIResource(Color.black), "List.background", new ColorUIResource(Color.white), "List.border", new BasicBorders.MarginBorder(), "List.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "PAGE_UP", "scrollUp", "ctrl \\", "clearSelection", "PAGE_DOWN", "scrollDown", "shift PAGE_DOWN", "scrollDownExtendSelection", "END", "selectLastRow", "HOME", "selectFirstRow", "shift END", "selectLastRowExtendSelection", "shift HOME", "selectFirstRowExtendSelection", "UP", "selectPreviousRow", "ctrl /", "selectAll", "ctrl A", "selectAll", "DOWN", "selectNextRow", "shift UP", "selectPreviousRowExtendSelection", "ctrl SPACE", "selectNextRowExtendSelection", "shift DOWN", "selectNextRowExtendSelection", "KP_UP", "selectPreviousRow", "shift PAGE_UP", "scrollUpExtendSelection", "KP_DOWN", "selectNextRow" }), "List.foreground", new ColorUIResource(Color.black), "List.selectionBackground", new ColorUIResource(0xCC, 0xCC, 0xFF), "List.selectionForeground", new ColorUIResource(Color.black), "Menu.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12), "Menu.acceleratorForeground", new ColorUIResource(Color.black), "Menu.acceleratorSelectionForeground", new ColorUIResource(Color.white), "Menu.arrowIcon", BasicIconFactory.getMenuArrowIcon(), "Menu.background", new ColorUIResource(Color.lightGray), "Menu.border", new BasicBorders.MarginBorder(), "Menu.borderPainted", Boolean.FALSE, "Menu.checkIcon", BasicIconFactory.getMenuItemCheckIcon(), "Menu.consumesTabs", Boolean.TRUE, "Menu.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Menu.foreground", new ColorUIResource(Color.black), "Menu.margin", new InsetsUIResource(2, 2, 2, 2), "Menu.selectedWindowInputMapBindings", new Object[] { "ESCAPE", "cancel", "DOWN", "selectNext", "KP_DOWN", "selectNext", "UP", "selectPrevious", "KP_UP", "selectPrevious", "LEFT", "selectParent", "KP_LEFT", "selectParent", "RIGHT", "selectChild", "KP_RIGHT", "selectChild", "ENTER", "return", "SPACE", "return" }, "Menu.selectionBackground", new ColorUIResource(lightPurple), "Menu.selectionForeground", new ColorUIResource(Color.black), "MenuBar.background", new ColorUIResource(Color.lightGray), "MenuBar.border", new BasicBorders.MenuBarBorder(null, null), "MenuBar.font", new FontUIResource("Dialog", Font.PLAIN, 12), "MenuBar.foreground", new ColorUIResource(Color.black), "MenuBar.windowBindings", new Object[] { "F10", "takeFocus" }, "MenuItem.acceleratorDelimiter", "-", "MenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12), "MenuItem.acceleratorForeground", new ColorUIResource(Color.black), "MenuItem.acceleratorSelectionForeground", new ColorUIResource(Color.white), "MenuItem.arrowIcon", BasicIconFactory.getMenuItemArrowIcon(), "MenuItem.background", new ColorUIResource(Color.lightGray), "MenuItem.border", new BasicBorders.MarginBorder(), "MenuItem.borderPainted", Boolean.FALSE, "MenuItem.checkIcon", BasicIconFactory.getMenuItemCheckIcon(), "MenuItem.font", new FontUIResource("Dialog", Font.PLAIN, 12), "MenuItem.foreground", new ColorUIResource(Color.black), "MenuItem.margin", new InsetsUIResource(2, 2, 2, 2), "MenuItem.selectionBackground", new ColorUIResource(lightPurple), "MenuItem.selectionForeground", new ColorUIResource(Color.black), "OptionPane.background", new ColorUIResource(Color.lightGray), "OptionPane.border", new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0), "OptionPane.buttonAreaBorder", new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0), "OptionPane.cancelButtonText", "Cancel", // XXX Don't use gif
"OptionPane.errorIcon", new IconUIResource(new ImageIcon("icons/Error.gif")), "OptionPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "OptionPane.foreground", new ColorUIResource(Color.black), // XXX Don't use gif
"OptionPane.informationIcon", new IconUIResource(new ImageIcon("icons/Inform.gif")), "OptionPane.messageAreaBorder", new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0), "OptionPane.messageForeground", new ColorUIResource(Color.black), "OptionPane.minimumSize", new DimensionUIResource(262, 90), "OptionPane.noButtonText", "No", "OptionPane.okButtonText", "OK", // XXX Don't use gif
"OptionPane.questionIcon", new IconUIResource(new ImageIcon("icons/Question.gif")), // XXX Don't use gif
"OptionPane.warningIcon", new IconUIResource(new ImageIcon("icons/Warn.gif")), "OptionPane.windowBindings", new Object[] { "ESCAPE", "close" }, "OptionPane.yesButtonText", "Yes", "Panel.background", new ColorUIResource(Color.lightGray), "Panel.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Panel.foreground", new ColorUIResource(Color.black), "PasswordField.background", new ColorUIResource(Color.white), "PasswordField.border", new BasicBorders.FieldBorder(null, null, null, null), "PasswordField.caretBlinkRate", new Integer(500), "PasswordField.caretForeground", new ColorUIResource(Color.black), "PasswordField.font", new FontUIResource("MonoSpaced", Font.PLAIN, 12), "PasswordField.foreground", new ColorUIResource(Color.black), "PasswordField.inactiveForeground", new ColorUIResource(Color.gray), "PasswordField.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "notify-field-accept") }, "PasswordField.margin", new InsetsUIResource(0, 0, 0, 0), "PasswordField.selectionBackground", new ColorUIResource(lightPurple), "PasswordField.selectionForeground", new ColorUIResource(Color.black), "PopupMenu.background", new ColorUIResource(Color.lightGray), "PopupMenu.border", new BorderUIResource.BevelBorderUIResource(0), "PopupMenu.font", new FontUIResource("Dialog", Font.PLAIN, 12), "PopupMenu.foreground", new ColorUIResource(Color.black), "ProgressBar.background", new ColorUIResource(Color.lightGray), "ProgressBar.border", new BorderUIResource.LineBorderUIResource(Color.darkGray), "ProgressBar.cellLength", new Integer(1), "ProgressBar.cellSpacing", new Integer(0), "ProgressBar.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ProgressBar.foreground", new ColorUIResource(midPurple), "ProgressBar.selectionBackground", new ColorUIResource(lightPurple), "ProgressBar.selectionForeground", new ColorUIResource(Color.lightGray), "ProgressBar.repaintInterval", new Integer(250), "ProgressBar.cycleTime", new Integer(6000), "RadioButton.background", new ColorUIResource(Color.lightGray), "RadioButton.border", new BorderUIResource.CompoundBorderUIResource(null, null), "RadioButton.darkShadow", new ColorUIResource(Color.darkGray), "RadioButton.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), "RadioButton.font", new FontUIResource("Dialog", Font.PLAIN, 12), "RadioButton.foreground", new ColorUIResource(Color.black), "RadioButton.highlight", new ColorUIResource(Color.white), "RadioButton.icon", BasicIconFactory.getRadioButtonIcon(), "RadioButton.light", new ColorUIResource(Color.lightGray.brighter()), "RadioButton.margin", new InsetsUIResource(2, 2, 2, 2), "RadioButton.shadow", new ColorUIResource(Color.gray), "RadioButton.textIconGap", new Integer(4), "RadioButton.textShiftOffset", new Integer(0), "RadioButtonMenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12), "RadioButtonMenuItem.acceleratorForeground", new ColorUIResource(Color.black), "RadioButtonMenuItem.acceleratorSelectionForeground", new ColorUIResource(Color.white), "RadioButtonMenuItem.arrowIcon", BasicIconFactory.getMenuItemArrowIcon(), "RadioButtonMenuItem.background", new ColorUIResource(Color.lightGray), "RadioButtonMenuItem.border", new BasicBorders.MarginBorder(), "RadioButtonMenuItem.borderPainted", Boolean.FALSE, "RadioButtonMenuItem.checkIcon", BasicIconFactory.getRadioButtonMenuItemIcon(), "RadioButtonMenuItem.font", new FontUIResource("Dialog", Font.PLAIN, 12), "RadioButtonMenuItem.foreground", new ColorUIResource(Color.black), "RadioButtonMenuItem.margin", new InsetsUIResource(2, 2, 2, 2), "RadioButtonMenuItem.selectionBackground", new ColorUIResource(lightPurple), "RadioButtonMenuItem.selectionForeground", new ColorUIResource(Color.black), "RootPane.defaultButtonWindowKeyBindings", new Object[] { "ENTER", "press", "released ENTER", "release", "ctrl ENTER", "press", "ctrl released ENTER", "release" }, "ScrollBar.background", new ColorUIResource(224, 224, 224), "ScrollBar.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "PAGE_UP", "negativeBlockIncrement", "PAGE_DOWN", "positiveBlockIncrement", "END", "maxScroll", "HOME", "minScroll", "LEFT", "positiveUnitIncrement", "KP_UP", "negativeUnitIncrement", "KP_DOWN", "positiveUnitIncrement", "UP", "negativeUnitIncrement", "RIGHT", "negativeUnitIncrement", "KP_LEFT", "positiveUnitIncrement", "DOWN", "positiveUnitIncrement", "KP_RIGHT", "negativeUnitIncrement" }), "ScrollBar.foreground", new ColorUIResource(Color.lightGray), "ScrollBar.maximumThumbSize", new DimensionUIResource(4096, 4096), "ScrollBar.minimumThumbSize", new DimensionUIResource(8, 8), "ScrollBar.thumb", new ColorUIResource(Color.lightGray), "ScrollBar.thumbDarkShadow", new ColorUIResource(Color.black), "ScrollBar.thumbHighlight", new ColorUIResource(Color.white), "ScrollBar.thumbLightShadow", new ColorUIResource(Color.gray), "ScrollBar.track", new ColorUIResource(224, 224, 224), "ScrollBar.trackHighlight", new ColorUIResource(Color.black), "ScrollPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "PAGE_UP", "scrollUp", "KP_LEFT", "unitScrollLeft", "ctrl PAGE_DOWN", "scrollRight", "PAGE_DOWN", "scrollDown", "KP_RIGHT", "unitScrollRight", "LEFT", "unitScrollLeft", "ctrl END", "scrollEnd", "UP", "unitScrollUp", "RIGHT", "unitScrollRight", "DOWN", "unitScrollDown", "ctrl HOME", "scrollHome", "ctrl PAGE_UP", "scrollLeft", "KP_UP", "unitScrollUp", "KP_DOWN", "unitScrollDown" }), "ScrollPane.background", new ColorUIResource(Color.lightGray), "ScrollPane.border", new BorderUIResource.EtchedBorderUIResource(), "ScrollPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ScrollPane.foreground", new ColorUIResource(Color.black), "Separator.background", new ColorUIResource(Color.white), "Separator.foreground", new ColorUIResource(Color.gray), "Separator.highlight", new ColorUIResource(Color.white), "Separator.shadow", new ColorUIResource(Color.gray), "Slider.background", new ColorUIResource(Color.lightGray), "Slider.focus", new ColorUIResource(Color.black), "Slider.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "PAGE_UP", "positiveBlockIncrement", "PAGE_DOWN", "negativeBlockIncrement", "END", "maxScroll", "HOME", "minScroll", "LEFT", "negativeUnitIncrement", "KP_UP", "positiveUnitIncrement", "KP_DOWN", "negativeUnitIncrement", "UP", "positiveUnitIncrement", "RIGHT", "positiveUnitIncrement", "KP_LEFT", "negativeUnitIncrement", "DOWN", "negativeUnitIncrement", "KP_RIGHT", "positiveUnitIncrement" }), "Slider.focusInsets", new InsetsUIResource(2, 2, 2, 2), "Slider.foreground", new ColorUIResource(Color.lightGray), "Slider.highlight", new ColorUIResource(Color.white), "Slider.shadow", new ColorUIResource(Color.gray), "Slider.thumbHeight", new Integer(20), "Slider.thumbWidth", new Integer(10), "Slider.tickHeight", new Integer(12), "SplitPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "F6", "toggleFocus", "F8", "startResize", "END", "selectMax", "HOME", "selectMin", "LEFT", "negativeIncremnent", "KP_UP", "negativeIncrement", "KP_DOWN", "positiveIncrement", "UP", "negativeIncrement", "RIGHT", "positiveIncrement", "KP_LEFT", "negativeIncrement", "DOWN", "positiveIncrement", "KP_RIGHT", "positiveIncrement" }), "SplitPane.background", new ColorUIResource(Color.lightGray), "SplitPane.border", new BasicBorders.SplitPaneBorder(null, null), "SplitPane.dividerSize", new Integer(10), "SplitPane.highlight", new ColorUIResource(Color.white), "SplitPane.shadow", new ColorUIResource(Color.gray), "TabbedPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ctrl PAGE_DOWN", "navigatePageDown", "ctrl PAGE_UP", "navigatePageUp", "ctrl UP", "requestFocus", "ctrl KP_UP", "requestFocus" }), "TabbedPane.background", new ColorUIResource(Color.LIGHT_GRAY), "TabbedPane.contentBorderInsets", new InsetsUIResource(2, 2, 3, 3), "TabbedPane.darkShadow", new ColorUIResource(Color.darkGray), "TabbedPane.focus", new ColorUIResource(Color.black), "TabbedPane.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "LEFT", "navigateLeft", "KP_UP", "navigateUp", "ctrl DOWN", "requestFocusForVisibleComponent", "UP", "navigateUp", "KP_DOWN", "navigateDown", "RIGHT", "navigateRight", "KP_LEFT", "navigateLeft", "ctrl KP_DOWN", "requestFocusForVisibleComponent", "KP_RIGHT", "navigateRight", "DOWN", "navigateDown" }), "TabbedPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TabbedPane.foreground", new ColorUIResource(Color.black), "TabbedPane.highlight", new ColorUIResource(Color.lightGray), "TabbedPane.lightHighlight", new ColorUIResource(Color.white), "TabbedPane.selectedTabPadInsets", new InsetsUIResource(2, 2, 2, 1), "TabbedPane.shadow", new ColorUIResource(Color.gray), "TabbedPane.tabbedPaneTabAreaInsets", new InsetsUIResource(3, 2, 1, 2), "TabbedPane.tabbedPaneTabInsets", new InsetsUIResource(1, 4, 1, 4), "TabbedPane.tabbedPaneContentBorderInsets", new InsetsUIResource(3, 2, 1, 2), "TabbedPane.tabbedPaneTabPadInsets", new InsetsUIResource(1, 1, 1, 1), "TabbedPane.tabRunOverlay", new Integer(2), "TabbedPane.textIconGap", new Integer(4), "Table.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "shift PAGE_DOWN", "scrollDownExtendSelection", "PAGE_DOWN", "scrollDownChangeSelection", "END", "selectLastColumn", "shift END", "selectLastColumnExtendSelection", "HOME", "selectFirstColumn", "ctrl END", "selectLastRow", "ctrl shift END", "selectLastRowExtendSelection", "LEFT", "selectPreviousColumn", "shift HOME", "selectFirstColumnExtendSelection", "UP", "selectPreviousRow", "RIGHT", "selectNextColumn", "ctrl HOME", "selectFirstRow", "shift LEFT", "selectPreviousColumnExtendSelection", "DOWN", "selectNextRow", "ctrl shift HOME", "selectFirstRowExtendSelection", "shift UP", "selectPreviousRowExtendSelection", "F2", "startEditing", "shift RIGHT", "selectNextColumnExtendSelection", "TAB", "selectNextColumnCell", "shift DOWN", "selectNextRowExtendSelection", "ENTER", "selectNextRowCell", "KP_UP", "selectPreviousRow", "KP_DOWN", "selectNextRow", "KP_LEFT", "selectPreviousColumn", "KP_RIGHT", "selectNextColumn", "shift TAB", "selectPreviousColumnCell", "ctrl A", "selectAll", "shift ENTER", "selectPreviousRowCell", "shift KP_DOWN", "selectNextRowExtendSelection", "shift KP_LEFT", "selectPreviousColumnExtendSelection", "ESCAPE", "cancel", "ctrl shift PAGE_UP", "scrollRightExtendSelection", "shift KP_RIGHT", " selectNextColumnExtendSelection", "ctrl PAGE_UP", "scrollLeftChangeSelection", "shift PAGE_UP", "scrollUpExtendSelection", "ctrl shift PAGE_DOWN", "scrollLeftExtendSelection", "ctrl PAGE_DOWN", "scrollRightChangeSelection", "PAGE_UP", "scrollUpChangeSelection" }), "Table.background", new ColorUIResource(Color.white), "Table.focusCellBackground", new ColorUIResource(Color.white), "Table.focusCellForeground", new ColorUIResource(Color.black), "Table.focusCellHighlightBorder", new BorderUIResource.LineBorderUIResource(Color.white), "Table.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Table.foreground", new ColorUIResource(Color.black), "Table.gridColor", new ColorUIResource(Color.gray), "Table.scrollPaneBorder", new BorderUIResource.BevelBorderUIResource(0), "Table.selectionBackground", new ColorUIResource(lightPurple), "Table.selectionForeground", new ColorUIResource(Color.black), "TableHeader.background", new ColorUIResource(Color.lightGray), "TableHeader.cellBorder", new BorderUIResource.BevelBorderUIResource(0), "TableHeader.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TableHeader.foreground", new ColorUIResource(Color.black), "TextArea.background", new ColorUIResource(Color.white), "TextArea.border", new BasicBorders.MarginBorder(), "TextArea.caretBlinkRate", new Integer(500), "TextArea.caretForeground", new ColorUIResource(Color.black), "TextArea.font", new FontUIResource("MonoSpaced", Font.PLAIN, 12), "TextArea.foreground", new ColorUIResource(Color.black), "TextArea.inactiveForeground", new ColorUIResource(Color.gray), "TextArea.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), "caret-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), "caret-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0), "page-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0), "page-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "insert-break"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0), "insert-tab") }, "TextArea.margin", new InsetsUIResource(0, 0, 0, 0), "TextArea.selectionBackground", new ColorUIResource(lightPurple), "TextArea.selectionForeground", new ColorUIResource(Color.black), "TextField.background", new ColorUIResource(Color.white), "TextField.border", new BasicBorders.FieldBorder(null, null, null, null), "TextField.caretBlinkRate", new Integer(500), "TextField.caretForeground", new ColorUIResource(Color.black), "TextField.font", new FontUIResource("SansSerif", Font.PLAIN, 12), "TextField.foreground", new ColorUIResource(Color.black), "TextField.inactiveForeground", new ColorUIResource(Color.gray), "TextField.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "notify-field-accept"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, InputEvent.SHIFT_DOWN_MASK), "selection-backward"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, InputEvent.SHIFT_DOWN_MASK), "selection-forward") }, "TextField.margin", new InsetsUIResource(0, 0, 0, 0), "TextField.selectionBackground", new ColorUIResource(lightPurple), "TextField.selectionForeground", new ColorUIResource(Color.black), "TextPane.background", new ColorUIResource(Color.white), "TextPane.border", new BasicBorders.MarginBorder(), "TextPane.caretBlinkRate", new Integer(500), "TextPane.caretForeground", new ColorUIResource(Color.black), "TextPane.font", new FontUIResource("Serif", Font.PLAIN, 12), "TextPane.foreground", new ColorUIResource(Color.black), "TextPane.inactiveForeground", new ColorUIResource(Color.gray), "TextPane.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), "caret-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), "caret-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0), "page-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0), "page-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "insert-break"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0), "insert-tab") }, "TextPane.margin", new InsetsUIResource(3, 3, 3, 3), "TextPane.selectionBackground", new ColorUIResource(Color.lightGray), "TextPane.selectionForeground", new ColorUIResource(Color.white), "TitledBorder.border", new BorderUIResource.EtchedBorderUIResource(), "TitledBorder.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TitledBorder.titleColor", new ColorUIResource(Color.black), "ToggleButton.background", new ColorUIResource(Color.lightGray), "ToggleButton.border", new BorderUIResource.CompoundBorderUIResource(null, null), "ToggleButton.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), "ToggleButton.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ToggleButton.foreground", new ColorUIResource(Color.black), "ToggleButton.margin", new InsetsUIResource(2, 14, 2, 14), "ToggleButton.textIconGap", new Integer(4), "ToggleButton.textShiftOffset", new Integer(0), "ToolBar.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "UP", "navigateUp", "KP_UP", "navigateUp", "DOWN", "navigateDown", "KP_DOWN", "navigateDown", "LEFT", "navigateLeft", "KP_LEFT", "navigateLeft", "RIGHT", "navigateRight", "KP_RIGHT", "navigateRight" }), "ToolBar.background", new ColorUIResource(Color.lightGray), "ToolBar.border", new BorderUIResource.EtchedBorderUIResource(), "ToolBar.dockingBackground", new ColorUIResource(Color.lightGray), "ToolBar.dockingForeground", new ColorUIResource(11, 30, 143), "ToolBar.floatingBackground", new ColorUIResource(Color.lightGray), "ToolBar.floatingForeground", new ColorUIResource(113, 171, 212), "ToolBar.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ToolBar.foreground", new ColorUIResource(Color.black), "ToolBar.separatorSize", new DimensionUIResource(20, 20), "ToolTip.background", new ColorUIResource(122, 178, 241), "ToolTip.border", new BorderUIResource.LineBorderUIResource(Color.lightGray), "ToolTip.font", new FontUIResource("SansSerif", Font.PLAIN, 12), "ToolTip.foreground", new ColorUIResource(Color.black), "Tree.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "cancel" }), "Tree.background", new ColorUIResource(Color.white), "Tree.changeSelectionWithFocus", Boolean.TRUE, "Tree.closedIcon", new IconUIResource(new ImageIcon("icons/TreeClosed.png")), "Tree.collapsedIcon", new IconUIResource(new ImageIcon("icons/TreeCollapsed.png")), "Tree.drawsFocusBorderAroundIcon", Boolean.FALSE, "Tree.editorBorder", new BorderUIResource.LineBorderUIResource(Color.lightGray), "Tree.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "shift PAGE_DOWN", "scrollDownExtendSelection", "PAGE_DOWN", "scrollDownChangeSelection", "END", "selectLast", "ctrl KP_UP", "selectPreviousChangeLead", "shift END", "selectLastExtendSelection", "HOME", "selectFirst", "ctrl END", "selectLastChangeLead", "ctrl /", "selectAll", "LEFT", "selectParent", "shift HOME", "selectFirstExtendSelection", "UP", "selectPrevious", "ctrl KP_DOWN", "selectNextChangeLead", "RIGHT", "selectChild", "ctrl HOME", "selectFirstChangeLead", "DOWN", "selectNext", "ctrl KP_LEFT", "scrollLeft", "shift UP", "selectPreviousExtendSelection", "F2", "startEditing", "ctrl LEFT", "scrollLeft", "ctrl KP_RIGHT", "scrollRight", "ctrl UP", "selectPreviousChangeLead", "shift DOWN", "selectNextExtendSelection", "ENTER", "toggle", "KP_UP", "selectPrevious", "KP_DOWN", "selectNext", "ctrl RIGHT", "scrollRight", "KP_LEFT", "selectParent", "KP_RIGHT", "selectChild", "ctrl DOWN", "selectNextChangeLead", "ctrl A", "selectAll", "shift KP_UP", "selectPreviousExtendSelection", "shift KP_DOWN", "selectNextExtendSelection", "ctrl SPACE", "toggleSelectionPreserveAnchor", "ctrl shift PAGE_UP", "scrollUpExtendSelection", "ctrl \\", "clearSelection", "shift SPACE", "extendSelection", "ctrl PAGE_UP", "scrollUpChangeLead", "shift PAGE_UP", "scrollUpExtendSelection", "SPACE", "toggleSelectionPreserveAnchor", "ctrl shift PAGE_DOWN", "scrollDownExtendSelection", "PAGE_UP", "scrollUpChangeSelection", "ctrl PAGE_DOWN", "scrollDownChangeLead" }), "Tree.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Tree.expandedIcon", new IconUIResource(new ImageIcon("icons/TreeExpanded.png")), "Tree.foreground", new ColorUIResource(Color.black), "Tree.hash", new ColorUIResource(Color.gray), "Tree.leafIcon", new IconUIResource(new ImageIcon("icons/TreeLeaf.png")), "Tree.leftChildIndent", new Integer(7), "Tree.openIcon", new IconUIResource(new ImageIcon("icons/TreeOpen.png")), "Tree.rightChildIndent", new Integer(13), "Tree.rowHeight", new Integer(16), "Tree.scrollsOnExpand", Boolean.TRUE, "Tree.selectionBackground", new ColorUIResource(lightPurple), "Tree.selectionBorderColor", new ColorUIResource(Color.black), "Tree.selectionForeground", new ColorUIResource(Color.black), "Tree.textBackground", new ColorUIResource(Color.lightGray), "Tree.textForeground", new ColorUIResource(Color.black), "Viewport.background", new ColorUIResource(Color.lightGray), "Viewport.font", new FontUIResource("Dialog", Font.PLAIN, 12) };
defaults.putDefaults(uiDefaults);
}Example 101
| Project: jmeter-master File: JMeterUtils.java View source code |
/**
* Apply HiDPI scale factor on fonts
* @param scale float scale to apply
*/
public static void applyScaleOnFonts(final float scale) {
log.info("Applying HiDPI scale: {}", scale);
SwingUtilities.invokeLater(() -> {
UIDefaults defaults = UIManager.getLookAndFeelDefaults();
// the font objects are missing, so iterate over the keys, only
for (Object key : new ArrayList<>(defaults.keySet())) {
Object value = defaults.get(key);
log.debug("Try key {} with value {}", key, value);
if (value instanceof Font) {
Font font = (Font) value;
final float newSize = font.getSize() * scale;
if (font instanceof FontUIResource) {
defaults.put(key, new FontUIResource(font.getName(), font.getStyle(), Math.round(newSize)));
} else {
defaults.put(key, font.deriveFont(newSize));
}
}
}
JMeterUtils.refreshUI();
});
}