Examples of XAccessibleStateSet


Examples of com.sun.star.accessibility.XAccessibleStateSet

    }


    synchronized public void Update ()
    {
        XAccessibleStateSet xStateSet = mxContext.getAccessibleStateSet();
        if (xStateSet != null)
        {
            String sStates = new String ();
            short aStates[] = xStateSet.getStates();
            for (int i=0; i<aStates.length; i++)
            {
                if (i > 0)
                    sStates = sStates + ", ";
                sStates = sStates + NameProvider.getStateName(aStates[i]);
View Full Code Here

Examples of com.sun.star.accessibility.XAccessibleStateSet

    public void Update ()
    {
        maChildrenSelector.removeAll ();

        // Determine whether multi selection is possible.
        XAccessibleStateSet aStateSet = mxContext.getAccessibleStateSet();
        boolean bMultiSelectable = false;
        ButtonGroup aButtonGroup = null;
        if (aStateSet!=null && aStateSet.contains(AccessibleStateType.MULTI_SELECTABLE))
        {
            bMultiSelectable = true;
            maTypeLabel.setText ("multi selectable");
        }
        else
        {
            maTypeLabel.setText ("single selectable");
            aButtonGroup = new ButtonGroup ();
        }

        int nCount = mxContext.getAccessibleChildCount();
        for (int i=0; i<nCount; i++)
        {
            try
            {
                XAccessible xChild = mxContext.getAccessibleChild(i);
                XAccessibleContext xChildContext = xChild.getAccessibleContext();

                String sName = i + " " + xChildContext.getAccessibleName();
                JToggleButton aChild;
                if (bMultiSelectable)
                    aChild = new JCheckBox (sName);
                else
                {
                    aChild = new JRadioButton (sName);
                    aButtonGroup.add (aChild);
                }

                XAccessibleStateSet aChildStateSet = mxContext.getAccessibleStateSet();
                aChild.setSelected (aChildStateSet!=null
                    && aChildStateSet.contains(AccessibleStateType.SELECTED));

                aChild.addActionListener (this);
                maChildrenSelector.add (aChild);
               
            }
View Full Code Here

Examples of com.sun.star.accessibility.XAccessibleStateSet

            maFocused.setText ("<null object>");
            maGrabFocus.setEnabled (false);
        }
        else
        {
            XAccessibleStateSet aStateSet = mxContext.getAccessibleStateSet();
            if (aStateSet.contains(AccessibleStateType.FOCUSED))
                maFocused.setText ("focused");
            else
                maFocused.setText ("not focused");
            if (maGrabFocus != null)
                maGrabFocus.setEnabled (true);
View Full Code Here

Examples of com.sun.star.accessibility.XAccessibleStateSet

        try {
            oObj = at.getAccessibleObjectForRole
                (xRoot, AccessibleRole.HEADER, "").getAccessibleChild(0);
            XAccessibleContext cont = (XAccessibleContext)
                    UnoRuntime.queryInterface(XAccessibleContext.class, oObj);
            XAccessibleStateSet StateSet = cont.getAccessibleStateSet();
            if (StateSet.contains((short)27)) {
                log.println("Object is transient");
            }
        } catch (com.sun.star.lang.IndexOutOfBoundsException iabe) {
            throw new StatusException("Couldn't find needed Child",iabe);
        }
View Full Code Here

Examples of com.sun.star.accessibility.XAccessibleStateSet

     * Just gets the set. <p>
     *
     * Has <b> OK </b> status if the set is not null.
     */
    public void _getAccessibleStateSet() {
        XAccessibleStateSet set = oObj.getAccessibleStateSet();
        boolean res = true;
        String[] expectedStateNames = (String[]) tEnv.getObjRelation(
                                                "expectedStateNames");
        short[] expectedStates = (short[]) tEnv.getObjRelation(
                                           "expectedStates");
View Full Code Here

Examples of com.sun.star.accessibility.XAccessibleStateSet

        try {
            oObj = at.getAccessibleObjectForRole
                (xRoot, AccessibleRole.HEADER, "").getAccessibleChild(0);
            XAccessibleContext cont = (XAccessibleContext)
                    UnoRuntime.queryInterface(XAccessibleContext.class, oObj);
            XAccessibleStateSet StateSet = cont.getAccessibleStateSet();
            if (StateSet.contains((short)27)) {
                log.println("Object is transient");
            }
        } catch (com.sun.star.lang.IndexOutOfBoundsException iabe) {
            throw new StatusException("Couldn't find needed Child",iabe);
        }
View Full Code Here

Examples of com.sun.star.accessibility.XAccessibleStateSet

     * Just gets the set. <p>
     *
     * Has <b> OK </b> status if the set is not null.
     */
    public void _getAccessibleStateSet() {
        XAccessibleStateSet set = oObj.getAccessibleStateSet();
        boolean res = true;
        String[] expectedStateNames = (String[]) tEnv.getObjRelation(
                                                "expectedStateNames");
        short[] expectedStates = (short[]) tEnv.getObjRelation(
                                           "expectedStates");
View Full Code Here

Examples of com.sun.star.accessibility.XAccessibleStateSet

            maFocused.setText ("<null object>");
            maGrabFocus.setEnabled (false);
        }
        else
        {
            XAccessibleStateSet aStateSet = mxContext.getAccessibleStateSet();
            if (aStateSet.contains(AccessibleStateType.FOCUSED))
                maFocused.setText ("focused");
            else
                maFocused.setText ("not focused");
            if (maGrabFocus != null)
                maGrabFocus.setEnabled (true);
View Full Code Here

Examples of com.sun.star.accessibility.XAccessibleStateSet

        g.setRenderingHint (
            RenderingHints.KEY_ANTIALIASING,
            RenderingHints.VALUE_ANTIALIAS_ON);

        XAccessibleStateSet xStateSet = ( mxContext != null ) ? mxContext.getAccessibleStateSet() : null;
        if (xStateSet != null)
        {
            short aStates[] = xStateSet.getStates ();
            final int nMaxStateIndex = AccessibleStateType.VISIBLE;//MANAGES_DESCENDANTS;
            int nStateWidth = (aWidgetArea.width-12) / (nMaxStateIndex+1);
            AffineTransform aTransform = g.getTransform ();
            g.setColor (aTextColor);
            int y = aWidgetArea.y+aWidgetArea.height - 25;
            double nTextRotation = -0.9;//-java.lang.Math.PI/2;
            double nScale = 0.6;

            // Create a shape for the boxes.
            int nBoxWidth = 8;
            Rectangle aCheckBox = new Rectangle (-nBoxWidth/2,0,nBoxWidth,nBoxWidth);

            // For each state draw a box, fill it appropriately, and draw
            // thre states name.
            for (short i=0; i<=nMaxStateIndex; i++)
            {
                int x = nStateWidth + i * nStateWidth;
                String sStateName = NameProvider.getStateName (i);
                if (sStateName == null)
                    sStateName = new String ("<unknown state " + i + ">");
                boolean bStateSet = xStateSet.contains (i);
                g.setTransform (aTransform);
                g.translate (x,y);
                if (bStateSet)
                {
                    switch (i)
View Full Code Here

Examples of com.sun.star.accessibility.XAccessibleStateSet

    public void Update ()
    {
        maChildrenSelector.removeAll ();

        // Determine whether multi selection is possible.
        XAccessibleStateSet aStateSet = mxContext.getAccessibleStateSet();
        boolean bMultiSelectable = false;
        if (aStateSet!=null && aStateSet.contains(
      AccessibleStateType.MULTI_SELECTABLE))
        {
            bMultiSelectable = true;
            maTypeLabel.setText ("multi selectable");
        }
        else
        {
            maTypeLabel.setText ("single selectable");
        }

        if (mxContext.getAccessibleRole() != AccessibleRole.TABLE)
        {
            int nCount = mxContext.getAccessibleChildCount();
            for (int i=0; i<nCount; i++)
            {
                try
                {
                    XAccessible xChild = mxContext.getAccessibleChild(i);
                    XAccessibleContext xChildContext = xChild.getAccessibleContext();
                   
                    String sName = i + " " + xChildContext.getAccessibleName();
                    JToggleButton aChild;
                    aChild = new JCheckBox (sName);
                    aChild.setFont (maContainer.GetViewFont());

                    XAccessibleStateSet aChildStateSet =
                        mxContext.getAccessibleStateSet();
                    aChild.setSelected (aChildStateSet!=null
                        && aChildStateSet.contains(AccessibleStateType.SELECTED));
                   
                    aChild.addActionListener (this);
                    maChildrenSelector.add (aChild);
                   
                }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.