Package com.seaglasslookandfeel

Examples of com.seaglasslookandfeel.SeaGlassStyle$RuntimeState


        updateStyle(comboBox);
    }

    private void updateStyle(JComboBox comboBox) {
        SeaGlassStyle oldStyle = style;
        SeaGlassContext context = getContext(comboBox, ENABLED);

        style = (SeaGlassStyle) SeaGlassLookAndFeel.updateStyle(context, this);
        if (style != oldStyle) {
            popupInsets = (Insets) style.get(context, "ComboBox.popupInsets");
View Full Code Here


     * @param context the SeaGlassContext.
     * @param prefix  the control prefix, e.g. "TextField",
     *                "FormattedTextField", or "PasswordField".
     */
    static void updateStyle(JTextComponent c, SeaGlassContext context, String prefix) {
        SeaGlassStyle style = (SeaGlassStyle) context.getStyle();

        Color color = c.getCaretColor();

        if (color == null || color instanceof UIResource) {
            c.setCaretColor((Color) style.get(context, prefix + ".caretForeground"));
        }

        Color fg = c.getForeground();

        if (fg == null || fg instanceof UIResource) {
            fg = style.getColorForState(context, ColorType.TEXT_FOREGROUND);
            if (fg != null) {
                c.setForeground(fg);
            }
        }

        Object ar = style.get(context, prefix + ".caretAspectRatio");

        if (ar instanceof Number) {
            c.putClientProperty("caretAspectRatio", ar);
        }

        context.setComponentState(SELECTED | FOCUSED);

        Color s = c.getSelectionColor();

        if (s == null || s instanceof UIResource) {
            c.setSelectionColor(style.getColor(context, ColorType.TEXT_BACKGROUND));
        }

        Color sfg = c.getSelectedTextColor();

        if (sfg == null || sfg instanceof UIResource) {
            c.setSelectedTextColor(style.getColor(context, ColorType.TEXT_FOREGROUND));
        }

        context.setComponentState(DISABLED);

        Color dfg = c.getDisabledTextColor();

        if (dfg == null || dfg instanceof UIResource) {
            c.setDisabledTextColor(style.getColor(context, ColorType.TEXT_FOREGROUND));
        }

        Insets margin = c.getMargin();

        if (margin == null || margin instanceof UIResource) {
            margin = (Insets) style.get(context, prefix + ".margin");
            if (margin == null) {
                // Some places assume margins are non-null.
                margin = SeaGlassLookAndFeel.EMPTY_UIRESOURCE_INSETS;
            }

            c.setMargin(margin);
        }

        Caret caret = c.getCaret();

        if (caret instanceof UIResource) {
            Object o = style.get(context, prefix + ".caretBlinkRate");

            if (o != null && o instanceof Integer) {
                Integer rate = (Integer) o;

                caret.setBlinkRate(rate.intValue());
View Full Code Here

        super.installUI(c);
    }

    private void updateStyle(JTextComponent comp) {
        SeaGlassContext context = getContext(comp, ENABLED);
        SeaGlassStyle oldStyle = style;

        style = (SeaGlassStyle) SeaGlassLookAndFeel.updateStyle(context, this);

        if (style != oldStyle) {
            SeaGlassTextFieldUI.updateStyle(comp, context, getPropertyPrefix());
View Full Code Here

        SeaGlassContext context = getContext(c, ENABLED);
        Window window = SwingUtilities.getWindowAncestor(popupMenu);
        if (PlatformUtils.isMac() && window != null) {
            WindowUtils.makeWindowNonOpaque(window);
        }
        SeaGlassStyle oldStyle = style;
        style = (SeaGlassStyle) SeaGlassLookAndFeel.updateStyle(context, this);
        if (style != oldStyle) {
            if (oldStyle != null) {
                uninstallKeyboardActions();
                installKeyboardActions();
View Full Code Here

     *      int, int, int, int)
     */
    public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
        JComponent      jc      = (JComponent) c;
        SeaGlassContext context = (SeaGlassContext) ui.getContext(jc);
        SeaGlassStyle   style   = (SeaGlassStyle) context.getStyle();

        if (style == null) {
            assert false : "SeaGlassBorder is being used outside after the UI has been uninstalled";

            return;
View Full Code Here

TOP

Related Classes of com.seaglasslookandfeel.SeaGlassStyle$RuntimeState

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.