From e202da94b60691d3c1ba86f736ffb9367a49f7b5 Mon Sep 17 00:00:00 2001 From: tzefferer Date: Fri, 16 Oct 2009 09:54:59 +0000 Subject: Keyboard accessibility for Online-BKU git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@529 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../main/java/at/gv/egiz/bku/gui/ActivationGUI.java | 9 +++++---- .../main/java/at/gv/egiz/bku/gui/CardMgmtGUI.java | 5 +++-- .../java/at/gv/egiz/bku/gui/PINManagementGUI.java | 21 ++++++++++++++++----- .../java/at/gv/egiz/bku/gui/ActivationGuiTest.java | 2 +- 4 files changed, 25 insertions(+), 12 deletions(-) (limited to 'BKUGuiExt/src') diff --git a/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/ActivationGUI.java b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/ActivationGUI.java index c8927e1e..1a1426a5 100644 --- a/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/ActivationGUI.java +++ b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/ActivationGUI.java @@ -50,8 +50,9 @@ public class ActivationGUI extends CardMgmtGUI implements ActivationGUIFacade { Locale locale, Style guiStyle, URL backgroundImgURL, - AbstractHelpListener helpListener) { - super(contentPane, locale, guiStyle, backgroundImgURL, helpListener); + AbstractHelpListener helpListener, + SwitchFocusListener switchFocusListener) { + super(contentPane, locale, guiStyle, backgroundImgURL, helpListener, switchFocusListener); progressBar = new JProgressBar(); } @@ -84,7 +85,7 @@ public class ActivationGUI extends CardMgmtGUI implements ActivationGUIFacade { infoLabel.setText(cardmgmtMessages.getString(TITLE_ACTIVATION)); } - helpListener.setHelpTopic(HELP_ACTIVATION); + helpMouseListener.setHelpTopic(HELP_ACTIVATION); progressBar.setIndeterminate(false); progressBar.setStringPainted(true); @@ -187,7 +188,7 @@ public class ActivationGUI extends CardMgmtGUI implements ActivationGUIFacade { infoLabel.setText(cardmgmtMessages.getString(TITLE_ACTIVATION)); } - helpListener.setHelpTopic(HELP_ACTIVATION); + helpMouseListener.setHelpTopic(HELP_ACTIVATION); progressBar.setIndeterminate(true); progressBar.setStringPainted(true); diff --git a/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/CardMgmtGUI.java b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/CardMgmtGUI.java index c8e1826c..68b2a2ba 100644 --- a/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/CardMgmtGUI.java +++ b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/CardMgmtGUI.java @@ -38,8 +38,9 @@ public class CardMgmtGUI extends BKUGUIImpl { Locale locale, Style guiStyle, URL backgroundImgURL, - AbstractHelpListener helpListener) { - super(contentPane, locale, guiStyle, backgroundImgURL, helpListener); + AbstractHelpListener helpListener, + SwitchFocusListener switchFocusListener) { + super(contentPane, locale, guiStyle, backgroundImgURL, helpListener, switchFocusListener); } diff --git a/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINManagementGUI.java b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINManagementGUI.java index 9c698d79..12f032d8 100644 --- a/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINManagementGUI.java +++ b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINManagementGUI.java @@ -58,8 +58,9 @@ public class PINManagementGUI extends CardMgmtGUI implements PINManagementGUIFac Locale locale, Style guiStyle, URL backgroundImgURL, - AbstractHelpListener helpListener) { - super(contentPane, locale, guiStyle, backgroundImgURL, helpListener); + AbstractHelpListener helpListener, + SwitchFocusListener switchFocusListener) { + super(contentPane, locale, guiStyle, backgroundImgURL, helpListener, switchFocusListener); } @Override @@ -98,7 +99,9 @@ public class PINManagementGUI extends CardMgmtGUI implements PINManagementGUIFac mainPanel.removeAll(); buttonPanel.removeAll(); - helpListener.setHelpTopic(HELP_PINMGMT); + helpMouseListener.setHelpTopic(HELP_PINMGMT); + helpKeyListener.setHelpTopic(HELP_PINMGMT); + JLabel mgmtLabel = new JLabel(); mgmtLabel.setFont(mgmtLabel.getFont().deriveFont(mgmtLabel.getFont().getStyle() & ~java.awt.Font.BOLD)); @@ -187,8 +190,10 @@ public class PINManagementGUI extends CardMgmtGUI implements PINManagementGUIFac if (!renderHeaderPanel) { messageHorizontal .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE) + .addComponent(switchFocusDummyLabel) .addComponent(helpLabel); messageVertical + .addComponent(switchFocusDummyLabel) .addComponent(helpLabel); } @@ -225,6 +230,7 @@ public class PINManagementGUI extends CardMgmtGUI implements PINManagementGUIFac buttonPanelLayout.setHorizontalGroup(buttonHorizontal); buttonPanelLayout.setVerticalGroup(buttonVertical); + helpLabel.requestFocus(); contentPanel.validate(); } }); @@ -336,7 +342,8 @@ public class PINManagementGUI extends CardMgmtGUI implements PINManagementGUIFac mainPanel.removeAll(); buttonPanel.removeAll(); - helpListener.setHelpTopic(HELP_TOPIC); + helpMouseListener.setHelpTopic(HELP_TOPIC); + helpKeyListener.setHelpTopic(HELP_TOPIC); JLabel mgmtLabel = new JLabel(); if (retries < 0) { @@ -344,7 +351,8 @@ public class PINManagementGUI extends CardMgmtGUI implements PINManagementGUIFac } else { mgmtLabel.setFont(mgmtLabel.getFont().deriveFont(mgmtLabel.getFont().getStyle() | Font.BOLD)); mgmtLabel.setForeground(ERROR_COLOR); - helpListener.setHelpTopic(HELP_RETRY); + helpMouseListener.setHelpTopic(HELP_RETRY); + helpKeyListener.setHelpTopic(HELP_RETRY); } if (renderHeaderPanel) { @@ -370,8 +378,10 @@ public class PINManagementGUI extends CardMgmtGUI implements PINManagementGUIFac if (!renderHeaderPanel) { infoHorizontal .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE) + .addComponent(switchFocusDummyLabel) .addComponent(helpLabel); infoVertical + .addComponent(switchFocusDummyLabel) .addComponent(helpLabel); } @@ -628,6 +638,7 @@ public class PINManagementGUI extends CardMgmtGUI implements PINManagementGUIFac .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addGroup(pinVertical)); + helpLabel.requestFocus(); contentPanel.validate(); } diff --git a/BKUGuiExt/src/test/java/at/gv/egiz/bku/gui/ActivationGuiTest.java b/BKUGuiExt/src/test/java/at/gv/egiz/bku/gui/ActivationGuiTest.java index 49ae577b..fd562a21 100644 --- a/BKUGuiExt/src/test/java/at/gv/egiz/bku/gui/ActivationGuiTest.java +++ b/BKUGuiExt/src/test/java/at/gv/egiz/bku/gui/ActivationGuiTest.java @@ -42,7 +42,7 @@ public class ActivationGuiTest { Container contentPane = testFrame.getContentPane(); contentPane.setPreferredSize(new Dimension(152, 145)); // contentPane.setPreferredSize(new Dimension(300, 190)); - ActivationGUIFacade gui = new ActivationGUI(contentPane, null, BKUGUIFacade.Style.tiny, null, null); + ActivationGUIFacade gui = new ActivationGUI(contentPane, null, BKUGUIFacade.Style.tiny, null, null, null); BKUGUIWorker worker = new BKUGUIWorker(); worker.init(gui); testFrame.pack(); -- cgit v1.2.3