Package java.text

Examples of java.text.AttributedCharacterIterator.first()


    HashMap attributes = new HashMap();
    attributes.put(TextAttribute.BACKGROUND, Color.red);
    attributes.put(TextAttribute.FOREGROUND, Color.yellow);
    as.addAttributes(attributes, 2, 4);
    AttributedCharacterIterator aci = as.getIterator();
    aci.first();
    harness.check(aci.getRunStart(TextAttribute.BACKGROUND), 0);
    harness.check(aci.getRunLimit(TextAttribute.BACKGROUND), 2);
    aci.next();
    aci.next();
    harness.check(aci.getRunStart(TextAttribute.BACKGROUND), 2);
View Full Code Here


    final AttributedString as = (AttributedString) o;
    final AttributedCharacterIterator aci = as.getIterator();
    // build a plain string from aci
    // then write the string
    StringBuffer plainStr = new StringBuffer(100);
    char current = aci.first();
    while (current != CharacterIterator.DONE) {
        plainStr = plainStr.append(current);
        current = aci.next();
    }
    stream.writeObject(plainStr.toString());
View Full Code Here

        current = aci.next();
    }
    stream.writeObject(plainStr.toString());

    // then write the attributes and limits for each run
    current = aci.first();
    final int begin = aci.getBeginIndex();
    while (current != CharacterIterator.DONE) {
        // write the current character - when the reader sees that this
        // is not CharacterIterator.DONE, it will know to read the
        // run limits and attributes
View Full Code Here

                gvl.add(gl.getGlyphVector());
            }
            GVTGlyphVector gv = new MultiGlyphVector(gvl);
            gvs[chunk] = gv;
            wordInfos[chunk] = doWordAnalysis(gv, aci, numWords, frc);
            aci.first();
            BlockInfo bi = (BlockInfo)aci.getAttribute(FLOW_PARAGRAPH);
            bi.initLineInfo(frc);
            blockInfos[chunk] = bi;
            if (prevBotMargin > bi.getTopMargin())
                topSkip[chunk] = prevBotMargin;
View Full Code Here

        }
  int end = text.indexOf(pattern, currentIndex);

  AttributedCharacterIterator aci =
      textNode.getAttributedCharacterIterator();
  aci.first();
  for (int i=0; i < end; ++i) {
      aci.next();
  }
  Mark startMark = textNode.getMarkerForChar(aci.getIndex(), true);
 
View Full Code Here

                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();
                Float x = (Float) aci.getAttribute(
                    GVTAttributedCharacterIterator.TextAttribute.X);
                Float y = (Float) aci.getAttribute(
                    GVTAttributedCharacterIterator.TextAttribute.Y);
View Full Code Here

            if (c >= arabicStart && c <= arabicEnd) {
                as.addAttribute(GVTAttributedCharacterIterator.TextAttribute.ARABIC_FORM,
                                GVTAttributedCharacterIterator.TextAttribute.ARABIC_NONE, i, i+1);
            }
        }
        aci.first();

        boolean moreRuns = true;
        // for each run of arabic chars, assign the appropriate form
        while (moreRuns) {
            int start = aci.getRunStart(
View Full Code Here

        for (int i = 0 ; i < list.size(); i++) {
            StrokingTextPainter.TextRun run;
            run = (StrokingTextPainter.TextRun)list.get(i);
            TextSpanLayout layout = run.getLayout();
            AttributedCharacterIterator aci = run.getACI();
            aci.first();
            Element elem = (Element)aci.getAttribute(TEXT_COMPOUND_DELIMITER);

            if (elem == null) continue;
            if (elems.contains(elem)) continue;
            if (!isTextSensitive(elem))   continue;
View Full Code Here

        for (int i = 0 ; i < list.size(); i++) {
            StrokingTextPainter.TextRun run;
            run = (StrokingTextPainter.TextRun)list.get(i);
            TextSpanLayout layout = run.getLayout();
            AttributedCharacterIterator aci = run.getACI();
            aci.first();
            Element elem = (Element)aci.getAttribute(TEXT_COMPOUND_DELIMITER);

            if (elem == null) continue;
            if (reject.contains(elem)) continue;
            if (!isTextSensitive(elem)) {
View Full Code Here

        for (int i = 0 ; i < list.size(); i++) {
            StrokingTextPainter.TextRun run;
            run = (StrokingTextPainter.TextRun)list.get(i);
            TextSpanLayout layout = run.getLayout();
            AttributedCharacterIterator aci = run.getACI();
            aci.first();
            Element runElem = (Element)aci.getAttribute
                (TEXT_COMPOUND_DELIMITER);
            if (runElem == null) continue;

            // Only consider runElem if it is sensitive.
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.