Package javax.swing.text.html.CSS

Examples of javax.swing.text.html.CSS.Attribute


        MutableAttributeSet converted = new SimpleAttributeSet(old);
        Enumeration attrKeys = attr.getAttributeNames();
        while (attrKeys.hasMoreElements()) {
            Object key = attrKeys.nextElement();
            Object value = attr.getAttribute(key);
            Attribute cssKey = (Attribute)CSS.mapToCSSForced(key);
            if (cssKey == null) {
                if (key == StyleConstants.Underline
                    || key == StyleConstants.StrikeThrough) {

                    value = createTextDecoration(converted, key, value);
                    key = CSS.Attribute.TEXT_DECORATION;
                }
                converted.addAttribute(key, value);
            } else {
                if (!(value instanceof CSS.PropertyValueConverter)) {
                    value = cssKey.getConverter().toCSS(value);
                }
                if (value != null) {
                    converted.addAttribute(cssKey, value);
                }
            }
View Full Code Here


                return super.removeAttribute(old, Attribute.TEXT_DECORATION);
            }
            return super.addAttribute(old, Attribute.TEXT_DECORATION, td);
        }

        Attribute cssKey = (Attribute)CSS.mapToCSSForced(key);
        if (cssKey == null) {
            return super.removeAttribute(old, key);
        }
        return super.removeAttribute(old, cssKey);
    }
View Full Code Here

        return CSS.FontSize.sizeValueIndex((int)size) + 1;
    }

    public AttributeSet addAttribute(final AttributeSet old, final Object key,
                                     final Object value) {
        Attribute cssKey = (Attribute)CSS.mapToCSSForced(key);
        if (cssKey == null || cssKey.getConverter() == null) {
            if (key == StyleConstants.Underline
                || key == StyleConstants.StrikeThrough) {

                return super.addAttribute(old, CSS.Attribute.TEXT_DECORATION,
                                          createTextDecoration(old, key, value));
            }
            return super.addAttribute(old, key, value);
        }
        return super.addAttribute(old, cssKey,
                                  value instanceof PropertyValueConverter
                                  ? value : cssKey.getConverter().toCSS(value));
    }
View Full Code Here

        MutableAttributeSet converted = new SimpleAttributeSet(old);
        Enumeration attrKeys = attr.getAttributeNames();
        while (attrKeys.hasMoreElements()) {
            Object key = attrKeys.nextElement();
            Object value = attr.getAttribute(key);
            Attribute cssKey = (Attribute)CSS.mapToCSSForced(key);
            if (cssKey == null) {
                if (key == StyleConstants.Underline
                    || key == StyleConstants.StrikeThrough) {

                    value = createTextDecoration(converted, key, value);
                    key = CSS.Attribute.TEXT_DECORATION;
                }
                converted.addAttribute(key, value);
            } else {
                if (!(value instanceof CSS.PropertyValueConverter)) {
                    value = cssKey.getConverter().toCSS(value);
                }
                if (value != null) {
                    converted.addAttribute(cssKey, value);
                }
            }
View Full Code Here

                return super.removeAttribute(old, Attribute.TEXT_DECORATION);
            }
            return super.addAttribute(old, Attribute.TEXT_DECORATION, td);
        }

        Attribute cssKey = (Attribute)CSS.mapToCSSForced(key);
        if (cssKey == null) {
            return super.removeAttribute(old, key);
        }
        return super.removeAttribute(old, cssKey);
    }
View Full Code Here

        return CSS.FontSize.sizeValueIndex((int)size) + 1;
    }

    public AttributeSet addAttribute(final AttributeSet old, final Object key,
                                     final Object value) {
        Attribute cssKey = (Attribute)CSS.mapToCSSForced(key);
        if (cssKey == null || cssKey.getConverter() == null) {
            if (key == StyleConstants.Underline
                || key == StyleConstants.StrikeThrough) {

                return super.addAttribute(old, CSS.Attribute.TEXT_DECORATION,
                                          createTextDecoration(old, key, value));
            }
            return super.addAttribute(old, key, value);
        }
        return super.addAttribute(old, cssKey,
                                  value instanceof PropertyValueConverter
                                  ? value : cssKey.getConverter().toCSS(value));
    }
View Full Code Here

        MutableAttributeSet converted = new SimpleAttributeSet(old);
        Enumeration attrKeys = attr.getAttributeNames();
        while (attrKeys.hasMoreElements()) {
            Object key = attrKeys.nextElement();
            Object value = attr.getAttribute(key);
            Attribute cssKey = (Attribute)CSS.mapToCSSForced(key);
            if (cssKey == null) {
                if (key == StyleConstants.Underline
                    || key == StyleConstants.StrikeThrough) {

                    value = createTextDecoration(converted, key, value);
                    key = CSS.Attribute.TEXT_DECORATION;
                }
                converted.addAttribute(key, value);
            } else {
                if (!(value instanceof CSS.PropertyValueConverter)) {
                    value = cssKey.getConverter().toCSS(value);
                }
                if (value != null) {
                    converted.addAttribute(cssKey, value);
                }
            }
View Full Code Here

                return super.removeAttribute(old, Attribute.TEXT_DECORATION);
            }
            return super.addAttribute(old, Attribute.TEXT_DECORATION, td);
        }

        Attribute cssKey = (Attribute)CSS.mapToCSSForced(key);
        if (cssKey == null) {
            return super.removeAttribute(old, key);
        }
        return super.removeAttribute(old, cssKey);
    }
View Full Code Here

        return CSS.FontSize.sizeValueIndex((int)size) + 1;
    }

    public AttributeSet addAttribute(final AttributeSet old, final Object key,
                                     final Object value) {
        Attribute cssKey = (Attribute)CSS.mapToCSSForced(key);
        if (cssKey == null || cssKey.getConverter() == null) {
            if (key == StyleConstants.Underline
                || key == StyleConstants.StrikeThrough) {

                return super.addAttribute(old, CSS.Attribute.TEXT_DECORATION,
                                          createTextDecoration(old, key, value));
            }
            return super.addAttribute(old, key, value);
        }
        return super.addAttribute(old, cssKey,
                                  value instanceof PropertyValueConverter
                                  ? value : cssKey.getConverter().toCSS(value));
    }
View Full Code Here

        MutableAttributeSet converted = new SimpleAttributeSet(old);
        Enumeration attrKeys = attr.getAttributeNames();
        while (attrKeys.hasMoreElements()) {
            Object key = attrKeys.nextElement();
            Object value = attr.getAttribute(key);
            Attribute cssKey = (Attribute)CSS.mapToCSSForced(key);
            if (cssKey == null) {
                if (key == StyleConstants.Underline
                    || key == StyleConstants.StrikeThrough) {

                    value = createTextDecoration(converted, key, value);
                    key = CSS.Attribute.TEXT_DECORATION;
                }
                converted.addAttribute(key, value);
            } else {
                if (!(value instanceof CSS.PropertyValueConverter)) {
                    value = cssKey.getConverter().toCSS(value);
                }
                if (value != null) {
                    converted.addAttribute(cssKey, value);
                }
            }
View Full Code Here

TOP

Related Classes of javax.swing.text.html.CSS.Attribute

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.