Package com.ibm.richtext.textlayout.attributes

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


        else {
            selRange = new TextRange(0, 0);
        }

        if (selRange.start == selRange.limit) {
            AttributeMap pStyle = fText.paragraphStyleAt(selRange.start);
            Object value = pStyle.get(key);
            return value==null? getDefaultValues().get(key) : value;
        }
        else {
            int paragraphStart = selRange.start;
            Object defaultValue = getDefaultValues().get(key);
View Full Code Here


     * @param paragraphStyle the paragraph style which the TabRuler will
     *     reflect
     */
    private void set(AttributeMap paragraphStyle, boolean update) {

        AttributeMap panelDefaults;
       
        if (fTextPanel==null) {
            panelDefaults = TextPanel.getDefaultSettings().getDefaultValues();
        }
        else {
View Full Code Here

        while (fColorer.next()) {

            int rangeStart = fColorer.currentStart();
            int rangeLimit = fColorer.currentLimit();
           
            AttributeMap style = fColorer.currentStyle();
           
            if (oldText.characterStyleLimit(rangeStart) < rangeLimit ||
                    oldText.characterStyleAt(rangeStart) != style) {
           
                int cstart = rangeStart-start;
View Full Code Here

    protected CodeEdit(String[] args, int start) {

        super(Toolkit.getDefaultToolkit().getSystemClipboard(),
              TextDocument.PLAIN_TEXT);

        AttributeMap defaultStyle = new AttributeMap(TextAttribute.SIZE, new Float(12))
                                       .addAttribute(TextAttribute.FAMILY, "Monospaced");
                                      
        fSettings = TextPanel.getDefaultSettings();
        fSettings.setWraps(false);
        fSettings.addDefaultValues(defaultStyle);
View Full Code Here

/**
* Update the style table to reflect a change in the RunArray's size.
*/
    private void handleArrayResize(int oldNegStart) {

        AttributeMap newStyleTable[] = new AttributeMap[fRunArray.getArrayLength()];
        System.arraycopy(fStyleTable, 0, newStyleTable, 0, fRunArray.fPosEnd+1);
        System.arraycopy(fStyleTable, oldNegStart, newStyleTable, fRunArray.fNegStart, (fRunArray.getArrayLength()-fRunArray.fNegStart));
        fStyleTable = newStyleTable;
    }
View Full Code Here

        int newEnd = fRunArray.findRunContaining(start-1);

        if (newEnd != fRunArray.fPosEnd) {

            AttributeMap propStyle = fStyleTable[fRunArray.fPosEnd];
            boolean propogated;

            if (newEnd == -1) {
                propogated = !propStyle.equals(fFirstStyle);
                fFirstStyle = propStyle;
            }
            else {
                propogated = !propStyle.equals(fStyleTable[newEnd]);
                fStyleTable[newEnd] = propStyle;
            }

            if (propogated) {
                int pStart = (newEnd==-1)? 0 : fRunArray.fRunStart[newEnd] + 1;
View Full Code Here

            run = fRunArray.fNegStart;
        else if (run == fRunArray.fNegStart-1)
            run = fRunArray.fPosEnd;

        int runStart;
        AttributeMap style;

        if (run < 0) {
            runStart = 0;
            style = fFirstStyle;
        }
View Full Code Here

        if (insLength == 0)
            return;

        final int oldPosEnd = fRunArray.fPosEnd;
        AttributeMap origStyle;
        if (limit < origLength) {
            origStyle = (fRunArray.fPosEnd>=0)? fStyleTable[fRunArray.fPosEnd] : fFirstStyle;
        }
        else {
            origStyle = srcText.paragraphStyleAt(srcLimit);
        }

        int paragraphStart = srcStart;
        int lastPLimit = srcText.paragraphStart(srcLimit);
        boolean separatorAtEnd = lastPLimit > srcStart && isParagraphBreak(srcText.at(lastPLimit-1));

        if (limit == origLength && lastPLimit == paragraphStart) {
            if (fRunArray.fPosEnd > 0) {
                fStyleTable[fRunArray.fPosEnd] = origStyle;
            }
            else {
                fFirstStyle = origStyle;
            }
        }
        else {
            boolean firstPass = true;
            while (paragraphStart < lastPLimit) {

                AttributeMap style = srcText.paragraphStyleAt(paragraphStart);
                int paragraphLimit = srcText.paragraphLimit(paragraphStart);

                if (fRunArray.fPosEnd+1 >= fRunArray.fNegStart)
                    expandStyleTable();

                if (fRunArray.fPosEnd >= 0) {
                    if (!style.equals(fStyleTable[fRunArray.fPosEnd])) {
                        fStyleTable[fRunArray.fPosEnd] = style;
                        if (firstPass) {
                            int pStart = fRunArray.fRunStart[fRunArray.fPosEnd]+1;
                            damagedRange[0] = Math.min(damagedRange[0], pStart);
                        }
                    }
                }
                else if (!style.equals(fFirstStyle)) {
                    fFirstStyle = style;
                    damagedRange[0] = 0;
                }

                firstPass = false;
View Full Code Here

            boolean modified = false;

            if (run < 0) {

                AttributeMap newStyle = modifier.modifyStyle(fFirstStyle);

                if (!newStyle.equals(fFirstStyle)) {
                    fFirstStyle = newStyle;
                    modified = true;
                }
            }
            else {

                AttributeMap newStyle = modifier.modifyStyle(fStyleTable[run]);

                if (!fStyleTable[run].equals(newStyle)) {
                    fStyleTable[run] = newStyle;
                    modified = true;
                }
View Full Code Here

/**
* Update the style table to reflect a change in the RunArray's size.
*/
    private void handleArrayResize(int oldNegStart) {

        AttributeMap newStyleTable[] = new AttributeMap[fRunArray.getArrayLength()];
        System.arraycopy(fStyleTable, 0, newStyleTable, 0, fRunArray.fPosEnd+1);
        System.arraycopy(fStyleTable, oldNegStart, newStyleTable, fRunArray.fNegStart, (fRunArray.getArrayLength()-fRunArray.fNegStart));
        fStyleTable = newStyleTable;
    }
View Full Code Here

TOP

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

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.