Java Code Examples for javax.swing.JComponent#AccessibleJComponent

The following examples show how to use javax.swing.JComponent#AccessibleJComponent . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ProfilerWindow.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public AccessibleContext getAccessibleContext() {
    if (accessibleContext == null) {
        accessibleContext = new JComponent.AccessibleJComponent() {
            public AccessibleRole getAccessibleRole() {
                return AccessibleRole.PANEL;
            }

            public String getAccessibleName() {
                return Bundle.ProfilerWindow_accessName(getDisplayName());
            }

            public String getAccessibleDescription() {
                ProfilerFeature selected = featuresView == null ? null :
                                featuresView.getSelectedFeature();
                return selected == null ? WelcomePanel.CAPTION :
                       (selected.getName() + " " + selected.getDescription()); // NOI18N
            }
        };
    }
    return accessibleContext;
}
 
Example 2
Source File: ProfilerWindow.java    From visualvm with GNU General Public License v2.0 6 votes vote down vote up
public AccessibleContext getAccessibleContext() {
    if (accessibleContext == null) {
        accessibleContext = new JComponent.AccessibleJComponent() {
            public AccessibleRole getAccessibleRole() {
                return AccessibleRole.PANEL;
            }

            public String getAccessibleName() {
                return Bundle.ProfilerWindow_accessName(getDisplayName());
            }

            public String getAccessibleDescription() {
                ProfilerFeature selected = featuresView == null ? null :
                                featuresView.getSelectedFeature();
                return selected == null ? WelcomePanel.CAPTION :
                       (selected.getName() + " " + selected.getDescription()); // NOI18N
            }
        };
    }
    return accessibleContext;
}
 
Example 3
Source File: JTableAccessibleGetLocationOnScreen.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void assertGetLocation() {
    // the frame is now invisible
    // test getLocationOnScreen() of
    // JTable$AccessibleJTable$AccessibleJTableHeaderCell
    // and JTable$AccessibleJTable$AccessibleJTableCell
    AccessibleTable accessibleTable = (AccessibleTable) table
            .getAccessibleContext();
    AccessibleTable header = accessibleTable.getAccessibleColumnHeader();
    AccessibleComponent accessibleComp1 = (AccessibleComponent) header
            .getAccessibleAt(0, 0);
    // getLocation() must be null according to its javadoc and no exception
    // is thrown
    if (null != accessibleComp1.getLocationOnScreen()) {
        throw new RuntimeException(
                "JTable$AccessibleJTable$AccessibleJTableHeaderCell."
                        + "getLocation() must be null");
    }

    JComponent.AccessibleJComponent accessibleJComponent =
            (JComponent.AccessibleJComponent) table.getAccessibleContext();
    AccessibleComponent accessibleComp2 = (AccessibleComponent)
            accessibleJComponent.getAccessibleChild(3);
    // getLocation() must be null according to its javadoc and no exception
    // is thrown
    if (null != accessibleComp2.getLocationOnScreen()) {
        throw new RuntimeException("JTable$AccessibleJTable$"
                + "AccessibleJTableCell.getLocation() must be null");
    }

}
 
Example 4
Source File: JTableAccessibleGetLocationOnScreen.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void assertGetLocation() {
    // the frame is now invisible
    // test getLocationOnScreen() of
    // JTable$AccessibleJTable$AccessibleJTableHeaderCell
    // and JTable$AccessibleJTable$AccessibleJTableCell
    AccessibleTable accessibleTable = (AccessibleTable) table
            .getAccessibleContext();
    AccessibleTable header = accessibleTable.getAccessibleColumnHeader();
    AccessibleComponent accessibleComp1 = (AccessibleComponent) header
            .getAccessibleAt(0, 0);
    // getLocation() must be null according to its javadoc and no exception
    // is thrown
    if (null != accessibleComp1.getLocationOnScreen()) {
        throw new RuntimeException(
                "JTable$AccessibleJTable$AccessibleJTableHeaderCell."
                        + "getLocation() must be null");
    }

    JComponent.AccessibleJComponent accessibleJComponent =
            (JComponent.AccessibleJComponent) table.getAccessibleContext();
    AccessibleComponent accessibleComp2 = (AccessibleComponent)
            accessibleJComponent.getAccessibleChild(3);
    // getLocation() must be null according to its javadoc and no exception
    // is thrown
    if (null != accessibleComp2.getLocationOnScreen()) {
        throw new RuntimeException("JTable$AccessibleJTable$"
                + "AccessibleJTableCell.getLocation() must be null");
    }

}
 
Example 5
Source File: JTableAccessibleGetLocationOnScreen.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void assertGetLocation() {
    // the frame is now invisible
    // test getLocationOnScreen() of
    // JTable$AccessibleJTable$AccessibleJTableHeaderCell
    // and JTable$AccessibleJTable$AccessibleJTableCell
    AccessibleTable accessibleTable = (AccessibleTable) table
            .getAccessibleContext();
    AccessibleTable header = accessibleTable.getAccessibleColumnHeader();
    AccessibleComponent accessibleComp1 = (AccessibleComponent) header
            .getAccessibleAt(0, 0);
    // getLocation() must be null according to its javadoc and no exception
    // is thrown
    if (null != accessibleComp1.getLocationOnScreen()) {
        throw new RuntimeException(
                "JTable$AccessibleJTable$AccessibleJTableHeaderCell."
                        + "getLocation() must be null");
    }

    JComponent.AccessibleJComponent accessibleJComponent =
            (JComponent.AccessibleJComponent) table.getAccessibleContext();
    AccessibleComponent accessibleComp2 = (AccessibleComponent)
            accessibleJComponent.getAccessibleChild(3);
    // getLocation() must be null according to its javadoc and no exception
    // is thrown
    if (null != accessibleComp2.getLocationOnScreen()) {
        throw new RuntimeException("JTable$AccessibleJTable$"
                + "AccessibleJTableCell.getLocation() must be null");
    }

}
 
Example 6
Source File: JTableAccessibleGetLocationOnScreen.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void assertGetLocation() {
    // the frame is now invisible
    // test getLocationOnScreen() of
    // JTable$AccessibleJTable$AccessibleJTableHeaderCell
    // and JTable$AccessibleJTable$AccessibleJTableCell
    AccessibleTable accessibleTable = (AccessibleTable) table
            .getAccessibleContext();
    AccessibleTable header = accessibleTable.getAccessibleColumnHeader();
    AccessibleComponent accessibleComp1 = (AccessibleComponent) header
            .getAccessibleAt(0, 0);
    // getLocation() must be null according to its javadoc and no exception
    // is thrown
    if (null != accessibleComp1.getLocationOnScreen()) {
        throw new RuntimeException(
                "JTable$AccessibleJTable$AccessibleJTableHeaderCell."
                        + "getLocation() must be null");
    }

    JComponent.AccessibleJComponent accessibleJComponent =
            (JComponent.AccessibleJComponent) table.getAccessibleContext();
    AccessibleComponent accessibleComp2 = (AccessibleComponent)
            accessibleJComponent.getAccessibleChild(3);
    // getLocation() must be null according to its javadoc and no exception
    // is thrown
    if (null != accessibleComp2.getLocationOnScreen()) {
        throw new RuntimeException("JTable$AccessibleJTable$"
                + "AccessibleJTableCell.getLocation() must be null");
    }

}
 
Example 7
Source File: JTableAccessibleGetLocationOnScreen.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private static void assertGetLocation() {
    // the frame is now invisible
    // test getLocationOnScreen() of
    // JTable$AccessibleJTable$AccessibleJTableHeaderCell
    // and JTable$AccessibleJTable$AccessibleJTableCell
    AccessibleTable accessibleTable = (AccessibleTable) table
            .getAccessibleContext();
    AccessibleTable header = accessibleTable.getAccessibleColumnHeader();
    AccessibleComponent accessibleComp1 = (AccessibleComponent) header
            .getAccessibleAt(0, 0);
    // getLocation() must be null according to its javadoc and no exception
    // is thrown
    if (null != accessibleComp1.getLocationOnScreen()) {
        throw new RuntimeException(
                "JTable$AccessibleJTable$AccessibleJTableHeaderCell."
                        + "getLocation() must be null");
    }

    JComponent.AccessibleJComponent accessibleJComponent =
            (JComponent.AccessibleJComponent) table.getAccessibleContext();
    AccessibleComponent accessibleComp2 = (AccessibleComponent)
            accessibleJComponent.getAccessibleChild(3);
    // getLocation() must be null according to its javadoc and no exception
    // is thrown
    if (null != accessibleComp2.getLocationOnScreen()) {
        throw new RuntimeException("JTable$AccessibleJTable$"
                + "AccessibleJTableCell.getLocation() must be null");
    }

}
 
Example 8
Source File: BaseRenderer.java    From visualvm with GNU General Public License v2.0 5 votes vote down vote up
protected AccessibleContext createAccesibleContext() {
    return new JComponent.AccessibleJComponent() {
        public AccessibleRole getAccessibleRole() {
            return AccessibleRole.LABEL;
        }
        public String getAccessibleName() {
            return BaseRenderer.this.toString();
        }
    };
}
 
Example 9
Source File: JTableAccessibleGetLocationOnScreen.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private static void assertGetLocation() {
    // the frame is now invisible
    // test getLocationOnScreen() of
    // JTable$AccessibleJTable$AccessibleJTableHeaderCell
    // and JTable$AccessibleJTable$AccessibleJTableCell
    AccessibleTable accessibleTable = (AccessibleTable) table
            .getAccessibleContext();
    AccessibleTable header = accessibleTable.getAccessibleColumnHeader();
    AccessibleComponent accessibleComp1 = (AccessibleComponent) header
            .getAccessibleAt(0, 0);
    // getLocation() must be null according to its javadoc and no exception
    // is thrown
    if (null != accessibleComp1.getLocationOnScreen()) {
        throw new RuntimeException(
                "JTable$AccessibleJTable$AccessibleJTableHeaderCell."
                        + "getLocation() must be null");
    }

    JComponent.AccessibleJComponent accessibleJComponent =
            (JComponent.AccessibleJComponent) table.getAccessibleContext();
    AccessibleComponent accessibleComp2 = (AccessibleComponent)
            accessibleJComponent.getAccessibleChild(3);
    // getLocation() must be null according to its javadoc and no exception
    // is thrown
    if (null != accessibleComp2.getLocationOnScreen()) {
        throw new RuntimeException("JTable$AccessibleJTable$"
                + "AccessibleJTableCell.getLocation() must be null");
    }

}
 
Example 10
Source File: JTableAccessibleGetLocationOnScreen.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private static void assertGetLocation() {
    // the frame is now invisible
    // test getLocationOnScreen() of
    // JTable$AccessibleJTable$AccessibleJTableHeaderCell
    // and JTable$AccessibleJTable$AccessibleJTableCell
    AccessibleTable accessibleTable = (AccessibleTable) table
            .getAccessibleContext();
    AccessibleTable header = accessibleTable.getAccessibleColumnHeader();
    AccessibleComponent accessibleComp1 = (AccessibleComponent) header
            .getAccessibleAt(0, 0);
    // getLocation() must be null according to its javadoc and no exception
    // is thrown
    if (null != accessibleComp1.getLocationOnScreen()) {
        throw new RuntimeException(
                "JTable$AccessibleJTable$AccessibleJTableHeaderCell."
                        + "getLocation() must be null");
    }

    JComponent.AccessibleJComponent accessibleJComponent =
            (JComponent.AccessibleJComponent) table.getAccessibleContext();
    AccessibleComponent accessibleComp2 = (AccessibleComponent)
            accessibleJComponent.getAccessibleChild(3);
    // getLocation() must be null according to its javadoc and no exception
    // is thrown
    if (null != accessibleComp2.getLocationOnScreen()) {
        throw new RuntimeException("JTable$AccessibleJTable$"
                + "AccessibleJTableCell.getLocation() must be null");
    }

}
 
Example 11
Source File: JTableAccessibleGetLocationOnScreen.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void assertGetLocation() {
    // the frame is now invisible
    // test getLocationOnScreen() of
    // JTable$AccessibleJTable$AccessibleJTableHeaderCell
    // and JTable$AccessibleJTable$AccessibleJTableCell
    AccessibleTable accessibleTable = (AccessibleTable) table
            .getAccessibleContext();
    AccessibleTable header = accessibleTable.getAccessibleColumnHeader();
    AccessibleComponent accessibleComp1 = (AccessibleComponent) header
            .getAccessibleAt(0, 0);
    // getLocation() must be null according to its javadoc and no exception
    // is thrown
    if (null != accessibleComp1.getLocationOnScreen()) {
        throw new RuntimeException(
                "JTable$AccessibleJTable$AccessibleJTableHeaderCell."
                        + "getLocation() must be null");
    }

    JComponent.AccessibleJComponent accessibleJComponent =
            (JComponent.AccessibleJComponent) table.getAccessibleContext();
    AccessibleComponent accessibleComp2 = (AccessibleComponent)
            accessibleJComponent.getAccessibleChild(3);
    // getLocation() must be null according to its javadoc and no exception
    // is thrown
    if (null != accessibleComp2.getLocationOnScreen()) {
        throw new RuntimeException("JTable$AccessibleJTable$"
                + "AccessibleJTableCell.getLocation() must be null");
    }

}
 
Example 12
Source File: JTableAccessibleGetLocationOnScreen.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private static void assertGetLocation() {
    // the frame is now invisible
    // test getLocationOnScreen() of
    // JTable$AccessibleJTable$AccessibleJTableHeaderCell
    // and JTable$AccessibleJTable$AccessibleJTableCell
    AccessibleTable accessibleTable = (AccessibleTable) table
            .getAccessibleContext();
    AccessibleTable header = accessibleTable.getAccessibleColumnHeader();
    AccessibleComponent accessibleComp1 = (AccessibleComponent) header
            .getAccessibleAt(0, 0);
    // getLocation() must be null according to its javadoc and no exception
    // is thrown
    if (null != accessibleComp1.getLocationOnScreen()) {
        throw new RuntimeException(
                "JTable$AccessibleJTable$AccessibleJTableHeaderCell."
                        + "getLocation() must be null");
    }

    JComponent.AccessibleJComponent accessibleJComponent =
            (JComponent.AccessibleJComponent) table.getAccessibleContext();
    AccessibleComponent accessibleComp2 = (AccessibleComponent)
            accessibleJComponent.getAccessibleChild(3);
    // getLocation() must be null according to its javadoc and no exception
    // is thrown
    if (null != accessibleComp2.getLocationOnScreen()) {
        throw new RuntimeException("JTable$AccessibleJTable$"
                + "AccessibleJTableCell.getLocation() must be null");
    }

}
 
Example 13
Source File: JTableAccessibleGetLocationOnScreen.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private static void assertGetLocation() {
    // the frame is now invisible
    // test getLocationOnScreen() of
    // JTable$AccessibleJTable$AccessibleJTableHeaderCell
    // and JTable$AccessibleJTable$AccessibleJTableCell
    AccessibleTable accessibleTable = (AccessibleTable) table
            .getAccessibleContext();
    AccessibleTable header = accessibleTable.getAccessibleColumnHeader();
    AccessibleComponent accessibleComp1 = (AccessibleComponent) header
            .getAccessibleAt(0, 0);
    // getLocation() must be null according to its javadoc and no exception
    // is thrown
    if (null != accessibleComp1.getLocationOnScreen()) {
        throw new RuntimeException(
                "JTable$AccessibleJTable$AccessibleJTableHeaderCell."
                        + "getLocation() must be null");
    }

    JComponent.AccessibleJComponent accessibleJComponent =
            (JComponent.AccessibleJComponent) table.getAccessibleContext();
    AccessibleComponent accessibleComp2 = (AccessibleComponent)
            accessibleJComponent.getAccessibleChild(3);
    // getLocation() must be null according to its javadoc and no exception
    // is thrown
    if (null != accessibleComp2.getLocationOnScreen()) {
        throw new RuntimeException("JTable$AccessibleJTable$"
                + "AccessibleJTableCell.getLocation() must be null");
    }

}
 
Example 14
Source File: BaseRenderer.java    From netbeans with Apache License 2.0 5 votes vote down vote up
protected AccessibleContext createAccesibleContext() {
    return new JComponent.AccessibleJComponent() {
        public AccessibleRole getAccessibleRole() {
            return AccessibleRole.LABEL;
        }
        public String getAccessibleName() {
            return BaseRenderer.this.toString();
        }
    };
}
 
Example 15
Source File: JTableAccessibleGetLocationOnScreen.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private static void assertGetLocation() {
    // the frame is now invisible
    // test getLocationOnScreen() of
    // JTable$AccessibleJTable$AccessibleJTableHeaderCell
    // and JTable$AccessibleJTable$AccessibleJTableCell
    AccessibleTable accessibleTable = (AccessibleTable) table
            .getAccessibleContext();
    AccessibleTable header = accessibleTable.getAccessibleColumnHeader();
    AccessibleComponent accessibleComp1 = (AccessibleComponent) header
            .getAccessibleAt(0, 0);
    // getLocation() must be null according to its javadoc and no exception
    // is thrown
    if (null != accessibleComp1.getLocationOnScreen()) {
        throw new RuntimeException(
                "JTable$AccessibleJTable$AccessibleJTableHeaderCell."
                        + "getLocation() must be null");
    }

    JComponent.AccessibleJComponent accessibleJComponent =
            (JComponent.AccessibleJComponent) table.getAccessibleContext();
    AccessibleComponent accessibleComp2 = (AccessibleComponent)
            accessibleJComponent.getAccessibleChild(3);
    // getLocation() must be null according to its javadoc and no exception
    // is thrown
    if (null != accessibleComp2.getLocationOnScreen()) {
        throw new RuntimeException("JTable$AccessibleJTable$"
                + "AccessibleJTableCell.getLocation() must be null");
    }

}
 
Example 16
Source File: JTableAccessibleGetLocationOnScreen.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private static void assertGetLocation() {
    // the frame is now invisible
    // test getLocationOnScreen() of
    // JTable$AccessibleJTable$AccessibleJTableHeaderCell
    // and JTable$AccessibleJTable$AccessibleJTableCell
    AccessibleTable accessibleTable = (AccessibleTable) table
            .getAccessibleContext();
    AccessibleTable header = accessibleTable.getAccessibleColumnHeader();
    AccessibleComponent accessibleComp1 = (AccessibleComponent) header
            .getAccessibleAt(0, 0);
    // getLocation() must be null according to its javadoc and no exception
    // is thrown
    if (null != accessibleComp1.getLocationOnScreen()) {
        throw new RuntimeException(
                "JTable$AccessibleJTable$AccessibleJTableHeaderCell."
                        + "getLocation() must be null");
    }

    JComponent.AccessibleJComponent accessibleJComponent =
            (JComponent.AccessibleJComponent) table.getAccessibleContext();
    AccessibleComponent accessibleComp2 = (AccessibleComponent)
            accessibleJComponent.getAccessibleChild(3);
    // getLocation() must be null according to its javadoc and no exception
    // is thrown
    if (null != accessibleComp2.getLocationOnScreen()) {
        throw new RuntimeException("JTable$AccessibleJTable$"
                + "AccessibleJTableCell.getLocation() must be null");
    }

}
 
Example 17
Source File: JTableAccessibleGetLocationOnScreen.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private static void assertGetLocation() {
    // the frame is now invisible
    // test getLocationOnScreen() of
    // JTable$AccessibleJTable$AccessibleJTableHeaderCell
    // and JTable$AccessibleJTable$AccessibleJTableCell
    AccessibleTable accessibleTable = (AccessibleTable) table
            .getAccessibleContext();
    AccessibleTable header = accessibleTable.getAccessibleColumnHeader();
    AccessibleComponent accessibleComp1 = (AccessibleComponent) header
            .getAccessibleAt(0, 0);
    // getLocation() must be null according to its javadoc and no exception
    // is thrown
    if (null != accessibleComp1.getLocationOnScreen()) {
        throw new RuntimeException(
                "JTable$AccessibleJTable$AccessibleJTableHeaderCell."
                        + "getLocation() must be null");
    }

    JComponent.AccessibleJComponent accessibleJComponent =
            (JComponent.AccessibleJComponent) table.getAccessibleContext();
    AccessibleComponent accessibleComp2 = (AccessibleComponent)
            accessibleJComponent.getAccessibleChild(3);
    // getLocation() must be null according to its javadoc and no exception
    // is thrown
    if (null != accessibleComp2.getLocationOnScreen()) {
        throw new RuntimeException("JTable$AccessibleJTable$"
                + "AccessibleJTableCell.getLocation() must be null");
    }

}
 
Example 18
Source File: ProfilerTreeTable.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public AccessibleContext getAccessibleContext() {
    TreeCellRenderer renderer = getCellRenderer();
    return renderer instanceof Accessible ?
           ((Accessible)renderer).getAccessibleContext() :
           new JComponent.AccessibleJComponent() {};
}
 
Example 19
Source File: ProfilerTreeTable.java    From visualvm with GNU General Public License v2.0 4 votes vote down vote up
public AccessibleContext getAccessibleContext() {
    TreeCellRenderer renderer = getCellRenderer();
    return renderer instanceof Accessible ?
           ((Accessible)renderer).getAccessibleContext() :
           new JComponent.AccessibleJComponent() {};
}