Use our UI delegate for the specified UI control type.

@param d      the UI defaults map.
@param uiName the UI type, e.g. "ScrollPane".
512139
private void useOurUIs() {
        for (String uiName : UI_LIST) {
            uiName = uiName + "UI";
            uiDefaults.put(uiName, UI_PACKAGE_PREFIX + uiName);
        }
    }
525482
@Override
    public ICodeBaseEntry lookupResource(String resourceName) {
        ICodeBaseEntry delegateCodeBaseEntry = delegateCodeBase.lookupResource(resourceName);
        if (delegateCodeBaseEntry == null) {
            return null;
        }
        return new DelegatingCodeBaseEntry(this, delegateCodeBaseEntry);
    }
59026
public synchronized void setDelegateMap(PropertyMap delegateMap)
    {
        if (!isCompatibleClass(delegateMap.getMapClass()))
            throw new IllegalArgumentException("The delegate map type (" + delegateMap.getMapClass() + " is an incompatible type with " + _mapClass);

        _delegateMap = delegateMap;
    }
517618
public void setDirectEditButtonStyle(String buttonstyle) {

        int buttonstyleValue = BUTTONSTYLE_TEXTIMAGE;
        try {
            if (buttonstyle != null) {
                buttonstyleValue = BUTTON_STYLES_LIST.indexOf(buttonstyle);
            }
        } catch (Exception e) {
            // do nothing, use the default value
        }
        setDirectEditButtonStyle(buttonstyleValue);
    }
153272
@SuppressLint("NewApi")
    public static void setBackground(View v, Drawable d) {
        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
            v.setBackgroundDrawable(d);
        } else {
            v.setBackground(d);
        }
    }
598045
private void defineArrowButtons(UIDefaults d) {
        String c = PAINTER_PREFIX + "ArrowButtonPainter";
        String p = "ArrowButton";

        d.put(p + ".States", "Enabled,MouseOver,Disabled,Pressed");
        d.put(p + "[Disabled].foreground", new ColorUIResource(0x9ba8cf));
        d.put(p + "[Enabled].foreground",  new ColorUIResource(0x5b7ea4));            // getDerivedColor("seaGlassBlueGrey", -0.6111111f, -0.110526316f, -0.34509805f, 0, true)); // JTabbedPane arrows no longer black: Nimbus dependency should be replaced with color value?
        
        d.put(p + "[Pressed].foreground", new ColorUIResource(0x134D8C));
        d.put(p + "[Disabled].foregroundPainter", new LazyPainter(c, ArrowButtonPainter.Which.FOREGROUND_DISABLED));
        d.put(p + "[Enabled].foregroundPainter", new LazyPainter(c, ArrowButtonPainter.Which.FOREGROUND_ENABLED));
        d.put(p + "[MouseOver].foregroundPainter", new LazyPainter(c, ArrowButtonPainter.Which.FOREGROUND_ENABLED));
        d.put(p + "[Pressed].foregroundPainter", new LazyPainter(c, ArrowButtonPainter.Which.FOREGROUND_PRESSED));
    }
276699
@Override
    public void setName(String name) {

        m_textbox.setName(name);
        m_descriptionArea.setName(name + "_TextArea");

    }
1140292
public <V extends TextView> void setTypeface(V view, String typefaceName) {
		Typeface typeface = mCache.get(typefaceName);
		view.setTypeface(typeface);
	}
1106380
public void setPageMarginDrawable(Drawable d) {
        mMarginDrawable = d;
        if (d != null) refreshDrawableState();
        setWillNotDraw(d == null);
        invalidate();
    }
1323369
public void addParameterForButton(final UIContext uic, final WButton button) {
		UIContextHolder.pushContext(uic);
		try {
			setParameter(button.getId(), "x");
		} finally {
			UIContextHolder.popContext();
		}
	}
440368
public <D extends Dialog> void setTypeface(D dialog, String typefaceName, int style) {
		DialogUtils.setTypeface(this, dialog, typefaceName, style);
	}
821404
private void defineButtons(UIDefaults d) {
        
        d.put("Button.contentMargins", new InsetsUIResource(6, 14, 6, 14));
        d.put("Button.defaultButtonFollowsFocus", Boolean.FALSE);
        
        d.put("buttonBorderBaseEnabled", new Color(0x709ad0));
        d.put("buttonBorderBasePressed", new Color(0x4879bf));

        d.put("buttonInteriorBaseEnabled", new Color(0xd5e8f7));
        d.put("buttonInteriorBasePressed", new Color(0x6d8fba));
        d.put("buttonInteriorBaseSelected", new Color(0x80a6d2));
        d.put("buttonInteriorBasePressedSelected", new Color(0x7497c2));

        d.put("texturedButtonBorderBaseEnabled", new Color(0x999999));

        d.put("texturedButtonInteriorBaseEnabled", new Color(0xf0f0f0));
        d.put("texturedButtonInteriorBasePressed", new Color(0x8eb3d2));
        d.put("texturedButtonInteriorBaseSelected", new Color(0x98c1e2));
        d.put("texturedButtonInteriorBasePressedSelected", new Color(0x7e9fba));

        d.put("buttonBulletBottomEnabled", Color.BLACK);

        d.put("buttonArrow", Color.BLACK);

        String p = "Button";
        String c = PAINTER_PREFIX + "ButtonPainter";

        // Initialize Button
        d.put(p + ".States", "Enabled,Pressed,Disabled,Focused,Default");
        d.put(p + "[Default+Pressed].textForeground", new ColorUIResource(Color.black));
        d.put(p + "[Disabled].textForeground", getDerivedColor("seaGlassDisabledText", 0.0f, 0.0f, 0.0f, 0, true));
        d.put(p + "[Default].backgroundPainter", new LazyPainter(c, ButtonPainter.Which.BACKGROUND_DEFAULT));
        d.put(p + "[Default+Focused].backgroundPainter", new LazyPainter(c, ButtonPainter.Which.BACKGROUND_DEFAULT_FOCUSED));
        d.put(p + "[Default+Pressed].backgroundPainter", new LazyPainter(c, ButtonPainter.Which.BACKGROUND_PRESSED_DEFAULT));
        d.put(p + "[Default+Focused+Pressed].backgroundPainter",
              new LazyPainter(c,
                              ButtonPainter.Which.BACKGROUND_PRESSED_DEFAULT_FOCUSED));
        d.put(p + "[Disabled].backgroundPainter", new LazyPainter(c, ButtonPainter.Which.BACKGROUND_DISABLED));
        d.put(p + "[Enabled].backgroundPainter", new LazyPainter(c, ButtonPainter.Which.BACKGROUND_ENABLED));
        d.put(p + "[Focused].backgroundPainter", new LazyPainter(c, ButtonPainter.Which.BACKGROUND_FOCUSED));
        d.put(p + "[Pressed].backgroundPainter", new LazyPainter(c, ButtonPainter.Which.BACKGROUND_PRESSED));
        d.put(p + "[Focused+Pressed].backgroundPainter", new LazyPainter(c, ButtonPainter.Which.BACKGROUND_PRESSED_FOCUSED));

        // Initialize ToggleButton
        p = "ToggleButton";
        d.put(p + ".contentMargins", new InsetsUIResource(6, 14, 6, 14));
        d.put(p + ".States", "Enabled,Pressed,Disabled,Focused,Selected");
        d.put(p + "[Selected].textForeground", new ColorUIResource(Color.black));
        d.put(p + "[Disabled].textForeground", getDerivedColor("seaGlassDisabledText", 0.0f, 0.0f, 0.0f, 0, true));
        d.put(p + "[Default+Pressed].textForeground", new ColorUIResource(Color.black));
        d.put(p + "[Focused+Selected].textForeground", new ColorUIResource(Color.black));
        d.put(p + "[Disabled+Selected].textForeground", new ColorUIResource(new Color(0, 0, 0, 0x80)));
        d.put(p + "[Disabled].backgroundPainter", new LazyPainter(c, ButtonPainter.Which.BACKGROUND_DISABLED));
        d.put(p + "[Enabled].backgroundPainter", new LazyPainter(c, ButtonPainter.Which.BACKGROUND_ENABLED));
        d.put(p + "[Focused].backgroundPainter", new LazyPainter(c, ButtonPainter.Which.BACKGROUND_FOCUSED));
        d.put(p + "[Pressed].backgroundPainter", new LazyPainter(c, ButtonPainter.Which.BACKGROUND_PRESSED));
        d.put(p + "[Focused+Pressed].backgroundPainter",
              new LazyPainter(c, ButtonPainter.Which.BACKGROUND_PRESSED_FOCUSED));
        d.put(p + "[Selected].backgroundPainter", new LazyPainter(c, ButtonPainter.Which.BACKGROUND_SELECTED));
        d.put(p + "[Focused+Selected].backgroundPainter",
              new LazyPainter(c, ButtonPainter.Which.BACKGROUND_SELECTED_FOCUSED));
        d.put(p + "[Pressed+Selected].backgroundPainter",
              new LazyPainter(c, ButtonPainter.Which.BACKGROUND_PRESSED_SELECTED));
        d.put(p + "[Focused+Pressed+Selected].backgroundPainter",
              new LazyPainter(c,
                              ButtonPainter.Which.BACKGROUND_PRESSED_SELECTED_FOCUSED));
        d.put(p + "[Disabled+Selected].backgroundPainter",
              new LazyPainter(c, ButtonPainter.Which.BACKGROUND_DISABLED_SELECTED));

        // Initialize CheckBox
        p = "CheckBox";
        c = PAINTER_PREFIX + "CheckBoxPainter";
        d.put(p + ".States", "Enabled,Pressed,Disabled,Focused,Selected");
        d.put(p + ".contentMargins", new InsetsUIResource(0, 0, 0, 0));
        d.put(p + "[Disabled].textForeground", getDerivedColor("seaGlassDisabledText", 0.0f, 0.0f, 0.0f, 0, true));
        d.put(p + "[Disabled].iconPainter", new LazyPainter(c, CheckBoxPainter.Which.ICON_DISABLED));
        d.put(p + "[Enabled].iconPainter", new LazyPainter(c, CheckBoxPainter.Which.ICON_ENABLED));
        d.put(p + "[Focused].iconPainter", new LazyPainter(c, CheckBoxPainter.Which.ICON_FOCUSED));
        d.put(p + "[Pressed].iconPainter", new LazyPainter(c, CheckBoxPainter.Which.ICON_PRESSED));
        d.put(p + "[Focused+Pressed].iconPainter", new LazyPainter(c, CheckBoxPainter.Which.ICON_PRESSED_FOCUSED));
        d.put(p + "[Selected].iconPainter", new LazyPainter(c, CheckBoxPainter.Which.ICON_SELECTED));
        d.put(p + "[Focused+Selected].iconPainter", new LazyPainter(c, CheckBoxPainter.Which.ICON_SELECTED_FOCUSED));
        d.put(p + "[Pressed+Selected].iconPainter", new LazyPainter(c, CheckBoxPainter.Which.ICON_PRESSED_SELECTED));
        d.put(p + "[Focused+Pressed+Selected].iconPainter",
              new LazyPainter(c, CheckBoxPainter.Which.ICON_PRESSED_SELECTED_FOCUSED));
        d.put(p + "[Disabled+Selected].iconPainter", new LazyPainter(c, CheckBoxPainter.Which.ICON_DISABLED_SELECTED));
        d.put(p + ".icon", new SeaGlassIcon(p, "iconPainter", 18, 18));

        // Initialize RadioButton
        p = "RadioButton";
        c = PAINTER_PREFIX + "RadioButtonPainter";
        d.put(p + ".States", "Enabled,Pressed,Disabled,Focused,Selected");
        d.put(p + ".contentMargins", new InsetsUIResource(0, 0, 0, 0));
        d.put(p + "[Disabled].textForeground", getDerivedColor("seaGlassDisabledText", 0.0f, 0.0f, 0.0f, 0, true));
        d.put(p + "[Disabled].iconPainter", new LazyPainter(c, RadioButtonPainter.Which.ICON_DISABLED));
        d.put(p + "[Enabled].iconPainter", new LazyPainter(c, RadioButtonPainter.Which.ICON_ENABLED));
        d.put(p + "[Focused].iconPainter", new LazyPainter(c, RadioButtonPainter.Which.ICON_FOCUSED));
        d.put(p + "[Pressed].iconPainter", new LazyPainter(c, RadioButtonPainter.Which.ICON_PRESSED));
        d.put(p + "[Focused+Pressed].iconPainter", new LazyPainter(c, RadioButtonPainter.Which.ICON_PRESSED_FOCUSED));
        d.put(p + "[Selected].iconPainter", new LazyPainter(c, RadioButtonPainter.Which.ICON_SELECTED));
        d.put(p + "[Focused+Selected].iconPainter", new LazyPainter(c, RadioButtonPainter.Which.ICON_SELECTED_FOCUSED));
        d.put(p + "[Pressed+Selected].iconPainter", new LazyPainter(c, RadioButtonPainter.Which.ICON_PRESSED_SELECTED));
        d.put(p + "[Focused+Pressed+Selected].iconPainter",
              new LazyPainter(c,
                              RadioButtonPainter.Which.ICON_PRESSED_SELECTED_FOCUSED));
        d.put(p + "[Disabled+Selected].iconPainter", new LazyPainter(c, RadioButtonPainter.Which.ICON_DISABLED_SELECTED));
        d.put(p + ".icon", new SeaGlassIcon(p, "iconPainter", 18, 18));
    }
1136745
private void defineComboBoxes(UIDefaults d) {
        // Copied from nimbus
        
        d.put("ComboBox.contentMargins", new InsetsUIResource(0, 0, 0, 0));
        d.put("ComboBox.forceOpaque", Boolean.TRUE);
        d.put("ComboBox.buttonWhenNotEditable", Boolean.TRUE);
        d.put("ComboBox.rendererUseListColors", Boolean.FALSE);
        d.put("ComboBox.pressedWhenPopupVisible", Boolean.TRUE);
        d.put("ComboBox.squareButton", Boolean.FALSE);
        d.put("ComboBox.popupInsets", new InsetsUIResource(-2, 2, 0, 2));
        d.put("ComboBox.padding", new InsetsUIResource(2, 2, 2, 2));

        d.put("ComboBox:\"ComboBox.arrowButton\".contentMargins", new InsetsUIResource(0, 0, 0, 0));
        d.put("ComboBox:\"ComboBox.arrowButton\".size", new Integer(19));
       
        d.put("ComboBox:\"ComboBox.listRenderer\".contentMargins", new InsetsUIResource(2, 4, 2, 4));
        d.put("ComboBox:\"ComboBox.listRenderer\".opaque", Boolean.TRUE);
        addColor(d, "ComboBox:\"ComboBox.listRenderer\".background", "seaGlassLightBackground", 0.0f, 0.0f, 0.0f, 0);
        addColor(d, "ComboBox:\"ComboBox.listRenderer\"[Disabled].textForeground", "seaGlassDisabledText", 0.0f, 0.0f, 0.0f, 0);
        addColor(d, "ComboBox:\"ComboBox.listRenderer\"[Selected].textForeground", "seaGlassSelectedText", 0.0f, 0.0f, 0.0f, 0);
        addColor(d, "ComboBox:\"ComboBox.listRenderer\"[Selected].background", "seaGlassSelectionBackground", 0.0f, 0.0f, 0.0f, 0);
       
        d.put("ComboBox:\"ComboBox.renderer\".contentMargins", new InsetsUIResource(2, 4, 2, 4));
        addColor(d, "ComboBox:\"ComboBox.renderer\"[Disabled].textForeground", "seaGlassDisabledText", 0.0f, 0.0f, 0.0f, 0);
        addColor(d, "ComboBox:\"ComboBox.renderer\"[Selected].textForeground", "seaGlassSelectedText", 0.0f, 0.0f, 0.0f, 0);
        addColor(d, "ComboBox:\"ComboBox.renderer\"[Selected].background", "seaGlassSelectionBackground", 0.0f, 0.0f, 0.0f, 0);

        //Initialize \"ComboBox.scrollPane\"
        d.put("\"ComboBox.scrollPane\".contentMargins", new InsetsUIResource(0, 0, 0, 0));
        
        // Seaglass starts below.
        
        String p = "ComboBox";
        d.put(p + ".States", "Enabled,Pressed,Selected,Disabled,Focused,Editable");
        d.put(p + ".Editable", new ComboBoxEditableState());
        d.put(p + ":\"ComboBox.arrowButton\".Editable", new ComboBoxArrowButtonEditableState());


        // Background
        String c = PAINTER_PREFIX + "ComboBoxPainter";

        d.put(p + "[Disabled].backgroundPainter", new LazyPainter(c, ComboBoxPainter.Which.BACKGROUND_DISABLED));
        d.put(p + "[Disabled+Pressed].backgroundPainter", new LazyPainter(c, ComboBoxPainter.Which.BACKGROUND_DISABLED_PRESSED));
        d.put(p + "[Enabled].backgroundPainter", new LazyPainter(c, ComboBoxPainter.Which.BACKGROUND_ENABLED));
        d.put(p + "[Focused].backgroundPainter", new LazyPainter(c, ComboBoxPainter.Which.BACKGROUND_FOCUSED));
        d.put(p + "[Focused+Pressed].backgroundPainter", new LazyPainter(c, ComboBoxPainter.Which.BACKGROUND_PRESSED_FOCUSED));
        d.put(p + "[Pressed].backgroundPainter", new LazyPainter(c, ComboBoxPainter.Which.BACKGROUND_PRESSED));
        d.put(p + "[Enabled+Selected].backgroundPainter", new LazyPainter(c, ComboBoxPainter.Which.BACKGROUND_ENABLED_SELECTED));

        d.put(p + "[Disabled+Editable].backgroundPainter",
              new LazyPainter(c, ComboBoxPainter.Which.BACKGROUND_DISABLED_EDITABLE));
        d.put(p + "[Editable+Enabled].backgroundPainter", new LazyPainter(c, ComboBoxPainter.Which.BACKGROUND_ENABLED_EDITABLE));
        d.put(p + "[Editable+Focused].backgroundPainter", new LazyPainter(c, ComboBoxPainter.Which.BACKGROUND_FOCUSED_EDITABLE));
        d.put(p + "[Editable+Pressed].backgroundPainter", new LazyPainter(c, ComboBoxPainter.Which.BACKGROUND_PRESSED_EDITABLE));

        // Editable arrow
        c = PAINTER_PREFIX + "ComboBoxArrowButtonPainter";
        p = "ComboBox:\"ComboBox.arrowButton\"";
        d.put(p + ".size", new Integer(22));
        d.put(p + ".States", "Enabled,Pressed,Disabled,Editable");
        d.put(p + "[Disabled+Editable].backgroundPainter",
              new LazyPainter(c, ComboBoxArrowButtonPainter.Which.BACKGROUND_DISABLED));
        d.put(p + "[Editable+Enabled].backgroundPainter",
              new LazyPainter(c, ComboBoxArrowButtonPainter.Which.BACKGROUND_ENABLED));
        d.put(p + "[Editable+Pressed].backgroundPainter",
              new LazyPainter(c, ComboBoxArrowButtonPainter.Which.BACKGROUND_PRESSED));
        d.put(p + "[Editable+Selected].backgroundPainter",
              new LazyPainter(c, ComboBoxArrowButtonPainter.Which.BACKGROUND_SELECTED));
        d.put(p + "[Enabled].foregroundPainter", new LazyPainter(c, ComboBoxArrowButtonPainter.Which.FOREGROUND_ENABLED));
        d.put(p + "[Disabled].foregroundPainter", new LazyPainter(c, ComboBoxArrowButtonPainter.Which.FOREGROUND_DISABLED));
        d.put(p + "[Pressed].foregroundPainter", new LazyPainter(c, ComboBoxArrowButtonPainter.Which.FOREGROUND_PRESSED));
        d.put(p + "[Selected].foregroundPainter", new LazyPainter(c, ComboBoxArrowButtonPainter.Which.FOREGROUND_SELECTED));
        d.put(p + "[Editable].foregroundPainter",
              new LazyPainter(c, ComboBoxArrowButtonPainter.Which.FOREGROUND_ENABLED_EDITABLE));
        d.put(p + "[Editable+Disabled].foregroundPainter",
              new LazyPainter(c, ComboBoxArrowButtonPainter.Which.FOREGROUND_DISABLED_EDITABLE));

        // Textfield
        c = PAINTER_PREFIX + "ComboBoxTextFieldPainter";
        
        p = "ComboBox:\"ComboBox.textField\"";
        d.put(p + ".contentMargins", new InsetsUIResource(2, 6, 2, 0));
        d.put(p + ".background", Color.WHITE);
        d.put(p + "[Disabled].textForeground", getDerivedColor("seaGlassDisabledText", 0.0f, 0.0f, 0.0f, 0, true));
        d.put(p + "[Disabled].backgroundPainter", new LazyPainter(c, ComboBoxTextFieldPainter.Which.BACKGROUND_DISABLED));
        d.put(p + "[Enabled].backgroundPainter", new LazyPainter(c, ComboBoxTextFieldPainter.Which.BACKGROUND_ENABLED));
        d.put(p + "[Selected].backgroundPainter", new LazyPainter(c, ComboBoxTextFieldPainter.Which.BACKGROUND_SELECTED));
    }
456831
@Override
	public void setButtonBaseStyle(String baseStyle) {
		this.setBaseStyle(baseStyle.replace("Button", "DropDownButton"));
		dropDownPanel.setStyleName(baseStyle.replace("Button", "Panel"));
	}
1166556
public final void addButton(String label, String className) {
        addButton(label, className, SimpleCallback.DEFAULT_SIMPLE_CALLBACK);
    }
1272
private void processLabelClicked(final String name, final ClickType clickType) {
            if (logger.isTraceEnabled()) {
                logger.trace("JS reports label {} clicked {}", name, clickType);
            }
            synchronized (mapCoordinateElements) {
                if (mapCoordinateElements.containsKey(name)) {
                    final MapCoordinateElement mapCoordinateElement = mapCoordinateElements.get(name).get();
                    if (mapCoordinateElement instanceof MapLabel) {
                        EventType<MapLabelEvent> eventType = null;
                        switch (clickType) {
                            case LEFT:
                                eventType = MapLabelEvent.MAPLABEL_CLICKED;
                                break;
                            case DOUBLE:
                                eventType = MapLabelEvent.MAPLABEL_DOUBLECLICKED;
                                break;
                            case RIGHT:
                                eventType = MapLabelEvent.MAPLABEL_RIGHTCLICKED;
                                break;
                            case MOUSEDOWN:
                                eventType = MapLabelEvent.MAPLABEL_MOUSEDOWN;
                                break;
                            case MOUSEUP:
                                eventType = MapLabelEvent.MAPLABEL_MOUSEUP;
                                break;
                            case ENTERED:
                                eventType = MapLabelEvent.MAPLABEL_ENTERED;
                                break;
                            case EXITED:
                                eventType = MapLabelEvent.MAPLABEL_EXITED;
                                break;
                        }
                        fireEvent(new MapLabelEvent(eventType, (MapLabel) mapCoordinateElement));
                    }
                }
            }
        }
969272
@Override
	public void setStyleName(String styleName) {
		super.setStyleName(styleName);
		memberLayout.setStyleName(styleName + "Body");
		titleLabel.setStyleName(styleName + "Title");
		buttonBaseStyle = styleName.substring(0, styleName.length() - 5) + "Button";
		for (RibbonColumn column : columns) {
			column.setButtonBaseStyle(buttonBaseStyle);
		}
	}