Package javax.swing.plaf

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


    // try to get the first element still shown in the viewport
    Rectangle vr = viewport.getViewRect();
    TextUI ui1 = editor.getUI();

    int p0 = ui1.viewToModel(editor, new Point(vr.x, vr.y));
    int p1 =
        ui1.viewToModel(editor, new Point(vr.x + vr.width, vr.y + vr.height));

    // find elements in document that contain p0 and p1
    int start =
View Full Code Here


    Rectangle vr = viewport.getViewRect();
    TextUI ui1 = editor.getUI();

    int p0 = ui1.viewToModel(editor, new Point(vr.x, vr.y));
    int p1 =
        ui1.viewToModel(editor, new Point(vr.x + vr.width, vr.y + vr.height));

    // find elements in document that contain p0 and p1
    int start =
        editor.getDocument().getDefaultRootElement().getElementIndex(p0);
    int end = editor.getDocument().getDefaultRootElement().getElementIndex(p1);
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.