Package javax.swing.plaf

Examples of javax.swing.plaf.TextUI.modelToView()


            Rectangle startRect = null;
            Rectangle endRect = null;
            Rectangle shapeBounds = shape.getBounds();

            try {
                startRect = textUI.modelToView(jtc, start,
                                               Position.Bias.Forward);
                endRect = textUI.modelToView(jtc, end, Position.Bias.Backward);
            } catch (final BadLocationException e) {
            }
View Full Code Here


            Rectangle shapeBounds = shape.getBounds();

            try {
                startRect = textUI.modelToView(jtc, start,
                                               Position.Bias.Forward);
                endRect = textUI.modelToView(jtc, end, Position.Bias.Backward);
            } catch (final BadLocationException e) {
            }

            if (startRect == null || endRect == null) {
                return;
View Full Code Here

            r1 = jta.modelToView(6);
            r2 = jta.modelToView(10);
            r3 = jta.modelToView(15);
            r4 = jta.modelToView(2);
            TextUI textUI = jta.getUI();
            r5 = textUI.modelToView(jta, 5, Position.Bias.Backward);
            r6 = textUI.modelToView(jta, 7, Position.Bias.Forward);
            assertNotNull(r1);
            assertNotNull(r2);
            assertNotNull(r3);
            assertNotNull(r4);
View Full Code Here

            r2 = jta.modelToView(10);
            r3 = jta.modelToView(15);
            r4 = jta.modelToView(2);
            TextUI textUI = jta.getUI();
            r5 = textUI.modelToView(jta, 5, Position.Bias.Backward);
            r6 = textUI.modelToView(jta, 7, Position.Bias.Forward);
            assertNotNull(r1);
            assertNotNull(r2);
            assertNotNull(r3);
            assertNotNull(r4);
        } catch (BadLocationException e) {
View Full Code Here

            public void paint(final Graphics g) {
                /* painting cursor. If it is not visible it is out of focus, we
                 * make it barely visible. */
                try {
                    final TextUI mapper = getComponent().getUI();
                    final Rectangle r = mapper.modelToView(getComponent(), getDot(), getDotBias());
                    if (r == null) {
                        return;
                    }
                    g.setColor(getComponent().getCaretColor());
                    if (isVisible() && editEnabled) {
View Full Code Here

                Map m = hdoc.getMap((String)useMap);
                if (m != null && offset < hdoc.getLength()) {
                    Rectangle bounds;
                    TextUI ui = html.getUI();
                    try {
                        Shape lBounds = ui.modelToView(html, offset,
                                                   Position.Bias.Forward);
                        Shape rBounds = ui.modelToView(html, offset + 1,
                                                   Position.Bias.Backward);
                        bounds = lBounds.getBounds();
                        bounds.add((rBounds instanceof Rectangle) ?
View Full Code Here

                    Rectangle bounds;
                    TextUI ui = html.getUI();
                    try {
                        Shape lBounds = ui.modelToView(html, offset,
                                                   Position.Bias.Forward);
                        Shape rBounds = ui.modelToView(html, offset + 1,
                                                   Position.Bias.Backward);
                        bounds = lBounds.getBounds();
                        bounds.add((rBounds instanceof Rectangle) ?
                                    (Rectangle)rBounds : rBounds.getBounds());
                    } catch (BadLocationException ble) {
View Full Code Here

                                                   Element e, int offset,
                                                   int x, int y) {
            if (e != null && offset > 0 && e.getStartOffset() == offset) {
                try {
                    TextUI ui = editor.getUI();
                    Shape s1 = ui.modelToView(editor, offset,
                                              Position.Bias.Forward);
                    if (s1 == null) {
                        return false;
                    }
                    Rectangle r1 = (s1 instanceof Rectangle) ? (Rectangle)s1 :
View Full Code Here

                    if (s1 == null) {
                        return false;
                    }
                    Rectangle r1 = (s1 instanceof Rectangle) ? (Rectangle)s1 :
                                    s1.getBounds();
                    Shape s2 = ui.modelToView(editor, e.getEndOffset(),
                                              Position.Bias.Backward);
                    if (s2 != null) {
                        Rectangle r2 = (s2 instanceof Rectangle) ? (Rectangle)s2 :
                                    s2.getBounds();
                        r1.add(r2);
View Full Code Here

    try {

      // Determine locations.
      TextUI mapper = c.getUI();
      Rectangle p0 = mapper.modelToView(c, offs0);
      Rectangle p1 = mapper.modelToView(c, offs1);
      Paint paint = getPaint();
      if (paint==null)
        g2d.setColor(c.getSelectionColor());
      else
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.