Examples of TextKit


Examples of org.apache.harmony.awt.text.TextKit

        public float getAlignment(final int axis) {
            return ALIGN_LEFT;
        }

        public void paint(final Graphics g, final Shape shape) {
            TextKit textKit = getTextKit();

            if (textKit != null) {
                textKit.paintLayeredHighlights(g, getStartOffset(),
                                               getEndOffset() - 1,
                                               shape, this);
            }

            super.paint(g, shape);
View Full Code Here

Examples of org.apache.harmony.awt.text.TextKit

        paintParams.updateFields();

        final Rectangle clipBounds = g.getClipBounds();
        final int height = metrics.getHeight();

        final TextKit textKit = getTextKit();
        for (int i = 0; i < getElement().getElementCount(); i++, y += height) {
            if (!lineToRect(shape, i).intersects(clipBounds)) {
                continue;
            }

            if (textKit != null) {
                Element line = getElement().getElement(i);
                textKit.paintLayeredHighlights(g, line.getStartOffset(),
                                               line.getEndOffset() - 1,
                                               shape, this);
            }
            drawLine(i, g, bounds.x, y);
        }
View Full Code Here

Examples of org.apache.harmony.awt.text.TextKit

        }

        private void paintHilite(final int start, final int end,
                                 final Graphics g, final Shape shape) {
            TextKit textKit = getTextKit();
            if (textKit != null) {
                textKit.paintLayeredHighlights(g, start, end, shape, this);
            }
        }
View Full Code Here

Examples of org.apache.harmony.awt.text.TextKit

        return getFontMetrics(v).getDescent();
    }

    public void paint(final GlyphView v, final Graphics g, final Shape alloc,
                      final int startOffset, final int endOffset) {
        final TextKit textKit = v.getTextKit();
        textKit.paintLayeredHighlights(g, startOffset, endOffset, alloc, v);

        final Rectangle bounds = alloc.getBounds();
        final Font font = v.getFont();
        final TextPainter painter = new TextPainter(v, bounds, font,
                                                    g instanceof Graphics2D
                                                    && v.isUnderline()
                                                       || v.isStrikeThrough());
        final UnselectedTextInterval ui =
            new UnselectedTextInterval(v.getStartOffset(), v.getEndOffset(),
                                       painter);
        final SelectedTextInterval si =
            new SelectedTextInterval(textKit.getSelectionStart(),
                                     textKit.getSelectionEnd(), painter);
        final List intervals = Arrays.asList(ui.dissect(si));

        Color oldColor = g.getColor();
        Font oldFont = g.getFont();
View Full Code Here

Examples of org.apache.harmony.awt.text.TextKit

       
        ActiveClient() throws HeadlessException {
            // prevent IM invocation on this component
            enableInputMethods(false);
            ComponentInternals ci = ComponentInternals.getComponentInternals();
            TextKit textKit = ci.getTextKit(this);
            caret = (DefaultCaret) textKit.getCaret();
            caret.setBlinkRate(0);
            caret.setVisible(true);
            imRequests = new InputMethodRequestsImpl(textKit) {
                @Override
                public TextHitInfo getLocationOffset(int x, int y) {
View Full Code Here

Examples of org.apache.harmony.awt.text.TextKit

       
        ActiveClient() throws HeadlessException {
            // prevent IM invocation on this component
            enableInputMethods(false);
            ComponentInternals ci = ComponentInternals.getComponentInternals();
            TextKit textKit = ci.getTextKit(this);
            caret = (DefaultCaret) textKit.getCaret();
            caret.setBlinkRate(0);
            caret.setVisible(true);
            imRequests = new InputMethodRequestsImpl(textKit) {
                @Override
                public TextHitInfo getLocationOffset(int x, int y) {
View Full Code Here

Examples of org.apache.harmony.awt.text.TextKit

     * depending on <code>isMovingCaret</code> value
     */
    final void changeCaretPosition(
            final JTextComponent component, final int newPos,
            final boolean isMovingCaret, final Position.Bias newBias) {
        TextKit textKit = TextUtils.getTextKit(component);
        TextUtils.changeCaretPosition(textKit, newPos, isMovingCaret, newBias);
    }
View Full Code Here

Examples of org.apache.harmony.awt.text.TextKit

     */
    final void setMagicPosition(
            final JTextComponent source, final int pos,
            final int direction, final Point oldPoint)
            throws BadLocationException {
        TextKit textKit = TextUtils.getTextKit(source);
        textKit.getCaret().setMagicCaretPosition(pos, direction, oldPoint);
    }
View Full Code Here

Examples of org.apache.harmony.awt.text.TextKit

        return getFontMetrics(v).getDescent();
    }

    public void paint(final GlyphView v, final Graphics g, final Shape alloc,
                      final int startOffset, final int endOffset) {
        final TextKit textKit = v.getTextKit();
        textKit.paintLayeredHighlights(g, startOffset, endOffset, alloc, v);

        final Rectangle bounds = alloc.getBounds();
        final Font font = v.getFont();
        final TextPainter painter = new TextPainter(v, bounds, font,
                                                    g instanceof Graphics2D
                                                    && v.isUnderline()
                                                       || v.isStrikeThrough());
        final UnselectedTextInterval ui =
            new UnselectedTextInterval(v.getStartOffset(), v.getEndOffset(),
                                       painter);
        final SelectedTextInterval si =
            new SelectedTextInterval(textKit.getSelectionStart(),
                                     textKit.getSelectionEnd(), painter);
        final List intervals = Arrays.asList(ui.dissect(si));

        Color oldColor = g.getColor();
        Font oldFont = g.getFont();
View Full Code Here

Examples of org.apache.harmony.awt.text.TextKit

        paintParams.updateFields();

        final Rectangle clipBounds = g.getClipBounds();
        final int height = metrics.getHeight();

        final TextKit textKit = getTextKit();
        for (int i = 0; i < getElement().getElementCount(); i++, y += height) {
            if (!lineToRect(shape, i).intersects(clipBounds)) {
                continue;
            }

            if (textKit != null) {
                Element line = getElement().getElement(i);
                textKit.paintLayeredHighlights(g, line.getStartOffset(),
                                               line.getEndOffset() - 1,
                                               shape, this);
            }
            drawLine(i, g, bounds.x, y);
        }
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.