Package com.ibm.richtext.textlayout.attributes

Examples of com.ibm.richtext.textlayout.attributes.AttributeSet


        super(menuData);
       
        fKeys = (Object[]) keys.clone();
        fCharacter = character;
       
        AttributeSet keySet = new AttributeSet(keys);
        final StyleModifier modifier = StyleModifier.createRemoveModifier(keySet);
       
        fItem.addListener(new EventListener() {
            public void eventOccurred(EventObject event) {
                MTextPanel panel = getTextPanel();
View Full Code Here


        }
        maps = maps.addElement(bigMap);

        sets = AttributeSet.EMPTY_SET;

        sets = new AttributeSet(AttributeSet.EMPTY_SET);

        for (int i=0; i < attributes.length; i++) {
            AttributeSet newSet = new AttributeSet(attributes[i]);
            sets = sets.addElement(newSet);
        }

        AttributeSet allAttrs = AttributeSet.EMPTY_SET;
        for (int i=0; i < attributes.length; i++) {
            allAttrs = allAttrs.addElement(attributes[i]);
        }

        sets = sets.addElement(allAttrs);
    }
View Full Code Here

                _testUnionWith(testMap, (AttributeMap) unionIter.nextElement());
            }

            Enumeration setIter = sets.elements();
            while (setIter.hasMoreElements()) {
                AttributeSet testSet = (AttributeSet) setIter.nextElement();
                _testIntersectWith(testMap, testSet);
                _testRemoveAttributes(testMap, testSet);
            }
        }
    }
View Full Code Here

     */
    void _testIntersectWith(AttributeMap map, AttributeSet intersect) {

        AttributeMap lhs = map.intersectWith(intersect);

        AttributeSet keySet = map.getKeySet();
        AttributeSet removeSet = keySet.subtract(intersect);
        AttributeMap rhs = map.removeAttributes(removeSet);

        if (!equalMaps(lhs, rhs)) {
            map.intersectWith(intersect);
            logln("intersect: " + intersect);
View Full Code Here

     *    map.get() is consistent with entry's key, value;
     *    sum of hashcodes of entries equals map.hashCode().
     */
    void _testViews(AttributeMap map) {

        AttributeSet keySet = map.getKeySet();

        Enumeration keyIter = keySet.elements();
        while (keyIter.hasMoreElements()) {
            if (!map.containsKey(keyIter.nextElement())) {
                errln("keySet contains key not in map");
            }
        }

        if (gJDK11) {
            return;
        }
       
        Collection vals = map.values();
        Set entrySet = map.entrySet();

        if (keySet.size() != map.size() || entrySet.size() != map.size()) {
            errln("Set sizes are inconsistent with map size.");
        }

        int hashCode = 0;

        Iterator valueIter = vals.iterator();
        while (valueIter.hasNext()) {
            if (!map.containsValue(valueIter.next())) {
                errln("value set contains value not in map");
            }
        }

        Iterator entryIter = entrySet.iterator();
        while (entryIter.hasNext()) {

            Entry entry = (Entry) entryIter.next();

            Object key = entry.getKey();
            if (!keySet.contains(key)) {
                errln("Entry key is not in key set.");
            }

            Object value = map.get(entry.getKey());
            if (!vals.contains(value)) {
View Full Code Here

        final Object elem1 = new Object();
        final Object elem2 = new Float(4);
        final Object elem3 = "String";
        final Object elem4 = Boolean.FALSE;

        AttributeSet set1 = new AttributeSet(new Object[] {elem1, elem2, elem3});
        if (set1.size() != 3) {
            errln("Size is wrong.");
        }

        if (set1.contains(elem4)){
            errln("Set contents are wrong.");
        }

        if (!set1.contains(elem1)) {
            errln("Set contents are wrong.");
        }

        AttributeSet set2 = new AttributeSet(elem4);

        if (set2.size() != 1) {
            errln("Size is wrong.");
        }

        if (!set2.contains(elem4)){
            errln("Set contents are wrong.");
        }

        if (set2.contains(elem1)) {
            errln("Set contents are wrong.");
        }

        Enumeration iter = set2.elements();
        if (!iter.nextElement().equals(elem4)) {
            errln("Invalid object in iterator.");
        }

        AttributeSet union = set2.unionWith(set1);
        if (!set1.unionWith(set2).equals(union)) {
            errln("unionWith is not commutative.");
        }

        if (!union.contains(elem1) || !union.contains(elem4)) {
            errln("Set contents are wrong.");
        }

        if (!set1.addElement(elem4).equals(union)) {
            errln("addElement is wrong.");
        }

        if (!union.intersectWith(set1).equals(set1)) {
            errln("intersectWith is wrong.");
        }

        if (!union.subtract(set1).equals(set2)) {
            errln("subtract is wrong.");
        }
    }
View Full Code Here

                MTextPanel panel = getTextPanel();
                if (panel == null) {
                    throw new Error("Menu item is enabled when panel is null!");
                }
                if (continuousAndCommand()) {
                    AttributeSet set = new AttributeSet(fKey);
                    modifier = StyleModifier.createRemoveModifier(set);
                }
                else {
                    modifier = StyleModifier.createAddModifier(fKey, fOnValue);
                }
View Full Code Here

            throw new Error("Menu item is enabled when panel is null!");
        }
       
        StyleModifier modifier;
        if (value == null) {
            AttributeSet set = new AttributeSet(fKey);
            modifier = StyleModifier.createRemoveModifier(set);
        }
        else {
            modifier = StyleModifier.createAddModifier(fKey, value);
        }
View Full Code Here

        StyleModifier modifier;
        if (value != null) {
            modifier = StyleModifier.createAddModifier(fKey, value);
        }
        else {
            AttributeSet set = new AttributeSet(fKey);
            modifier = StyleModifier.createRemoveModifier(set);
        }
       
        if (fCharacter == MenuItemSet.CHARACTER) {
            fTextPanel.modifyCharacterStyleOnSelection(modifier);
View Full Code Here

        StyleModifier modifier;
        if (value != null) {
            modifier = StyleModifier.createAddModifier(fKey, value);
        }
        else {
            AttributeSet set = new AttributeSet(fKey);
            modifier = StyleModifier.createRemoveModifier(set);
        }

        if (fCharacter == MenuItemSet.CHARACTER) {
            fTextPanel.modifyCharacterStyleOnSelection(modifier);
View Full Code Here

TOP

Related Classes of com.ibm.richtext.textlayout.attributes.AttributeSet

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.