Examples of modelToView()


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

                                                   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

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

                    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

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

    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

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

    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
        g2d.setPaint(paint);
View Full Code Here

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

                int dot = getDot();
                // PENDING: We need to expose the bias in DefaultCaret.
                Position.Bias bias = Position.Bias.Forward;
                Rectangle startRect = null;
                try {
                    startRect = ui.modelToView(field, dot, bias);
                } catch (BadLocationException ble) {}

                Insets i = field.getInsets();
                BoundedRangeModel vis = field.getHorizontalVisibility();
                int x = r.x + vis.getValue() - i.left;
View Full Code Here

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

                // the model hasn't changed. This checks for the change,
                // and if necessary, resets the internal location.
                if (startRect != null) {
                    try {
                        Rectangle endRect;
                        endRect = ui.modelToView(field, dot, bias);
                        if (endRect != null && !endRect.equals(startRect)){
                            damage(endRect);
                        }
                    } catch (BadLocationException ble) {}
                }
View Full Code Here

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

                JTextComponent c) {
            Rectangle alloc = bounds.getBounds();
            try {
                // --- determine locations ---
                TextUI mapper = c.getUI();
                Rectangle p0 = mapper.modelToView(c, offs0);
                Rectangle p1 = mapper.modelToView(c, offs1);

                // --- render ---
                Color color = getColor();
View Full Code Here

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

            Rectangle alloc = bounds.getBounds();
            try {
                // --- determine locations ---
                TextUI mapper = c.getUI();
                Rectangle p0 = mapper.modelToView(c, offs0);
                Rectangle p1 = mapper.modelToView(c, offs1);

                // --- render ---
                Color color = getColor();

                if (color == null) {
View Full Code Here

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

                    int start = e.getStartOffset();

                    try
                    {
                        Rectangle rect = tui.modelToView(textPane, start, Bias.Forward);
                        if( rect==null )continue;

                        String textToRender = Integer.toString(i+1);
                        Rectangle2D textRect = fnt.getStringBounds(textToRender, fctx);
View Full Code Here

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

            try {
               
                TextUI textUI = c.getUI();
                Rectangle start = textUI.modelToView(c, p0);
                Rectangle end = textUI.modelToView(c, p1);

                g.setColor(getLineColor());

                // This is the y coordinate of the bottom of the area we can draw in
                int y = start.y + start.height - 1;
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.