<Swing Dev> A patch for JConsole about accessibility

Sean Chou zhouyx at linux.vnet.ibm.com
Fri Apr 1 12:05:11 UTC 2011


Hi all,

JConsole is a popular tool for monitoring java processes. During
daily use, we hope it can contain more descriptions for tabs, menus
and other controls, so that it can give user more information
to understand the functionality and enhance user experiences. We
already did some work for this purpose and they are welcomed.

And, we would like to contribute this work to OPENJDK to share
the benefit. However, the patch is a little large, which counts to 1700+
LOC.
I suppose posting the entire patch on the mailing list is not a good
choice, but it is also attached in case some one would like a try.

Please give your comments.

Two images are attached to demo a small difference. Jconsole1.png
is the one with more description and jconsole2.png is the current
openjdk implementation.

And a piece of the patch is as follows:

diff -r 0653cab602f2 src/share/classes/sun/tools/jconsole/ClassTab.java
--- a/src/share/classes/sun/tools/jconsole/ClassTab.java Thu Mar 17 14:33:00
2011 -0700
+++ b/src/share/classes/sun/tools/jconsole/ClassTab.java Tue Mar 22 17:33:19
2011 +0800
@@ -41,6 +41,8 @@
 import java.util.concurrent.*;

 import sun.awt.*;
+import sun.tools.jconsole.LabeledComponent;
+import sun.tools.jconsole.Resources;

 import static sun.tools.jconsole.Formatter.*;
 import static sun.tools.jconsole.Resources.*;
@@ -87,6 +89,10 @@
                         Center: details
     */

+    public static String getTabDescription() {
+        return Resources.getText("Classes.accessibleDescription");
+    }
+
     public static String getTabName() {
         return Resources.getText("Classes");
     }
@@ -109,6 +115,7 @@
         topPanel.add(controlPanel, BorderLayout.CENTER);

         verboseCheckBox = new JCheckBox(Resources.getText("Verbose
Output"));
+    verboseCheckBox.setMnemonic(getMnemonicInt("Verbose Output"));
         verboseCheckBox.addActionListener(this);
         verboseCheckBox.setToolTipText(getText("Verbose Output.toolTip"));
         JPanel topRightPanel = new JPanel();
@@ -128,20 +135,24 @@
                                                   true);
         setAccessibleName(loadedClassesMeter.plotter,

getText("ClassTab.loadedClassesPlotter.accessibleName"));
+    setAccessibleDescription(loadedClassesMeter.plotter,
+
 getText("ClassTab.loadedClassesPlotter.accessibleDescription"));
         plotterPanel.add(loadedClassesMeter);

         timeComboBox = new TimeComboBox(loadedClassesMeter.plotter);
-        controlPanel.add(new LabeledComponent(Resources.getText("Time
Range:"),
-                                              getMnemonicInt("Time
Range:"),
-                                              timeComboBox));
+    controlPanel.add(new LabeledComponent(getText("Time Range:"),
+            getText("TimeRange.accessibleDescription"),
+                          getMnemonicInt("Time Range:"), timeComboBox));

         LabeledComponent.layout(plotterPanel);

         bottomPanel.setBorder(new CompoundBorder(new
TitledBorder(Resources.getText("Details")),
                                                   new EmptyBorder(10, 10,
10, 10)));
+    setAccessibleDescription(bottomPanel,
getText("Details.accessibleDescription"));

         details = new HTMLPane();
         setAccessibleName(details, getText("Details"));
+    setAccessibleDescription(details,
getText("Details.accessibleDescription"));
         JScrollPane scrollPane = new JScrollPane(details);
         scrollPane.setPreferredSize(new Dimension(0, 150));
         bottomPanel.add(scrollPane, BorderLayout.SOUTH);


-- 
Best Regards,
Sean Chou
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20110401/1e914ab1/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Jconsole2.png
Type: image/png
Size: 59132 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20110401/1e914ab1/Jconsole2.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Jconsole-1.png
Type: image/png
Size: 48519 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20110401/1e914ab1/Jconsole-1.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jconsole.patch
Type: application/octet-stream
Size: 81312 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20110401/1e914ab1/jconsole.patch>


More information about the swing-dev mailing list