JAL-1807 Bob
[jalviewjs.git] / site / j2s / swingjs / plaf / HTML5LookAndFeel.js
1 Clazz.declarePackage ("swingjs.plaf");
2 Clazz.load (["javax.swing.LookAndFeel"], "swingjs.plaf.HTML5LookAndFeel", ["java.lang.Boolean", "$.Long", "java.awt.Color", "$.Dimension", "javax.swing.DefaultListCellRenderer", "$.UIDefaults", "javax.swing.UIDefaults.ActiveValue", "javax.swing.plaf.ColorUIResource", "$.DimensionUIResource", "$.FontUIResource", "$.InsetsUIResource"], function () {
3 c$ = Clazz.declareType (swingjs.plaf, "HTML5LookAndFeel", javax.swing.LookAndFeel);
4 Clazz.overrideMethod (c$, "getDefaults", 
5 function () {
6 var table =  new javax.swing.UIDefaults (610, 0.75);
7 this.initClassDefaults (table);
8 this.initSystemColorDefaults (table);
9 this.initComponentDefaults (table);
10 return table;
11 });
12 Clazz.overrideMethod (c$, "initialize", 
13 function () {
14 });
15 Clazz.defineMethod (c$, "installAWTEventListener", 
16 function () {
17 });
18 Clazz.overrideMethod (c$, "uninitialize", 
19 function () {
20 });
21 Clazz.defineMethod (c$, "initClassDefaults", 
22 function (table) {
23 var packageName = "swingjs.plaf.";
24 var uiDefaults =  Clazz.newArray (-1, ["ButtonUI", "swingjs.plaf.JSButtonUI", "CheckBoxUI", "swingjs.plaf.JSCheckBoxUI", "ColorChooserUI", "swingjs.plaf.JSColorChooserUI", "FormattedTextFieldUI", "swingjs.plaf.JSFormattedTextFieldUI", "MenuBarUI", "swingjs.plaf.JSMenuBarUI", "MenuUI", "swingjs.plaf.JSMenuUI", "MenuItemUI", "swingjs.plaf.JSMenuItemUI", "CheckBoxMenuItemUI", "swingjs.plaf.JSCheckBoxMenuItemUI", "RadioButtonMenuItemUI", "swingjs.plaf.JSRadioButtonMenuItemUI", "RadioButtonUI", "swingjs.plaf.JSRadioButtonUI", "ToggleButtonUI", "swingjs.plaf.JSToggleButtonUI", "PopupMenuUI", "swingjs.plaf.JSPopupMenuUI", "ProgressBarUI", "swingjs.plaf.JSProgressBarUI", "ScrollBarUI", "swingjs.plaf.JSScrollBarUI", "ScrollPaneUI", "swingjs.plaf.JSScrollPaneUI", "SplitPaneUI", "swingjs.plaf.JSSplitPaneUI", "SliderUI", "swingjs.plaf.JSSliderUI", "SeparatorUI", "swingjs.plaf.JSSeparatorUI", "SpinnerUI", "swingjs.plaf.JSSpinnerUI", "ToolBarSeparatorUI", "swingjs.plaf.JSToolBarSeparatorUI", "PopupMenuSeparatorUI", "swingjs.plaf.JSPopupMenuSeparatorUI", "TabbedPaneUI", "swingjs.plaf.JSTabbedPaneUI", "TextAreaUI", "swingjs.plaf.JSTextAreaUI", "TextFieldUI", "swingjs.plaf.JSTextFieldUI", "PasswordFieldUI", "swingjs.plaf.JSPasswordFieldUI", "TextPaneUI", "swingjs.plaf.JSTextPaneUI", "EditorPaneUI", "swingjs.plaf.JSEditorPaneUI", "TreeUI", "swingjs.plaf.JSTreeUI", "LabelUI", "swingjs.plaf.JSLabelUI", "ListUI", "swingjs.plaf.JSListUI", "ToolBarUI", "swingjs.plaf.JSToolBarUI", "ToolTipUI", "swingjs.plaf.JSToolTipUI", "ComboBoxUI", "swingjs.plaf.JSComboBoxUI", "TableUI", "swingjs.plaf.JSTableUI", "TableHeaderUI", "swingjs.plaf.JSTableHeaderUI", "InternalFrameUI", "swingjs.plaf.JSInternalFrameUI", "DesktopPaneUI", "swingjs.plaf.JSDesktopPaneUI", "DesktopIconUI", "swingjs.plaf.JSDesktopIconUI", "OptionPaneUI", "swingjs.plaf.JSOptionPaneUI", "PanelUI", "swingjs.plaf.JSPanelUI", "ViewportUI", "swingjs.plaf.JSViewportUI", "RootPaneUI", "swingjs.plaf.JSRootPaneUI"]);
25 table.putDefaults (uiDefaults);
26 }, "javax.swing.UIDefaults");
27 Clazz.defineMethod (c$, "initSystemColorDefaults", 
28 function (table) {
29 var defaultSystemColors =  Clazz.newArray (-1, ["window", "#FFFFFF", "windowText", "#333333", "menu", "#C0C0C0", "menuText", "#333333", "text", "#C0C0C0", "textText", "#333333", "control", "#EEEEEE", "controlText", "#333333", "scrollbar", "#E0E0E0", "info", "#FFFFE1", "infoText", "#000000"]);
30 this.loadSystemColors (table, defaultSystemColors, this.isNativeLookAndFeel ());
31 }, "javax.swing.UIDefaults");
32 Clazz.defineMethod (c$, "loadSystemColors", 
33 function (table, systemColors, useNative) {
34 for (var i = 0; i < systemColors.length; i += 2) {
35 var color = java.awt.Color.black;
36 try {
37 color = java.awt.Color.decode (systemColors[i + 1]);
38 } catch (e) {
39 if (Clazz.exceptionOf (e, NumberFormatException)) {
40 e.printStackTrace ();
41 } else {
42 throw e;
43 }
44 }
45 table.put (systemColors[i],  new javax.swing.plaf.ColorUIResource (color));
46 }
47 }, "javax.swing.UIDefaults,~A,~B");
48 Clazz.defineMethod (c$, "initResourceBundle", 
49  function (table) {
50 }, "javax.swing.UIDefaults");
51 Clazz.defineMethod (c$, "initComponentDefaults", 
52 function (table) {
53 this.initResourceBundle (table);
54 var oneThousand =  new Long (1000);
55 var twelve =  new Integer (12);
56 var fontPlain =  new Integer (0);
57 var serifPlain12 =  new javax.swing.plaf.FontUIResource ("Serif", 0, 12);
58 var sansSerifPlain12 =  new javax.swing.plaf.FontUIResource ("SansSerif", 0, 12);
59 var dialogPlain12 =  new javax.swing.plaf.FontUIResource ("Dialog", 0, 12);
60 var monospacedPlain12 =  new javax.swing.plaf.FontUIResource ("Monospaced", 0, 12);
61 var black =  new javax.swing.plaf.ColorUIResource (java.awt.Color.black);
62 var white =  new javax.swing.plaf.ColorUIResource (java.awt.Color.white);
63 var gray =  new javax.swing.plaf.ColorUIResource (java.awt.Color.gray);
64 var darkGray =  new javax.swing.plaf.ColorUIResource (java.awt.Color.darkGray);
65 var control = table.getColor ("control");
66 var controlText = table.getColor ("controlText");
67 var menu = table.getColor ("menu");
68 var menuText = table.getColor ("menuText");
69 var textText = table.getColor ("textText");
70 var window = table.getColor ("window");
71 var zeroInsets =  new javax.swing.plaf.InsetsUIResource (0, 0, 0, 0);
72 var twoInsets =  new javax.swing.plaf.InsetsUIResource (2, 2, 2, 2);
73 var threeInsets =  new javax.swing.plaf.InsetsUIResource (3, 3, 3, 3);
74 var listCellRendererActiveValue = ((Clazz.isClassDefined ("swingjs.plaf.HTML5LookAndFeel$1") ? 0 : swingjs.plaf.HTML5LookAndFeel.$HTML5LookAndFeel$1$ ()), Clazz.innerTypeInstance (swingjs.plaf.HTML5LookAndFeel$1, this, null));
75 var zero =  new Integer (0);
76 var tabbedPaneTabInsets =  new javax.swing.plaf.InsetsUIResource (0, 4, 1, 4);
77 var tabbedPaneTabPadInsets =  new javax.swing.plaf.InsetsUIResource (2, 2, 2, 1);
78 var tabbedPaneTabAreaInsets =  new javax.swing.plaf.InsetsUIResource (3, 2, 0, 2);
79 var tabbedPaneContentBorderInsets =  new javax.swing.plaf.InsetsUIResource (2, 2, 3, 3);
80 var editorMargin = threeInsets;
81 var four =  new Integer (4);
82 var defaults =  Clazz.newArray (-1, ["*.font", dialogPlain12, "*.background", control, "*.foreground", controlText, "Button.margin",  new javax.swing.plaf.InsetsUIResource (2, 14, 2, 14), "ToggleButton.margin",  new javax.swing.plaf.InsetsUIResource (2, 14, 2, 14), "ToggleButton.textIconGap", four, "ToggleButton.textShiftOffset", zero, "RadioButton.margin", twoInsets, "RadioButton.textIconGap", four, "RadioButton.textShiftOffset", zero, "CheckBox.margin", twoInsets, "CheckBox.textIconGap", four, "CheckBox.textShiftOffset", zero, "ColorChooser.swatchesSwatchSize",  new java.awt.Dimension (10, 10), "ColorChooser.swatchesRecentSwatchSize",  new java.awt.Dimension (10, 10), "ColorChooser.swatchesDefaultRecentColor", control, "ComboBox.font", sansSerifPlain12, "ComboBox.background", window, "ComboBox.foreground", textText, "ComboBox.timeFactor", oneThousand, "ComboBox.isEnterSelectablePopup", Boolean.FALSE, "FileChooser.readOnly", Boolean.FALSE, "Label.border", null, "List.background", window, "List.foreground", textText, "List.cellRenderer", listCellRendererActiveValue, "List.timeFactor", oneThousand, "MenuBar.font", dialogPlain12, "MenuBar.background", menu, "MenuBar.foreground", menuText, "MenuItem.font", dialogPlain12, "MenuItem.background", menu, "MenuItem.foreground", menuText, "MenuItem.margin", twoInsets, "RadioButtonMenuItem.font", dialogPlain12, "RadioButtonMenuItem.background", menu, "RadioButtonMenuItem.foreground", menuText, "RadioButtonMenuItem.margin", twoInsets, "CheckBoxMenuItem.font", dialogPlain12, "CheckBoxMenuItem.background", menu, "CheckBoxMenuItem.foreground", menuText, "CheckBoxMenuItem.margin", twoInsets, "Menu.background", menu, "Menu.foreground", menuText, "Menu.margin", twoInsets, "PopupMenu.background", menu, "PopupMenu.foreground", menuText, "PopupMenu.consumeEventOnClose", Boolean.FALSE, "OptionPane.messageForeground", controlText, "Panel.font", dialogPlain12, "Panel.background", control, "Panel.foreground", textText, "ProgressBar.cellLength",  new Integer (1), "ProgressBar.cellSpacing", zero, "ProgressBar.repaintInterval",  new Integer (50), "ProgressBar.cycleTime",  new Integer (3000), "ProgressBar.horizontalSize",  new javax.swing.plaf.DimensionUIResource (146, 12), "ProgressBar.verticalSize",  new javax.swing.plaf.DimensionUIResource (12, 146), "ScrollBar.foreground", control, "ScrollBar.width",  new Integer (16), "Viewport.foreground", textText, "Slider.horizontalSize",  new java.awt.Dimension (200, 21), "Slider.verticalSize",  new java.awt.Dimension (21, 200), "Slider.minimumHorizontalSize",  new java.awt.Dimension (36, 21), "Slider.minimumVerticalSize",  new java.awt.Dimension (21, 36), "Spinner.font", monospacedPlain12, "Spinner.arrowButtonSize",  new java.awt.Dimension (16, 5), "Spinner.editorAlignment", new Integer (11), "SplitPane.background", control, "SplitPane.dividerSize",  new Integer (7), "SplitPaneDivider.draggingColor", darkGray, "TabbedPane.selected", null, "TabbedPane.textIconGap", four, "TabbedPane.tabsOverlapBorder", Boolean.FALSE, "TabbedPane.labelShift", new Integer (1), "TabbedPane.selectedLabelShift", new Integer (-1), "TabbedPane.tabInsets", tabbedPaneTabInsets, "TabbedPane.selectedTabPadInsets", tabbedPaneTabPadInsets, "TabbedPane.tabAreaInsets", tabbedPaneTabAreaInsets, "TabbedPane.contentBorderInsets", tabbedPaneContentBorderInsets, "TabbedPane.tabRunOverlay",  new Integer (2), "Table.background", window, "Table.dropLineShortColor", black, "Table.gridColor", gray, "Table.focusCellBackground", window, "Table.focusCellForeground", controlText, "TextField.font", sansSerifPlain12, "TextField.background", window, "TextField.foreground", textText, "TextField.margin", zeroInsets, "FormattedTextField.font", sansSerifPlain12, "FormattedTextField.background", window, "FormattedTextField.foreground", textText, "FormattedTextField.caretForeground", textText, "FormattedTextField.margin", zeroInsets, "PasswordField.font", monospacedPlain12, "PasswordField.background", window, "PasswordField.foreground", textText, "PasswordField.margin", zeroInsets, "PasswordField.echoChar", new Character ('*'), "TextArea.font", monospacedPlain12, "TextArea.background", window, "TextArea.foreground", textText, "TextArea.margin", zeroInsets, "TextPane.font", serifPlain12, "TextPane.background", white, "TextPane.foreground", textText, "TextPane.margin", editorMargin, "EditorPane.font", serifPlain12, "EditorPane.background", white, "EditorPane.foreground", textText, "EditorPane.margin", editorMargin, "TitledBorder.titleColor", controlText, "Tree.paintLines", Boolean.TRUE, "Tree.lineTypeDashed", Boolean.FALSE, "Tree.background", window, "Tree.foreground", textText, "Tree.hash", gray, "Tree.textForeground", textText, "Tree.textBackground", table.get ("text"), "Tree.leftChildIndent",  new Integer (7), "Tree.rightChildIndent",  new Integer (13), "Tree.rowHeight",  new Integer (16), "Tree.scrollsOnExpand", Boolean.TRUE, "Tree.timeFactor", oneThousand]);
83 table.putDefaults (defaults);
84 }, "javax.swing.UIDefaults");
85 Clazz.overrideMethod (c$, "getName", 
86 function () {
87 return "SwingJS";
88 });
89 Clazz.overrideMethod (c$, "getID", 
90 function () {
91 return "SwingJS";
92 });
93 Clazz.overrideMethod (c$, "getDescription", 
94 function () {
95 return "SwingJS L&F";
96 });
97 Clazz.overrideMethod (c$, "isNativeLookAndFeel", 
98 function () {
99 return true;
100 });
101 Clazz.overrideMethod (c$, "isSupportedLookAndFeel", 
102 function () {
103 return true;
104 });
105 c$.$HTML5LookAndFeel$1$ = function () {
106 Clazz.pu$h(self.c$);
107 c$ = Clazz.declareAnonymous (swingjs.plaf, "HTML5LookAndFeel$1", null, javax.swing.UIDefaults.ActiveValue);
108 Clazz.overrideMethod (c$, "createValue", 
109 function (table) {
110 return  new javax.swing.DefaultListCellRenderer.UIResource ();
111 }, "javax.swing.UIDefaults");
112 c$ = Clazz.p0p ();
113 };
114 });