Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8256126: Create implementation for NSAccessibilityImage protocol peer #2096

Closed
wants to merge 1 commit into from

Conversation

@pankaj-bansal
Copy link

@pankaj-bansal pankaj-bansal commented Jan 15, 2021

Create implementation for NSAccessibilityImage protocol peer


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8256126: Create implementation for NSAccessibilityImage protocol peer

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/2096/head:pull/2096
$ git checkout pull/2096

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Jan 15, 2021

👋 Welcome back pbansal! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr label Jan 15, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Jan 15, 2021

@pankaj-bansal The following label will be automatically applied to this pull request:

  • awt

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the awt label Jan 15, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Jan 15, 2021

Webrevs

@openjdk
Copy link

@openjdk openjdk bot commented Jan 15, 2021

@pankaj-bansal This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8256126: Create implementation for NSAccessibilityImage protocol peer

Reviewed-by: kizune, serb

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 42 new commits pushed to the master branch:

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready label Jan 15, 2021
@mrserb
Copy link
Member

@mrserb mrserb commented Jan 16, 2021

@pankaj-bansal please provide some steps to test that a11y for the image works.

@azuev-java
Copy link
Member

@azuev-java azuev-java commented Jan 16, 2021

@pankaj-bansal please provide some steps to test that a11y for the image works.

I use the simple code snippet like this:

import java.awt.*;
import java.net.MalformedURLException;
import java.net.URL;
import javax.swing.*;

public class AccessibleImageTest {
    public static void main(String[] args) throws MalformedURLException {
        new AccessibleImageTest().test();
    }

    public void test() throws MalformedURLException {
        JFrame frame = new JFrame("Test frame");
        frame.setLayout(new BorderLayout());
        ImageIcon imageIcon = new ImageIcon(new URL("https://www.oracle.com/a/ocom/img/i-code-java-300x352-3854596.png"));
        JLabel label = new JLabel(imageIcon);
        label.getAccessibleContext().setAccessibleDescription("I code Java");
        frame.add(label, BorderLayout.CENTER);
        frame.add(new JButton("Top button"), BorderLayout.NORTH);
        frame.add(new JButton("Bottom button"), BorderLayout.SOUTH);
        frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        frame.pack();
        frame.setVisible(true);
    }
}

After compiling and running the code you should see frame with two buttons on top and bottom and image in the middle. Now if you turn on VoiceOver with <Command><F5> the accessibility cursor should be on one of the buttons. By using <Control><Option><UpArrow> and <Control><Option><DownArrow> combinations you should be able to move accessibility cursor between buttons and the image. If image accessibility implemented correctly the accessibility cursor should be drawn around the image borders and the VoiceOver should understand the selected element type and take accessible text of the image into account, so the narration should sound like "I code Java, image". Of course that also should work with the local images and icon images.

@pankaj-bansal
Copy link
Author

@pankaj-bansal pankaj-bansal commented Jan 16, 2021

I also used something similar. I used this program https://docs.oracle.com/javase/tutorial/uiswing/examples/components/LabelDemoProject/src/components/LabelDemo.java. I verified that the VO output is same before and after this change.
To verify that the VO is actually using the ImageAccessibility and not JLabel accessibility support, I returned some dummy text from (nullable NSString *)accessibilityLabel function in ImageAccessibility class. VO does return the dummy text as expected.

mrserb
mrserb approved these changes Jan 16, 2021
@pankaj-bansal
Copy link
Author

@pankaj-bansal pankaj-bansal commented Jan 16, 2021

/integrate

@openjdk openjdk bot closed this Jan 16, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels Jan 16, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Jan 16, 2021

@pankaj-bansal Since your change was applied there have been 42 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

Pushed as commit bbb93ca.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@pankaj-bansal pankaj-bansal deleted the JDK-8256126 branch May 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants