Example usage for javax.accessibility AccessibleContext getAccessibleChild

List of usage examples for javax.accessibility AccessibleContext getAccessibleChild

Introduction

In this page you can find the example usage for javax.accessibility AccessibleContext getAccessibleChild.

Prototype

public abstract Accessible getAccessibleChild(int i);

Source Link

Document

Returns the specified Accessible child of the object.

Usage

From source file:Main.java

private static void setForeground0(AccessibleContext ac, Color fg) {
    ac.getAccessibleComponent().setForeground(fg);
    for (int i = 0; i < ac.getAccessibleChildrenCount(); i++) {
        setForeground0(ac.getAccessibleChild(i).getAccessibleContext(), fg);
    }/*from  w  ww.  j  av  a 2s  .c  o m*/
}

From source file:Main.java

private static void setBackground0(AccessibleContext ac, Color bg) {
    ac.getAccessibleComponent().setBackground(bg);
    int n = ac.getAccessibleChildrenCount();
    for (int i = 0; i < n; i++) {
        setBackground0(ac.getAccessibleChild(i).getAccessibleContext(), bg);
    }//from   w  w  w.  jav  a  2 s  .com
}

From source file:MainClass.java

void dumpInfo(AccessibleContext ac) {
    System.out.println("Name = " + ac.getAccessibleName());
    System.out.println("Description = " + ac.getAccessibleDescription());

    int nChildren = ac.getAccessibleChildrenCount();

    for (int i = 0; i < nChildren; i++)
        dumpInfo(ac.getAccessibleChild(i).getAccessibleContext());
}

From source file:MainClass.java

void dumpTextInfo(AccessibleContext ac) {
    AccessibleText at = ac.getAccessibleText();

    if (at != null) {
        System.out.println("Caret position = " + at.getCaretPosition());
        System.out.println("Selected text = " + at.getSelectedText());

        return;/*from  w w  w.  j  av a  2  s  .c o m*/
    }

    int nChildren = ac.getAccessibleChildrenCount();

    for (int i = 0; i < nChildren; i++)
        dumpTextInfo(ac.getAccessibleChild(i).getAccessibleContext());
}

From source file:MainClass.java

void dumpTableInfo(AccessibleContext ac) {
    AccessibleTable at = ac.getAccessibleTable();

    if (at != null) {
        int nCol = at.getAccessibleColumnCount();
        System.out.println("Columns = " + nCol);

        int nRow = at.getAccessibleRowCount();
        System.out.println("Rows = " + nRow);

        return;/*ww w  .  j  av  a  2 s  .com*/
    }

    int nChildren = ac.getAccessibleChildrenCount();

    for (int i = 0; i < nChildren; i++)
        dumpTableInfo(ac.getAccessibleChild(i).getAccessibleContext());
}

From source file:MainClass.java

void dumpValueInfo(AccessibleContext ac) {
    AccessibleValue av = ac.getAccessibleValue();

    if (av != null) {
        System.out.println("Minimum value = " + av.getMinimumAccessibleValue());
        System.out.println("Current value = " + av.getCurrentAccessibleValue());
        System.out.println("Maximum value = " + av.getMaximumAccessibleValue());

        return;//from w  w  w.  ja v  a2 s .c o  m
    }

    int nChildren = ac.getAccessibleChildrenCount();

    for (int i = 0; i < nChildren; i++)
        dumpValueInfo(ac.getAccessibleChild(i).getAccessibleContext());
}

From source file:MainClass.java

void dumpConnectedInfo(AccessibleContext ac) {
    AccessibleRelationSet ars = ac.getAccessibleRelationSet();

    AccessibleRelation ar = null;

    if (ars != null)
        ar = ars.get("connector");

    if (ar != null) {
        Object[] o = ar.getTarget();
        JComponent jc = (JComponent) o[0];
        System.out.println("Label connected to: " + jc.getAccessibleContext().getAccessibleName());
        return;//from ww  w. jav  a  2  s  . c o m
    }
    int nChildren = ac.getAccessibleChildrenCount();
    for (int i = 0; i < nChildren; i++)
        dumpConnectedInfo(ac.getAccessibleChild(i).getAccessibleContext());
}

From source file:MainClass.java

void dumpActionInfo(AccessibleContext ac) {
    AccessibleAction aa = ac.getAccessibleAction();

    if (aa != null) {
        String s = ac.getAccessibleName();
        System.out.println(s);/*w ww  .ja va 2  s . com*/

        int count = aa.getAccessibleActionCount();

        for (int i = 0; i < count; i++) {
            s = aa.getAccessibleActionDescription(i);
            System.out.println("Description = " + s);
        }
    }

    int nChildren = ac.getAccessibleChildrenCount();

    for (int i = 0; i < nChildren; i++)
        dumpActionInfo(ac.getAccessibleChild(i).getAccessibleContext());
}

From source file:MainClass.java

void dumpIconInfo(AccessibleContext ac) {
    AccessibleIcon[] ai = ac.getAccessibleIcon();

    if (ai != null) {
        for (int i = 0; i < ai.length; i++) {
            String s = ai[i].getAccessibleIconDescription();
            System.out.println("Description = " + s);
            System.out.println("Width = " + ai[i].getAccessibleIconWidth());
            System.out.println("height = " + ai[i].getAccessibleIconHeight());
        }// w  w w  .  ja v a 2s. c o m
        return;
    }
    int nChildren = ac.getAccessibleChildrenCount();

    for (int i = 0; i < nChildren; i++)
        dumpIconInfo(ac.getAccessibleChild(i).getAccessibleContext());
}

From source file:MainClass.java

void dumpSelectionInfo(AccessibleContext ac) {
    AccessibleSelection as = ac.getAccessibleSelection();
    if (as != null) {
        int count = as.getAccessibleSelectionCount();

        for (int i = 0; i < count; i++) {
            Accessible a = as.getAccessibleSelection(i);
            AccessibleContext ac2 = a.getAccessibleContext();
            String s = ac2.getAccessibleName();
            System.out.println("Name = " + s);
        }/*  ww  w .  ja va 2  s  .  c  om*/

        return;
    }

    int nChildren = ac.getAccessibleChildrenCount();

    for (int i = 0; i < nChildren; i++)
        dumpSelectionInfo(ac.getAccessibleChild(i).getAccessibleContext());
}