Examples of modelToView()


Examples of javax.swing.JEditorPane.modelToView()

                searchString = "Data types:\n"
                  + e.getDescription().substring(1);
                pos = content.indexOf(searchString);
              }

              final Rectangle r = pane.modelToView(pos);
              System.out.println();
              r.y += pane.getVisibleRect().height;
              pane.scrollRectToVisible(r);
              // pane.setCaretPosition(pos);
            } catch (final Throwable t2) {
View Full Code Here

Examples of javax.swing.JEditorPane.modelToView()

                    int i, k = eps.length;
                    for (i = 0; i < k; i++) {
                        if (eps[i].getDocument() == doc) {
                            final JEditorPane ep = eps[i];
                            try {
                                ep.scrollRectToVisible(ep.modelToView(offset));
                            } catch (BadLocationException ex) {
                                //      ErrorManager.getDefault ().notify (ex);
                            }
                        }
                    }
View Full Code Here

Examples of javax.swing.JTextPane.modelToView()

                    // まずは text の検索
                    int pos = pPane.getText().indexOf(text);
                    // もし見つかったら,マーキングと positions データベース登録
                    while (pos != -1) {
                        // 見つかったテキストに,foundAttr をセットして,見つかった位置の y 座標を positions データベースに入れる
                        int y = kpHeight + pPane.modelToView(pos).y;
                        foundDataList.addRow(y, true, pPane, pos, null);

                        // 次の検索
                        pos = pPane.getText().indexOf(text, pos+1);
                    }
View Full Code Here

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

  protected synchronized void damage(Rectangle r) {
    if (r != null)
      try {
        JTextComponent comp = getComponent();
        TextUI mapper = comp.getUI();
        Rectangle r2 = mapper.modelToView(comp, getDot() + 1);
        int width = r2.x - r.x;
        if (width == 0)
          width = 8;
        comp.repaint(r.x, r.y, width, r.height);
        x = r.x;
View Full Code Here

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

  public void paint(Graphics g) {
    if (isVisible())
      try {
        JTextComponent comp = getComponent();
        TextUI mapper = comp.getUI();
        Rectangle r1 = mapper.modelToView(comp, getDot());
        Rectangle r2 = mapper.modelToView(comp, getDot() + 1);
        g = g.create();
        g.setColor(comp.getForeground());
        g.setXORMode(comp.getBackground());
        int width = r2.x - r1.x;
View Full Code Here

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

    if (isVisible())
      try {
        JTextComponent comp = getComponent();
        TextUI mapper = comp.getUI();
        Rectangle r1 = mapper.modelToView(comp, getDot());
        Rectangle r2 = mapper.modelToView(comp, getDot() + 1);
        g = g.create();
        g.setColor(comp.getForeground());
        g.setXORMode(comp.getBackground());
        int width = r2.x - r1.x;
        if (width == 0)
View Full Code Here

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

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

            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

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