當前位置: 首頁>>代碼示例>>Java>>正文


Java JComponent.AccessibleJComponent方法代碼示例

本文整理匯總了Java中javax.swing.JComponent.AccessibleJComponent方法的典型用法代碼示例。如果您正苦於以下問題:Java JComponent.AccessibleJComponent方法的具體用法?Java JComponent.AccessibleJComponent怎麽用?Java JComponent.AccessibleJComponent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.swing.JComponent的用法示例。


在下文中一共展示了JComponent.AccessibleJComponent方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getAccessibleContext

import javax.swing.JComponent; //導入方法依賴的package包/類
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;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:22,代碼來源:ProfilerWindow.java

示例2: createAccesibleContext

import javax.swing.JComponent; //導入方法依賴的package包/類
protected AccessibleContext createAccesibleContext() {
    return new JComponent.AccessibleJComponent() {
        public AccessibleRole getAccessibleRole() {
            return AccessibleRole.LABEL;
        }
        public String getAccessibleName() {
            return BaseRenderer.this.toString();
        }
    };
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:11,代碼來源:BaseRenderer.java

示例3: assertGetLocation

import javax.swing.JComponent; //導入方法依賴的package包/類
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");
    }

}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:31,代碼來源:JTableAccessibleGetLocationOnScreen.java

示例4: getAccessibleContext

import javax.swing.JComponent; //導入方法依賴的package包/類
public AccessibleContext getAccessibleContext() {
    TreeCellRenderer renderer = getCellRenderer();
    return renderer instanceof Accessible ?
           ((Accessible)renderer).getAccessibleContext() :
           new JComponent.AccessibleJComponent() {};
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:7,代碼來源:ProfilerTreeTable.java


注:本文中的javax.swing.JComponent.AccessibleJComponent方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。