Package javax.swing.plaf

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


                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

                // 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

                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

            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

                    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

            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

        public void paint(Graphics g, int p0, int p1, Shape bounds, JTextComponent c) {

            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
View Full Code Here

            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

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.