Java Code Examples for javax.swing.JComponent#AccessibleJComponent

The following examples show how to use javax.swing.JComponent#AccessibleJComponent . These examples are extracted from open source projects. 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 Project: netbeans   File: ProfilerWindow.java    License: 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
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
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
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
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
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 Project: netbeans   File: BaseRenderer.java    License: 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 8
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 9
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
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
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
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
protected AccessibleContext createAccesibleContext() {
    return new JComponent.AccessibleJComponent() {
        public AccessibleRole getAccessibleRole() {
            return AccessibleRole.LABEL;
        }
        public String getAccessibleName() {
            return BaseRenderer.this.toString();
        }
    };
}
 
Example 14
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 15
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
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
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 Project: netbeans   File: ProfilerTreeTable.java    License: 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
public AccessibleContext getAccessibleContext() {
    TreeCellRenderer renderer = getCellRenderer();
    return renderer instanceof Accessible ?
           ((Accessible)renderer).getAccessibleContext() :
           new JComponent.AccessibleJComponent() {};
}