Example usage for javax.swing JInternalFrame getClass

List of usage examples for javax.swing JInternalFrame getClass

Introduction

In this page you can find the example usage for javax.swing JInternalFrame getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:com.github.lindenb.jvarkit.tools.bamviewgui.BamFileRef.java

private void listSelectionChanged() {
    int row = jTable.getSelectedRow();
    if (row == -1 || this.getDesktopPane() == null)
        return;/*w ww  . ja  v a2 s. c  om*/
    SAMRecord ctx = this.tableModel.getElementAt(row);

    if (ctx == null)
        return;

    for (JInternalFrame jif : this.getDesktopPane().getAllFrames()) {
        if (jif == this)
            continue;
        if (jif.getClass() != this.getClass())
            continue;
        BamInternalFrame other = BamInternalFrame.class.cast(jif);
        int row2 = -1;
        for (int i = 0; !ctx.getReadUnmappedFlag() && i < other.tableModel.getRowCount(); ++i) {
            SAMRecord ctx2 = other.tableModel.getElementAt(i);
            if (ctx2.getReadUnmappedFlag())
                continue;
            if (ctx.getReferenceName().equals(ctx2.getReferenceName())
                    && ctx.getAlignmentStart() <= ctx2.getAlignmentStart()) {
                row2 = i;
                break;
            }
        }
        if (row2 == -1) {
            other.jTable.getSelectionModel().clearSelection();
        } else {
            other.jTable.getSelectionModel().setSelectionInterval(row2, row2);
            other.jTable.scrollRectToVisible((other.jTable.getCellRect(row2, 0, true)));
        }
    }
}