Package java.text

Examples of java.text.AttributedString.addAttributes()


                reorderedAS.addAttributes(prevAttrMap, runStart, i);
                prevAttrMap = attrMap;
                runStart = i;
            }
        }
        reorderedAS.addAttributes(prevAttrMap, runStart, numChars);

        // transfer any position atttributes to the new first char
        this.aci.first();
        Float x = (Float) this.aci.getAttribute
            (GVTAttributedCharacterIterator.TextAttribute.X);
View Full Code Here


        String text = getCurrentLineText();
        AttributedString attrString = new AttributedString(text, STYLE_BASE);
        int startCharIndex = 0;
        for (LineCacheEntry entry : currentLineCache) {
            int endCharIndex = startCharIndex + entry.text.length();
            attrString.addAttributes(entry.attributes, startCharIndex, endCharIndex);
            startCharIndex = endCharIndex;
        }
        lines.add(attrString);
        textLines.add(text);
View Full Code Here

            }
            AttributedString reorderedAS = new AttributedString(reorderedString);
            for (int i = 0; i < numChars; i++) {
                aci.setIndex(charOrder[i]);
                Map attributes = aci.getAttributes();
                reorderedAS.addAttributes(attributes, i, i+1);
            }
            if (charOrder[0] == (aci.getBeginIndex()+1) && charOrder[1] == aci.getBeginIndex()) {
                // have swapped the first 2 chars, may need to move any position attributes

                aci.first();
View Full Code Here

        // construct the reordered ACI
        AttributedString reorderedAS = new AttributedString(reorderedString);
        for (int i = 0; i < numChars; i++) {
            this.aci.setIndex(newCharOrder[i]);
            Map attributes = this.aci.getAttributes();
            reorderedAS.addAttributes(attributes, i, i+1);
        }

        // transfer any position atttributes to the new first char
        this.aci.first();
        Float x = (Float) this.aci.getAttribute(
View Full Code Here

        this.visible = DEFAULT_AXIS_VISIBLE;
        this.labelFont = DEFAULT_AXIS_LABEL_FONT;
        this.labelPaint = DEFAULT_AXIS_LABEL_PAINT;
        if (label != null) {
            AttributedString s = new AttributedString(label);
            s.addAttributes(this.labelFont.getAttributes(), 0, label.length());
            this.label = s;
        }
        this.labelInsets = DEFAULT_AXIS_LABEL_INSETS;
        this.labelAngle = 0.0;
        this.labelLocation = AxisLabelLocation.MIDDLE;
View Full Code Here

    public AttributedString createLabel(String label) {
        if (label == null) {
            return null;
        }
        AttributedString s = new AttributedString(label);
        s.addAttributes(this.labelFont.getAttributes(), 0, label.length());
        return s;
    }
   
    /**
     * Returns the font for the axis label.
View Full Code Here

                baseStr = this.baseFormatter.format(this.base);
            }
            double logy = calculateLog(value);
            String exponentStr = getTickUnit().valueToString(logy);
            AttributedString as = new AttributedString(baseStr + exponentStr);
            as.addAttributes(getTickLabelFont().getAttributes(), 0, (baseStr
                    + exponentStr).length());
            as.addAttribute(TextAttribute.SUPERSCRIPT,
                    TextAttribute.SUPERSCRIPT_SUPER, baseStr.length(),
                    baseStr.length() + exponentStr.length());
            return as;
View Full Code Here

            while (c != CharacterIterator.DONE) {
                int limit = stream.readInt();
                Map<? extends AttributedCharacterIterator.Attribute, ?> atts
                        = (Map<? extends AttributedCharacterIterator.Attribute,
                        ?>) stream.readObject();
                result.addAttributes(atts, start, limit);
                start = limit;
                c = stream.readChar();
            }
        }
        return result;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.