summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormcentner <mcentner@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2010-05-05 15:29:01 +0000
committermcentner <mcentner@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2010-05-05 15:29:01 +0000
commitb1c8641a63a67e3c64d948f9e8dce5c01e11e2dd (patch)
tree0883f08a408f89f758e9a1be629232e3dd055c3a
parent83a9b613836910f7edc370c2fe60fa2268dc4461 (diff)
downloadmocca-b1c8641a63a67e3c64d948f9e8dce5c01e11e2dd.tar.gz
mocca-b1c8641a63a67e3c64d948f9e8dce5c01e11e2dd.tar.bz2
mocca-b1c8641a63a67e3c64d948f9e8dce5c01e11e2dd.zip
Merged feature branch mocca-1.2.13-id@r724 back to trunk.
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@725 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
-rw-r--r--BKUApplet/keystore.ksbin5635 -> 5639 bytes
-rw-r--r--BKUApplet/pom.xml53
-rw-r--r--BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java24
-rw-r--r--BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletSecureViewer.java31
-rw-r--r--BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java106
-rw-r--r--BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/InternalSSLSocketFactory.java18
-rw-r--r--BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/viewer/URLFontLoader.java37
-rw-r--r--BKUApplet/src/main/resources/simplelog.properties25
-rw-r--r--BKUAppletExt/keystore.ksbin5635 -> 5639 bytes
-rw-r--r--BKUAppletExt/pom.xml39
-rw-r--r--BKUAppletExt/src/main/java/at/gv/egiz/bku/online/applet/ActivationApplet.java17
-rw-r--r--BKUAppletExt/src/main/java/at/gv/egiz/bku/online/applet/PINManagementApplet.java38
-rw-r--r--BKUAppletExt/src/main/java/at/gv/egiz/bku/online/applet/PINManagementBKUWorker.java11
-rw-r--r--BKUCertificates/pom.xml4
-rw-r--r--BKUCommonGUI/pom.xml17
-rw-r--r--BKUCommonGUI/src/main/java/META-INF/MANIFEST.MF3
-rw-r--r--BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/AbstractHelpListener.java103
-rw-r--r--BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java22
-rw-r--r--BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java4160
-rw-r--r--BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUIcons.java17
-rw-r--r--BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/DeafHelpListener.java67
-rw-r--r--BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/DefaultHelpListener.java81
-rw-r--r--BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/FocusBorder.java69
-rw-r--r--BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataTableModel.java12
-rw-r--r--BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HelpKeyListener.java46
-rw-r--r--BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HelpListener.java84
-rw-r--r--BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HelpMouseListener.java54
-rw-r--r--BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HelpURLProvider.java (renamed from bkucommon/src/test/java/at/gv/egiz/bku/conf/DummyConfiguration.java)21
-rw-r--r--BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HelpViewer.java13
-rw-r--r--BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HyperlinkRenderer.java11
-rw-r--r--BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/ImagePanel.java2
-rw-r--r--BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SecureViewerDialog.java139
-rw-r--r--BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SwitchFocusFocusListener.java82
-rw-r--r--BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SwitchFocusListener.java98
-rw-r--r--BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/ViewerHelpListener.java101
-rw-r--r--BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/WindowCloseAdapter.java54
-rw-r--r--BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/html/RestrictedHTMLEditorKit.java3
-rw-r--r--BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/viewer/FontProviderException.java2
-rw-r--r--BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/viewer/SecureViewerSaveDialog.java51
-rw-r--r--BKUCommonGUI/src/main/java/at/gv/egiz/stal/impl/ByteArrayHashDataInput.java8
-rw-r--r--BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties3
-rw-r--r--BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_en.properties4
-rw-r--r--BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java9
-rw-r--r--BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/DummyFontLoader.java8
-rw-r--r--BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/SecureViewerDialogTest.java4
-rw-r--r--BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/SimplePinInfo.java (renamed from smccSTALExt/src/main/java/at/gv/egiz/bku/smccstal/GetPINStatusException.java)47
-rw-r--r--BKUCommonGUI/src/test/resources/commons-logging.properties1
-rw-r--r--BKUFonts/.classpath8
-rw-r--r--BKUFonts/.project36
-rw-r--r--BKUFonts/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--BKUFonts/.settings/org.eclipse.wst.common.component6
-rw-r--r--BKUFonts/.settings/org.eclipse.wst.common.project.facet.core.xml5
-rw-r--r--BKUFonts/.settings/org.maven.ide.eclipse.prefs9
-rw-r--r--BKUFonts/pom.xml26
-rw-r--r--BKUGuiExt/pom.xml10
-rw-r--r--BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/ActivationGUI.java21
-rw-r--r--BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/ActivationGUIFacade.java1
-rw-r--r--BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/CardMgmtGUI.java11
-rw-r--r--BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINManagementGUI.java1468
-rw-r--r--BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINManagementGUIFacade.java20
-rw-r--r--BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINSpecRenderer.java21
-rw-r--r--BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINStatusRenderer.java36
-rw-r--r--BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINStatusTableModel.java27
-rw-r--r--BKUGuiExt/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java4
-rw-r--r--BKUGuiExt/src/test/java/at/gv/egiz/bku/gui/SimplePinInfo.java46
-rw-r--r--BKUHelp/pom.xml6
-rw-r--r--BKUHelp/src/main/webapp/help/cardnotsupported.html48
-rw-r--r--BKUHelp/src/main/webapp/help/cardnotsupported.pngbin0 -> 2120 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/css/help.css81
-rw-r--r--BKUHelp/src/main/webapp/help/en/cardnotsupported.html48
-rw-r--r--BKUHelp/src/main/webapp/help/en/cardnotsupported.pngbin0 -> 2120 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/en/error.card.locked.html47
-rw-r--r--BKUHelp/src/main/webapp/help/en/error.card.locked.pngbin0 -> 2727 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/en/error.card.notactivated.html44
-rw-r--r--BKUHelp/src/main/webapp/help/en/error.card.notactivated.pngbin0 -> 3116 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/en/error.cardterminal.html43
-rw-r--r--BKUHelp/src/main/webapp/help/en/error.cardterminal.pngbin0 -> 3362 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/en/error.pcsc.html52
-rw-r--r--BKUHelp/src/main/webapp/help/en/error.pcsc.pngbin0 -> 3488 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/en/error.pin.timeout.html45
-rw-r--r--BKUHelp/src/main/webapp/help/en/error.pin.timeout.pngbin0 -> 3866 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/en/error.ws.unreachable.html40
-rw-r--r--BKUHelp/src/main/webapp/help/en/error.ws.unreachable.pngbin0 -> 2853 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/en/help.activate.pin.html47
-rw-r--r--BKUHelp/src/main/webapp/help/en/help.cardpin.html42
-rw-r--r--BKUHelp/src/main/webapp/help/en/help.cardpin1.pngbin0 -> 3163 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/en/help.cardpin2.pngbin0 -> 3189 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/en/help.change.pin.html48
-rw-r--r--BKUHelp/src/main/webapp/help/en/help.hashdataviewer.html42
-rw-r--r--BKUHelp/src/main/webapp/help/en/help.hashdataviewer.pngbin0 -> 11310 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/en/help.install.cacert.html58
-rw-r--r--BKUHelp/src/main/webapp/help/en/help.install.cacert.pngbin0 -> 25299 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/en/help.pin.activate.pngbin0 -> 6227 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/en/help.pin.change.pngbin0 -> 6359 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/en/help.pin.mgmt-1.pngbin0 -> 8206 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/en/help.pin.mgmt-2.pngbin0 -> 7764 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/en/help.pin.mgmt-3.pngbin0 -> 8923 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/en/help.pin.mgmt-4.pngbin0 -> 8503 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/en/help.pin.mgmt.html78
-rw-r--r--BKUHelp/src/main/webapp/help/en/help.pin.mgmt.pngbin0 -> 7478 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/en/help.pin.verify.pngbin0 -> 5422 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/en/help.retry.html41
-rw-r--r--BKUHelp/src/main/webapp/help/en/help.retry.pngbin0 -> 3729 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/en/help.signpin-1.pngbin0 -> 12818 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/en/help.signpin.html46
-rw-r--r--BKUHelp/src/main/webapp/help/en/help.signpin.pngbin0 -> 4043 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/en/help.unblock.pin.html47
-rw-r--r--BKUHelp/src/main/webapp/help/en/help.unsupported.mimetype.html41
-rw-r--r--BKUHelp/src/main/webapp/help/en/help.verify.pin.html51
-rw-r--r--BKUHelp/src/main/webapp/help/en/index.html49
-rw-r--r--BKUHelp/src/main/webapp/help/en/insertcard.html43
-rw-r--r--BKUHelp/src/main/webapp/help/en/insertcard.pngbin0 -> 2270 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/en/wait.html40
-rw-r--r--BKUHelp/src/main/webapp/help/en/wait.pngbin0 -> 1542 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/en/welcome.html41
-rw-r--r--BKUHelp/src/main/webapp/help/en/welcome.pngbin0 -> 1537 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/error.card.locked.html47
-rw-r--r--BKUHelp/src/main/webapp/help/error.card.locked.pngbin0 -> 2727 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/error.card.notactivated.html44
-rw-r--r--BKUHelp/src/main/webapp/help/error.card.notactivated.pngbin0 -> 3116 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/error.cardterminal.html43
-rw-r--r--BKUHelp/src/main/webapp/help/error.cardterminal.pngbin0 -> 3362 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/error.pcsc.html52
-rw-r--r--BKUHelp/src/main/webapp/help/error.pcsc.pngbin0 -> 3488 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/error.pin.timeout.html45
-rw-r--r--BKUHelp/src/main/webapp/help/error.pin.timeout.pngbin0 -> 3866 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/error.ws.unreachable.html40
-rw-r--r--BKUHelp/src/main/webapp/help/error.ws.unreachable.pngbin0 -> 2853 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/help.activate.pin.html47
-rw-r--r--BKUHelp/src/main/webapp/help/help.cardpin.html42
-rw-r--r--BKUHelp/src/main/webapp/help/help.cardpin1.pngbin0 -> 3163 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/help.cardpin2.pngbin0 -> 3189 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/help.change.pin.html48
-rw-r--r--BKUHelp/src/main/webapp/help/help.hashdataviewer.html42
-rw-r--r--BKUHelp/src/main/webapp/help/help.hashdataviewer.pngbin0 -> 11310 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/help.install.cacert.html58
-rw-r--r--BKUHelp/src/main/webapp/help/help.install.cacert.pngbin0 -> 25299 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/help.pin.activate.pngbin0 -> 6227 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/help.pin.change.pngbin0 -> 6359 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/help.pin.mgmt-1.pngbin0 -> 8206 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/help.pin.mgmt-2.pngbin0 -> 7764 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/help.pin.mgmt-3.pngbin0 -> 8923 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/help.pin.mgmt-4.pngbin0 -> 8503 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/help.pin.mgmt.html78
-rw-r--r--BKUHelp/src/main/webapp/help/help.pin.mgmt.pngbin0 -> 7478 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/help.pin.verify.pngbin0 -> 5422 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/help.retry.html41
-rw-r--r--BKUHelp/src/main/webapp/help/help.retry.pngbin0 -> 3729 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/help.signpin-1.pngbin0 -> 12818 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/help.signpin.html46
-rw-r--r--BKUHelp/src/main/webapp/help/help.signpin.pngbin0 -> 4043 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/help.unblock.pin.html47
-rw-r--r--BKUHelp/src/main/webapp/help/help.unsupported.mimetype.html41
-rw-r--r--BKUHelp/src/main/webapp/help/help.verify.pin.html51
-rw-r--r--BKUHelp/src/main/webapp/help/index.html24
-rw-r--r--BKUHelp/src/main/webapp/help/insertcard.html43
-rw-r--r--BKUHelp/src/main/webapp/help/insertcard.pngbin0 -> 2270 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/wait.html40
-rw-r--r--BKUHelp/src/main/webapp/help/wait.pngbin0 -> 1542 bytes
-rw-r--r--BKUHelp/src/main/webapp/help/welcome.html41
-rw-r--r--BKUHelp/src/main/webapp/help/welcome.pngbin0 -> 1537 bytes
-rw-r--r--BKULocal/pom.xml78
-rw-r--r--BKULocal/src/main/java/at/gv/egiz/bku/local/accesscontroller/SpringSecurityManager.java65
-rw-r--r--BKULocal/src/main/java/at/gv/egiz/bku/local/conf/SpringConfigurator.java142
-rw-r--r--BKULocal/src/main/java/at/gv/egiz/bku/local/gui/GUIProxy.java2
-rw-r--r--BKULocal/src/main/java/at/gv/egiz/bku/local/gui/LocalHelpListener.java58
-rw-r--r--BKULocal/src/main/java/at/gv/egiz/bku/local/stal/ExclusiveAccessSTAL.java76
-rw-r--r--BKULocal/src/main/java/at/gv/egiz/bku/local/stal/ExclusiveAccessSTALFactory.java65
-rw-r--r--BKULocal/src/main/java/at/gv/egiz/bku/local/stal/LocalBKUWorker.java2
-rw-r--r--BKULocal/src/main/java/at/gv/egiz/bku/local/stal/LocalSTALFactory.java69
-rw-r--r--BKULocal/src/main/java/at/gv/egiz/bku/local/stal/LocalSecureViewer.java24
-rw-r--r--BKULocal/src/main/java/at/gv/egiz/bku/local/stal/LocalSignRequestHandler.java9
-rw-r--r--BKULocal/src/main/java/at/gv/egiz/bku/local/webapp/BKURequestHandler.java135
-rw-r--r--BKULocal/src/main/java/at/gv/egiz/bku/local/webapp/MoccaContextListener.java93
-rw-r--r--BKULocal/src/main/java/at/gv/egiz/bku/local/webapp/PINManagementServlet.java12
-rw-r--r--BKULocal/src/main/java/at/gv/egiz/bku/local/webapp/SpringBKUServlet.java9
-rw-r--r--BKULocal/src/main/resources/commons-logging.properties16
-rw-r--r--BKULocal/src/main/webapp/WEB-INF/applicationContext.xml274
-rw-r--r--BKULocal/src/main/webapp/WEB-INF/conf/configuration.xml10
-rw-r--r--BKULocal/src/main/webapp/WEB-INF/web.xml18
-rw-r--r--BKULocal/src/main/webapp/en/index.html64
-rw-r--r--BKULocal/src/main/webapp/index.html16
-rw-r--r--BKUOnline/pom.xml107
-rw-r--r--BKUOnline/src/main/java/at/gv/egiz/bku/online/accesscontroller/SpringSecurityManager.java63
-rw-r--r--BKUOnline/src/main/java/at/gv/egiz/bku/online/conf/SpringConfigurator.java127
-rw-r--r--BKUOnline/src/main/java/at/gv/egiz/bku/online/spring/ServletContextPathFactoryBean.java49
-rw-r--r--BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/AbstractWebRequestHandler.java327
-rw-r--r--BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/AppletDispatcher.java13
-rw-r--r--BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/BKURequestHandler.java289
-rw-r--r--BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/MoccaContextListener.java128
-rw-r--r--BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/ResultServlet.java121
-rw-r--r--BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/SessionListener.java (renamed from BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/SessionTimeout.java)64
-rw-r--r--BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/ShutdownHandler.java96
-rw-r--r--BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/SpringBKUServlet.java8
-rw-r--r--BKUOnline/src/main/java/at/gv/egiz/mocca/id/AbstractCommandSequenceBindingProcessor.java123
-rw-r--r--BKUOnline/src/main/java/at/gv/egiz/mocca/id/DataURLServerServlet.java225
-rw-r--r--BKUOnline/src/main/java/at/gv/egiz/mocca/id/IdLink.java346
-rw-r--r--BKUOnline/src/main/java/at/gv/egiz/mocca/id/IdLinkException.java43
-rw-r--r--BKUOnline/src/main/java/at/gv/egiz/mocca/id/IdLinkFactory.java154
-rw-r--r--BKUOnline/src/main/java/at/gv/egiz/mocca/id/IdLinkKeySelector.java88
-rw-r--r--BKUOnline/src/main/java/at/gv/egiz/mocca/id/IdLinkPersonData.java76
-rw-r--r--BKUOnline/src/main/java/at/gv/egiz/mocca/id/PersonalIdentifier.java81
-rw-r--r--BKUOnline/src/main/java/at/gv/egiz/mocca/id/QESTemplates.java115
-rw-r--r--BKUOnline/src/main/java/at/gv/egiz/mocca/id/SAMLBindingProcessorFactory.java44
-rw-r--r--BKUOnline/src/main/java/at/gv/egiz/mocca/id/SAMLBindingProcessorImpl.java357
-rw-r--r--BKUOnline/src/main/java/at/gv/egiz/mocca/id/SAMLRequestHandler.java33
-rw-r--r--BKUOnline/src/main/java/at/gv/egiz/mocca/id/SLCommandBrocker.java100
-rw-r--r--BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/RequestBrokerSTALFactory.java49
-rw-r--r--BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALRequestBrokerImpl.java24
-rw-r--r--BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALServiceImpl.java385
-rw-r--r--BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALXJAXBContextFactory.java7
-rw-r--r--BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/TestSignatureData.java7
-rw-r--r--BKUOnline/src/main/policy/50mocca.policy229
-rw-r--r--BKUOnline/src/main/policy/catalina.policy411
-rw-r--r--BKUOnline/src/main/resources/at/gv/egiz/mocca/id/idlschema/PersonData.xsd57
-rw-r--r--BKUOnline/src/main/resources/at/gv/egiz/mocca/id/idlschema/oasis-sstc-saml-schema-assertion-1.0.xsd105
-rw-r--r--BKUOnline/src/main/resources/at/gv/egiz/mocca/id/idlschema/xmldsig-core-schema.xsd (renamed from bkucommon/src/main/resources/at/gv/egiz/bku/slcommands/schema/xmldsig-core-schema.xsd)0
-rw-r--r--BKUOnline/src/main/resources/at/gv/egiz/mocca/id/idlschema/xmldsig-more.xsd147
-rw-r--r--BKUOnline/src/main/resources/commons-logging.properties16
-rw-r--r--BKUOnline/src/main/resources/log4j.properties7
-rw-r--r--BKUOnline/src/main/webapp/IDRequestForm.html71
-rw-r--r--BKUOnline/src/main/webapp/PINManagement.jsp82
-rw-r--r--BKUOnline/src/main/webapp/SLRequestForm.html6
-rw-r--r--BKUOnline/src/main/webapp/WEB-INF/applicationContext.xml288
-rw-r--r--BKUOnline/src/main/webapp/WEB-INF/conf/configuration.xml10
-rw-r--r--BKUOnline/src/main/webapp/WEB-INF/mocca-conf.xml51
-rw-r--r--BKUOnline/src/main/webapp/WEB-INF/web.xml62
-rw-r--r--BKUOnline/src/main/webapp/applet.jsp132
-rw-r--r--BKUOnline/src/main/webapp/img/dec.pngbin0 -> 6311 bytes
-rw-r--r--BKUOnline/src/main/webapp/img/help.pngbin0 -> 303 bytes
-rw-r--r--BKUOnline/src/main/webapp/img/inc.pngbin0 -> 7198 bytes
-rw-r--r--BKUOnline/src/main/webapp/local.jsp63
-rw-r--r--BKUOnline/src/test/java/at/gv/egiz/bku/online/conf/SSLConfigTest.java40
-rw-r--r--BKUOnline/src/test/java/at/gv/egiz/stal/service/STALRequestBrokerTest.java7
-rw-r--r--BKUOnline/src/test/resources/commons-logging.properties16
-rw-r--r--BKUOnline/src/test/resources/templates/empty.xml2
-rw-r--r--BKUOnline/src/test/resources/templates/template.xsl88
-rw-r--r--BKUViewer/pom.xml17
-rw-r--r--BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/SLXHTMLValidator.java10
-rw-r--r--BKUViewer/src/main/java/at/gv/egiz/bku/text/TextValidator.java10
-rw-r--r--BKUViewer/src/test/java/at/gv/egiz/bku/slxhtml/ValidatorTest.java9
-rw-r--r--BKUViewer/src/test/resources/commons-logging.properties1
-rw-r--r--BKUWebStart/pom.xml30
-rw-r--r--BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Configurator.java12
-rw-r--r--BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Container.java60
-rw-r--r--BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Launcher.java39
-rw-r--r--BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/LogSecurityManager.java443
-rw-r--r--BKUWebStart/src/main/jnlp/keystore.ksbin5635 -> 5639 bytes
-rw-r--r--BKUWebStart/src/main/jnlp/template-local.xml18
-rw-r--r--BKUWebStart/src/main/jnlp/template-unstable.xml2
-rw-r--r--BKUWebStart/src/main/jnlp/template.xml2
-rw-r--r--BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/messages.properties12
-rw-r--r--BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/messages_en.properties38
-rw-r--r--BKUWebStart/src/test/java/at/gv/egiz/bku/webstart/ConfiguratorTest.java12
-rw-r--r--BKUWebStart/src/test/resources/commons-logging.properties1
-rw-r--r--BKUWebStartPackage/nbactions.xml10
-rw-r--r--BKUWebStartPackage/pom.xml160
-rw-r--r--BKUWebStartPackage/src/main/assemblies/zip-webstart.xml35
-rw-r--r--BKUWebStartPackage/src/main/jnlp/keystore.ksbin5635 -> 0 bytes
-rw-r--r--BKUWebStartPackage/src/main/jnlp/resources/img/chip128.pngbin7775 -> 0 bytes
-rw-r--r--BKUWebStartPackage/src/main/jnlp/resources/img/chip16.pngbin787 -> 0 bytes
-rw-r--r--BKUWebStartPackage/src/main/jnlp/resources/img/chip24.pngbin1227 -> 0 bytes
-rw-r--r--BKUWebStartPackage/src/main/jnlp/resources/img/chip32.pngbin1753 -> 0 bytes
-rw-r--r--BKUWebStartPackage/src/main/jnlp/resources/img/chip48.pngbin2771 -> 0 bytes
-rw-r--r--BKUWebStartPackage/src/main/jnlp/resources/img/splash.pngbin41455 -> 0 bytes
-rw-r--r--BKUWebStartPackage/src/main/jnlp/resources/img/version.xml52
-rw-r--r--BKUWebStartPackage/src/main/jnlp/resources/player.jnlp3
-rw-r--r--BKUWebStartPackage/src/main/jnlp/template-local.xml41
-rw-r--r--BKUWebStartPackage/src/main/jnlp/template.xml49
-rw-r--r--STAL/pom.xml10
-rw-r--r--STALExt/pom.xml8
-rw-r--r--STALService/pom.xml17
-rw-r--r--STALService/src/main/java/at/gv/egiz/stal/service/STALService.java2
-rw-r--r--STALService/src/main/java/at/gv/egiz/stal/service/translator/STALTranslator.java43
-rw-r--r--STALService/src/main/java/at/gv/egiz/stal/service/translator/TranslationException.java9
-rw-r--r--STALXService/pom.xml14
-rw-r--r--STALXService/src/main/java/at/gv/egiz/stalx/service/STALService.java2
-rw-r--r--STALXService/src/main/java/at/gv/egiz/stalx/service/translator/STALXTranslationHandler.java34
-rw-r--r--bkucommon/pom.xml46
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/accesscontroller/AccessControllerFactory.java305
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/accesscontroller/AuthenticationClassifier.java220
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/accesscontroller/ChainChecker.java183
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/accesscontroller/InfoboxParamChecker.java149
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/accesscontroller/RuleChecker.java406
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/accesscontroller/SecurityManagerFacade.java237
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/binding/AbstractBindingProcessor.java111
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/binding/AbstractBindingProcessorFactory.java81
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/binding/BindingProcessor.java153
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/binding/BindingProcessorFactory.java42
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/binding/BindingProcessorFuture.java73
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/binding/BindingProcessorManager.java138
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/binding/BindingProcessorManagerImpl.java414
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/binding/DataURLConnectionFactory.java (renamed from utils/src/main/java/at/gv/egiz/bku/utils/urldereferencer/URLDereferencerContext.java)23
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/binding/DataUrl.java91
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/binding/DataUrlConnection.java134
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/binding/DataUrlConnectionImpl.java340
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/binding/DataUrlConnectionSPI.java64
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/binding/ExpiryRemover.java67
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/binding/FormDataURLDereferencer.java71
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/binding/FormDataURLSupplier.java (renamed from utils/src/main/java/at/gv/egiz/bku/utils/urldereferencer/FormDataURLSupplier.java)7
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/binding/HTTPBindingProcessor.java859
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/binding/HTTPBindingProcessorFactory.java80
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/binding/HTTPBindingProcessorImpl.java896
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/binding/HttpDataURLConnection.java68
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/binding/HttpUtil.java3
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/binding/HttpsDataURLConnection.java72
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/binding/IdFactory.java180
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/binding/IdImpl.java11
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/binding/InputDecoderFactory.java148
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/binding/MultiPartFormDataInputDecoder.java235
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/binding/ProcessingContext.java59
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/binding/SLCommandInvokerImpl.java33
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/binding/XWWWFormUrlInputIterator.java1
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/conf/CertValidator.java13
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/conf/CertValidatorImpl.java110
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/conf/Configuration.java100
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/conf/Configurator.java467
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/conf/IAIKCommonsLogFactory.java59
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/conf/IAIKLogAdapter.java (renamed from bkucommon/src/main/java/at/gv/egiz/bku/conf/IAIKCommonsLog.java)40
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/conf/IAIKLogAdapterFactory.java62
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/conf/MoccaConfigurationFacade.java (renamed from bkucommon/src/main/java/at/gv/egiz/bku/binding/RemovalStrategy.java)18
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/jmx/ComponentMXBean.java27
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/jmx/ComponentState.java38
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/jmx/ComponentStateCheck.java24
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/AbstractSLCommandFactory.java46
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/CreateXMLSignatureCommand.java2
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/CreateXMLSignatureResult.java7
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/ErrorResult.java8
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/InfoboxReadResult.java5
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/SLCommand.java10
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/SLCommandContext.java31
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/SLCommandFactory.java519
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/SLCommandInvoker.java2
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/SLMarshallerFactory.java11
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/SLSourceContext.java3
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/AbstractAssocArrayInfobox.java16
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/AbstractBinaryFileInfobox.java8
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/AbstractInfoboxCommandFactory.java40
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/AbstractInfoboxCommandImpl.java26
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/AbstractInfoboxFactory.java24
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/CardChannelInfoboxFactory.java27
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/CardChannelInfoboxImpl.java12
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/CertificatesInfoboxFactory.java27
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/CertificatesInfoboxImpl.java6
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/CreateXMLSignatureCommandFactory.java65
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/CreateXMLSignatureCommandImpl.java77
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/CreateXMLSignatureResultImpl.java27
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/DomCreateXMLSignatureResultImpl.java47
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/DomErrorResultImpl.java70
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/DomInfoboxReadResultImpl.java105
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/DomSLResult.java41
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/ErrorResultImpl.java18
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/GetStatusCommandFactory.java37
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/GetStatusCommandImpl.java24
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/IdentityLinkInfoboxFactory.java48
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/IdentityLinkInfoboxImpl.java28
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/InfoboxFactory.java103
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/InfoboxReadCommandFactory.java37
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/InfoboxReadCommandImpl.java84
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/InfoboxReadResultFileImpl.java40
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/InfoboxReadResultImpl.java18
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/InfoboxUpdateCommandFactory.java37
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/InfoboxUpdateCommandImpl.java16
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/NullOperationCommandFactory.java37
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/NullOperationCommandImpl.java3
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/SLCommandImpl.java33
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/SLResultImpl.java18
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/STALHelper.java17
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/SVPersonendatenInfoboxFactory.java27
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/SVPersonendatenInfoboxImpl.java10
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/xsect/AlgorithmMethodFactoryImpl.java3
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/xsect/DataObject.java191
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/xsect/LocRefDereferencer.java189
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/xsect/STALPrivateKey.java3
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/xsect/STALProvider.java71
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/xsect/STALSignature.java184
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/xsect/STALSignatureException.java2
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/xsect/STALSignatureMethod.java127
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/xsect/Signature.java43
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/xsect/SignatureContext.java50
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/xsect/SignatureLocation.java418
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/xsect/URIDereferncerAdapter.java14
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slexceptions/SLBindingException.java2
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slexceptions/SLCanceledException.java2
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slexceptions/SLException.java9
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slexceptions/SLRequestException.java2
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slexceptions/SLRuntimeException.java2
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slexceptions/SLViewerException.java2
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/spring/ConfigurableHostnameVerifier.java77
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/spring/ConfigurationFactoryBean.java172
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/spring/PKIProfileFactoryBean.java235
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/spring/PKITrustManager.java173
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/spring/SSLSocketFactoryBean.java109
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/spring/SecurityManagerFactoryBean.java102
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/viewer/ResourceFontLoader.java6
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/viewer/ValidatorFactory.java22
-rw-r--r--bkucommon/src/main/resources/at/gv/egiz/bku/accesscontrol/config/accessControlConfig.xml (renamed from BKUOnline/src/main/resources/at/gv/egiz/bku/online/conf/accessControlConfig.xml)0
-rw-r--r--bkucommon/src/main/resources/at/gv/egiz/bku/slcommands/schema/xmldsig-transforms.xsd41
-rw-r--r--bkucommon/src/test/java/at/gv/egiz/bku/accesscontroller/ConfigTest.java7
-rw-r--r--bkucommon/src/test/java/at/gv/egiz/bku/binding/AbstractBindingProcessorTest.java77
-rw-r--r--bkucommon/src/test/java/at/gv/egiz/bku/binding/BindingProcessorManagerTest.java27
-rw-r--r--bkucommon/src/test/java/at/gv/egiz/bku/binding/DataUrlConnectionTest.java39
-rw-r--r--bkucommon/src/test/java/at/gv/egiz/bku/binding/EmptyMultipartSLRequestTest.java98
-rw-r--r--bkucommon/src/test/java/at/gv/egiz/bku/binding/ExpiryRemoverTest.java70
-rw-r--r--bkucommon/src/test/java/at/gv/egiz/bku/binding/FormDataTest.java (renamed from utils/src/test/java/at/gv/egiz/urldereferencer/FormDataTest.java)30
-rw-r--r--bkucommon/src/test/java/at/gv/egiz/bku/binding/HttpBindingProcessorTest.java81
-rw-r--r--bkucommon/src/test/java/at/gv/egiz/bku/binding/MultiTestDataUrlConnection.java5
-rw-r--r--bkucommon/src/test/java/at/gv/egiz/bku/binding/MultipartSLRequestTest.java78
-rw-r--r--bkucommon/src/test/java/at/gv/egiz/bku/binding/NullOperationTest.java54
-rw-r--r--bkucommon/src/test/java/at/gv/egiz/bku/binding/SSLDataUrlConnectionTest.java18
-rw-r--r--bkucommon/src/test/java/at/gv/egiz/bku/binding/TestDataUrlConnection.java212
-rw-r--r--bkucommon/src/test/java/at/gv/egiz/bku/binding/XWWWFormUrlInputIteratorTest.java4
-rw-r--r--bkucommon/src/test/java/at/gv/egiz/bku/conf/CertValidatorTest.java35
-rw-r--r--bkucommon/src/test/java/at/gv/egiz/bku/slcommands/SLCommandFactoryTest.java17
-rw-r--r--bkucommon/src/test/java/at/gv/egiz/bku/slcommands/impl/CreateXMLSignatureComandImplTest.java61
-rw-r--r--bkucommon/src/test/java/at/gv/egiz/bku/slcommands/impl/InfoboxReadComandImplTest.java47
-rw-r--r--bkucommon/src/test/java/at/gv/egiz/bku/slcommands/impl/SVPersonendatenInfoboxImplTest.java66
-rw-r--r--bkucommon/src/test/java/at/gv/egiz/bku/slcommands/impl/xsect/SignatureTest.java110
-rw-r--r--bkucommon/src/test/java/at/gv/egiz/stal/dummy/DummySTAL.java13
-rw-r--r--bkucommon/src/test/java/at/gv/egiz/stal/dummy/DummyStalFactory.java (renamed from bkucommon/src/test/java/at/gv/egiz/bku/binding/DummyStalFactory.java)2
-rw-r--r--bkucommon/src/test/resources/at/gv/egiz/bku/binding/NOPMultipartDataUrl.txt2
-rw-r--r--bkucommon/src/test/resources/at/gv/egiz/bku/slcommands/impl/TransformsInfo_2.xml2
-rw-r--r--bkucommon/src/test/resources/at/gv/egiz/bku/slcommands/testApplicationContext.xml156
-rw-r--r--bkucommon/src/test/resources/commons-logging.properties1
-rw-r--r--pom.xml88
-rw-r--r--smcc/keystore.ksbin5635 -> 5639 bytes
-rw-r--r--smcc/pom.xml15
-rw-r--r--smcc/src/main/java/at/gv/egiz/smcc/ACOSCard.java134
-rw-r--r--smcc/src/main/java/at/gv/egiz/smcc/AbstractSignatureCard.java22
-rw-r--r--smcc/src/main/java/at/gv/egiz/smcc/BELPICCard.java23
-rw-r--r--smcc/src/main/java/at/gv/egiz/smcc/EstEIDCard.java280
-rw-r--r--smcc/src/main/java/at/gv/egiz/smcc/ExclSignatureCardProxy.java11
-rw-r--r--smcc/src/main/java/at/gv/egiz/smcc/ITCard.java24
-rw-r--r--smcc/src/main/java/at/gv/egiz/smcc/LogCardChannel.java16
-rw-r--r--smcc/src/main/java/at/gv/egiz/smcc/PINConfirmationException.java3
-rw-r--r--smcc/src/main/java/at/gv/egiz/smcc/PINFormatException.java3
-rw-r--r--smcc/src/main/java/at/gv/egiz/smcc/PINMgmtSignatureCard.java20
-rw-r--r--smcc/src/main/java/at/gv/egiz/smcc/PinInfo.java (renamed from smcc/src/main/java/at/gv/egiz/smcc/PINSpec.java)123
-rw-r--r--smcc/src/main/java/at/gv/egiz/smcc/PtEidCard.java310
-rw-r--r--smcc/src/main/java/at/gv/egiz/smcc/STARCOSCard.java218
-rw-r--r--smcc/src/main/java/at/gv/egiz/smcc/SWCard.java12
-rw-r--r--smcc/src/main/java/at/gv/egiz/smcc/SignatureCardFactory.java61
-rw-r--r--smcc/src/main/java/at/gv/egiz/smcc/pin/gui/ModifyPINGUI.java10
-rw-r--r--smcc/src/main/java/at/gv/egiz/smcc/pin/gui/ModifyPINProvider.java6
-rw-r--r--smcc/src/main/java/at/gv/egiz/smcc/pin/gui/PINGUI.java6
-rw-r--r--smcc/src/main/java/at/gv/egiz/smcc/pin/gui/PINProvider.java4
-rw-r--r--smcc/src/main/java/at/gv/egiz/smcc/reader/CardReader.java32
-rw-r--r--smcc/src/main/java/at/gv/egiz/smcc/reader/DefaultCardReader.java16
-rw-r--r--smcc/src/main/java/at/gv/egiz/smcc/reader/PinpadCardReader.java167
-rw-r--r--smcc/src/main/java/at/gv/egiz/smcc/reader/ReaderFactory.java32
-rw-r--r--smcc/src/main/java/at/gv/egiz/smcc/util/ISO7816Utils.java51
-rw-r--r--smcc/src/main/java/at/gv/egiz/smcc/util/SMCCHelper.java268
-rw-r--r--smcc/src/main/java/at/gv/egiz/smcc/util/SmartCardIO.java358
-rw-r--r--smcc/src/main/resources/at/gv/egiz/smcc/EstEIDCard.properties1
-rw-r--r--smcc/src/main/resources/at/gv/egiz/smcc/PtEidCard.properties1
-rw-r--r--smcc/src/main/resources/at/gv/egiz/smcc/SWCard.properties (renamed from BKUApplet/src/main/resources/commons-logging.properties)3
-rw-r--r--smcc/src/test/java/at/gv/egiz/smcc/CardTest.java16
-rw-r--r--smcc/src/test/java/at/gv/egiz/smcc/acos/A03CardTest.java4
-rw-r--r--smcc/src/test/java/at/gv/egiz/smcc/acos/A04CardTest.java4
-rw-r--r--smcc/src/test/java/at/gv/egiz/smcc/card/CreateSignature.java108
-rw-r--r--smcc/src/test/java/at/gv/egiz/smcc/card/ReadCertiticate.java56
-rw-r--r--smcc/src/test/java/at/gv/egiz/smcc/pin/gui/CancelChangePINProvider.java6
-rw-r--r--smcc/src/test/java/at/gv/egiz/smcc/pin/gui/CancelPINProvider.java4
-rw-r--r--smcc/src/test/java/at/gv/egiz/smcc/pin/gui/ChangePINProvider.java6
-rw-r--r--smcc/src/test/java/at/gv/egiz/smcc/pin/gui/DummyChangePINGUI.java10
-rw-r--r--smcc/src/test/java/at/gv/egiz/smcc/pin/gui/DummyPINGUI.java6
-rw-r--r--smcc/src/test/java/at/gv/egiz/smcc/pin/gui/InterruptPINProvider.java4
-rw-r--r--smcc/src/test/java/at/gv/egiz/smcc/pin/gui/InvalidChangePINProvider.java6
-rw-r--r--smcc/src/test/java/at/gv/egiz/smcc/pin/gui/InvalidPINProvider.java4
-rw-r--r--smcc/src/test/java/at/gv/egiz/smcc/pin/gui/SMCCTestPINProvider.java4
-rw-r--r--smcc/src/test/java/at/gv/egiz/smcc/starcos/STARCOSCardChannelEmul.java4
-rw-r--r--smcc/src/test/java/at/gv/egiz/smcc/starcos/STARCOSCardTest.java30
-rw-r--r--smcc/src/test/java/at/gv/egiz/smcc/starcos/STARCOSG3CardTest.java24
-rw-r--r--smccSTAL/pom.xml16
-rw-r--r--smccSTAL/src/main/java/at/gv/egiz/bku/pin/gui/AbstractPINProvider.java11
-rw-r--r--smccSTAL/src/main/java/at/gv/egiz/bku/pin/gui/SignPINGUI.java24
-rw-r--r--smccSTAL/src/main/java/at/gv/egiz/bku/pin/gui/SignPINProvider.java20
-rw-r--r--smccSTAL/src/main/java/at/gv/egiz/bku/pin/gui/VerifyPINGUI.java14
-rw-r--r--smccSTAL/src/main/java/at/gv/egiz/bku/pin/gui/VerifyPINProvider.java21
-rw-r--r--smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/AbstractBKUWorker.java19
-rw-r--r--smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/AbstractRequestHandler.java7
-rw-r--r--smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/AbstractSMCCSTAL.java35
-rw-r--r--smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/InfoBoxReadRequestHandler.java26
-rw-r--r--smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/SignRequestHandler.java17
-rw-r--r--smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/StatusRequestHandler.java16
-rw-r--r--smccSTALExt/pom.xml10
-rw-r--r--smccSTALExt/src/main/java/at/gv/egiz/bku/pin/gui/ManagementPINGUI.java16
-rw-r--r--smccSTALExt/src/main/java/at/gv/egiz/bku/pin/gui/ManagementPINProvider.java20
-rw-r--r--smccSTALExt/src/main/java/at/gv/egiz/bku/smccstal/CardMgmtRequestHandler.java35
-rw-r--r--smccSTALExt/src/main/java/at/gv/egiz/bku/smccstal/PINManagementRequestHandler.java188
-rw-r--r--utils/pom.xml50
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/AccessAuthorizationType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/AllSignatoriesType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/AnyChildrenType.java22
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/AnyMixedChildrenType.java24
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/AuthenticationClassType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/Base64ContentType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/Base64OptRefContentType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/Base64XMLContentType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/Base64XMLLocRefContentType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/Base64XMLLocRefOptRefContentType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/Base64XMLLocRefReqRefContentType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/Base64XMLOptRefContentType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/BindingType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/CMSDataObjectOptionalMetaType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/CMSDataObjectRequiredMetaType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/CMSEncryptedContentType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/CMSRecipientPublicKeyType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/CMSToBeEncryptedType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/CheckResultType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/CreateCMSSignatureRequestType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/CreateCMSSignatureResponseType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/CreateHashInfoRequestType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/CreateHashInfoResponseType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/CreateHashRequestType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/CreateHashResponseType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/CreateXMLSignatureRequestType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/CreateXMLSignatureResponseType.java22
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/DataObjectAssociationType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/DataObjectInfoType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/DecryptCMSRequestType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/DecryptCMSResponseType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/DecryptXMLRequestType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/DecryptXMLResponseType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/EncryptCMSRequestType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/EncryptCMSResponseType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/EncryptXMLRequest.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/EncryptXMLRequestType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/EncryptXMLResponseType.java24
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/EncryptedDataType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/EncryptionInfoType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/ErrorResponseType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/GetPropertiesRequest.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/GetPropertiesRequestType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/GetPropertiesResponseType.java22
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/GetStatusRequestType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/GetStatusResponseType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/HashDataType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/InfoboxAssocArrayPairType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/InfoboxAvailableRequestType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/InfoboxAvailableResponseType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/InfoboxCreateRequestType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/InfoboxCreateResponseType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/InfoboxDeleteRequestType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/InfoboxDeleteResponseType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/InfoboxReadDataAssocArrayType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/InfoboxReadParamsAssocArrayType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/InfoboxReadParamsBinaryFileType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/InfoboxReadRequestType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/InfoboxReadResponseType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/InfoboxTypeType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/InfoboxUpdateParamsAssocArrayType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/InfoboxUpdateRequestType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/InfoboxUpdateResponseType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/ManifestRefsCheckResultInfoType.java28
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/ManifestRefsCheckResultType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/MetaInfoType.java22
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/NullOperationRequestType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/NullOperationResponseType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/ObjectFactory.java6
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/QualifiedBoxIdentifierType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/ReferencesCheckResultInfoType.java24
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/ReferencesCheckResultType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/RequesterIDType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/ReturnResultType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/SignatureInfoCreationType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/SignatureInfoVerificationType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/SignatureLocationType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/ToBeEncryptedType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/TokenStatusType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/TransformsInfoType.java41
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/UserConfirmationSimpleType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/UserConfirmationType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/VerificationResultType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/VerifyCMSSignatureRequestType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/VerifyCMSSignatureResponseType.java24
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/VerifyHashInfoRequestType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/VerifyHashRequestType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/VerifyHashResponseType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/VerifyXMLSignatureRequestType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/VerifyXMLSignatureResponseType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/XMLContentType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/XMLRecipientPublicKeyType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/XMLToBeEncryptedNewContentType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/XMLToBeEncryptedNewType.java20
-rw-r--r--utils/src/main/java/at/buergerkarte/namespaces/securitylayer/_1/package-info.java20
-rw-r--r--utils/src/main/java/at/gv/e_government/reference/namespace/persondata/_20020228_/AbstractAddressType.java21
-rw-r--r--utils/src/main/java/at/gv/e_government/reference/namespace/persondata/_20020228_/AbstractPersonType.java21
-rw-r--r--utils/src/main/java/at/gv/e_government/reference/namespace/persondata/_20020228_/CorporateBodyType.java23
-rw-r--r--utils/src/main/java/at/gv/e_government/reference/namespace/persondata/_20020228_/DefinedAlternativeNameTypeType.java20
-rw-r--r--utils/src/main/java/at/gv/e_government/reference/namespace/persondata/_20020228_/DefinedRelationType.java20
-rw-r--r--utils/src/main/java/at/gv/e_government/reference/namespace/persondata/_20020228_/IdentificationType.java23
-rw-r--r--utils/src/main/java/at/gv/e_government/reference/namespace/persondata/_20020228_/InternetAddressType.java36
-rw-r--r--utils/src/main/java/at/gv/e_government/reference/namespace/persondata/_20020228_/MaritalStatusType.java20
-rw-r--r--utils/src/main/java/at/gv/e_government/reference/namespace/persondata/_20020228_/MobileTelcomNumberType.java20
-rw-r--r--utils/src/main/java/at/gv/e_government/reference/namespace/persondata/_20020228_/ObjectFactory.java290
-rw-r--r--utils/src/main/java/at/gv/e_government/reference/namespace/persondata/_20020228_/PersonDataType.java38
-rw-r--r--utils/src/main/java/at/gv/e_government/reference/namespace/persondata/_20020228_/PersonNameType.java20
-rw-r--r--utils/src/main/java/at/gv/e_government/reference/namespace/persondata/_20020228_/PhysicalPersonType.java23
-rw-r--r--utils/src/main/java/at/gv/e_government/reference/namespace/persondata/_20020228_/PostalAddressType.java20
-rw-r--r--utils/src/main/java/at/gv/e_government/reference/namespace/persondata/_20020228_/SexType.java20
-rw-r--r--utils/src/main/java/at/gv/e_government/reference/namespace/persondata/_20020228_/TelcomNumberListType.java20
-rw-r--r--utils/src/main/java/at/gv/e_government/reference/namespace/persondata/_20020228_/TelcomNumberType.java20
-rw-r--r--utils/src/main/java/at/gv/e_government/reference/namespace/persondata/_20020228_/TelephoneAddressType.java23
-rw-r--r--utils/src/main/java/at/gv/e_government/reference/namespace/persondata/_20020228_/TypedPostalAddressType.java23
-rw-r--r--utils/src/main/java/at/gv/e_government/reference/namespace/persondata/_20020228_/package-info.java20
-rw-r--r--utils/src/main/java/at/gv/egiz/bku/utils/ClasspathURLStreamHandler.java34
-rw-r--r--utils/src/main/java/at/gv/egiz/bku/utils/DebugInputStream.java59
-rw-r--r--utils/src/main/java/at/gv/egiz/bku/utils/binding/Protocol.java5
-rw-r--r--utils/src/main/java/at/gv/egiz/bku/utils/urldereferencer/HTTPURLProtocolHandlerImpl.java70
-rw-r--r--utils/src/main/java/at/gv/egiz/bku/utils/urldereferencer/SimpleFormDataContextImpl.java41
-rw-r--r--utils/src/main/java/at/gv/egiz/bku/utils/urldereferencer/URIResolverAdapter.java150
-rw-r--r--utils/src/main/java/at/gv/egiz/bku/utils/urldereferencer/URLDereferencer.java96
-rw-r--r--utils/src/main/java/at/gv/egiz/bku/utils/urldereferencer/URLDereferencerImpl.java108
-rw-r--r--utils/src/main/java/at/gv/egiz/bku/utils/urldereferencer/URLProtocolHandler.java6
-rw-r--r--utils/src/main/java/at/gv/egiz/idlink/CompressedIdentityLinkFactory.java1
-rw-r--r--utils/src/main/java/at/gv/egiz/idlink/IdentityLinkFactory.java11
-rw-r--r--utils/src/main/java/at/gv/egiz/idlink/IdentityLinkTransformer.java188
-rw-r--r--utils/src/main/java/at/gv/egiz/marshal/MarshallerFactory.java15
-rw-r--r--utils/src/main/java/at/gv/egiz/marshal/NamespacePrefixMapperImpl.java10
-rw-r--r--utils/src/main/java/at/gv/egiz/org/apache/tomcat/util/http/AcceptLanguage.java1
-rw-r--r--utils/src/main/java/at/gv/egiz/slbinding/RedirectEventFilter.java3
-rw-r--r--utils/src/main/java/at/gv/egiz/slbinding/RedirectUnmarshallerListener.java6
-rw-r--r--utils/src/main/java/at/gv/egiz/slbinding/SLUnmarshaller.java263
-rw-r--r--utils/src/main/java/at/gv/egiz/slbinding/impl/CreateXMLSignatureResponseType.java90
-rw-r--r--utils/src/main/java/at/gv/egiz/slbinding/impl/SignatureLocationType.java8
-rw-r--r--utils/src/main/java/at/gv/egiz/slbinding/impl/TransformsInfoType.java17
-rw-r--r--utils/src/main/java/at/gv/egiz/slbinding/impl/XMLContentType.java16
-rw-r--r--utils/src/main/java/at/gv/egiz/validation/ReportingValidationEventHandler.java6
-rw-r--r--utils/src/main/java/at/gv/egiz/xades/QualifyingPropertiesException.java9
-rw-r--r--utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/ActionType.java4
-rw-r--r--utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AdviceType.java10
-rw-r--r--utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AnyType.java12
-rw-r--r--utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AssertionType.java25
-rw-r--r--utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AttributeDesignatorType.java4
-rw-r--r--utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AttributeStatementType.java4
-rw-r--r--utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AttributeType.java4
-rw-r--r--utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AudienceRestrictionConditionType.java4
-rw-r--r--utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AuthenticationStatementType.java4
-rw-r--r--utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AuthorityBindingType.java4
-rw-r--r--utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AuthorizationDecisionStatementType.java4
-rw-r--r--utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/ConditionAbstractType.java4
-rw-r--r--utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/ConditionsType.java4
-rw-r--r--utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/DecisionType.java4
-rw-r--r--utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/EvidenceType.java4
-rw-r--r--utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/NameIdentifierType.java4
-rw-r--r--utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/ObjectFactory.java96
-rw-r--r--utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/StatementAbstractType.java4
-rw-r--r--utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/SubjectConfirmationType.java19
-rw-r--r--utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/SubjectLocalityType.java4
-rw-r--r--utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/SubjectStatementAbstractType.java4
-rw-r--r--utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/SubjectType.java14
-rw-r--r--utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/package-info.java4
-rw-r--r--utils/src/main/java/org/w3/_2000/_09/xmldsig_/CanonicalizationMethodType.java22
-rw-r--r--utils/src/main/java/org/w3/_2000/_09/xmldsig_/DSAKeyValueType.java20
-rw-r--r--utils/src/main/java/org/w3/_2000/_09/xmldsig_/DigestMethodType.java24
-rw-r--r--utils/src/main/java/org/w3/_2000/_09/xmldsig_/KeyInfoType.java42
-rw-r--r--utils/src/main/java/org/w3/_2000/_09/xmldsig_/KeyValueType.java26
-rw-r--r--utils/src/main/java/org/w3/_2000/_09/xmldsig_/ManifestType.java20
-rw-r--r--utils/src/main/java/org/w3/_2000/_09/xmldsig_/ObjectFactory.java233
-rw-r--r--utils/src/main/java/org/w3/_2000/_09/xmldsig_/ObjectType.java24
-rw-r--r--utils/src/main/java/org/w3/_2000/_09/xmldsig_/PGPDataType.java34
-rw-r--r--utils/src/main/java/org/w3/_2000/_09/xmldsig_/RSAKeyValueType.java20
-rw-r--r--utils/src/main/java/org/w3/_2000/_09/xmldsig_/ReferenceType.java20
-rw-r--r--utils/src/main/java/org/w3/_2000/_09/xmldsig_/RetrievalMethodType.java20
-rw-r--r--utils/src/main/java/org/w3/_2000/_09/xmldsig_/SPKIDataType.java26
-rw-r--r--utils/src/main/java/org/w3/_2000/_09/xmldsig_/SignatureMethodType.java24
-rw-r--r--utils/src/main/java/org/w3/_2000/_09/xmldsig_/SignaturePropertiesType.java20
-rw-r--r--utils/src/main/java/org/w3/_2000/_09/xmldsig_/SignaturePropertyType.java24
-rw-r--r--utils/src/main/java/org/w3/_2000/_09/xmldsig_/SignatureType.java34
-rw-r--r--utils/src/main/java/org/w3/_2000/_09/xmldsig_/SignatureValueType.java20
-rw-r--r--utils/src/main/java/org/w3/_2000/_09/xmldsig_/SignedInfoType.java20
-rw-r--r--utils/src/main/java/org/w3/_2000/_09/xmldsig_/TransformType.java26
-rw-r--r--utils/src/main/java/org/w3/_2000/_09/xmldsig_/TransformsType.java22
-rw-r--r--utils/src/main/java/org/w3/_2000/_09/xmldsig_/X509DataType.java34
-rw-r--r--utils/src/main/java/org/w3/_2000/_09/xmldsig_/X509IssuerSerialType.java20
-rw-r--r--utils/src/main/java/org/w3/_2000/_09/xmldsig_/package-info.java20
-rw-r--r--utils/src/main/resources/at/gv/egiz/bku/slschema/Core-1.2.xsd (renamed from bkucommon/src/main/resources/at/gv/egiz/bku/slcommands/schema/Core-1.2.xsd)2
-rw-r--r--utils/src/main/resources/at/gv/egiz/bku/slschema/Core.20020225.xsd (renamed from bkucommon/src/main/resources/at/gv/egiz/bku/slcommands/schema/Core.20020225.xsd)0
-rw-r--r--utils/src/main/resources/at/gv/egiz/bku/slschema/Core.20020831.xsd (renamed from bkucommon/src/main/resources/at/gv/egiz/bku/slcommands/schema/Core.20020831.xsd)0
-rw-r--r--utils/src/main/resources/at/gv/egiz/bku/slschema/xml.xsd (renamed from bkucommon/src/main/resources/at/gv/egiz/bku/slcommands/schema/xml.xsd)0
-rw-r--r--utils/src/main/resources/at/gv/egiz/bku/slschema/xmldsig-core-schema.xsd308
-rw-r--r--utils/src/main/resources/at/gv/egiz/slbinding/impl/jaxb.index3
-rw-r--r--utils/src/test/java/at/gv/egiz/idlink/IdentityLink.java5
-rw-r--r--utils/src/test/java/at/gv/egiz/slbinding/RedirectTest.java55
-rw-r--r--utils/src/test/java/at/gv/egiz/slbinding/UnmarshallCXSRTest.java53
-rw-r--r--utils/src/test/java/cardchannel/UnmarshalTest.java8
-rw-r--r--utils/src/test/java/saml/KeyValueAttributeTypeTest.java9
-rw-r--r--utils/src/test/resources/at/gv/egiz/slbinding/CreateXMLSignatureResponse.xml19
-rw-r--r--utils/src/test/resources/commons-logging.properties1
-rw-r--r--utils/src/test/resources/log4j.properties2
691 files changed, 22547 insertions, 16077 deletions
diff --git a/BKUApplet/keystore.ks b/BKUApplet/keystore.ks
index 824c3a40..ba0b4652 100644
--- a/BKUApplet/keystore.ks
+++ b/BKUApplet/keystore.ks
Binary files differ
diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml
index de0d95ff..1c27294e 100644
--- a/BKUApplet/pom.xml
+++ b/BKUApplet/pom.xml
@@ -1,14 +1,14 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
- <artifactId>bku</artifactId>
+ <artifactId>mocca</artifactId>
<groupId>at.gv.egiz</groupId>
- <version>1.2.14-SNAPSHOT</version>
+ <version>1.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>at.gv.egiz</groupId>
<artifactId>BKUApplet</artifactId>
<name>BKU Applet</name>
- <version>1.2.14-SNAPSHOT</version>
+ <version>${project.parent.version}</version>
<build>
<plugins>
<plugin>
@@ -20,28 +20,13 @@
<goal>unpack-dependencies</goal>
</goals>
<configuration>
- <includeGroupIds>at.gv.egiz</includeGroupIds>
+ <includeScope>runtime</includeScope>
<!-- don't include transitive dependency BKUFonts [runtime] from BKUCommonGUI -->
- <excludeTransitive>true</excludeTransitive>
+ <excludeTransitive>false</excludeTransitive>
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
<excludes>META-INF\/</excludes>
</configuration>
</execution>
- <execution>
- <!-- appletviewer target/test-classes/appletTest.html
- | commons-logging and iaik_jce_me4se are transitive dependencies
- |-->
- <id>copy_testapplet</id>
- <goals>
- <goal>copy-dependencies</goal>
- </goals>
- <configuration>
- <outputDirectory>${project.build.directory}/test-classes</outputDirectory>
- <includeGroupIds>at.gv.egiz,commons-logging,iaik</includeGroupIds>
- <includeArtifactIds>commons-logging,iaik_jce_me4se</includeArtifactIds>
- <stripVersion>true</stripVersion>
- </configuration>
- </execution>
</executions>
</plugin>
<plugin>
@@ -118,27 +103,43 @@
<dependency>
<groupId>at.gv.egiz</groupId>
<artifactId>smcc</artifactId>
- <version>1.2.14-SNAPSHOT</version>
+ <version>${project.parent.version}</version>
+ <optional>true</optional>
</dependency>
<dependency>
<groupId>at.gv.egiz</groupId>
<artifactId>STAL</artifactId>
- <version>1.2.14-SNAPSHOT</version>
+ <version>${project.parent.version}</version>
+ <optional>true</optional>
</dependency>
<dependency>
<groupId>at.gv.egiz</groupId>
<artifactId>STALService</artifactId>
- <version>1.2.14-SNAPSHOT</version>
+ <version>${project.parent.version}</version>
+ <optional>true</optional>
</dependency>
<dependency>
<groupId>at.gv.egiz</groupId>
<artifactId>smccSTAL</artifactId>
- <version>1.2.14-SNAPSHOT</version>
+ <version>${project.parent.version}</version>
+ <optional>true</optional>
</dependency>
<dependency>
<groupId>at.gv.egiz</groupId>
<artifactId>BKUCommonGUI</artifactId>
- <version>1.2.14-SNAPSHOT</version>
- </dependency>
+ <version>${project.parent.version}</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-jdk14</artifactId>
+ <scope>runtime</scope>
+ <optional>true</optional>
+ </dependency>
</dependencies>
</project> \ No newline at end of file
diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java
index d5f8dd69..6fa9d45f 100644
--- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java
+++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java
@@ -37,12 +37,17 @@ import java.util.List;
import javax.xml.bind.JAXBElement;
import javax.xml.ws.WebServiceException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
/**
*
* @author Clemens Orthacker <clemens.orthacker@iaik.tugraz.at>
*/
public class AppletBKUWorker extends AbstractBKUWorker implements Runnable {
+ private final Logger log = LoggerFactory.getLogger(AbstractBKUWorker.class);
+
protected BKUApplet applet;
protected String sessionId;
@@ -55,7 +60,7 @@ public class AppletBKUWorker extends AbstractBKUWorker implements Runnable {
sessionId = applet.getParameter(BKUApplet.SESSION_ID);
if (sessionId == null) {
sessionId = "TestSession";
- log.warn("using dummy sessionId " + sessionId);
+ log.warn("Using dummy sessionId {}.", sessionId);
}
}
@@ -85,7 +90,8 @@ public class AppletBKUWorker extends AbstractBKUWorker implements Runnable {
// (rather use validator)
if (requests.size() == 0) {
- log.error("Received empty NextRequestResponse: no STAL requests to handle. (STAL-X requests might not have gotten unmarshalled)");
+ log.error("Received empty NextRequestResponse: no STAL requests to handle. " +
+ "(STAL-X requests might not have gotten unmarshalled)");
throw new RuntimeException("No STAL requests to handle.");
}
@@ -105,7 +111,7 @@ public class AppletBKUWorker extends AbstractBKUWorker implements Runnable {
try {
stalRequests.add(stalTranslator.translate(req));
} catch (TranslationException ex) {
- log.error("Received unknown request from server STAL: " + ex.getMessage());
+ log.error("Received unknown request from server STAL. {}", ex.getMessage());
throw new RuntimeException(ex);
}
}
@@ -117,7 +123,7 @@ public class AppletBKUWorker extends AbstractBKUWorker implements Runnable {
try {
responses.add(stalTranslator.translate(stalResponse));
} catch (TranslationException ex) {
- log.error("Received unknown response from STAL: " + ex.getMessage());
+ log.error("Received unknown response from STAL.{}", ex.getMessage());
throw new RuntimeException(ex);
}
}
@@ -131,7 +137,7 @@ public class AppletBKUWorker extends AbstractBKUWorker implements Runnable {
} else {
Throwable cause = ex.getCause();
if (cause != null && cause instanceof InterruptedException) {
- log.info("do not return error response, client might want to resume session");
+ log.info("Do not return error response, client might want to resume session.");
finished = true;
}
err.setErrorCode(4000);
@@ -160,13 +166,13 @@ public class AppletBKUWorker extends AbstractBKUWorker implements Runnable {
} while (!finished);
- log.info("Finished " + Thread.currentThread().getName());
+ log.info("Finished {}.", Thread.currentThread().getName());
} catch (WebServiceException ex) {
- log.fatal("communication error with server STAL: " + ex.getMessage(), ex);
+ log.error("Communication error with server STAL: {}.", ex.getMessage(), ex);
showErrorDialog(BKUGUIFacade.ERR_SERVICE_UNREACHABLE, ex);
} catch (MalformedURLException ex) {
- log.fatal(ex.getMessage(), ex);
+ log.error(ex.getMessage(), ex);
showErrorDialog(BKUGUIFacade.ERR_CONFIG, ex);
} catch (Exception ex) {
log.error(ex.getMessage(), ex);
@@ -213,7 +219,7 @@ public class AppletBKUWorker extends AbstractBKUWorker implements Runnable {
try {
waitForAction();
} catch (InterruptedException e) {
- log.error(e);
+ log.error("Interrupted.", e);
}
}
diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletSecureViewer.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletSecureViewer.java
index c67699af..e9f36c2f 100644
--- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletSecureViewer.java
+++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletSecureViewer.java
@@ -33,8 +33,8 @@ import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
*
@@ -42,7 +42,7 @@ import org.apache.commons.logging.LogFactory;
*/
public class AppletSecureViewer implements SecureViewer {
- private static final Log log = LogFactory.getLog(AppletSecureViewer.class);
+ private static final Logger log = LoggerFactory.getLogger(AppletSecureViewer.class);
protected BKUGUIFacade gui;
protected STALPortType stalPort;
@@ -81,8 +81,7 @@ public class AppletSecureViewer implements SecureViewer {
throws DigestException, Exception {
if (verifiedDataToBeSigned == null) {
- log.info("retrieve data to be signed for dsig:SignedInfo " +
- signedInfo.getId());
+ log.info("Retrieve data to be signed for dsig:SignedInfo {}.", signedInfo.getId());
List<GetHashDataInputResponseType.Reference> hdi =
getHashDataInput(signedInfo.getReference());
verifiedDataToBeSigned = verifyHashDataInput(signedInfo.getReference(),
@@ -106,16 +105,12 @@ public class AppletSecureViewer implements SecureViewer {
GetHashDataInputType request = new GetHashDataInputType();
request.setSessionId(sessId);
-// HashMap<String, ReferenceType> idSignedRefMap = new HashMap<String, ReferenceType>();
for (ReferenceType signedRef : signedReferences) {
//don't get Manifest, QualifyingProperties, ...
if (signedRef.getType() == null) {
String signedRefId = signedRef.getId();
if (signedRefId != null) {
- if (log.isTraceEnabled()) {
- log.trace("requesting hashdata input for reference " + signedRefId);
- }
-// idSignedRefMap.put(signedRefId, signedRef);
+ log.trace("Requesting hashdata input for reference {}.", signedRefId);
GetHashDataInputType.Reference ref = new GetHashDataInputType.Reference();
ref.setID(signedRefId);
request.getReference().add(ref);
@@ -127,12 +122,14 @@ public class AppletSecureViewer implements SecureViewer {
}
if (request.getReference().size() < 1) {
- log.error("No signature data (apart from any QualifyingProperties or a Manifest) for session " + sessId);
+ log.error("No signature data (apart from any QualifyingProperties or a Manifest) for session {}.", sessId);
throw new Exception("No signature data (apart from any QualifyingProperties or a Manifest)");
}
if (log.isDebugEnabled()) {
- log.debug("WebService call GetHashDataInput for " + request.getReference().size() + " references in session " + sessId);
+ log.debug(
+ "WebService call GetHashDataInput for {} references in session {}.",
+ request.getReference().size(), sessId);
}
GetHashDataInputResponseType response = stalPort.getHashDataInput(request);
return response.getReference();
@@ -154,7 +151,7 @@ public class AppletSecureViewer implements SecureViewer {
for (ReferenceType signedRef : signedReferences) {
if (signedRef.getType() == null) {
- log.info("Verifying digest for signed reference " + signedRef.getId());
+ log.info("Verifying digest for signed reference {}.", signedRef.getId());
String signedRefId = signedRef.getId();
byte[] signedDigest = signedRef.getDigestValue();
@@ -191,12 +188,9 @@ public class AppletSecureViewer implements SecureViewer {
byte[] hashDataInputDigest = digest(hdi, signedDigestAlg);
- if (log.isDebugEnabled()) {
- log.debug("Comparing digest to claimed digest value for reference " + signedRefId);
- }
-// log.warn("***************** DISABLED HASHDATA VERIFICATION");
+ log.debug("Comparing digest to claimed digest value for reference {}.", signedRefId);
if (!Arrays.equals(hashDataInputDigest, signedDigest)) {
- log.error("Bad digest value for reference " + signedRefId);
+ log.error("Bad digest value for reference {}.", signedRefId);
throw new DigestException("Bad digest value for reference " + signedRefId);
}
@@ -207,7 +201,6 @@ public class AppletSecureViewer implements SecureViewer {
return verifiedHashDataInputs;
}
- //TODO
private byte[] digest(byte[] hashDataInput, String mdAlg) throws NoSuchAlgorithmException {
if ("http://www.w3.org/2000/09/xmldsig#sha1".equals(mdAlg)) {
mdAlg = "SHA-1";
diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java
index 2fa4889a..7873b263 100644
--- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java
+++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java
@@ -18,8 +18,6 @@ package at.gv.egiz.bku.online.applet;
import at.gv.egiz.bku.online.applet.viewer.URLFontLoader;
import at.gv.egiz.bku.gui.BKUGUIFacade.Style;
-import at.gv.egiz.bku.gui.DefaultHelpListener;
-import at.gv.egiz.bku.gui.AbstractHelpListener;
import at.gv.egiz.bku.gui.SwitchFocusListener;
import at.gv.egiz.smcc.SignatureCardFactory;
import at.gv.egiz.stal.service.translator.STALTranslator;
@@ -35,11 +33,13 @@ import javax.net.ssl.HttpsURLConnection;
import javax.swing.JApplet;
import javax.swing.JPanel;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import at.gv.egiz.bku.gui.BKUGUIFacade;
import at.gv.egiz.bku.gui.BKUGUIImpl;
+import at.gv.egiz.bku.gui.DeafHelpListener;
+import at.gv.egiz.bku.gui.HelpListener;
import at.gv.egiz.bku.gui.viewer.FontProvider;
import at.gv.egiz.stal.service.STALPortType;
import at.gv.egiz.stal.service.STALService;
@@ -56,7 +56,9 @@ import javax.xml.namespace.QName;
public class BKUApplet extends JApplet {
private static final long serialVersionUID = 1L;
- private static Log log = LogFactory.getLog(BKUApplet.class);
+
+ private final Logger log = LoggerFactory.getLogger(BKUApplet.class);
+
/**
* Applet parameter keys
*/
@@ -71,8 +73,9 @@ public class BKUApplet extends JApplet {
public static final String BACKGROUND_COLOR = "BackgroundColor";
public static final String REDIRECT_URL = "RedirectURL";
public static final String REDIRECT_TARGET = "RedirectTarget";
- public static final String HASHDATA_DISPLAY_FRAME = "frame";
public static final String ENFORCE_RECOMMENDED_PIN_LENGTH = "EnforceRecommendedPINLength";
+
+
/**
* STAL WSDL namespace and service name
*/
@@ -88,22 +91,21 @@ public class BKUApplet extends JApplet {
static {
String tmp = UNKNOWN_VERSION;
+ Logger log = LoggerFactory.getLogger(BKUApplet.class);
try {
String BKUAppletJar = BKUApplet.class.getProtectionDomain().getCodeSource().getLocation().toString();
URL manifestURL = new URL("jar:" + BKUAppletJar + "!/META-INF/MANIFEST.MF");
- if (log.isTraceEnabled()) {
- log.trace("read version information from " + manifestURL);
- }
+ log.trace("Read version information from {}.", manifestURL);
Manifest manifest = new Manifest(manifestURL.openStream());
Attributes atts = manifest.getMainAttributes();
if (atts != null) {
tmp = atts.getValue("Implementation-Build");
}
} catch (IOException ex) {
- log.error("failed to read version", ex);
+ log.error("Failed to read version.", ex);
} finally {
VERSION = tmp;
- log.debug("BKU Applet " + VERSION);
+ log.debug("BKU Applet {}.", VERSION);
}
}
@@ -112,6 +114,7 @@ public class BKUApplet extends JApplet {
*/
protected AppletBKUWorker worker;
protected Thread workerThread;
+ protected HelpListener helpListener;
/*
* (non-Javadoc)
@@ -139,16 +142,15 @@ public class BKUApplet extends JApplet {
"URL for locating help files, e.g. '../help/' (no help provided if missing)"}};
}
-
/**
* Factory method to create and wire HelpListener, GUI and BKUWorker.
* (Config via applet parameters, see BKUApplet.* constants)
*/
@Override
public void init() {
- log.info("Welcome to MOCCA " + VERSION);
- log.trace("Called init()");
- showStatus("Initializing MOCCA applet");
+ log.info("Welcome to MOCCA {}.", VERSION);
+ log.trace("Called init().");
+ showStatus("Initializing MOCCA applet.");
HttpsURLConnection.setDefaultSSLSocketFactory(InternalSSLSocketFactory.getInstance());
@@ -156,12 +158,12 @@ public class BKUApplet extends JApplet {
if (locale != null) {
this.setLocale(new Locale(locale));
}
- log.trace("default locale: " + Locale.getDefault());
- log.debug("setting locale: " + getLocale());
+ log.trace("Default locale: {}.", Locale.getDefault());
+ log.debug("Applet locale set to: {}.", getLocale());
if (Boolean.parseBoolean(getParameter(ENFORCE_RECOMMENDED_PIN_LENGTH))) {
SignatureCardFactory.ENFORCE_RECOMMENDED_PIN_LENGTH = true;
- log.debug("enforce recommended pin length = " + SignatureCardFactory.ENFORCE_RECOMMENDED_PIN_LENGTH);
+ log.debug("Enforce recommended pin length = {}.", SignatureCardFactory.ENFORCE_RECOMMENDED_PIN_LENGTH);
}
BKUGUIFacade.Style guiStyle;
@@ -173,27 +175,30 @@ public class BKUApplet extends JApplet {
} else {
guiStyle = BKUGUIFacade.Style.simple;
}
- log.debug("setting gui-style: " + guiStyle);
+ log.debug("Setting gui-style: {}.", guiStyle);
URL backgroundImgURL = null;
try {
backgroundImgURL = getURLParameter(BACKGROUND_IMG, null);
- log.debug("setting background: " + backgroundImgURL);
+ log.debug("Setting background: {}.", backgroundImgURL);
} catch (MalformedURLException ex) {
- log.warn("cannot load applet background image: " + ex.getMessage());
+ log.warn("Cannot load applet background image. {}", ex.getMessage());
}
- AbstractHelpListener helpListener = null;
- try {
- helpListener = new DefaultHelpListener(getAppletContext(),
- getURLParameter(HELP_URL, null), getLocale());
- if (log.isDebugEnabled()) {
- log.debug("setting helpURL: " + getURLParameter(HELP_URL, null));
- }
- } catch (MalformedURLException ex) {
- log.warn("failed to load help URL: " + ex.getMessage() + ", disabling help");
- }
+ helpListener = new DeafHelpListener(getParameter(HELP_URL), getLocale());
+ SwitchFocusListener switchFocusListener = new SwitchFocusListener(
+ getAppletContext(), "focusToBrowser");
+
+
+//ViewerHelpListener example:
+// try {
+// String absoluteHelpURL = new URL(getCodeBase(), getParameter(HELP_URL)).toString();
+// helpListener = new ViewerHelpListener(getAppletContext(), absoluteHelpURL, getLocale());
+// } catch (MalformedURLException ex) {
+// log.error("invalid help URL, help disabled", ex);
+// }
+
// Note: We need a panel in order to be able to set the background
// properly.
// Setting the background without a panel has side effects with the
@@ -205,10 +210,10 @@ public class BKUApplet extends JApplet {
if (backgroundColor != null && backgroundColor.startsWith("#")) {
try {
Color color = new Color(Integer.parseInt(backgroundColor.substring(1), 16));
- log.debug("setting background color to " + color);
+ log.debug("Setting background color to {}.", color);
contentPanel.setBackground(color);
} catch (NumberFormatException e) {
- log.debug("failed to set background color '" + backgroundColor + "'");
+ log.debug("Failed to set background color '{}'.", backgroundColor);
}
}
@@ -216,30 +221,30 @@ public class BKUApplet extends JApplet {
URLFontLoader fontProvider = new URLFontLoader(getCodeBase());
fontProvider.loadInBackground();
BKUGUIFacade gui = createGUI(contentPanel, getLocale(), guiStyle,
- backgroundImgURL, fontProvider, helpListener, null);
+ backgroundImgURL, fontProvider, helpListener, switchFocusListener);
worker = createBKUWorker(this, gui);
} catch (MalformedURLException ex) {
- log.fatal("failed to load font provider URL", ex);
+ log.error("Failed to load font provider URL.", ex);
System.err.println("invalid font provider URL " + ex.getMessage());
}
}
@Override
public void start() {
- log.trace("Called start()");
+ log.trace("Called start().");
if (worker != null) {
showStatus("Starting MOCCA applet");
workerThread = new Thread(worker);
workerThread.start();
} else {
- log.debug("cannot start uninitialzed MOCCA applet");
+ log.debug("Cannot start uninitialzed MOCCA applet.");
}
}
@Override
public void stop() {
- log.trace("Called stop()");
+ log.trace("Called stop().");
showStatus("Stopping MOCCA applet");
if ((workerThread != null) && (workerThread.isAlive())) {
workerThread.interrupt();
@@ -248,7 +253,11 @@ public class BKUApplet extends JApplet {
@Override
public void destroy() {
- log.trace("Called destroy()");
+ log.trace("Called destroy().");
+ }
+
+ public String getHelpURL() {
+ return helpListener.getHelpURL();
}
// ///////////////////////////////////////////////////////////////////////////
@@ -256,7 +265,7 @@ public class BKUApplet extends JApplet {
// ///////////////////////////////////////////////////////////////////////////
protected BKUGUIFacade createGUI(Container contentPane, Locale locale,
Style guiStyle, URL backgroundImgURL,
- FontProvider fontProvider, AbstractHelpListener helpListener,
+ FontProvider fontProvider, HelpListener helpListener,
SwitchFocusListener switchFocusListener) {
return new BKUGUIImpl(contentPane, locale, guiStyle, backgroundImgURL,
fontProvider, helpListener, switchFocusListener);
@@ -277,7 +286,7 @@ public class BKUApplet extends JApplet {
*/
public STALPortType getSTALPort() throws MalformedURLException {
URL wsdlURL = getURLParameter(WSDL_URL, null);
- log.debug("setting STAL WSDL: " + wsdlURL);
+ log.debug("Setting STAL WSDL: {}.", wsdlURL);
QName endpointName = new QName(STAL_WSDL_NS, STAL_SERVICE);
STALService stal = new STALService(wsdlURL, endpointName);
return stal.getSTALPort();
@@ -304,25 +313,26 @@ public class BKUApplet extends JApplet {
try {
AppletContext ctx = getAppletContext();
if (ctx == null) {
- log.error("no applet context (applet might already have been destroyed)");
+ log.error("No applet context (applet might already have been destroyed).");
return;
}
URL redirectURL = getURLParameter(REDIRECT_URL, sessionId);
String redirectTarget = getParameter(REDIRECT_TARGET);
if (redirectTarget == null) {
- log.info("Done. Redirecting to " + redirectURL + " ...");
+ log.info("Done. Redirecting to {}.", redirectURL);
ctx.showDocument(redirectURL);
} else {
- log.info("Done. Redirecting to " + redirectURL + " (target=" + redirectTarget + ") ...");
+ log.info("Done. Redirecting to {} (target={}).", redirectURL, redirectTarget);
ctx.showDocument(redirectURL, redirectTarget);
}
} catch (MalformedURLException ex) {
- log.warn("Failed to redirect: " + ex.getMessage(), ex);
- // gui.showErrorDialog(errorMsg, okListener, actionCommand)
+ log.warn("Failed to redirect.", ex);
}
}
public void getFocusFromBrowser() {
+
+ log.debug("Obtained focus from browser.");
worker.getFocusFromBrowser();
}
@@ -348,11 +358,11 @@ public class BKUApplet extends JApplet {
}
return url;
} catch (MalformedURLException ex) {
- log.error("applet paremeter " + urlParam + " is not a valid URL: " + ex.getMessage());
+ log.error("Applet paremeter {} ist not a valid URL. {}", urlParam, ex.getMessage());
throw ex;
}
} else {
- log.error("applet paremeter " + paramKey + " not set");
+ log.error("Applet paremeter {} not set.", paramKey);
throw new MalformedURLException(paramKey + " not set");
}
}
diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/InternalSSLSocketFactory.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/InternalSSLSocketFactory.java
index a02e56eb..c9bf81ca 100644
--- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/InternalSSLSocketFactory.java
+++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/InternalSSLSocketFactory.java
@@ -31,8 +31,8 @@ import javax.net.ssl.SSLPeerUnverifiedException;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class InternalSSLSocketFactory extends SSLSocketFactory {
@@ -40,8 +40,7 @@ public class InternalSSLSocketFactory extends SSLSocketFactory {
private static InternalSSLSocketFactory instance = new InternalSSLSocketFactory();
- private final static Log log = LogFactory
- .getLog(InternalSSLSocketFactory.class);
+ private final Logger log = LoggerFactory.getLogger(InternalSSLSocketFactory.class);
private SSLSocket sslSocket;
@@ -107,19 +106,19 @@ public class InternalSSLSocketFactory extends SSLSocketFactory {
}
public boolean isEgovAgency() {
- log.info("Checking if server is egov agency");
+ log.info("Checking if server is egov agency.");
if (sslSocket != null) {
try {
X509Certificate cert = (X509Certificate) sslSocket.getSession()
.getPeerCertificates()[0];
- log.info("Server cert: " + cert);
+ log.info("Server cert: {}.", cert);
return isGovAgency(cert);
} catch (SSLPeerUnverifiedException e) {
- log.error(e);
+ log.error("Failed to check server cert.", e);
return false;
}
}
- log.info("Not a SSL connection");
+ log.info("Not a SSL connection.");
return false;
}
@@ -146,7 +145,8 @@ public class InternalSSLSocketFactory extends SSLSocketFactory {
}
}
} catch (CertificateParsingException e) {
- log.error(e);
+ Logger log = LoggerFactory.getLogger(InternalSSLSocketFactory.class);
+ log.error("Failed to parse certificate.", e);
}
if ((cert.getExtensionValue("1.2.40.0.10.1.1.1") != null)
|| (cert.getExtensionValue("1.2.40.0.10.1.1.2") != null)) {
diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/viewer/URLFontLoader.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/viewer/URLFontLoader.java
index 49615887..d30080d0 100644
--- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/viewer/URLFontLoader.java
+++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/viewer/URLFontLoader.java
@@ -16,17 +16,20 @@
*/
package at.gv.egiz.bku.online.applet.viewer;
-import at.gv.egiz.bku.gui.viewer.FontProviderException;
-import at.gv.egiz.bku.gui.viewer.FontProvider;
import java.awt.Font;
import java.awt.FontFormatException;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.concurrent.ExecutionException;
+
import javax.swing.SwingWorker;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import at.gv.egiz.bku.gui.viewer.FontProvider;
+import at.gv.egiz.bku.gui.viewer.FontProviderException;
/**
*
@@ -34,29 +37,24 @@ import org.apache.commons.logging.LogFactory;
*/
public class URLFontLoader extends SwingWorker<Font, Object> implements FontProvider {
- protected static final Log log = LogFactory.getLog(URLFontLoader.class);
+ private final Logger log = LoggerFactory.getLogger(URLFontLoader.class);
+
protected URL fontURL;
protected Font font;
public URLFontLoader(URL codebase) throws MalformedURLException {
this.fontURL = new URL(codebase, SANSMONO_FONT_RESOURCE);
- if (log.isDebugEnabled()) {
- log.debug("[" + Thread.currentThread().getName() + "] setting font load URL: " + fontURL);
- }
+ log.debug("[{}] setting font load URL: {}.", Thread.currentThread().getName(), fontURL);
}
public void loadInBackground() {
- if (log.isDebugEnabled()) {
- log.debug("[" + Thread.currentThread().getName() + "] scheduling font loading in background: " + fontURL);
- }
+ log.debug("[{}] scheduling font loading in background: {}.", Thread.currentThread().getName(), fontURL);
this.execute();
}
@Override
protected Font doInBackground() throws MalformedURLException, FontFormatException, IOException {
- if (log.isDebugEnabled()) {
- log.debug("[" + Thread.currentThread().getName() + "] loading font in background...");
- }
+ log.debug("[{}] loading font in background.", Thread.currentThread().getName());
return Font.createFont(Font.TRUETYPE_FONT, fontURL.openStream());
}
@@ -67,16 +65,15 @@ public class URLFontLoader extends SwingWorker<Font, Object> implements FontProv
*/
@Override
public Font getFont() throws FontProviderException {
- log.debug("[" + Thread.currentThread().getName() + "] get font (EDT?)");
+ log.debug("[{}] get font (EDT?)", Thread.currentThread().getName());
try {
return get();
} catch (InterruptedException ex) {
- log.error("font loader interrupted");
-// Thread.currentThread().interrupt();
- throw new FontProviderException("font loader interrupted", ex);
+ log.error("Font loader interrupted.");
+ throw new FontProviderException("Font loader interrupted.", ex);
} catch (ExecutionException ex) {
- log.error("failed to load font", ex.getCause());
- throw new FontProviderException("failed to load font", ex.getCause());
+ log.error("Failed to load font. {}", ex.getCause());
+ throw new FontProviderException("Failed to load font.", ex.getCause());
}
}
}
diff --git a/BKUApplet/src/main/resources/simplelog.properties b/BKUApplet/src/main/resources/simplelog.properties
deleted file mode 100644
index d62508cf..00000000
--- a/BKUApplet/src/main/resources/simplelog.properties
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright 2008 Federal Chancellery Austria and
-# Graz University of Technology
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Logging detail level,
-# Must be one of ("trace", "debug", "info", "warn", "error", or "fatal").
-org.apache.commons.logging.simplelog.defaultlog=debug
-# Logs the Log instance used
-org.apache.commons.logging.simplelog.showlogname=true
-#Logs the class name with package(or Path)
-#( Valid Values "true","false". Default Value "true")
-org.apache.commons.logging.simplelog.showShortLogname=true
-#Logs date and time( Valid Values "true","false". Default Value "false")
-org.apache.commons.logging.simplelog.showdatetime=false
diff --git a/BKUAppletExt/keystore.ks b/BKUAppletExt/keystore.ks
index 824c3a40..ba0b4652 100644
--- a/BKUAppletExt/keystore.ks
+++ b/BKUAppletExt/keystore.ks
Binary files differ
diff --git a/BKUAppletExt/pom.xml b/BKUAppletExt/pom.xml
index b79dd260..c60864bc 100644
--- a/BKUAppletExt/pom.xml
+++ b/BKUAppletExt/pom.xml
@@ -1,45 +1,62 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
- <artifactId>bku</artifactId>
+ <artifactId>mocca</artifactId>
<groupId>at.gv.egiz</groupId>
- <version>1.2.14-SNAPSHOT</version>
+ <version>1.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>at.gv.egiz</groupId>
<artifactId>BKUAppletExt</artifactId>
<name>BKU Applet Extension</name>
- <version>1.2.14-SNAPSHOT</version>
+ <version>${project.parent.version}</version>
<description />
<dependencies>
<dependency>
<groupId>at.gv.egiz</groupId>
<artifactId>STALExt</artifactId>
- <version>1.2.14-SNAPSHOT</version>
+ <version>${project.parent.version}</version>
+ <optional>true</optional>
</dependency>
<dependency>
<groupId>at.gv.egiz</groupId>
<artifactId>STALXService</artifactId>
- <version>1.2.14-SNAPSHOT</version>
+ <version>${project.parent.version}</version>
+ <optional>true</optional>
</dependency>
<dependency>
<groupId>at.gv.egiz</groupId>
<artifactId>smccSTAL</artifactId>
- <version>1.2.14-SNAPSHOT</version>
+ <version>${project.parent.version}</version>
+ <optional>true</optional>
</dependency>
<dependency>
<groupId>at.gv.egiz</groupId>
<artifactId>BKUApplet</artifactId>
- <version>1.2.14-SNAPSHOT</version>
+ <version>${project.parent.version}</version>
+ <optional>true</optional>
</dependency>
<dependency>
<groupId>at.gv.egiz</groupId>
<artifactId>BKUGuiExt</artifactId>
- <version>1.2.14-SNAPSHOT</version>
+ <version>${project.parent.version}</version>
+ <optional>true</optional>
</dependency>
<dependency>
<groupId>at.gv.egiz</groupId>
<artifactId>smccSTALExt</artifactId>
- <version>1.2.14-SNAPSHOT</version>
+ <version>${project.parent.version}</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-jdk14</artifactId>
+ <scope>runtime</scope>
+ <optional>true</optional>
</dependency>
</dependencies>
<build>
@@ -98,8 +115,8 @@
<goal>unpack-dependencies</goal>
</goals>
<configuration>
- <includeGroupIds>at.gv.egiz</includeGroupIds>
- <excludeTransitive>true</excludeTransitive>
+ <includeScope>runtime</includeScope>
+ <excludeTransitive>false</excludeTransitive>
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
<excludes>META-INF\/</excludes>
</configuration>
diff --git a/BKUAppletExt/src/main/java/at/gv/egiz/bku/online/applet/ActivationApplet.java b/BKUAppletExt/src/main/java/at/gv/egiz/bku/online/applet/ActivationApplet.java
index 4f2f1331..b8526730 100644
--- a/BKUAppletExt/src/main/java/at/gv/egiz/bku/online/applet/ActivationApplet.java
+++ b/BKUAppletExt/src/main/java/at/gv/egiz/bku/online/applet/ActivationApplet.java
@@ -16,13 +16,12 @@
*/
package at.gv.egiz.bku.online.applet;
-import at.gv.egiz.bku.gui.AbstractHelpListener;
import at.gv.egiz.bku.gui.ActivationGUI;
import at.gv.egiz.bku.gui.BKUGUIFacade;
import at.gv.egiz.bku.gui.SwitchFocusListener;
import at.gv.egiz.bku.gui.BKUGUIFacade.Style;
+import at.gv.egiz.bku.gui.HelpListener;
import at.gv.egiz.bku.gui.viewer.FontProvider;
-import at.gv.egiz.bku.online.applet.BKUApplet;
import at.gv.egiz.bku.smccstal.AbstractSMCCSTAL;
import at.gv.egiz.bku.smccstal.CardMgmtRequestHandler;
import at.gv.egiz.stal.ext.APDUScriptRequest;
@@ -35,8 +34,8 @@ import java.net.MalformedURLException;
import java.net.URL;
import java.util.Locale;
import javax.xml.namespace.QName;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
*
@@ -45,7 +44,7 @@ import org.apache.commons.logging.LogFactory;
public class ActivationApplet extends BKUApplet {
private static final long serialVersionUID = 1L;
- private static Log log = LogFactory.getLog(ActivationApplet.class);
+ private final Logger log = LoggerFactory.getLogger(ActivationApplet.class);
@Override
public void init() {
@@ -53,7 +52,7 @@ public class ActivationApplet extends BKUApplet {
if (worker instanceof AbstractSMCCSTAL) {
CardMgmtRequestHandler handler = new CardMgmtRequestHandler();
((AbstractSMCCSTAL) worker).addRequestHandler(APDUScriptRequest.class, handler);
- log.debug("Registered CardMgmtRequestHandler");
+ log.debug("Registered CardMgmtRequestHandler.");
} else {
log.warn("Cannot register CardMgmtRequestHandler.");
}
@@ -67,9 +66,9 @@ public class ActivationApplet extends BKUApplet {
@Override
public STALPortType getSTALPort() throws MalformedURLException {
URL wsdlURL = getURLParameter(WSDL_URL, null);
- log.debug("setting STAL WSDL: " + wsdlURL);
+ log.debug("Setting STAL WSDL: {}.", wsdlURL);
QName endpointName = new QName(STAL_WSDL_NS, STAL_SERVICE);
- log.info("creating STAL-X enabled webservice port");
+ log.info("Creating STAL-X enabled webservice port.");
STALService stal = new STALService(wsdlURL, endpointName);
return stal.getSTALPort();
}
@@ -87,7 +86,7 @@ public class ActivationApplet extends BKUApplet {
Style guiStyle,
URL backgroundImgURL,
FontProvider fontProvider,
- AbstractHelpListener helpListener,
+ HelpListener helpListener,
SwitchFocusListener switchFocusListener) {
return new ActivationGUI(contentPane, locale, guiStyle, backgroundImgURL, fontProvider, helpListener, switchFocusListener);
}
diff --git a/BKUAppletExt/src/main/java/at/gv/egiz/bku/online/applet/PINManagementApplet.java b/BKUAppletExt/src/main/java/at/gv/egiz/bku/online/applet/PINManagementApplet.java
index bf323969..99e7ca3c 100644
--- a/BKUAppletExt/src/main/java/at/gv/egiz/bku/online/applet/PINManagementApplet.java
+++ b/BKUAppletExt/src/main/java/at/gv/egiz/bku/online/applet/PINManagementApplet.java
@@ -16,8 +16,8 @@
*/
package at.gv.egiz.bku.online.applet;
-import at.gv.egiz.bku.gui.AbstractHelpListener;
import at.gv.egiz.bku.gui.BKUGUIFacade;
+import at.gv.egiz.bku.gui.HelpListener;
import at.gv.egiz.bku.gui.PINManagementGUI;
import at.gv.egiz.bku.gui.PINManagementGUIFacade;
import at.gv.egiz.bku.gui.SwitchFocusListener;
@@ -25,31 +25,29 @@ import at.gv.egiz.bku.gui.viewer.FontProvider;
import java.awt.Container;
import java.net.URL;
import java.util.Locale;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
/**
- *
+ *
* @author Clemens Orthacker <clemens.orthacker@iaik.tugraz.at>
*/
public class PINManagementApplet extends BKUApplet {
- private static final long serialVersionUID = 1L;
- private static Log log = LogFactory.getLog(PINManagementApplet.class);
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ protected BKUGUIFacade createGUI(Container contentPane, Locale locale,
+ BKUGUIFacade.Style guiStyle, URL backgroundImgURL,
+ FontProvider fontProvider, HelpListener helpListener,
+ SwitchFocusListener switchFocusListener) {
+ return new PINManagementGUI(contentPane, locale, guiStyle,
+ backgroundImgURL, fontProvider, helpListener,
+ switchFocusListener);
+ }
+
+ @Override
+ protected AppletBKUWorker createBKUWorker(BKUApplet applet, BKUGUIFacade gui) {
+ return new PINManagementBKUWorker(applet, (PINManagementGUIFacade) gui);
+ }
- @Override
- protected BKUGUIFacade createGUI(Container contentPane,
- Locale locale,
- BKUGUIFacade.Style guiStyle,
- URL backgroundImgURL,
- FontProvider fontProvider,
- AbstractHelpListener helpListener,
- SwitchFocusListener switchFocusListener) {
- return new PINManagementGUI(contentPane, locale, guiStyle, backgroundImgURL, fontProvider, helpListener, switchFocusListener);
- }
- @Override
- protected AppletBKUWorker createBKUWorker(BKUApplet applet, BKUGUIFacade gui) {
- return new PINManagementBKUWorker(applet, (PINManagementGUIFacade) gui);
- }
}
diff --git a/BKUAppletExt/src/main/java/at/gv/egiz/bku/online/applet/PINManagementBKUWorker.java b/BKUAppletExt/src/main/java/at/gv/egiz/bku/online/applet/PINManagementBKUWorker.java
index 5dedcedb..b9f31f42 100644
--- a/BKUAppletExt/src/main/java/at/gv/egiz/bku/online/applet/PINManagementBKUWorker.java
+++ b/BKUAppletExt/src/main/java/at/gv/egiz/bku/online/applet/PINManagementBKUWorker.java
@@ -22,15 +22,16 @@ import at.gv.egiz.bku.smccstal.PINManagementRequestHandler;
import at.gv.egiz.stal.ErrorResponse;
import at.gv.egiz.stal.InfoboxReadRequest;
import at.gv.egiz.stal.QuitRequest;
-import at.gv.egiz.stal.STALRequest;
import at.gv.egiz.stal.STALResponse;
import at.gv.egiz.stal.SignRequest;
import at.gv.egiz.stal.ext.PINManagementRequest;
import at.gv.egiz.stal.ext.PINManagementResponse;
-import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
/**
* This BKU Worker does not connect to STAL webservice
* (no Internet connection permitted while activating PINs).
@@ -38,6 +39,8 @@ import java.util.List;
* @author Clemens Orthacker <clemens.orthacker@iaik.tugraz.at>
*/
public class PINManagementBKUWorker extends AppletBKUWorker {
+
+ private final Logger log = LoggerFactory.getLogger(PINManagementBKUWorker.class);
public PINManagementBKUWorker(BKUApplet applet, PINManagementGUIFacade gui) {
super(applet, gui);
@@ -59,9 +62,9 @@ public class PINManagementBKUWorker extends AppletBKUWorker {
if (responses.size() == 1) {
STALResponse response = responses.get(0);
if (response instanceof PINManagementResponse) {
- log.debug("PIN management dialog terminated");
+ log.debug("PIN management dialog terminated.");
} else if (response instanceof ErrorResponse) {
- log.debug("PIN management dialog terminated with error");
+ log.debug("PIN management dialog terminated with error.");
} else {
throw new RuntimeException("Invalid STAL response: " + response.getClass().getName());
}
diff --git a/BKUCertificates/pom.xml b/BKUCertificates/pom.xml
index eb7541aa..8227014f 100644
--- a/BKUCertificates/pom.xml
+++ b/BKUCertificates/pom.xml
@@ -1,9 +1,9 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
- <artifactId>bku</artifactId>
+ <artifactId>mocca</artifactId>
<groupId>at.gv.egiz</groupId>
- <version>1.2.14-SNAPSHOT</version>
+ <version>1.3.0-SNAPSHOT</version>
</parent>
<groupId>at.gv.egiz</groupId>
<artifactId>BKUCertificates</artifactId>
diff --git a/BKUCommonGUI/pom.xml b/BKUCommonGUI/pom.xml
index e426f7fe..ccb47235 100644
--- a/BKUCommonGUI/pom.xml
+++ b/BKUCommonGUI/pom.xml
@@ -1,33 +1,26 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
- <artifactId>bku</artifactId>
+ <artifactId>mocca</artifactId>
<groupId>at.gv.egiz</groupId>
- <version>1.2.14-SNAPSHOT</version>
+ <version>1.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>at.gv.egiz</groupId>
<artifactId>BKUCommonGUI</artifactId>
<name>BKU GUI</name>
- <version>1.2.14-SNAPSHOT</version>
+ <version>${project.parent.version}</version>
<dependencies>
<dependency>
<groupId>at.gv.egiz</groupId>
<artifactId>smcc</artifactId>
- <version>1.2.14-SNAPSHOT</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>at.gv.egiz</groupId>
<artifactId>STAL</artifactId>
- <version>1.2.14-SNAPSHOT</version>
+ <version>${project.parent.version}</version>
<scope>compile</scope>
</dependency>
- <!-- see BKUFonts.pom
- <dependency>
- <groupId>at.gv.egiz</groupId>
- <artifactId>BKUFonts</artifactId>
- <version>1.0</version>
- <scope>runtime</scope>
- </dependency-->
</dependencies>
<build>
<plugins>
diff --git a/BKUCommonGUI/src/main/java/META-INF/MANIFEST.MF b/BKUCommonGUI/src/main/java/META-INF/MANIFEST.MF
deleted file mode 100644
index 5e949512..00000000
--- a/BKUCommonGUI/src/main/java/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,3 +0,0 @@
-Manifest-Version: 1.0
-Class-Path:
-
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/AbstractHelpListener.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/AbstractHelpListener.java
deleted file mode 100644
index 6fd1ffea..00000000
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/AbstractHelpListener.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright 2008 Federal Chancellery Austria and
- * Graz University of Technology
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package at.gv.egiz.bku.gui;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Locale;
-import java.util.ResourceBundle;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * Implement the showDocument(URL) method to provide an actual HelpListener.
- * This class does not keep a GUI reference and subclasses should not interfere with the GUI.
- * Therefore, any errors occurring in showDocument() should be handled/displayed within
- * showDocument() and exceptions thrown from showDocument() are logged, not displayed in the GUI.
- * <br/>
- * The help URL is build as [baseURL]/[locale]/[helpTopic].html
- * (note that no session information is contained).
- *
- * @author Clemens Orthacker <clemens.orthacker@iaik.tugraz.at>
- */
-public abstract class AbstractHelpListener implements ActionListener {
-
- /**
- * any locale not in the list will be mapped to 'de'
- */
- public static final String[] SUPPORTED_LANGUAGES = new String[] { "de" };
-
- protected final static Log log = LogFactory.getLog(AbstractHelpListener.class);
- protected URL baseURL;
- protected Locale locale;
- protected ResourceBundle messages;
-
- public AbstractHelpListener(URL baseURL, Locale locale) {
- if (baseURL == null || "".equals(baseURL.toString())) {
- throw new RuntimeException("no help URL provided");
- }
- this.baseURL = baseURL;
- this.locale = locale;
- if (locale != null) {
- messages = ResourceBundle.getBundle(BKUGUIFacade.MESSAGES_BUNDLE, locale);
- } else {
- messages = ResourceBundle.getBundle(BKUGUIFacade.MESSAGES_BUNDLE);
- }
- }
-
- @Override
- public void actionPerformed(ActionEvent e) {
- log.debug("received help action: " + e.getActionCommand());
- URL helpURL = constructHelpURL(baseURL, e.getActionCommand());
- try {
- showDocument(helpURL, e.getActionCommand());
- } catch (Exception ex) {
- log.error("could not display help document " + helpURL + ": " + ex.getMessage());
- }
- }
-
- private URL constructHelpURL(URL baseURL, String helpTopic) {
- URL helpURL = baseURL;
- log.trace("constructing help URL: " + helpURL);
- try {
- // not localized for now
- //check if locale.getLanguage() supported and add default if not
-// if (locale != null) {
-// helpURL = new URL(helpURL, locale.toString() + "/");
-// log.trace("constructing help URL: " + helpURL);
-// }
- if (helpTopic != null && !"".equals(helpTopic)) {
- helpURL = new URL(helpURL, "de/" + helpTopic + ".html");
- log.trace("constructing help URL: " + helpURL);
- }
- } catch (MalformedURLException ex) {
- log.error("Failed to construct help URL for help item " + helpTopic + ": " + ex.getMessage());
- }
- return helpURL;
- }
-
- /**
- * Errors from HelpListeners should not (are not) displayed in the applet,
- * but should rather be in the HelpListener specific way.
- * Therefore, implementations SHOULD NOT throw exceptions (these are only logged).
- * @param helpDocument
- * @throws java.lang.Exception
- */
- public abstract void showDocument(URL helpDocument, String helpTopic) throws Exception;
-}
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
index 1e23c64c..b7ab156f 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
@@ -17,7 +17,7 @@
package at.gv.egiz.bku.gui;
import at.gv.egiz.stal.HashDataInput;
-import at.gv.egiz.smcc.PINSpec;
+import at.gv.egiz.smcc.PinInfo;
import java.awt.Color;
import java.awt.event.ActionListener;
import java.util.List;
@@ -46,10 +46,14 @@ public interface BKUGUIFacade {
public static final String DEFAULT_BACKGROUND = "/at/gv/egiz/bku/gui/chip32.png";
public static final String DEFAULT_ICON = "/at/gv/egiz/bku/gui/chiperling105.png";
public static final String HELP_IMG = "/at/gv/egiz/bku/gui/help.png";
+ public static final String HELP_IMG_L = "/at/gv/egiz/bku/gui/help_l.png";
+ public static final String HELP_IMG_XL = "/at/gv/egiz/bku/gui/help_xl.png";
+ public static final String HELP_IMG_XXL = "/at/gv/egiz/bku/gui/help_xxl.png";
public static final String HELP_IMG_FOCUS = "/at/gv/egiz/bku/gui/help.png"; //help_focus.png";
public static final String HASHDATA_FONT = "Monospaced";
public static final Color ERROR_COLOR = Color.RED;
public static final Color HYPERLINK_COLOR = Color.BLUE;
+ public static final Color HELP_COLOR = new Color(70, 148, 169);
public static final String TITLE_WELCOME = "title.welcome";
public static final String TITLE_INSERTCARD = "title.insertcard";
public static final String TITLE_CARD_NOT_SUPPORTED = "title.cardnotsupported";
@@ -114,11 +118,17 @@ public interface BKUGUIFacade {
public static final String SAVE_HASHDATAINPUT_PREFIX = "save.hashdatainput.prefix";
public static final String ALT_HELP = "alt.help";
- public void showEnterPINDirect(PINSpec spec, int retries);
+ public static final String SIGDATA_TOOLTIPTEXT = "dialog.sigpin.infolabel.sigdata.tooltiptext";
+ public static final String SWITCH_FOCUS_DUMMY_LABEL_NAME = "DummyLabel";
+
+ public enum DIALOG_TYPE {DIALOGUE_UNDEFINED, DIALOGUE_VERIFY_PIN, DIALOGUE_ENTER_PIN, DIALOGUE_SHOW_SIG_DATA, DIALOGUE_SIGNATURE_PIN, DIALOGUE_MESSAGE};
+
+
+ public void showEnterPINDirect(PinInfo pinInfo, int retries);
- public void showEnterPIN(PINSpec spec, int retries);
+ public void showEnterPIN(PinInfo pinInfo, int retries);
- public void showSignatureDataDialog(PINSpec spec, ActionListener listener, String string, ActionListener aThis0, String string0, ActionListener aThis1, String string1);
+ public void showSignatureDataDialog(PinInfo pinInfo, ActionListener listener, String string, ActionListener aThis0, String string0, ActionListener aThis1, String string1);
public void correctionButtonPressed();
@@ -134,11 +144,11 @@ public interface BKUGUIFacade {
*/
public Locale getLocale();
- public void showVerifyPINDialog(PINSpec pinSpec, int numRetries,
+ public void showVerifyPINDialog(PinInfo pinSpec, int numRetries,
ActionListener okListener, String okCommand,
ActionListener cancelListener, String cancelCommand);
- public void showSignaturePINDialog(PINSpec pinSpec, int numRetries,
+ public void showSignaturePINDialog(PinInfo pinSpec, int numRetries,
ActionListener signListener, String signCommand,
ActionListener cancelListener, String cancelCommand,
ActionListener viewerListener, String viewerCommand);
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java
index e005836c..d806c5fa 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java
@@ -20,15 +20,19 @@ package at.gv.egiz.bku.gui;
import at.gv.egiz.bku.gui.viewer.FontProviderException;
import at.gv.egiz.bku.gui.viewer.FontProvider;
import at.gv.egiz.bku.gui.viewer.SecureViewerSaveDialog;
-import at.gv.egiz.smcc.PINSpec;
+import at.gv.egiz.smcc.PinInfo;
import at.gv.egiz.stal.HashDataInput;
import java.awt.Color;
+import java.awt.Component;
import java.awt.Container;
import java.awt.Cursor;
+import java.awt.FocusTraversalPolicy;
import java.awt.Font;
import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
+import java.awt.event.ComponentAdapter;
+import java.awt.event.ComponentEvent;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.awt.event.KeyAdapter;
@@ -36,16 +40,19 @@ import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionAdapter;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
import java.net.URL;
import java.text.MessageFormat;
import java.util.List;
import java.util.Locale;
import java.util.ResourceBundle;
-import java.util.logging.Level;
-import java.util.logging.Logger;
+
+import javax.swing.BorderFactory;
import javax.swing.GroupLayout;
import javax.swing.ImageIcon;
import javax.swing.JButton;
+import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
@@ -59,1607 +66,2730 @@ import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.text.BadLocationException;
import javax.swing.text.Document;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
- *
+ *
* @author clemens
*/
public class BKUGUIImpl implements BKUGUIFacade {
-
- protected static final Log log = LogFactory.getLog(BKUGUIImpl.class);
- protected enum PinLabelPosition {
- LEFT, ABOVE
- }
+ private final Logger log = LoggerFactory.getLogger(BKUGUIImpl.class);
- protected HelpMouseListener helpMouseListener;
- protected HelpKeyListener helpKeyListener;
- protected SwitchFocusFocusListener switchFocusKeyListener;
- protected SecureViewerDialog secureViewer;
- protected FontProvider fontProvider;
-
- protected Container contentPane;
- protected ResourceBundle messages;
- /** left and right side main panels */
- protected JPanel iconPanel;
- protected JPanel contentPanel;
- /** right side content panels and layouts */
- protected JPanel headerPanel;
- protected JPanel mainPanel;
- protected JPanel buttonPanel;
- /** right side fixed labels */
- protected JLabel titleLabel;
- protected JLabel helpLabel;
- protected JLabel switchFocusDummyLabel;
- /** remember the pinfield to return to worker */
- protected JPasswordField pinField;
- protected Document pinpadPIN;
-
- protected int buttonSize;
-
- /** gui style config (default 'simple') */
- protected boolean renderHeaderPanel = false;
- protected boolean renderIconPanel = false;
- protected boolean renderCancelButton = false;
- protected boolean shortText = false;
- protected PinLabelPosition pinLabelPos = PinLabelPosition.LEFT;
- protected boolean renderRefId = false;
-
- /**
- * set contentPane
- * init message bundle
- * configure the style
- * register the help listener
- * create GUI (on event-dispatching thread)
- *
- * @param contentPane
- * @param locale
- * @param guiStyle
- * @param background
- * @param helpListener
- */
- public BKUGUIImpl(Container contentPane,
- Locale locale,
- Style guiStyle,
- URL background,
- FontProvider fontProvider,
- ActionListener helpListener,
- SwitchFocusListener switchFocusListener) {
- this.contentPane = contentPane;
-
- loadMessageBundle(locale);
-
- if (guiStyle == Style.advanced) {
- renderHeaderPanel = true;
- renderIconPanel = false;
- renderCancelButton = true;
- renderRefId = true;
- } else if (guiStyle == Style.tiny) {
- shortText = true;
- pinLabelPos = PinLabelPosition.ABOVE;
- }
-
- // ensure that buttons can be fired with enter key too
- UIManager.put("Button.defaultButtonFollowsFocus", Boolean.TRUE);
-
- registerHelpListener(helpListener);
-
- registerSwitchFocusListener(switchFocusListener);
-
- this.fontProvider = fontProvider;
- createGUI(background);
- }
-
- private void createGUI(final URL background) {
-
- try {
-
- log.debug("scheduling gui initialization");
-
- SwingUtilities.invokeLater(new Runnable() {
-
- @Override
- public void run() {
-
- log.debug("[" + Thread.currentThread().getName() + "] initializing gui");
-
- if (renderIconPanel) {
- initIconPanel(background);
- initContentPanel(null);
- } else {
- initContentPanel(background);
- }
-
- GroupLayout layout = new GroupLayout(contentPane);
- contentPane.setLayout(layout);
-
- if (renderIconPanel) {
- layout.setHorizontalGroup(layout.createSequentialGroup()
- .addContainerGap()
- .addComponent(iconPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(contentPanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addContainerGap());
- layout.setVerticalGroup(layout.createSequentialGroup()
- .addContainerGap()
- .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addComponent(iconPanel, GroupLayout.Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(contentPanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- .addContainerGap());
- } else {
- layout.setHorizontalGroup(layout.createSequentialGroup()
- // left border
- .addContainerGap()
- .addComponent(contentPanel)
- .addContainerGap());
- layout.setVerticalGroup(layout.createSequentialGroup()
- .addContainerGap()
- .addComponent(contentPanel)
- .addContainerGap());
- }
- }
- });
- } catch (Exception ex) {
- throw new RuntimeException("Failed to init GUI: " + ex.getMessage());
- }
- }
-
- protected void initIconPanel(URL background) {
- if (background == null) {
- background = getClass().getResource(DEFAULT_ICON);
- }
- if ("file".equals(background.getProtocol())) {
- log.warn("file:// background images not permitted: " + background +
- ", loading default background");
- background = getClass().getResource(DEFAULT_ICON);
- }
- log.debug("loading icon panel background " + background);
-
- iconPanel = new JPanel();
- JLabel iconLabel = new JLabel();
- iconLabel.setIcon(new ImageIcon(background));
-
- GroupLayout iconPanelLayout = new GroupLayout(iconPanel);
- iconPanel.setLayout(iconPanelLayout);
- iconPanelLayout.setHorizontalGroup(
- iconPanelLayout.createSequentialGroup()
- .addComponent(iconLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE));
- iconPanelLayout.setVerticalGroup(
- iconPanelLayout.createSequentialGroup()
- .addComponent(iconLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE));
- }
+ protected enum PinLabelPosition {
+ LEFT, ABOVE
+ }
- protected void initContentPanel(URL background) {
-
- if (background == null) {
- log.debug("no background image set");
-// contentPanel = new ImagePanel(getClass().getResource(DEFAULT_BACKGROUND));
- contentPanel = new JPanel();
- } else if ("file".equals(background.getProtocol())) {
- log.warn("file:// background images not permitted: " + background);
- contentPanel = new JPanel();
- } else {
- log.debug("loading background " + background);
- contentPanel = new ImagePanel(background);
- }
- contentPanel.setOpaque(false);
- mainPanel = new JPanel();
- mainPanel.setOpaque(false);
- buttonPanel = new JPanel();
- buttonPanel.setOpaque(false);
-
- helpLabel = new JLabel();
- helpLabel.setIcon(new ImageIcon(getClass().getResource(HELP_IMG)));
- helpLabel.getAccessibleContext().setAccessibleName(getMessage(ALT_HELP));
- helpLabel.setFocusable(true);
- helpLabel.addMouseListener(helpMouseListener);
- helpLabel.addKeyListener(helpKeyListener);
- helpLabel.addFocusListener(new FocusAdapter() {
-
- @Override
- public void focusGained(FocusEvent e) {
-
- helpLabel.setIcon(new ImageIcon(getClass().getResource(HELP_IMG_FOCUS)));
- }
-
- @Override
- public void focusLost(FocusEvent e) {
-
- helpLabel.setIcon(new ImageIcon(getClass().getResource(HELP_IMG)));
- }
-
-
- });
- helpLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
-
- switchFocusDummyLabel = new JLabel();
- switchFocusDummyLabel.setText("");
- switchFocusDummyLabel.setFocusable(true);
- switchFocusDummyLabel.addFocusListener(switchFocusKeyListener);
-
- buttonSize = initButtonSize();
-
- if (renderHeaderPanel) {
- headerPanel = new JPanel();
- headerPanel.setOpaque(false);
-
- titleLabel = new JLabel();
- titleLabel.setFont(titleLabel.getFont().deriveFont(titleLabel.getFont().getStyle() |
- java.awt.Font.BOLD, titleLabel.getFont().getSize() + 2));
-
- GroupLayout headerPanelLayout = new GroupLayout(headerPanel);
- headerPanel.setLayout(headerPanelLayout);
-
- headerPanelLayout.setHorizontalGroup(
- headerPanelLayout.createSequentialGroup()
- .addComponent(titleLabel, 0, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE)
- .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
- .addComponent(switchFocusDummyLabel)
- .addComponent(helpLabel)
- );
- headerPanelLayout.setVerticalGroup(
- headerPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addComponent(titleLabel, 0, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE)
- .addComponent(switchFocusDummyLabel)
- .addComponent(helpLabel)
- );
- }
-
- GroupLayout contentPanelLayout = new GroupLayout(contentPanel);
- contentPanel.setLayout(contentPanelLayout);
-
- // align header, main and button to the right
- GroupLayout.ParallelGroup horizontalContent =
- contentPanelLayout.createParallelGroup(GroupLayout.Alignment.TRAILING); //LEADING);
- GroupLayout.SequentialGroup verticalContent =
- contentPanelLayout.createSequentialGroup();
-
- if (renderHeaderPanel) {
- horizontalContent
- .addComponent(headerPanel, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE);
- verticalContent
- .addComponent(headerPanel, 0, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED);
-
- }
- horizontalContent
- .addComponent(mainPanel, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(buttonPanel, 0, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE); //Short.MAX_VALUE);
- verticalContent
- .addComponent(mainPanel, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(buttonPanel, 0, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE);
-
- contentPanelLayout.setHorizontalGroup(horizontalContent); //Outer);
- contentPanelLayout.setVerticalGroup(verticalContent);
+ protected Component primaryFocusHolder;
+ protected SecureViewerDialog secureViewer;
+
+ protected HelpListener helpListener;
+ protected SwitchFocusFocusListener switchFocusKeyListener;
+ protected FontProvider fontProvider;
+
+ protected Container contentPane;
+ protected WindowCloseAdapter windowCloseAdapter;
+ protected ResourceBundle messages;
+ /** left and right side main panels */
+ protected JPanel iconPanel;
+ protected JPanel contentPanel;
+ /** right side content panels and layouts */
+ protected JPanel headerPanel;
+ protected JPanel mainPanel;
+ protected JPanel buttonPanel;
+ /** right side fixed labels */
+ protected JLabel titleLabel;
+ protected JLabel msgTitleLabel;
+ protected JLabel helpLabel;
+ protected JLabel switchFocusDummyLabel;
+ /** remember the pinfield to return to worker */
+ protected JPasswordField pinField;
+ protected Document pinpadPIN;
+
+ protected JButton okButton;
+ protected JButton backButton;
+ protected JButton enterPINButton;
+ protected final JButton cancelButton;
+ protected JLabel infoLabel;
+ protected final JLabel pinsizeLabel;
+ protected final JLabel signPinLabel;
+ protected final JButton signButton;
+ protected JLabel cardPinLabel;
+ protected JLabel pinLabel;
+ protected JPasswordField pinpadPINField;
+ protected JLabel msgLabel;
+ protected boolean showMessageOKButton;
+ protected JLabel refIdLabel;
+ protected JScrollPane hashDataScrollPane;
+ protected JTable hashDataTable;
+ protected HyperlinkRenderer hyperlinkRenderer;
+ protected int baseTableRowHeight;
+
+ protected FocusBorder sigDataFocusBorder;
+ protected FocusBorder helpFocusBorder;
+
+ protected Method methodToRunAtResize;
+
+ protected int buttonSize;
+ protected int baseButtonSize;
+ protected Integer baseWidth;
+ protected Integer baseHeight;
+ protected int baseFontSize;
+
+ /** gui style config (default 'simple') */
+ protected boolean renderHeaderPanel = false;
+ protected boolean renderIconPanel = false;
+ protected boolean renderCancelButton = false;
+ protected boolean shortText = false;
+ protected PinLabelPosition pinLabelPos = PinLabelPosition.LEFT;
+ protected boolean renderRefId = false;
+ protected boolean useFocusTraversalPolicy = false;
+
+// protected HashDataInput storedSelection;
+ protected List<HashDataInput> signedReferences;
+ protected Integer referenceIndex;
+ private at.gv.egiz.bku.gui.BKUGUIImpl.SignedReferencesSelectionListener.SignedReferencesListDisplayer storedBackToListListener;
+
+ /**
+ * set contentPane init message bundle configure the style register the help
+ * listener create GUI (on event-dispatching thread)
+ *
+ * @param contentPane
+ * @param locale
+ * @param guiStyle
+ * @param background
+ * @param helpListener
+ */
+ public BKUGUIImpl(Container contentPane, Locale locale, Style guiStyle,
+ URL background, FontProvider fontProvider,
+ HelpListener helpListener, SwitchFocusListener switchFocusListener) {
+ this.contentPane = contentPane;
+ Window w = SwingUtilities.getWindowAncestor(contentPane);
+ if (w != null && w instanceof JFrame) {
+ this.windowCloseAdapter = new WindowCloseAdapter();
+ ((JFrame) w).addWindowListener(windowCloseAdapter);
}
+
+ loadMessageBundle(locale);
+
+ cancelButton = new JButton();
+ infoLabel = new JLabel();
+ cardPinLabel = new JLabel();
+ pinsizeLabel = new JLabel();
+ signPinLabel = new JLabel();
+ signButton = new JButton();
+ pinLabel = new JLabel();
+ pinpadPINField = new JPasswordField();
+ msgLabel = new JLabel();
+ showMessageOKButton = false;
+
+ this.baseFontSize = new JLabel().getFont().getSize();
+ this.baseTableRowHeight = new JTable().getRowHeight();
+
+ if (guiStyle == Style.advanced) {
+ renderHeaderPanel = true;
+ renderIconPanel = false;
+ renderCancelButton = true;
+ renderRefId = true;
+ useFocusTraversalPolicy = true;
+ } else if (guiStyle == Style.tiny) {
+ shortText = true;
+ pinLabelPos = PinLabelPosition.ABOVE;
+ }
+
+ // ensure that buttons can be fired with enter key too
+ UIManager.put("Button.defaultButtonFollowsFocus", Boolean.TRUE);
+
+ registerSwitchFocusListener(switchFocusListener);
+
+ this.fontProvider = fontProvider;
+ this.helpListener = helpListener;
+ createGUI(background);
- /**
- * BKUWorker inits signaturecard with locale
- * @return
- */
- @Override
- public Locale getLocale() {
- return messages.getLocale();
- }
+ }
- /**
- * to be overridden by subclasses providing additional resource messages
- * @param key
- * @return
- */
- protected String getMessage(String key) {
- return messages.getString(key);
- }
+ private void createGUI(final URL background) {
+
+ try {
+
+ log.debug("Scheduling gui initialization.");
+
+ SwingUtilities.invokeLater(new Runnable() {
+
+ @Override
+ public void run() {
+
+ log.debug("[{}] Initializing gui.", Thread.currentThread().getName());
+
+ if (renderIconPanel) {
+ initIconPanel(background);
+ initContentPanel(null);
+ } else {
+ initContentPanel(background);
+ }
+
+ contentPanel.addComponentListener(new ComponentAdapter() {
+
+ @Override
+ public void componentResized(ComponentEvent e) {
+
+ log.debug("Component resize detected.");
+
+ resize();
+ }
+
+ });
+
+ GroupLayout layout = new GroupLayout(contentPane);
+ contentPane.setLayout(layout);
+
+ if (renderIconPanel) {
+ layout
+ .setHorizontalGroup(layout
+ .createSequentialGroup()
+ .addContainerGap()
+ .addComponent(iconPanel,
+ GroupLayout.PREFERRED_SIZE,
+ GroupLayout.DEFAULT_SIZE,
+ GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(
+ LayoutStyle.ComponentPlacement.UNRELATED)
+ .addComponent(contentPanel,
+ GroupLayout.DEFAULT_SIZE,
+ GroupLayout.DEFAULT_SIZE,
+ Short.MAX_VALUE)
+ .addContainerGap());
+ layout
+ .setVerticalGroup(layout
+ .createSequentialGroup()
+ .addContainerGap()
+ .addGroup(
+ layout
+ .createParallelGroup(
+ GroupLayout.Alignment.LEADING)
+ .addComponent(
+ iconPanel,
+ GroupLayout.Alignment.TRAILING,
+ GroupLayout.DEFAULT_SIZE,
+ GroupLayout.DEFAULT_SIZE,
+ Short.MAX_VALUE)
+ .addComponent(
+ contentPanel,
+ GroupLayout.DEFAULT_SIZE,
+ GroupLayout.DEFAULT_SIZE,
+ Short.MAX_VALUE))
+ .addContainerGap());
+ } else {
+ layout.setHorizontalGroup(layout
+ .createSequentialGroup()
+ // left border
+ .addContainerGap().addComponent(contentPanel)
+ .addContainerGap());
+ layout.setVerticalGroup(layout.createSequentialGroup()
+ .addContainerGap().addComponent(contentPanel)
+ .addContainerGap());
+ }
+ }
+ });
+
+ } catch (Exception ex) {
+ throw new RuntimeException("Failed to init GUI: " + ex.getMessage());
+ }
+ }
- /**
- * to be overridden by subclasses providing additional resource messages
- * @param key
- * @return
- */
- protected boolean hasMessage(String key) {
- return messages.containsKey(key);
- }
+ protected void initIconPanel(URL background) {
+ if (background == null) {
+ background = getClass().getResource(DEFAULT_ICON);
+ }
+ if ("file".equals(background.getProtocol())) {
+ log.warn("file:// background images not permitted: {}, "
+ + "loading default background", background);
+ background = getClass().getResource(DEFAULT_ICON);
+ }
+ log.debug("Loading icon panel background {}.", background);
+
+ iconPanel = new JPanel();
+ JLabel iconLabel = new JLabel();
+ iconLabel.setIcon(new ImageIcon(background));
+
+ GroupLayout iconPanelLayout = new GroupLayout(iconPanel);
+ iconPanel.setLayout(iconPanelLayout);
+ iconPanelLayout.setHorizontalGroup(iconPanelLayout
+ .createSequentialGroup().addComponent(iconLabel,
+ GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
+ GroupLayout.PREFERRED_SIZE));
+ iconPanelLayout.setVerticalGroup(iconPanelLayout
+ .createSequentialGroup().addComponent(iconLabel,
+ GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
+ GroupLayout.PREFERRED_SIZE));
+ }
+
+ protected void initContentPanel(URL background) {
+
+ if (background == null) {
+ log.debug("No background image set.");
+ // contentPanel = new
+ // ImagePanel(getClass().getResource(DEFAULT_BACKGROUND));
+ contentPanel = new JPanel();
+ } else if ("file".equals(background.getProtocol())) {
+ log.warn("file:// background images not permitted: {}.", background);
+ contentPanel = new JPanel();
+ } else {
+ log.debug("Loading background {}.", background);
+ contentPanel = new ImagePanel(background);
+ }
+ contentPanel.setOpaque(false);
+ mainPanel = new JPanel();
+ mainPanel.setOpaque(false);
+ buttonPanel = new JPanel();
+ buttonPanel.setOpaque(false);
+
+ okButton = new JButton();
+ backButton = new JButton();
+ enterPINButton = new JButton();
+
+ sigDataFocusBorder = new FocusBorder(HYPERLINK_COLOR);
+ helpFocusBorder = new FocusBorder(HELP_COLOR);
+
+ if (helpListener.implementsListener()) {
+ helpLabel = new JLabel();
+ helpLabel.setIcon(new ImageIcon(getClass().getResource(HELP_IMG)));
+ helpLabel.getAccessibleContext().setAccessibleName(
+ getMessage(ALT_HELP));
+ helpLabel.setFocusable(true);
+ helpLabel.addMouseListener(helpListener);
+ helpLabel.addKeyListener(helpListener);
+ helpLabel.addFocusListener(new FocusAdapter() {
+
+ @Override
+ public void focusGained(FocusEvent e) {
+
+ log.debug("Help label obtained focus.");
+ updateHelpLabelIcon();
+ }
+
+ @Override
+ public void focusLost(FocusEvent e) {
+
+ updateHelpLabelIcon();
+ }
+
+ });
+ helpLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
+ }
+
+ // This is a hidden label. When it gains focus, it hands over focus to
+ // the web browser
+ switchFocusDummyLabel = new JLabel();
+ switchFocusDummyLabel.setText("");
+ switchFocusDummyLabel.setName(SWITCH_FOCUS_DUMMY_LABEL_NAME);
+ switchFocusDummyLabel.setFocusable(true);
+ switchFocusDummyLabel.addFocusListener(switchFocusKeyListener);
+
+ buttonSize = initButtonSize();
+ baseButtonSize = buttonSize;
+
+ titleLabel = new JLabel();
+ msgTitleLabel = new JLabel();
+
+ if (renderHeaderPanel) {
+ headerPanel = new JPanel();
+ headerPanel.setOpaque(false);
+
+ titleLabel.setFocusable(true);
+ titleLabel.setFont(titleLabel.getFont().deriveFont(
+ titleLabel.getFont().getStyle() | java.awt.Font.BOLD,
+ titleLabel.getFont().getSize() + 2));
+
+ GroupLayout headerPanelLayout = new GroupLayout(headerPanel);
+ headerPanel.setLayout(headerPanelLayout);
+
+ GroupLayout.SequentialGroup horizontalHeader = headerPanelLayout
+ .createSequentialGroup().addComponent(titleLabel, 0,
+ GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE);
+
+ GroupLayout.ParallelGroup verticalHeader = headerPanelLayout
+ .createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addComponent(titleLabel, 0, GroupLayout.PREFERRED_SIZE,
+ Short.MAX_VALUE);
+
+ if (helpListener.implementsListener()) {
+ horizontalHeader.addPreferredGap(
+ LayoutStyle.ComponentPlacement.UNRELATED, 0,
+ Short.MAX_VALUE).addComponent(helpLabel);
+ verticalHeader.addComponent(helpLabel);
+ }
+
+ horizontalHeader.addComponent(switchFocusDummyLabel);
+ verticalHeader.addComponent(switchFocusDummyLabel);
+
+ headerPanelLayout.setHorizontalGroup(horizontalHeader);
+ headerPanelLayout.setVerticalGroup(verticalHeader);
+ }
+
+ GroupLayout contentPanelLayout = new GroupLayout(contentPanel);
+ contentPanel.setLayout(contentPanelLayout);
+
+ // align header, main and button to the right
+ GroupLayout.ParallelGroup horizontalContent = contentPanelLayout
+ .createParallelGroup(GroupLayout.Alignment.TRAILING); // LEADING);
+ GroupLayout.SequentialGroup verticalContent = contentPanelLayout
+ .createSequentialGroup();
+
+ if (renderHeaderPanel) {
+ horizontalContent.addComponent(headerPanel, 0,
+ GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE);
+ verticalContent.addComponent(headerPanel, 0,
+ GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED);
+
+ }
+ horizontalContent.addComponent(mainPanel, 0, GroupLayout.DEFAULT_SIZE,
+ Short.MAX_VALUE).addComponent(buttonPanel, 0,
+ GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE); // Short.MAX_VALUE);
+ verticalContent.addComponent(mainPanel, 0, GroupLayout.DEFAULT_SIZE,
+ Short.MAX_VALUE).addPreferredGap(
+ LayoutStyle.ComponentPlacement.UNRELATED).addComponent(
+ buttonPanel, 0, GroupLayout.DEFAULT_SIZE,
+ GroupLayout.PREFERRED_SIZE);
+
+ contentPanelLayout.setHorizontalGroup(horizontalContent); // Outer);
+ contentPanelLayout.setVerticalGroup(verticalContent);
+
+ }
+
+ /**
+ * BKUWorker inits signaturecard with locale
+ *
+ * @return
+ */
+ @Override
+ public Locale getLocale() {
+ return messages.getLocale();
+ }
+
+ /**
+ * to be overridden by subclasses providing additional resource messages
+ *
+ * @param key
+ * @return
+ */
+ protected String getMessage(String key) {
+ return messages.getString(key);
+ }
+
+ /**
+ * to be overridden by subclasses providing additional resource messages
+ *
+ * @param key
+ * @return
+ */
+ protected boolean hasMessage(String key) {
+ return messages.containsKey(key);
+ }
@Override
- public void showVerifyPINDialog(final PINSpec pinSpec, final int numRetries,
+ public void showVerifyPINDialog(final PinInfo pinSpec, final int numRetries,
final ActionListener okListener, final String okCommand,
final ActionListener cancelListener, final String cancelCommand) {
-
- log.debug("scheduling verify pin dialog");
-
- SwingUtilities.invokeLater(new Runnable() {
-
- @Override
- public void run() {
-
- log.debug("[" + Thread.currentThread().getName() + "] show verify pin dialog");
-
- mainPanel.removeAll();
- buttonPanel.removeAll();
-
- if (renderHeaderPanel) {
- if (numRetries < 0) {
- String verifyTitle = getMessage(TITLE_VERIFY_PIN);
- titleLabel.setText(MessageFormat.format(verifyTitle, new Object[]{pinSpec.getLocalizedName()}));
- } else {
- titleLabel.setText(getMessage(TITLE_RETRY));
- }
- }
-
- JButton okButton = new JButton();
- okButton.setFont(okButton.getFont().deriveFont(okButton.getFont().getStyle() & ~java.awt.Font.BOLD));
- okButton.setText(getMessage(BUTTON_OK));
- okButton.setEnabled(pinSpec.getMinLength() <= 0);
- okButton.setActionCommand(okCommand);
- okButton.addActionListener(okListener);
-
- JLabel cardPinLabel = new JLabel();
- cardPinLabel.setFont(cardPinLabel.getFont().deriveFont(cardPinLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
- String pinLabel = getMessage(LABEL_PIN);
- cardPinLabel.setText(MessageFormat.format(pinLabel, new Object[]{pinSpec.getLocalizedName()}));
-
- pinField = new JPasswordField();
- pinField.setText("");
- pinField.setDocument(new PINDocument(pinSpec.getMinLength(), pinSpec.getMaxLength(), pinSpec.getRexepPattern(), okButton));
- pinField.setActionCommand(okCommand);
- pinField.addActionListener(new ActionListener() {
-
- @Override
- public void actionPerformed(ActionEvent e) {
- if (pinField.getPassword().length >= pinSpec.getMinLength()) {
- okListener.actionPerformed(e);
- }
- }
- });
-
- JLabel infoLabel = new JLabel();
- if (numRetries < 0) {
- infoLabel.setFont(infoLabel.getFont().deriveFont(infoLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
- String infoPattern = getMessage(MESSAGE_ENTERPIN);
- if (shortText) {
- infoLabel.setText(MessageFormat.format(infoPattern, new Object[] {"PIN"}));
- } else {
- infoLabel.setText(MessageFormat.format(infoPattern, new Object[] {pinSpec.getLocalizedName()}));
- }
- helpMouseListener.setHelpTopic(HELP_VERIFY_PIN);
- helpKeyListener.setHelpTopic(HELP_VERIFY_PIN);
- } else {
- String retryPattern;
- if (numRetries < 2) {
- retryPattern = getMessage(MESSAGE_LAST_RETRY);
- } else {
- retryPattern = getMessage(MESSAGE_RETRIES);
- }
- infoLabel.setFont(infoLabel.getFont().deriveFont(infoLabel.getFont().getStyle() | java.awt.Font.BOLD));
- infoLabel.setText(MessageFormat.format(retryPattern, new Object[]{String.valueOf(numRetries)}));
- infoLabel.setForeground(ERROR_COLOR);
- helpMouseListener.setHelpTopic(HELP_RETRY);
- helpKeyListener.setHelpTopic(HELP_RETRY);
- }
-
- JLabel pinsizeLabel = new JLabel();
- pinsizeLabel.setFont(pinsizeLabel.getFont().deriveFont(pinsizeLabel.getFont().getStyle() & ~java.awt.Font.BOLD, pinsizeLabel.getFont().getSize()-2));
- pinsizeLabel.setText(MessageFormat.format(getMessage(LABEL_PINSIZE), pinSpec.getLocalizedLength()));
-
- GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
- mainPanel.setLayout(mainPanelLayout);
-
- GroupLayout.SequentialGroup infoHorizontal = mainPanelLayout.createSequentialGroup()
- .addComponent(infoLabel);
- GroupLayout.ParallelGroup infoVertical = mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addComponent(infoLabel);
-
- if (!renderHeaderPanel) {
- infoHorizontal
- .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
- .addComponent(switchFocusDummyLabel)
- .addComponent(helpLabel)
- ;
- infoVertical
- .addComponent(switchFocusDummyLabel)
- .addComponent(helpLabel)
- ;
- }
-
- // align pinfield and pinsize to the right
- GroupLayout.ParallelGroup pinHorizontal = mainPanelLayout.createParallelGroup(GroupLayout.Alignment.TRAILING);
- GroupLayout.Group pinVertical;
-
- if (pinLabelPos == PinLabelPosition.ABOVE) {
- pinHorizontal
- .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addComponent(cardPinLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addComponent(pinField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- .addComponent(pinsizeLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE);
- pinVertical = mainPanelLayout.createSequentialGroup()
- .addComponent(cardPinLabel)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(pinField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE);
- } else {
- pinHorizontal
- .addGroup(mainPanelLayout.createSequentialGroup()
- .addComponent(cardPinLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(pinField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- .addComponent(pinsizeLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE);
- pinVertical = mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
- .addComponent(cardPinLabel)
- .addComponent(pinField);
- }
-
- mainPanelLayout.setHorizontalGroup(
- mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addGroup(infoHorizontal)
- .addGroup(pinHorizontal));
-
- mainPanelLayout.setVerticalGroup(
- mainPanelLayout.createSequentialGroup()
- .addGroup(infoVertical)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(pinVertical)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(pinsizeLabel));
-
-
- GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
- buttonPanel.setLayout(buttonPanelLayout);
-
- GroupLayout.SequentialGroup buttonHorizontal = buttonPanelLayout.createSequentialGroup()
- .addComponent(okButton, GroupLayout.PREFERRED_SIZE, buttonSize, GroupLayout.PREFERRED_SIZE);
- GroupLayout.Group buttonVertical;
-
- if (renderCancelButton) {
- JButton cancelButton = new JButton();
- cancelButton.setFont(cancelButton.getFont().deriveFont(cancelButton.getFont().getStyle() & ~java.awt.Font.BOLD));
- cancelButton.setText(getMessage(BUTTON_CANCEL));
- cancelButton.setActionCommand(cancelCommand);
- cancelButton.addActionListener(cancelListener);
-
- buttonHorizontal
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(cancelButton, GroupLayout.PREFERRED_SIZE, buttonSize, GroupLayout.PREFERRED_SIZE);
- buttonVertical = buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
- .addComponent(okButton)
- .addComponent(cancelButton);
- } else {
- buttonVertical = buttonPanelLayout.createSequentialGroup()
- .addComponent(okButton);
- }
-
- buttonPanelLayout.setHorizontalGroup(buttonHorizontal);
- buttonPanelLayout.setVerticalGroup(buttonVertical);
-
-// pinField.requestFocusInWindow();
-// helpLabel.requestFocus();
- pinField.requestFocus();
- contentPanel.validate();
-
- }
- });
- }
- @Override
- public void showEnterPINDirect(PINSpec pinSpec, int retries) {
- if (retries < 0) {
- showMessageDialog(TITLE_VERIFY_PINPAD, MESSAGE_ENTERPIN_PINPAD_DIRECT, new Object[] {
- pinSpec.getLocalizedName(), pinSpec.getLocalizedLength() });
- } else {
- showMessageDialog(TITLE_RETRY, MESSAGE_RETRIES, new Object[]{String.valueOf(retries) });
- }
- }
+ log.debug("Scheduling verify pin dialog.");
+
+ SwingUtilities.invokeLater(new Runnable() {
+
+ @Override
+ public void run() {
+
+ log.debug("[{}] Show verify pin dialog.", Thread.currentThread()
+ .getName());
+
+ mainPanel.removeAll();
+ buttonPanel.removeAll();
+
+ // avoid that dummy label gains focus during load
+ switchFocusDummyLabel.setFocusable(false);
+
+ if (renderHeaderPanel) {
+ if (numRetries < 0) {
+ String verifyTitle = getMessage(TITLE_VERIFY_PIN);
+ titleLabel.setText(MessageFormat.format(verifyTitle,
+ new Object[] { pinSpec.getLocalizedName() }));
+ } else {
+ titleLabel.setText(getMessage(TITLE_RETRY));
+ }
+ }
+
+ okButton.setFont(okButton.getFont().deriveFont(
+ okButton.getFont().getStyle() & ~java.awt.Font.BOLD));
+ okButton.setText(getMessage(BUTTON_OK));
+ okButton.setEnabled(pinSpec.getMinLength() <= 0);
+ okButton.setActionCommand(okCommand);
+ okButton.addActionListener(okListener);
+
+ cardPinLabel.setFont(cardPinLabel.getFont()
+ .deriveFont(
+ cardPinLabel.getFont().getStyle()
+ & ~java.awt.Font.BOLD));
+ String pinLabel = getMessage(LABEL_PIN);
+ cardPinLabel.setText(MessageFormat.format(pinLabel,
+ new Object[] { pinSpec.getLocalizedName() }));
+
+ pinField = new JPasswordField();
+ pinField.setText("");
+ pinField.setName("PINField");
+ pinField.setDocument(new PINDocument(pinSpec.getMinLength(),
+ pinSpec.getMaxLength(), pinSpec.getRexepPattern(),
+ okButton));
+ pinField.setActionCommand(okCommand);
+ pinField.addActionListener(new ActionListener() {
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ if (pinField.getPassword().length >= pinSpec
+ .getMinLength()) {
+ okListener.actionPerformed(e);
+ }
+ }
+ });
+
+ pinField.addFocusListener(new FocusAdapter() {
+
+ @Override
+ public void focusGained(FocusEvent e) {
+
+ // focus has been set accordingly - re-enable dummy
+ // label
+ switchFocusDummyLabel.setFocusable(true);
+ }
+
+ });
+
+ infoLabel = new JLabel();
+ if (numRetries < 0) {
+ infoLabel.setFont(infoLabel.getFont().deriveFont(
+ infoLabel.getFont().getStyle()
+ & ~java.awt.Font.BOLD));
+ String infoPattern = getMessage(MESSAGE_ENTERPIN);
+ if (shortText) {
+ infoLabel.setText(MessageFormat.format(infoPattern,
+ new Object[] { "PIN" }));
+ } else {
+ infoLabel.setText(MessageFormat.format(infoPattern,
+ new Object[] { pinSpec.getLocalizedName() }));
+ }
+ helpListener.setHelpTopic(HELP_VERIFY_PIN);
+ } else {
+ String retryPattern;
+ if (numRetries < 2) {
+ retryPattern = getMessage(MESSAGE_LAST_RETRY);
+ } else {
+ retryPattern = getMessage(MESSAGE_RETRIES);
+ }
+ infoLabel.setFont(infoLabel.getFont()
+ .deriveFont(
+ infoLabel.getFont().getStyle()
+ | java.awt.Font.BOLD));
+ infoLabel.setText(MessageFormat.format(retryPattern,
+ new Object[] { String.valueOf(numRetries) }));
+ infoLabel.setForeground(ERROR_COLOR);
+ helpListener.setHelpTopic(HELP_RETRY);
+ }
+
+ pinsizeLabel.setFont(pinsizeLabel.getFont()
+ .deriveFont(
+ pinsizeLabel.getFont().getStyle()
+ & ~java.awt.Font.BOLD,
+ pinsizeLabel.getFont().getSize() - 2));
+ pinsizeLabel.setText(MessageFormat
+ .format(getMessage(LABEL_PINSIZE), pinSpec
+ .getLocalizedLength()));
+
+ pinField.getAccessibleContext().setAccessibleDescription(
+ cardPinLabel.getText() + pinsizeLabel.getText());
+
+ GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
+ mainPanel.setLayout(mainPanelLayout);
+
+ GroupLayout.SequentialGroup infoHorizontal = mainPanelLayout
+ .createSequentialGroup().addComponent(infoLabel);
+ GroupLayout.ParallelGroup infoVertical = mainPanelLayout
+ .createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addComponent(infoLabel);
+
+ if (!renderHeaderPanel) {
+
+ if (helpListener.implementsListener()) {
+ infoHorizontal.addPreferredGap(
+ LayoutStyle.ComponentPlacement.UNRELATED, 0,
+ Short.MAX_VALUE).addComponent(helpLabel);
+ infoVertical.addComponent(helpLabel);
+ }
+ infoHorizontal.addComponent(switchFocusDummyLabel);
+ infoVertical.addComponent(switchFocusDummyLabel);
+ }
+
+ // align pinfield and pinsize to the right
+ GroupLayout.ParallelGroup pinHorizontal = mainPanelLayout
+ .createParallelGroup(GroupLayout.Alignment.TRAILING);
+ GroupLayout.Group pinVertical;
+
+ if (pinLabelPos == PinLabelPosition.ABOVE) {
+ pinHorizontal.addGroup(
+ mainPanelLayout.createParallelGroup(
+ GroupLayout.Alignment.LEADING)
+ .addComponent(cardPinLabel,
+ GroupLayout.PREFERRED_SIZE,
+ GroupLayout.DEFAULT_SIZE,
+ GroupLayout.PREFERRED_SIZE)
+ .addComponent(pinField,
+ GroupLayout.PREFERRED_SIZE,
+ GroupLayout.DEFAULT_SIZE,
+ Short.MAX_VALUE)).addComponent(
+ pinsizeLabel, GroupLayout.PREFERRED_SIZE,
+ GroupLayout.DEFAULT_SIZE,
+ GroupLayout.PREFERRED_SIZE);
+ pinVertical = mainPanelLayout.createSequentialGroup()
+ .addComponent(cardPinLabel).addPreferredGap(
+ LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(pinField, GroupLayout.PREFERRED_SIZE,
+ GroupLayout.DEFAULT_SIZE,
+ GroupLayout.PREFERRED_SIZE);
+ } else {
+ pinHorizontal
+ .addGroup(
+ mainPanelLayout
+ .createSequentialGroup()
+ .addComponent(cardPinLabel,
+ GroupLayout.PREFERRED_SIZE,
+ GroupLayout.DEFAULT_SIZE,
+ GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(
+ LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(pinField,
+ GroupLayout.PREFERRED_SIZE,
+ GroupLayout.DEFAULT_SIZE,
+ Short.MAX_VALUE))
+ .addComponent(pinsizeLabel,
+ GroupLayout.PREFERRED_SIZE,
+ GroupLayout.DEFAULT_SIZE,
+ GroupLayout.PREFERRED_SIZE);
+ pinVertical = mainPanelLayout.createParallelGroup(
+ GroupLayout.Alignment.BASELINE).addComponent(
+ cardPinLabel).addComponent(pinField);
+ }
+
+ mainPanelLayout.setHorizontalGroup(mainPanelLayout
+ .createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addGroup(infoHorizontal).addGroup(pinHorizontal));
+
+ mainPanelLayout
+ .setVerticalGroup(mainPanelLayout
+ .createSequentialGroup().addGroup(infoVertical)
+ .addPreferredGap(
+ LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(pinVertical).addPreferredGap(
+ LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(pinsizeLabel));
+
+ if (renderCancelButton) {
+ cancelButton.setFont(cancelButton.getFont().deriveFont(
+ cancelButton.getFont().getStyle()
+ & ~java.awt.Font.BOLD));
+ cancelButton.setText(getMessage(BUTTON_CANCEL));
+ cancelButton.setActionCommand(cancelCommand);
+ cancelButton.addActionListener(cancelListener);
+ }
+
+ renderVerifyPINDialogueButtonPanel();
+
+ updateMethodToRunAtResize("at.gv.egiz.bku.gui.BKUGUIImpl",
+ "renderVerifyPINDialogueButtonPanel");
+
+ if (windowCloseAdapter != null) {
+ windowCloseAdapter.registerListener(cancelListener, cancelCommand);
+ }
- @Override
- public void showEnterPIN(final PINSpec pinSpec, final int retries) {
- showEnterPIN(pinSpec, retries, TITLE_VERIFY_PINPAD, MESSAGE_ENTERPIN_PINPAD, null);
- }
+ primaryFocusHolder = pinField;
+
+ pinField.requestFocus();
+ contentPanel.validate();
+
+ resize();
- protected void showEnterPIN(final PINSpec pinSpec, final int retries, final String titleKey, final String messageKey, final Object[] messageParams) {
- log.debug("scheduling pinpad dialog");
+ }
+ });
+ }
- SwingUtilities.invokeLater(new Runnable() {
+ @SuppressWarnings("unchecked")
+ protected void updateMethodToRunAtResize(String className, String methodName) {
+
+ try {
+ Class<at.gv.egiz.bku.gui.BKUGUIImpl> thisClass = (Class<at.gv.egiz.bku.gui.BKUGUIImpl>) Class
+ .forName(className);
+ Method m = thisClass.getMethod(methodName);
+ methodToRunAtResize = m;
+ } catch (SecurityException e1) {
+ log.error("Unable to store rendering method.", e1);
+ } catch (NoSuchMethodException e1) {
+ log.error("Unable to store rendering method.", e1);
+ } catch (ClassNotFoundException e) {
+ log.error("Unable to store rendering method.", e);
+ }
- @Override
- public void run() {
+ }
- log.debug("[" + Thread.currentThread().getName() + "] show pinpad dialog");
+ public void renderVerifyPINDialogueButtonPanel() {
- mainPanel.removeAll();
- buttonPanel.removeAll();
+ GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
+ buttonPanel.setLayout(buttonPanelLayout);
- if (renderHeaderPanel) {
- if (retries < 0) {
- titleLabel.setText(getMessage(titleKey));
- } else {
- titleLabel.setText(getMessage(TITLE_RETRY));
- }
- }
+ GroupLayout.SequentialGroup buttonHorizontal = buttonPanelLayout
+ .createSequentialGroup().addComponent(okButton,
+ GroupLayout.PREFERRED_SIZE, buttonSize,
+ GroupLayout.PREFERRED_SIZE);
+ GroupLayout.Group buttonVertical;
- final JLabel infoLabel = new JLabel();
- if (retries < 0) {
- infoLabel.setFont(infoLabel.getFont().deriveFont(infoLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
- infoLabel.setText(MessageFormat.format(getMessage(messageKey), messageParams));
- helpMouseListener.setHelpTopic(HELP_PINPAD);
- helpKeyListener.setHelpTopic(HELP_PINPAD);
- } else {
- String retryPattern;
- if (retries == 1) {
- retryPattern = getMessage(MESSAGE_LAST_RETRY);
- } else {
- retryPattern = getMessage(MESSAGE_RETRIES);
- }
- infoLabel.setText(MessageFormat.format(retryPattern, new Object[]{String.valueOf(retries)}));
- infoLabel.setFont(infoLabel.getFont().deriveFont(infoLabel.getFont().getStyle() | java.awt.Font.BOLD));
- infoLabel.setForeground(ERROR_COLOR);
- helpMouseListener.setHelpTopic(HELP_RETRY);
- helpKeyListener.setHelpTopic(HELP_RETRY);
- }
+ if (renderCancelButton) {
- JLabel pinLabel = new JLabel();
- pinLabel.setFont(pinLabel.getFont().deriveFont(pinLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
- String pinName = getMessage(LABEL_PIN);
- pinLabel.setText(MessageFormat.format(pinName, new Object[]{pinSpec.getLocalizedName()}));
-
- JPasswordField pinpadPINField = new JPasswordField();
- pinpadPINField.setText("");
- pinpadPINField.setEnabled(false);
- pinpadPIN = pinpadPINField.getDocument();
-
- JLabel pinsizeLabel = new JLabel();
- pinsizeLabel.setFont(pinsizeLabel.getFont().deriveFont(pinsizeLabel.getFont().getStyle() & ~java.awt.Font.BOLD, pinsizeLabel.getFont().getSize()-2));
- pinsizeLabel.setText(MessageFormat.format(getMessage(LABEL_PINSIZE), pinSpec.getLocalizedLength()));
-
- GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
- mainPanel.setLayout(mainPanelLayout);
-
- GroupLayout.SequentialGroup infoHorizontal = mainPanelLayout.createSequentialGroup()
- .addComponent(infoLabel);
- GroupLayout.ParallelGroup infoVertical = mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addComponent(infoLabel);
-
- if (!renderHeaderPanel) {
- infoHorizontal
- .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
- .addComponent(switchFocusDummyLabel)
- .addComponent(helpLabel)
- ;
- infoVertical
- .addComponent(switchFocusDummyLabel)
- .addComponent(helpLabel)
- ;
- }
+ buttonHorizontal.addPreferredGap(
+ LayoutStyle.ComponentPlacement.RELATED).addComponent(
+ cancelButton, GroupLayout.PREFERRED_SIZE, buttonSize,
+ GroupLayout.PREFERRED_SIZE);
+ buttonVertical = buttonPanelLayout.createParallelGroup(
+ GroupLayout.Alignment.BASELINE).addComponent(okButton)
+ .addComponent(cancelButton);
+ } else {
+ buttonVertical = buttonPanelLayout.createSequentialGroup()
+ .addComponent(okButton);
+ }
- // align pinfield and pinsize to the right
- GroupLayout.Group pinHorizontal = mainPanelLayout.createParallelGroup(GroupLayout.Alignment.TRAILING);
- GroupLayout.SequentialGroup pinVertical = mainPanelLayout.createSequentialGroup();
-
- if (pinLabelPos == PinLabelPosition.ABOVE) {
- pinHorizontal
- .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addComponent(pinLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addComponent(pinpadPINField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- .addComponent(pinsizeLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE);
- pinVertical
- .addComponent(pinLabel)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(pinpadPINField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(pinsizeLabel);
- } else { // PinLabelPosition.LEFT
- pinHorizontal
- .addGroup(mainPanelLayout.createSequentialGroup()
- .addComponent(pinLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(pinpadPINField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- .addComponent(pinsizeLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE);
- pinVertical
- .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
- .addComponent(pinLabel)
- .addComponent(pinpadPINField))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(pinsizeLabel);
- }
+ buttonPanelLayout.setHorizontalGroup(buttonHorizontal);
+ buttonPanelLayout.setVerticalGroup(buttonVertical);
+
+ }
+
+ @Override
+ public void showEnterPINDirect(PinInfo pinSpec, int retries) {
+ if (retries < 0) {
+ showMessageDialog(TITLE_VERIFY_PINPAD,
+ MESSAGE_ENTERPIN_PINPAD_DIRECT, new Object[] {
+ pinSpec.getLocalizedName(),
+ pinSpec.getLocalizedLength() });
+ } else {
+ showMessageDialog(TITLE_RETRY, MESSAGE_RETRIES,
+ new Object[] { String.valueOf(retries) });
+ }
+ }
+
+ @Override
+ public void showEnterPIN(final PinInfo pinSpec, final int retries) {
+ showEnterPIN(pinSpec, retries, TITLE_VERIFY_PINPAD,
+ MESSAGE_ENTERPIN_PINPAD, null);
+ }
+
+ protected void showEnterPIN(final PinInfo pinSpec, final int retries,
+ final String titleKey, final String messageKey,
+ final Object[] messageParams) {
+ log.debug("Scheduling pinpad dialog.");
+
+ SwingUtilities.invokeLater(new Runnable() {
+
+ @Override
+ public void run() {
+
+ log.debug("[{}] show pinpad dialog.", Thread.currentThread().getName());
+
+ mainPanel.removeAll();
+ buttonPanel.removeAll();
+
+ // avoid that dummy label gains focus during load
+ switchFocusDummyLabel.setFocusable(false);
+
+ if (renderHeaderPanel) {
+ if (retries < 0) {
+ titleLabel.setText(getMessage(titleKey));
+ } else {
+ titleLabel.setText(getMessage(TITLE_RETRY));
+ }
+ }
+
+ infoLabel = new JLabel();
+ if (retries < 0) {
+ infoLabel.setFont(infoLabel.getFont().deriveFont(
+ infoLabel.getFont().getStyle()
+ & ~java.awt.Font.BOLD));
+ infoLabel.setText(MessageFormat.format(
+ getMessage(messageKey), messageParams));
+ helpListener.setHelpTopic(HELP_PINPAD);
+ } else {
+ String retryPattern;
+ if (retries == 1) {
+ retryPattern = getMessage(MESSAGE_LAST_RETRY);
+ } else {
+ retryPattern = getMessage(MESSAGE_RETRIES);
+ }
+ infoLabel.setText(MessageFormat.format(retryPattern,
+ new Object[] { String.valueOf(retries) }));
+ infoLabel.getAccessibleContext().setAccessibleName(
+ infoLabel.getText());
+ infoLabel.setFont(infoLabel.getFont()
+ .deriveFont(
+ infoLabel.getFont().getStyle()
+ | java.awt.Font.BOLD));
+ infoLabel.setForeground(ERROR_COLOR);
+ helpListener.setHelpTopic(HELP_RETRY);
+ }
+
+ pinLabel.setFont(pinLabel.getFont().deriveFont(
+ pinLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
+ String pinName = getMessage(LABEL_PIN);
+ pinLabel.setText(MessageFormat.format(pinName,
+ new Object[] { pinSpec.getLocalizedName() }));
+
+ pinpadPINField.setText("");
+ pinpadPINField.setEnabled(false);
+ pinpadPIN = pinpadPINField.getDocument();
+
+ pinsizeLabel.setFont(pinsizeLabel.getFont()
+ .deriveFont(
+ pinsizeLabel.getFont().getStyle()
+ & ~java.awt.Font.BOLD,
+ pinsizeLabel.getFont().getSize() - 2));
+ pinsizeLabel.setText(MessageFormat
+ .format(getMessage(LABEL_PINSIZE), pinSpec
+ .getLocalizedLength()));
+
+ GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
+ mainPanel.setLayout(mainPanelLayout);
+
+ GroupLayout.SequentialGroup infoHorizontal = mainPanelLayout
+ .createSequentialGroup().addComponent(infoLabel);
+ GroupLayout.ParallelGroup infoVertical = mainPanelLayout
+ .createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addComponent(infoLabel);
+
+ if (!renderHeaderPanel) {
+
+ if (helpListener.implementsListener()) {
+ infoHorizontal.addPreferredGap(
+ LayoutStyle.ComponentPlacement.UNRELATED, 0,
+ Short.MAX_VALUE).addComponent(helpLabel);
+ infoVertical.addComponent(helpLabel);
+ }
+ infoHorizontal.addComponent(switchFocusDummyLabel);
+ infoVertical.addComponent(switchFocusDummyLabel);
+
+ }
+
+ // align pinfield and pinsize to the right
+ GroupLayout.Group pinHorizontal = mainPanelLayout
+ .createParallelGroup(GroupLayout.Alignment.TRAILING);
+ GroupLayout.SequentialGroup pinVertical = mainPanelLayout
+ .createSequentialGroup();
+
+ if (pinLabelPos == PinLabelPosition.ABOVE) {
+ pinHorizontal.addGroup(
+ mainPanelLayout.createParallelGroup(
+ GroupLayout.Alignment.LEADING)
+ .addComponent(pinLabel,
+ GroupLayout.PREFERRED_SIZE,
+ GroupLayout.DEFAULT_SIZE,
+ GroupLayout.PREFERRED_SIZE)
+ .addComponent(pinpadPINField,
+ GroupLayout.PREFERRED_SIZE,
+ GroupLayout.DEFAULT_SIZE,
+ Short.MAX_VALUE)).addComponent(
+ pinsizeLabel, GroupLayout.PREFERRED_SIZE,
+ GroupLayout.DEFAULT_SIZE,
+ GroupLayout.PREFERRED_SIZE);
+ pinVertical.addComponent(pinLabel).addPreferredGap(
+ LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(pinpadPINField,
+ GroupLayout.PREFERRED_SIZE,
+ GroupLayout.DEFAULT_SIZE,
+ GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(
+ LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(pinsizeLabel);
+ } else { // PinLabelPosition.LEFT
+ pinHorizontal
+ .addGroup(
+ mainPanelLayout
+ .createSequentialGroup()
+ .addComponent(pinLabel,
+ GroupLayout.PREFERRED_SIZE,
+ GroupLayout.DEFAULT_SIZE,
+ GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(
+ LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(pinpadPINField,
+ GroupLayout.PREFERRED_SIZE,
+ GroupLayout.DEFAULT_SIZE,
+ Short.MAX_VALUE))
+ .addComponent(pinsizeLabel,
+ GroupLayout.PREFERRED_SIZE,
+ GroupLayout.DEFAULT_SIZE,
+ GroupLayout.PREFERRED_SIZE);
+ pinVertical.addGroup(
+ mainPanelLayout.createParallelGroup(
+ GroupLayout.Alignment.BASELINE)
+ .addComponent(pinLabel).addComponent(
+ pinpadPINField)).addPreferredGap(
+ LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(pinsizeLabel);
+ }
+
+ mainPanelLayout.setHorizontalGroup(mainPanelLayout
+ .createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addGroup(infoHorizontal).addGroup(pinHorizontal));
+
+ mainPanelLayout
+ .setVerticalGroup(mainPanelLayout
+ .createSequentialGroup().addGroup(infoVertical)
+ .addPreferredGap(
+ LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(pinVertical));
+
+ infoLabel.setFocusable(true);
+
+ infoLabel.addFocusListener(new FocusAdapter() {
+
+ @Override
+ public void focusGained(FocusEvent e) {
+
+ // focus has been set accordingly - re-enable dummy
+ // label
+ switchFocusDummyLabel.setFocusable(true);
+ }
+
+ });
+
+ String accessibleData = cutOffHTMLTags(infoLabel.getText())
+ + cutOffHTMLTags(pinLabel.getText())
+ + cutOffHTMLTags(pinsizeLabel.getText());
+
+ infoLabel.getAccessibleContext().setAccessibleName(
+ accessibleData);
+ infoLabel.getAccessibleContext().setAccessibleDescription(
+ accessibleData);
+
+ primaryFocusHolder = infoLabel;
+
+ // delete potentially stored method to be run as nothing has to
+ // be re-rendered
+ methodToRunAtResize = null;
+
+ infoLabel.requestFocus();
+
+ contentPanel.validate();
+
+ resize();
+ }
+ });
+ }
+
+ // simple utility method to retrieve plain text from HTML
+ protected String cutOffHTMLTags(String str) {
+
+ char[] arr = str.toCharArray();
+ StringBuffer result = new StringBuffer();
+ boolean inTag = false;
- mainPanelLayout.setHorizontalGroup(
- mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addGroup(infoHorizontal)
- .addGroup(pinHorizontal));
+ for (int i = 0; i < arr.length; i++) {
- mainPanelLayout.setVerticalGroup(
- mainPanelLayout.createSequentialGroup()
- .addGroup(infoVertical)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(pinVertical));
+ char c = arr[i];
- contentPanel.validate();
- }
- });
- }
+ if (c == '<') {
+ inTag = true;
+ }
+
+ if (!inTag) {
+
+ result.append(c);
+ }
+
+ if (c == '>') {
+
+ inTag = false;
+ }
+ }
+
+ return result.toString();
+ }
@Override
- public void showSignatureDataDialog(PINSpec spec,
+ public void showSignatureDataDialog(PinInfo spec,
final ActionListener enterPINListener, final String enterPINCommand,
final ActionListener cancelListener, final String cancelCommand,
final ActionListener hashdataListener, final String hashdataCommand) {
- log.debug("scheduling signature-data dialog");
+ log.debug("Scheduling signature-data dialog.");
- SwingUtilities.invokeLater(new Runnable() {
+ SwingUtilities.invokeLater(new Runnable() {
- @Override
- public void run() {
+ @Override
+ public void run() {
- log.debug("[" + Thread.currentThread().getName() + "] show signature-data dialog");
+ log.debug("[{}] show signature-data dialog.",
+ Thread.currentThread().getName());
- mainPanel.removeAll();
- buttonPanel.removeAll();
+ mainPanel.removeAll();
+ buttonPanel.removeAll();
- if (renderHeaderPanel) {
- titleLabel.setText(getMessage(TITLE_SIGNATURE_DATA));
- }
+ // specify policy to ensure correct focus traversal
+ if (useFocusTraversalPolicy) {
- final JLabel infoLabel = new JLabel();
- infoLabel.setFont(infoLabel.getFont().deriveFont(infoLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
- if (shortText) {
- infoLabel.setText(getMessage(MESSAGE_HASHDATALINK_TINY));
- } else {
- infoLabel.setText(getMessage(MESSAGE_HASHDATALINK));
- }
- infoLabel.setFocusable(true);
- infoLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
- infoLabel.setForeground(HYPERLINK_COLOR);
- infoLabel.addMouseListener(new MouseAdapter() {
+ contentPanel.setFocusCycleRoot(true);
+ contentPanel
+ .setFocusTraversalPolicy(new AdvancedShowSigDataGUIFocusTraversalPolicy());
+ }
- @Override
- public void mouseClicked(MouseEvent me) {
- ActionEvent e = new ActionEvent(this, ActionEvent.ACTION_PERFORMED, hashdataCommand);
- hashdataListener.actionPerformed(e);
- }
- });
+ // avoid that dummy label gains focus during load
+ switchFocusDummyLabel.setFocusable(false);
- infoLabel.addKeyListener(new KeyAdapter() {
+ if (renderHeaderPanel) {
+ titleLabel.setText(getMessage(TITLE_SIGNATURE_DATA));
+ }
- @Override
- public void keyPressed(KeyEvent e) {
+ infoLabel = new JLabel();
+ infoLabel.setFont(infoLabel.getFont().deriveFont(
+ infoLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
+ if (shortText) {
+ infoLabel.setText(getMessage(MESSAGE_HASHDATALINK_TINY));
+ } else {
+ infoLabel.setText(getMessage(MESSAGE_HASHDATALINK));
+ }
+ infoLabel.getAccessibleContext().setAccessibleName(
+ infoLabel.getText());
+ infoLabel.setFocusable(true);
- if(e.getKeyCode() == KeyEvent.VK_ENTER) {
- ActionEvent e1 = new ActionEvent(this, ActionEvent.ACTION_PERFORMED, hashdataCommand);
- hashdataListener.actionPerformed(e1);
- }
- }
+ infoLabel.setToolTipText(getMessage(SIGDATA_TOOLTIPTEXT));
+ infoLabel.getAccessibleContext().setAccessibleDescription(
+ getMessage(SIGDATA_TOOLTIPTEXT));
+ infoLabel.getAccessibleContext().setAccessibleName(
+ getMessage(SIGDATA_TOOLTIPTEXT));
- });
+ infoLabel.setCursor(Cursor
+ .getPredefinedCursor(Cursor.HAND_CURSOR));
+ infoLabel.setForeground(HYPERLINK_COLOR);
+ infoLabel.addMouseListener(new MouseAdapter() {
- infoLabel.addFocusListener(new FocusAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent me) {
+ ActionEvent e = new ActionEvent(this,
+ ActionEvent.ACTION_PERFORMED, hashdataCommand);
+ hashdataListener.actionPerformed(e);
+ }
+ });
- @Override
- public void focusGained(FocusEvent e) {
+ infoLabel.addKeyListener(new KeyAdapter() {
- if (shortText) {
- infoLabel.setText(getMessage(MESSAGE_HASHDATALINK_TINY_FOCUS));
- } else {
- infoLabel.setText(getMessage(MESSAGE_HASHDATALINK_FOCUS));
- }
- }
+ @Override
+ public void keyPressed(KeyEvent e) {
- @Override
- public void focusLost(FocusEvent e) {
+ if (e.getKeyCode() == KeyEvent.VK_ENTER) {
+ ActionEvent e1 = new ActionEvent(this,
+ ActionEvent.ACTION_PERFORMED,
+ hashdataCommand);
+ hashdataListener.actionPerformed(e1);
+ }
+ }
- if (shortText) {
- infoLabel.setText(getMessage(MESSAGE_HASHDATALINK_TINY));
- } else {
- infoLabel.setText(getMessage(MESSAGE_HASHDATALINK));
- }
+ });
- }
+ infoLabel.addFocusListener(new FocusAdapter() {
- });
+ @Override
+ public void focusGained(FocusEvent e) {
- helpMouseListener.setHelpTopic(HELP_SIGNPIN);
- helpKeyListener.setHelpTopic(HELP_SIGNPIN);
+ infoLabel.setBorder(sigDataFocusBorder);
+ }
- //TODO message panel
+ @Override
+ public void focusLost(FocusEvent e) {
-// String msgPattern = getMessage(MESSAGE_ENTERPIN_PINPAD);
-// String msg = MessageFormat.format(msgPattern, new Object[] {
-// pinSpec.getLocalizedName(), pinSpec.getLocalizedLength() });
-//
-// JLabel msgLabel = new JLabel();
-// msgLabel.setFont(msgLabel.getFont().deriveFont(msgLabel.getFont().getStyle() & ~Font.BOLD));
-// msgLabel.setText(msg);
-
- GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
- mainPanel.setLayout(mainPanelLayout);
-
- GroupLayout.SequentialGroup infoHorizontal = mainPanelLayout.createSequentialGroup()
- .addComponent(infoLabel);
- GroupLayout.ParallelGroup infoVertical = mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addComponent(infoLabel);
-
- if (!renderHeaderPanel) {
- infoHorizontal
- .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
- .addComponent(switchFocusDummyLabel)
- .addComponent(helpLabel)
- ;
- infoVertical
- .addComponent(switchFocusDummyLabel)
- .addComponent(helpLabel)
- ;
- }
-
- mainPanelLayout.setHorizontalGroup(
- infoHorizontal);
-// mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
-// .addGroup(infoHorizontal)
-// .addComponent(msgLabel));
-
- mainPanelLayout.setVerticalGroup(
- infoVertical);
-// mainPanelLayout.createSequentialGroup()
-// .addGroup(infoVertical)
-// .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
-// .addComponent(msgLabel));
-
-
- GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
- buttonPanel.setLayout(buttonPanelLayout);
-
- GroupLayout.SequentialGroup buttonHorizontal = buttonPanelLayout.createSequentialGroup();
- GroupLayout.Group buttonVertical;
-
- JButton enterPINButton = new JButton();
- enterPINButton.setFont(enterPINButton.getFont().deriveFont(enterPINButton.getFont().getStyle() & ~java.awt.Font.BOLD));
- enterPINButton.setText(getMessage(BUTTON_SIGN));
- enterPINButton.setActionCommand(enterPINCommand);
- enterPINButton.addActionListener(enterPINListener);
-
- if (renderCancelButton) {
- JButton cancelButton = new JButton();
- cancelButton.setFont(cancelButton.getFont().deriveFont(cancelButton.getFont().getStyle() & ~java.awt.Font.BOLD));
- cancelButton.setText(getMessage(BUTTON_CANCEL));
- cancelButton.setActionCommand(cancelCommand);
- cancelButton.addActionListener(cancelListener);
-
- buttonHorizontal
- .addComponent(enterPINButton, GroupLayout.PREFERRED_SIZE, buttonSize, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(cancelButton, GroupLayout.PREFERRED_SIZE, buttonSize, GroupLayout.PREFERRED_SIZE)
- ;
- buttonVertical = buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
- .addComponent(enterPINButton)
- .addComponent(cancelButton)
- ;
- } else {
- buttonHorizontal
- .addComponent(enterPINButton, GroupLayout.PREFERRED_SIZE, buttonSize, GroupLayout.PREFERRED_SIZE)
- ;
- buttonVertical = buttonPanelLayout.createSequentialGroup()
- .addComponent(enterPINButton)
- ;
- }
-
- buttonPanelLayout.setHorizontalGroup(buttonHorizontal);
- buttonPanelLayout.setVerticalGroup(buttonVertical);
-
- contentPanel.validate();
+ infoLabel.setBorder(BorderFactory.createEmptyBorder());
+ }
+
+ });
+
+ helpListener.setHelpTopic(HELP_SIGNPIN);
+
+ GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
+ mainPanel.setLayout(mainPanelLayout);
+
+ GroupLayout.SequentialGroup infoHorizontal = mainPanelLayout
+ .createSequentialGroup().addComponent(infoLabel);
+ GroupLayout.ParallelGroup infoVertical = mainPanelLayout
+ .createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addComponent(infoLabel);
+
+ if (!renderHeaderPanel) {
+
+ if (helpListener.implementsListener()) {
+ infoHorizontal.addPreferredGap(
+ LayoutStyle.ComponentPlacement.UNRELATED, 0,
+ Short.MAX_VALUE).addComponent(helpLabel);
+ infoVertical.addComponent(helpLabel);
+ }
+ infoHorizontal.addComponent(switchFocusDummyLabel);
+ infoVertical.addComponent(switchFocusDummyLabel);
+
+ }
+
+ mainPanelLayout.setHorizontalGroup(infoHorizontal);
+ mainPanelLayout.setVerticalGroup(infoVertical);
+
+ enterPINButton.setFont(enterPINButton.getFont().deriveFont(
+ enterPINButton.getFont().getStyle()
+ & ~java.awt.Font.BOLD));
+ enterPINButton.setText(getMessage(BUTTON_SIGN));
+ enterPINButton.setActionCommand(enterPINCommand);
+ enterPINButton.addActionListener(enterPINListener);
+
+ enterPINButton.addFocusListener(new FocusAdapter() {
+
+ @Override
+ public void focusGained(FocusEvent e) {
+
+ // focus has been set accordingly - re-enable dummy
+ // label
+ switchFocusDummyLabel.setFocusable(true);
+ }
+
+ });
+
+ if (renderCancelButton) {
+ cancelButton.setFont(cancelButton.getFont().deriveFont(
+ cancelButton.getFont().getStyle()
+ & ~java.awt.Font.BOLD));
+ cancelButton.setText(getMessage(BUTTON_CANCEL));
+ cancelButton.setActionCommand(cancelCommand);
+ cancelButton.addActionListener(cancelListener);
+ }
+
+ updateMethodToRunAtResize("at.gv.egiz.bku.gui.BKUGUIImpl",
+ "renderShowSignatureDataDialogButtonPanel");
+
+ renderShowSignatureDataDialogButtonPanel();
+
+ if (windowCloseAdapter != null) {
+ windowCloseAdapter.registerListener(cancelListener, cancelCommand);
}
- });
- }
- @Override
- public void correctionButtonPressed() {
- log.debug("[" + Thread.currentThread().getName() + "] correction button pressed");
-
- if (pinpadPIN != null) {
- try {
- pinpadPIN.remove(0, 1);
- } catch (BadLocationException ex) {
- }
- }
- }
+ primaryFocusHolder = enterPINButton;
- @Override
- public void allKeysCleared() {
- log.debug("[" + Thread.currentThread().getName() + "] all keys cleared");
-
- if (pinpadPIN != null) {
- try {
- pinpadPIN.remove(0, pinpadPIN.getLength());
- } catch (BadLocationException ex) {
- }
- }
- }
+ enterPINButton.requestFocus();
- @Override
- public void validKeyPressed() {
- log.debug("[" + Thread.currentThread().getName() + "] valid key pressed");
-
- if (pinpadPIN != null) {
- try {
- pinpadPIN.insertString(0, "*", null);
- } catch (BadLocationException ex) {
- }
- }
- }
+ contentPanel.validate();
- @Override
- public void showSignaturePINDialog(final PINSpec pinSpec, final int numRetries,
+ resize();
+ }
+ });
+ }
+
+ public void renderShowSignatureDataDialogButtonPanel() {
+
+ GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
+ buttonPanel.setLayout(buttonPanelLayout);
+
+ GroupLayout.SequentialGroup buttonHorizontal = buttonPanelLayout
+ .createSequentialGroup();
+ GroupLayout.Group buttonVertical;
+
+ if (renderCancelButton) {
+
+ buttonHorizontal.addComponent(enterPINButton,
+ GroupLayout.PREFERRED_SIZE, buttonSize,
+ GroupLayout.PREFERRED_SIZE).addPreferredGap(
+ LayoutStyle.ComponentPlacement.RELATED).addComponent(
+ cancelButton, GroupLayout.PREFERRED_SIZE, buttonSize,
+ GroupLayout.PREFERRED_SIZE);
+ buttonVertical = buttonPanelLayout.createParallelGroup(
+ GroupLayout.Alignment.BASELINE)
+ .addComponent(enterPINButton).addComponent(cancelButton);
+ } else {
+ buttonHorizontal.addComponent(enterPINButton,
+ GroupLayout.PREFERRED_SIZE, buttonSize,
+ GroupLayout.PREFERRED_SIZE);
+ buttonVertical = buttonPanelLayout.createSequentialGroup()
+ .addComponent(enterPINButton);
+ }
+
+ buttonPanelLayout.setHorizontalGroup(buttonHorizontal);
+ buttonPanelLayout.setVerticalGroup(buttonVertical);
+
+ }
+
+ @Override
+ public void correctionButtonPressed() {
+ log.debug("[{}] Correction button pressed.", Thread.currentThread().getName());
+
+ if (pinpadPIN != null) {
+ try {
+ pinpadPIN.remove(0, 1);
+ } catch (BadLocationException ex) {
+ }
+ }
+ }
+
+ @Override
+ public void allKeysCleared() {
+ log.debug("[{}] All keys cleared.", Thread.currentThread().getName());
+
+ if (pinpadPIN != null) {
+ try {
+ pinpadPIN.remove(0, pinpadPIN.getLength());
+ } catch (BadLocationException ex) {
+ }
+ }
+ }
+
+ @Override
+ public void validKeyPressed() {
+ log.debug("[{}] Valid key pressed.", Thread.currentThread().getName());
+
+ if (pinpadPIN != null) {
+ try {
+ pinpadPIN.insertString(0, "*", null);
+ } catch (BadLocationException ex) {
+ }
+ }
+ }
+
+ @Override
+ public void showSignaturePINDialog(final PinInfo pinSpec, final int numRetries,
final ActionListener signListener, final String signCommand,
final ActionListener cancelListener, final String cancelCommand,
final ActionListener hashdataListener, final String hashdataCommand) {
- log.debug("scheduling signature-pin dialog");
-
- SwingUtilities.invokeLater(new Runnable() {
-
- @Override
- public void run() {
-
- log.debug("[" + Thread.currentThread().getName() + "] show signature-pin dialog");
-
- mainPanel.removeAll();
- buttonPanel.removeAll();
-
- if (renderHeaderPanel) {
- if (numRetries < 0) {
- titleLabel.setText(getMessage(TITLE_SIGN));
- } else {
- titleLabel.setText(getMessage(TITLE_RETRY));
- }
- }
-
- final JLabel infoLabel = new JLabel();
- if (numRetries < 0) {
- infoLabel.setFont(infoLabel.getFont().deriveFont(infoLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
- if (shortText) {
- infoLabel.setText(getMessage(MESSAGE_HASHDATALINK_TINY));
- } else {
- infoLabel.setText(getMessage(MESSAGE_HASHDATALINK));
- }
- infoLabel.setFocusable(true);
- infoLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
- infoLabel.setForeground(HYPERLINK_COLOR);
- infoLabel.addMouseListener(new MouseAdapter() {
-
- @Override
- public void mouseClicked(MouseEvent me) {
- ActionEvent e = new ActionEvent(this, ActionEvent.ACTION_PERFORMED, hashdataCommand);
- hashdataListener.actionPerformed(e);
- }
- });
-
- infoLabel.addKeyListener(new KeyAdapter() {
-
- @Override
- public void keyPressed(KeyEvent e) {
-
- if(e.getKeyCode() == KeyEvent.VK_ENTER) {
- ActionEvent e1 = new ActionEvent(this, ActionEvent.ACTION_PERFORMED, hashdataCommand);
- hashdataListener.actionPerformed(e1);
- }
- }
-
- });
-
- infoLabel.addFocusListener(new FocusAdapter() {
-
- @Override
- public void focusGained(FocusEvent e) {
-
-
- if (shortText) {
- infoLabel.setText(getMessage(MESSAGE_HASHDATALINK_TINY_FOCUS));
- } else {
- infoLabel.setText(getMessage(MESSAGE_HASHDATALINK_FOCUS));
- }
- }
-
- @Override
- public void focusLost(FocusEvent e) {
-
-
- if (shortText) {
- infoLabel.setText(getMessage(MESSAGE_HASHDATALINK_TINY));
- } else {
- infoLabel.setText(getMessage(MESSAGE_HASHDATALINK));
- }
-
- }
-
- });
-
- helpMouseListener.setHelpTopic(HELP_SIGNPIN);
- helpKeyListener.setHelpTopic(HELP_SIGNPIN);
- } else {
- String retryPattern;
- if (numRetries < 2) {
- retryPattern = getMessage(MESSAGE_LAST_RETRY);
- } else {
- retryPattern = getMessage(MESSAGE_RETRIES);
- }
- infoLabel.setFocusable(true);
- infoLabel.setText(MessageFormat.format(retryPattern, new Object[]{String.valueOf(numRetries)}));
- infoLabel.setFont(infoLabel.getFont().deriveFont(infoLabel.getFont().getStyle() | java.awt.Font.BOLD));
- infoLabel.setForeground(ERROR_COLOR);
- helpMouseListener.setHelpTopic(HELP_RETRY);
- helpKeyListener.setHelpTopic(HELP_RETRY);
- }
-
- JButton signButton = new JButton();
- signButton.setFont(signButton.getFont().deriveFont(signButton.getFont().getStyle() & ~java.awt.Font.BOLD));
- signButton.setText(getMessage(BUTTON_SIGN));
- signButton.setEnabled(pinSpec.getMinLength() <= 0);
- signButton.setActionCommand(signCommand);
- signButton.addActionListener(signListener);
-
- JLabel signPinLabel = new JLabel();
- signPinLabel.setFont(signPinLabel.getFont().deriveFont(signPinLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
- String pinLabel = getMessage(LABEL_PIN);
- signPinLabel.setText(MessageFormat.format(pinLabel, new Object[]{pinSpec.getLocalizedName()}));
-
- pinField = new JPasswordField();
- pinField.setText("");
- pinField.setDocument(new PINDocument(pinSpec.getMinLength(), pinSpec.getMaxLength(), pinSpec.getRexepPattern(), signButton));
- pinField.setActionCommand(signCommand);
- pinField.addActionListener(new ActionListener() {
-
- @Override
- public void actionPerformed(ActionEvent e) {
- if (pinField.getPassword().length >= pinSpec.getMinLength()) {
- signListener.actionPerformed(e);
- }
- }
- });
-
-
- JLabel pinsizeLabel = new JLabel();
- pinsizeLabel.setFont(pinsizeLabel.getFont().deriveFont(pinsizeLabel.getFont().getStyle() & ~java.awt.Font.BOLD, pinsizeLabel.getFont().getSize()-2));
- pinsizeLabel.setText(MessageFormat.format(getMessage(LABEL_PINSIZE), pinSpec.getLocalizedLength()));
-
- GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
- mainPanel.setLayout(mainPanelLayout);
-
- GroupLayout.SequentialGroup infoHorizontal = mainPanelLayout.createSequentialGroup()
- .addComponent(infoLabel);
- GroupLayout.ParallelGroup infoVertical = mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addComponent(infoLabel);
-
- if (!renderHeaderPanel) {
- infoHorizontal
- .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
- .addComponent(switchFocusDummyLabel)
- .addComponent(helpLabel)
- ;
- infoVertical
- .addComponent(switchFocusDummyLabel)
- .addComponent(helpLabel)
- ;
- }
-
- // align pinfield and pinsize to the right
- GroupLayout.Group pinHorizontal = mainPanelLayout.createParallelGroup(GroupLayout.Alignment.TRAILING);
- GroupLayout.SequentialGroup pinVertical = mainPanelLayout.createSequentialGroup();
-
- if (pinLabelPos == PinLabelPosition.ABOVE) {
- pinHorizontal
- .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addComponent(signPinLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addComponent(pinField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- .addComponent(pinsizeLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE);
- pinVertical
- .addComponent(signPinLabel)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(pinField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(pinsizeLabel);
- } else { // PinLabelPosition.LEFT
- pinHorizontal
- .addGroup(mainPanelLayout.createSequentialGroup()
- .addComponent(signPinLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(pinField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- .addComponent(pinsizeLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE);
- pinVertical
- .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
- .addComponent(signPinLabel)
- .addComponent(pinField))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(pinsizeLabel);
- }
-
- mainPanelLayout.setHorizontalGroup(
- mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addGroup(infoHorizontal)
- .addGroup(pinHorizontal));
-
- mainPanelLayout.setVerticalGroup(
- mainPanelLayout.createSequentialGroup()
- .addGroup(infoVertical)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(pinVertical));
-
- GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
- buttonPanel.setLayout(buttonPanelLayout);
-
- GroupLayout.SequentialGroup buttonHorizontal = buttonPanelLayout.createSequentialGroup();
- GroupLayout.Group buttonVertical;
-
- if (renderCancelButton) {
- JButton cancelButton = new JButton();
- cancelButton.setFont(cancelButton.getFont().deriveFont(cancelButton.getFont().getStyle() & ~java.awt.Font.BOLD));
- cancelButton.setText(getMessage(BUTTON_CANCEL));
- cancelButton.setActionCommand(cancelCommand);
- cancelButton.addActionListener(cancelListener);
-
- buttonHorizontal
- .addComponent(signButton, GroupLayout.PREFERRED_SIZE, buttonSize, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(cancelButton, GroupLayout.PREFERRED_SIZE, buttonSize, GroupLayout.PREFERRED_SIZE)
- ;
- buttonVertical = buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
- .addComponent(signButton)
- .addComponent(cancelButton)
- ;
- } else {
- buttonHorizontal
- .addComponent(signButton, GroupLayout.PREFERRED_SIZE, buttonSize, GroupLayout.PREFERRED_SIZE)
- ;
- buttonVertical = buttonPanelLayout.createSequentialGroup()
- .addComponent(signButton)
- ;
- }
-
- buttonPanelLayout.setHorizontalGroup(buttonHorizontal);
- buttonPanelLayout.setVerticalGroup(buttonVertical);
-
-// pinField.requestFocusInWindow();
-// helpLabel.requestFocus();
- pinField.requestFocus();
- contentPanel.validate();
-
- }
- });
- }
+ log.debug("Scheduling signature-pin dialog.");
+
+ SwingUtilities.invokeLater(new Runnable() {
+
+ @Override
+ public void run() {
+
+ log.debug("[{}] Show signature-pin dialog.", Thread.currentThread().getName());
+
+ mainPanel.removeAll();
+ buttonPanel.removeAll();
+
+ // specify policy to ensure correct focus traversal
+ if (useFocusTraversalPolicy) {
+
+ contentPanel.setFocusCycleRoot(true);
+ contentPanel
+ .setFocusTraversalPolicy(new AdvancedSigPinGUIFocusTraversalPolicy());
+ }
+
+ // avoid that dummy label gains focus during load
+ switchFocusDummyLabel.setFocusable(false);
+
+ if (renderHeaderPanel) {
+ if (numRetries < 0) {
+ titleLabel.setText(getMessage(TITLE_SIGN));
+ } else {
+ titleLabel.setText(getMessage(TITLE_RETRY));
+ }
+ }
+
+ infoLabel = new JLabel();
+ if (numRetries < 0) {
+ infoLabel.setFont(infoLabel.getFont().deriveFont(
+ infoLabel.getFont().getStyle()
+ & ~java.awt.Font.BOLD));
+ if (shortText) {
+ infoLabel
+ .setText(getMessage(MESSAGE_HASHDATALINK_TINY));
+ } else {
+ infoLabel.setText(getMessage(MESSAGE_HASHDATALINK));
+ }
+
+ infoLabel.setToolTipText(getMessage(SIGDATA_TOOLTIPTEXT));
+ infoLabel.getAccessibleContext().setAccessibleDescription(
+ getMessage(SIGDATA_TOOLTIPTEXT));
+ infoLabel.getAccessibleContext().setAccessibleName(
+ getMessage(SIGDATA_TOOLTIPTEXT));
+
+ infoLabel.setFocusable(true);
+ infoLabel.setCursor(Cursor
+ .getPredefinedCursor(Cursor.HAND_CURSOR));
+ infoLabel.setForeground(HYPERLINK_COLOR);
+ infoLabel.addMouseListener(new MouseAdapter() {
+
+ @Override
+ public void mouseClicked(MouseEvent me) {
+ ActionEvent e = new ActionEvent(this,
+ ActionEvent.ACTION_PERFORMED,
+ hashdataCommand);
+ hashdataListener.actionPerformed(e);
+ }
+ });
+
+ infoLabel.addKeyListener(new KeyAdapter() {
+
+ @Override
+ public void keyPressed(KeyEvent e) {
+
+ if (e.getKeyCode() == KeyEvent.VK_ENTER) {
+ ActionEvent e1 = new ActionEvent(this,
+ ActionEvent.ACTION_PERFORMED,
+ hashdataCommand);
+ hashdataListener.actionPerformed(e1);
+ }
+ }
+
+ });
+
+ infoLabel.addFocusListener(new FocusAdapter() {
+
+ @Override
+ public void focusGained(FocusEvent e) {
+
+ infoLabel.setBorder(sigDataFocusBorder);
+ }
+
+ @Override
+ public void focusLost(FocusEvent e) {
+
+ infoLabel.setBorder(BorderFactory
+ .createEmptyBorder());
+ }
+
+ });
+
+ helpListener.setHelpTopic(HELP_SIGNPIN);
+ } else {
+ String retryPattern;
+ if (numRetries < 2) {
+ retryPattern = getMessage(MESSAGE_LAST_RETRY);
+ } else {
+ retryPattern = getMessage(MESSAGE_RETRIES);
+ }
+ infoLabel.setFocusable(true);
+ infoLabel.setText(MessageFormat.format(retryPattern,
+ new Object[] { String.valueOf(numRetries) }));
+
+ infoLabel.setToolTipText(getMessage(SIGDATA_TOOLTIPTEXT));
+ infoLabel.getAccessibleContext().setAccessibleDescription(
+ getMessage(SIGDATA_TOOLTIPTEXT));
+ infoLabel.getAccessibleContext().setAccessibleName(
+ getMessage(SIGDATA_TOOLTIPTEXT));
+
+ infoLabel.setFont(infoLabel.getFont()
+ .deriveFont(
+ infoLabel.getFont().getStyle()
+ | java.awt.Font.BOLD));
+ infoLabel.setForeground(ERROR_COLOR);
+ helpListener.setHelpTopic(HELP_RETRY);
+ }
+
+ signButton.setFont(signButton.getFont().deriveFont(
+ signButton.getFont().getStyle() & ~java.awt.Font.BOLD));
+ signButton.setText(getMessage(BUTTON_SIGN));
+ signButton.setEnabled(pinSpec.getMinLength() <= 0);
+ signButton.setActionCommand(signCommand);
+ signButton.addActionListener(signListener);
+
+ signPinLabel.setFont(signPinLabel.getFont()
+ .deriveFont(
+ signPinLabel.getFont().getStyle()
+ & ~java.awt.Font.BOLD));
+ String pinLabel = getMessage(LABEL_PIN);
+ signPinLabel.setText(MessageFormat.format(pinLabel,
+ new Object[] { pinSpec.getLocalizedName() }));
+
+ pinField = new JPasswordField();
+ pinField.setText("");
+ pinField.setName("PINField");
+ pinField.setDocument(new PINDocument(pinSpec.getMinLength(),
+ pinSpec.getMaxLength(), pinSpec.getRexepPattern(),
+ signButton));
+ pinField.setActionCommand(signCommand);
+ pinField.addActionListener(new ActionListener() {
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ if (pinField.getPassword().length >= pinSpec
+ .getMinLength()) {
+ signListener.actionPerformed(e);
+ }
+ }
+ });
+
+ // FIXME: For some reason, the switchFocusDummyLabel obtains the
+ // focus even
+ // if the pinField requests the focus. Therefore, the
+ // switchFocusDummyLabel is
+ // deactivated first and enabled only after the pinField has
+ // obtained the focus
+ pinField.addFocusListener(new FocusAdapter() {
+
+ @Override
+ public void focusGained(FocusEvent e) {
+
+ // focus has been set accordingly - re-enable dummy
+ // label
+ switchFocusDummyLabel.setFocusable(true);
+ }
+
+ });
+
+ pinsizeLabel.setFont(pinsizeLabel.getFont()
+ .deriveFont(
+ pinsizeLabel.getFont().getStyle()
+ & ~java.awt.Font.BOLD,
+ pinsizeLabel.getFont().getSize() - 2));
+ pinsizeLabel.setText(MessageFormat
+ .format(getMessage(LABEL_PINSIZE), pinSpec
+ .getLocalizedLength()));
+
+ pinField.getAccessibleContext().setAccessibleDescription(
+ infoLabel.getText() + signPinLabel.getText()
+ + pinsizeLabel.getText());
+
+ GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
+ mainPanel.setLayout(mainPanelLayout);
+
+ GroupLayout.SequentialGroup infoHorizontal = mainPanelLayout
+ .createSequentialGroup().addComponent(infoLabel);
+ GroupLayout.ParallelGroup infoVertical = mainPanelLayout
+ .createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addComponent(infoLabel);
+
+ if (!renderHeaderPanel) {
+
+ if (helpListener.implementsListener()) {
+ infoHorizontal.addPreferredGap(
+ LayoutStyle.ComponentPlacement.UNRELATED, 0,
+ Short.MAX_VALUE).addComponent(helpLabel);
+ infoVertical.addComponent(helpLabel);
+ }
+ infoHorizontal.addComponent(switchFocusDummyLabel);
+ infoVertical.addComponent(switchFocusDummyLabel);
+
+ }
+
+ // align pinfield and pinsize to the right
+ GroupLayout.Group pinHorizontal = mainPanelLayout
+ .createParallelGroup(GroupLayout.Alignment.TRAILING);
+ GroupLayout.SequentialGroup pinVertical = mainPanelLayout
+ .createSequentialGroup();
+
+ if (pinLabelPos == PinLabelPosition.ABOVE) {
+ pinHorizontal.addGroup(
+ mainPanelLayout.createParallelGroup(
+ GroupLayout.Alignment.LEADING)
+ .addComponent(signPinLabel,
+ GroupLayout.PREFERRED_SIZE,
+ GroupLayout.DEFAULT_SIZE,
+ GroupLayout.PREFERRED_SIZE)
+ .addComponent(pinField,
+ GroupLayout.PREFERRED_SIZE,
+ GroupLayout.DEFAULT_SIZE,
+ Short.MAX_VALUE)).addComponent(
+ pinsizeLabel, GroupLayout.PREFERRED_SIZE,
+ GroupLayout.DEFAULT_SIZE,
+ GroupLayout.PREFERRED_SIZE);
+ pinVertical.addComponent(signPinLabel).addPreferredGap(
+ LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(pinField, GroupLayout.PREFERRED_SIZE,
+ GroupLayout.DEFAULT_SIZE,
+ GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(
+ LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(pinsizeLabel);
+ } else { // PinLabelPosition.LEFT
+ pinHorizontal
+ .addGroup(
+ mainPanelLayout
+ .createSequentialGroup()
+ .addComponent(signPinLabel,
+ GroupLayout.PREFERRED_SIZE,
+ GroupLayout.DEFAULT_SIZE,
+ GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(
+ LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(pinField,
+ GroupLayout.PREFERRED_SIZE,
+ GroupLayout.DEFAULT_SIZE,
+ Short.MAX_VALUE))
+ .addComponent(pinsizeLabel,
+ GroupLayout.PREFERRED_SIZE,
+ GroupLayout.DEFAULT_SIZE,
+ GroupLayout.PREFERRED_SIZE);
+ pinVertical.addGroup(
+ mainPanelLayout.createParallelGroup(
+ GroupLayout.Alignment.BASELINE)
+ .addComponent(signPinLabel).addComponent(
+ pinField)).addPreferredGap(
+ LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(pinsizeLabel);
+ }
+
+ mainPanelLayout.setHorizontalGroup(mainPanelLayout
+ .createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addGroup(infoHorizontal).addGroup(pinHorizontal));
+
+ mainPanelLayout
+ .setVerticalGroup(mainPanelLayout
+ .createSequentialGroup().addGroup(infoVertical)
+ .addPreferredGap(
+ LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(pinVertical));
+
+ if (renderCancelButton) {
+ cancelButton.setFont(cancelButton.getFont().deriveFont(
+ cancelButton.getFont().getStyle()
+ & ~java.awt.Font.BOLD));
+ cancelButton.setText(getMessage(BUTTON_CANCEL));
+ cancelButton.setActionCommand(cancelCommand);
+ cancelButton.addActionListener(cancelListener);
+ }
+
+ updateMethodToRunAtResize("at.gv.egiz.bku.gui.BKUGUIImpl",
+ "renderSignaturePINDialogueButtonPanel");
+
+ renderSignaturePINDialogueButtonPanel();
+
+ if (windowCloseAdapter != null) {
+ windowCloseAdapter.registerListener(cancelListener, cancelCommand);
+ }
- @Override
- public void showErrorDialog(
- final String errorMsgKey, final Object[] errorMsgParams,
- final ActionListener okListener, final String okCommand) {
-
- showMessageDialog(TITLE_ERROR, ERROR_COLOR,
- errorMsgKey, errorMsgParams, BUTTON_OK, okListener, okCommand);
- }
+ primaryFocusHolder = pinField;
- @Override
- public void showErrorDialog(
- final String errorMsgKey, final Object[] errorMsgParams) {
+ pinField.requestFocus();
- showMessageDialog(TITLE_ERROR, ERROR_COLOR,
- errorMsgKey, errorMsgParams, null, null, null);
- }
+ contentPanel.validate();
- @Override
- public void showMessageDialog(
- final String titleKey,
- final String msgKey, final Object[] msgParams,
- final String buttonKey,
- final ActionListener okListener, final String okCommand) {
-
- showMessageDialog(titleKey, null,
- msgKey, msgParams, buttonKey, okListener, okCommand);
- }
+ resize();
+ }
+ });
+ }
- @Override
- public void showMessageDialog(
- final String titleKey,
- final String msgKey, final Object[] msgParams) {
+ public void renderSignaturePINDialogueButtonPanel() {
+
+ GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
+ buttonPanel.setLayout(buttonPanelLayout);
+
+ GroupLayout.SequentialGroup buttonHorizontal = buttonPanelLayout
+ .createSequentialGroup();
+ GroupLayout.Group buttonVertical;
+
+ if (renderCancelButton) {
+
+ buttonHorizontal.addComponent(signButton,
+ GroupLayout.PREFERRED_SIZE, buttonSize,
+ GroupLayout.PREFERRED_SIZE).addPreferredGap(
+ LayoutStyle.ComponentPlacement.RELATED).addComponent(
+ cancelButton, GroupLayout.PREFERRED_SIZE, buttonSize,
+ GroupLayout.PREFERRED_SIZE);
+ buttonVertical = buttonPanelLayout.createParallelGroup(
+ GroupLayout.Alignment.BASELINE).addComponent(signButton)
+ .addComponent(cancelButton);
+ } else {
+ buttonHorizontal.addComponent(signButton,
+ GroupLayout.PREFERRED_SIZE, buttonSize,
+ GroupLayout.PREFERRED_SIZE);
+ buttonVertical = buttonPanelLayout.createSequentialGroup()
+ .addComponent(signButton);
+ }
+
+ buttonPanelLayout.setHorizontalGroup(buttonHorizontal);
+ buttonPanelLayout.setVerticalGroup(buttonVertical);
- showMessageDialog(titleKey, null,
- msgKey, msgParams, null, null, null);
- }
+ }
- @Override
- public void showMessageDialog(
- final String titleKey, final String msgKey) {
+ @Override
+ public void showErrorDialog(final String errorMsgKey,
+ final Object[] errorMsgParams, final ActionListener okListener,
+ final String okCommand) {
- showMessageDialog(titleKey, null,
- msgKey, null, null, null, null);
- }
+ showMessageDialog(TITLE_ERROR, ERROR_COLOR, errorMsgKey,
+ errorMsgParams, BUTTON_OK, okListener, okCommand);
+ }
- /**
- *
- * @param buttonKey if null defaults to BUTTON_OK
- */
- private void showMessageDialog(
- final String titleKey, final Color titleColor,
- final String msgKey, final Object[] msgParams,
- final String buttonKey,
- final ActionListener okListener, final String okCommand) {
-
- log.debug("scheduling message dialog");
-
- SwingUtilities.invokeLater(new Runnable() {
-
- @Override
- public void run() {
-
- log.debug("[" + Thread.currentThread().getName() + "] show message dialog");
-
- mainPanel.removeAll();
- buttonPanel.removeAll();
-
- if (renderHeaderPanel) {
- titleLabel.setText(getMessage(titleKey));
- }
-
- helpMouseListener.setHelpTopic(msgKey);
- helpKeyListener.setHelpTopic(msgKey);
-
- String msgPattern = getMessage(msgKey);
- String msg = MessageFormat.format(msgPattern, msgParams);
-
- JLabel msgLabel = new JLabel();
- msgLabel.setFont(msgLabel.getFont().deriveFont(msgLabel.getFont().getStyle() & ~Font.BOLD));
- msgLabel.setText(msg);
-
- GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
- mainPanel.setLayout(mainPanelLayout);
-
- GroupLayout.ParallelGroup mainHorizontal = mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING);
- GroupLayout.SequentialGroup mainVertical = mainPanelLayout.createSequentialGroup();
-
- log.debug("focus to contentPanel");
- contentPanel.requestFocus();
-
- if (!renderHeaderPanel) {
- JLabel titleLabel = new JLabel();
- titleLabel.setFont(titleLabel.getFont().deriveFont(titleLabel.getFont().getStyle() | Font.BOLD));
- titleLabel.setText(getMessage(titleKey));
- if (titleColor != null) {
- titleLabel.setForeground(titleColor);
- }
-
- mainHorizontal
- .addGroup(mainPanelLayout.createSequentialGroup()
- .addComponent(titleLabel)
- .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
- .addComponent(switchFocusDummyLabel)
- .addComponent(helpLabel)
- );
- mainVertical
- .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addComponent(titleLabel)
- .addComponent(switchFocusDummyLabel)
- .addComponent(helpLabel)
- );
-
- log.debug("focus to helpLabel");
- helpLabel.requestFocus();
- }
-
- mainPanelLayout.setHorizontalGroup(mainHorizontal
- .addComponent(msgLabel));
- mainPanelLayout.setVerticalGroup(mainVertical
- .addComponent(msgLabel));
-
- if (okListener != null) {
-
- JButton okButton = new JButton();
- okButton.setFont(okButton.getFont().deriveFont(okButton.getFont().getStyle() & ~java.awt.Font.BOLD));
- okButton.setText(getMessage((buttonKey != null) ? buttonKey : BUTTON_OK));
- okButton.setActionCommand(okCommand);
- okButton.addActionListener(okListener);
-
- GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
- buttonPanel.setLayout(buttonPanelLayout);
-
- buttonPanelLayout.setHorizontalGroup(
- buttonPanelLayout.createSequentialGroup()
- .addComponent(okButton, GroupLayout.PREFERRED_SIZE, buttonSize, GroupLayout.PREFERRED_SIZE));
- buttonPanelLayout.setVerticalGroup(
- buttonPanelLayout.createSequentialGroup()
- .addComponent(okButton));
-
- log.debug("focus to ok-button");
- okButton.requestFocus();
- }
-
- contentPanel.validate();
- }
- });
- }
+ @Override
+ public void showErrorDialog(final String errorMsgKey,
+ final Object[] errorMsgParams) {
+ showMessageDialog(TITLE_ERROR, ERROR_COLOR, errorMsgKey,
+ errorMsgParams, null, null, null);
+ }
- @Override
- public char[] getPin() {
- if (pinField != null) {
- char[] pin = pinField.getPassword(); //returns a copy
- pinField = null; //garbage collect original pin (make sure to clear char[] after use)
- return pin;
- }
- return null;
- }
+ @Override
+ public void showMessageDialog(final String titleKey, final String msgKey,
+ final Object[] msgParams, final String buttonKey,
+ final ActionListener okListener, final String okCommand) {
+ showMessageDialog(titleKey, null, msgKey, msgParams, buttonKey,
+ okListener, okCommand);
+ }
- ////////////////////////////////////////////////////////////////////////////
- // SECURE VIEWER
- ////////////////////////////////////////////////////////////////////////////
+ @Override
+ public void showMessageDialog(final String titleKey, final String msgKey,
+ final Object[] msgParams) {
-
- /**
- * @param signedReferences
- * @param backListener gets notified if pin-dialog has to be redrawn
- * (signedRefencesList returns via BACK button)
- * @param okCommand
- */
- @Override
- public void showSecureViewer(final List<HashDataInput> dataToBeSigned,
- final ActionListener backListener, final String backCommand) {
-
- if (dataToBeSigned == null) {
- showErrorDialog(getMessage(ERR_NO_HASHDATA),
- new Object[] {"no signature data provided"},
- backListener, backCommand);
- } else if (dataToBeSigned.size() == 1) {
- //TODO pull out (see also SignedReferencesSelectionListener)
- if (SecureViewerDialog.SUPPORTED_MIME_TYPES.contains(dataToBeSigned.get(0).getMimeType())) {
- try {
- log.debug("[" + Thread.currentThread().getName() + "] scheduling secure viewer");
-
- SwingUtilities.invokeLater(new Runnable() {
-
- @Override
- public void run() {
- try {
- showMessageDialog(TITLE_SIGNATURE_DATA, MESSAGE_HASHDATA_VIEWER);
- showSecureViewer(dataToBeSigned.get(0), backListener, backCommand);
- } catch (FontProviderException ex) {
- log.error("failed to display secure viewer", ex);
- showErrorDialog(ERR_VIEWER, new Object[] {ex.getMessage()}, backListener, backCommand);
- }
- }
- });
-
- } catch (Exception ex) { //InterruptedException InvocationTargetException
- log.error("Failed to display secure viewer: " + ex.getMessage());
- log.trace(ex);
- showErrorDialog(ERR_UNKNOWN, null, backListener, backCommand);
- }
- } else {
- log.debug("[" + Thread.currentThread().getName() + "] mime-type not supported by secure viewer, scheduling save dialog");
- showMessageDialog(TITLE_SIGNATURE_DATA, MESSAGE_UNSUPPORTED_MIMETYPE);
- SecureViewerSaveDialog.showSaveDialog(dataToBeSigned.get(0), messages, backListener, backCommand);
- }
- } else {
- showSignedReferencesListDialog(dataToBeSigned, backListener, backCommand);
- }
- }
-
- /**
- * has to be called from event dispatcher thread
- */
- private void showSecureViewer(HashDataInput dataToBeSigned, ActionListener closeListener, String closeCommand) throws FontProviderException {
-
- log.debug("[" + Thread.currentThread().getName() + "] show secure viewer");
- SecureViewerDialog secureViewer = new SecureViewerDialog(null, messages,
- closeListener, closeCommand,
- fontProvider, helpMouseListener.getActionListener());
-
- // workaround for [#439]
- // avoid AlwaysOnTop at least in applet, otherwise make secureViewer AlwaysOnTop since MOCCA Dialog (JFrame created in LocalSTALFactory) is always on top.
- Window window = SwingUtilities.getWindowAncestor(contentPane);
- if (window != null && window.isAlwaysOnTop()) {
- log.debug("make secureViewer alwaysOnTop");
- secureViewer.setAlwaysOnTop(true);
- }
- secureViewer.setContent(dataToBeSigned);
- log.trace("viewer setContent returned");
- }
-
-
-
- private void showSignedReferencesListDialog(final List<HashDataInput> signedReferences,
- final ActionListener backListener, final String backCommand) {
-
- log.debug("[" + Thread.currentThread().getName() + "] scheduling signed references list dialog");
-
- SwingUtilities.invokeLater(new Runnable() {
-
- @Override
- public void run() {
-
- log.debug("[" + Thread.currentThread().getName() + "] show signed references list dialog");
-
- mainPanel.removeAll();
- buttonPanel.removeAll();
-
- if (renderHeaderPanel) {
- titleLabel.setText(getMessage(TITLE_SIGNATURE_DATA));
- }
-
- helpMouseListener.setHelpTopic(HELP_HASHDATALIST);
- helpKeyListener.setHelpTopic(HELP_HASHDATALIST);
-
- JLabel refIdLabel = new JLabel();
- refIdLabel.setFont(refIdLabel.getFont().deriveFont(refIdLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
- String refIdLabelPattern = getMessage(MESSAGE_HASHDATALIST);
- refIdLabel.setText(MessageFormat.format(refIdLabelPattern, new Object[]{signedReferences.size()}));
-
- HashDataTableModel tableModel = new HashDataTableModel(signedReferences, renderRefId);
- final JTable hashDataTable = new JTable(tableModel);
- hashDataTable.setDefaultRenderer(HashDataInput.class, new HyperlinkRenderer(renderRefId));
- hashDataTable.setTableHeader(null);
-
- hashDataTable.addMouseMotionListener(new SignedReferencesMouseMotionListener(hashDataTable));
-
- hashDataTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- hashDataTable.getSelectionModel().addListSelectionListener(new SignedReferencesSelectionListener(signedReferences, backListener, backCommand));
-
- JScrollPane hashDataScrollPane = new JScrollPane(hashDataTable);
-
- GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
- mainPanel.setLayout(mainPanelLayout);
-
- GroupLayout.SequentialGroup messageHorizontal = mainPanelLayout.createSequentialGroup()
- .addComponent(refIdLabel);
-
- GroupLayout.ParallelGroup messageVertical = mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addComponent(refIdLabel);
-
- if (!renderHeaderPanel) {
- messageHorizontal
- .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
- .addComponent(switchFocusDummyLabel)
- .addComponent(helpLabel)
- ;
- messageVertical
- .addComponent(switchFocusDummyLabel)
- .addComponent(helpLabel)
- ;
- }
-
- mainPanelLayout.setHorizontalGroup(
- mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addGroup(messageHorizontal)
- .addComponent(hashDataScrollPane, 0, 0, Short.MAX_VALUE));
-
- mainPanelLayout.setVerticalGroup(
- mainPanelLayout.createSequentialGroup()
- .addGroup(messageVertical)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(hashDataScrollPane, 0, 0, hashDataTable.getPreferredSize().height+3));
-
- JButton backButton = new JButton();
- backButton.setFont(backButton.getFont().deriveFont(backButton.getFont().getStyle() & ~java.awt.Font.BOLD));
- backButton.setText(getMessage(BUTTON_BACK));
- backButton.setActionCommand(backCommand);
- backButton.addActionListener(backListener);
-
- GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
- buttonPanel.setLayout(buttonPanelLayout);
-
- buttonPanelLayout.setHorizontalGroup(buttonPanelLayout.createSequentialGroup()
- .addComponent(backButton, GroupLayout.PREFERRED_SIZE, buttonSize, GroupLayout.PREFERRED_SIZE));
- buttonPanelLayout.setVerticalGroup(buttonPanelLayout.createSequentialGroup()
- .addComponent(backButton));
-
- contentPanel.validate();
- }
- });
- }
-
-
-
- /**
- * not possible to add mouse listener to TableCellRenderer
- * to change cursor on specific columns only, use table.columnAtPoint(e.getPoint())
- *
- */
- private class SignedReferencesMouseMotionListener extends MouseMotionAdapter {
-
- JTable hashDataTable;
-
- public SignedReferencesMouseMotionListener(JTable table) {
- this.hashDataTable = table;
- }
-
- @Override
- public void mouseMoved(MouseEvent e) {
-// if (hashDataTable.columnAtPoint(e.getPoint()) == 0) {
- hashDataTable.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
- }
- }
-
- ///////////
- // SignedReferencesList (TODO pull out)
-
- public class SignedReferencesSelectionListener implements ListSelectionListener {
-
- List<HashDataInput> signedReferences;
- ActionListener backListener;
- String backCommand;
-
- public SignedReferencesSelectionListener(List<HashDataInput> signedReferences, ActionListener backListener, String backCommand) {
- this.signedReferences = signedReferences;
- this.backListener = backListener;
- this.backCommand = backCommand;
- }
-
- @Override
- public void valueChanged(ListSelectionEvent event) {
-
- if (event.getValueIsAdjusting()) {
- return;
- }
-
- ListSelectionModel lsm = (ListSelectionModel) event.getSource();
- int selectionIdx = lsm.getMinSelectionIndex();
-
- log.debug("[" + Thread.currentThread().getName() + "] reference " + selectionIdx + " selected");
-
- if (selectionIdx >= 0) {
- final HashDataInput selection = signedReferences.get(selectionIdx);
- final SignedReferencesListDisplayer backToListListener = new SignedReferencesListDisplayer(signedReferences, backListener, backCommand);
-
- if (SecureViewerDialog.SUPPORTED_MIME_TYPES.contains(selection.getMimeType())) {
- log.debug("[" + Thread.currentThread().getName() + "] scheduling secure viewer dialog");
- SwingUtilities.invokeLater(new Runnable() {
-
- @Override
- public void run() {
- try {
- showMessageDialog(TITLE_SIGNATURE_DATA, MESSAGE_HASHDATA_VIEWER);
- showSecureViewer(selection, backToListListener, null);
-// SecureViewerDialog.showSecureViewer(selection, messages, fontProvider, helpMouseListener.getActionListener(), false);
- } catch (FontProviderException ex) {
- log.error("failed to display secure viewer", ex);
- showErrorDialog(BKUGUIFacade.ERR_VIEWER, new Object[] {ex.getMessage()}, backToListListener, null);
- }
-
- }
- });
- } else {
- log.debug("[" + Thread.currentThread().getName() + "] mime-type not supported by secure viewer, scheduling save dialog");
- showMessageDialog(BKUGUIFacade.TITLE_SIGNATURE_DATA, BKUGUIFacade.MESSAGE_UNSUPPORTED_MIMETYPE);
- SecureViewerSaveDialog.showSaveDialog(selection, messages, backToListListener, null);
- }
- }
- }
-
- /**
- * ActionListener that returns to signed references list
- */
- private class SignedReferencesListDisplayer implements ActionListener {
- List<HashDataInput> sr;
- ActionListener bl;
- String bc;
-
- public SignedReferencesListDisplayer(List<HashDataInput> signedReferences, ActionListener backListener, String backCommand) {
- sr = signedReferences;
- bl = backListener;
- bc = backCommand;
- }
-
- @Override
- public void actionPerformed(ActionEvent e) {
-// log.debug("[" + Thread.currentThread().getName() + "] displaying signed references list");
- showSignedReferencesListDialog(sr, bl, bc);
- }
- }
- }
+ showMessageDialog(titleKey, null, msgKey, msgParams, null, null, null);
+ }
+ @Override
+ public void showMessageDialog(final String titleKey, final String msgKey) {
- ////////////////////////////////////////////////////////////////////////////
- // UTILITY METHODS
- ////////////////////////////////////////////////////////////////////////////
-
- private void registerHelpListener(ActionListener helpListener) {
- if (helpListener != null) {
- this.helpMouseListener = new HelpMouseListener(helpListener);
- this.helpKeyListener = new HelpKeyListener(helpListener);
- } else {
- log.error("no help listener provided, will not be able to display help");
- this.helpMouseListener = new HelpMouseListener(new ActionListener() {
-
- @Override
- public void actionPerformed(ActionEvent e) {
- log.error("no help listener registered (requested help topic: " + e.getActionCommand() + ")");
- }
- });
- this.helpKeyListener = new HelpKeyListener(new ActionListener() {
-
- @Override
- public void actionPerformed(ActionEvent e) {
- log.error("no help listener registered (requested help topic: " + e.getActionCommand() + ")");
- }
- });
- }
- }
+ showMessageDialog(titleKey, null, msgKey, null, null, null, null);
+ }
+
+ /**
+ *
+ * @param buttonKey
+ * if null defaults to BUTTON_OK
+ */
+ private void showMessageDialog(final String titleKey,
+ final Color titleColor, final String msgKey,
+ final Object[] msgParams, final String buttonKey,
+ final ActionListener okListener, final String okCommand) {
+
+ log.debug("Scheduling message dialog.");
+
+ SwingUtilities.invokeLater(new Runnable() {
+
+ @Override
+ public void run() {
+
+ log.debug("[{}] Show message dialog.", Thread.currentThread().getName());
+
+ log.debug("ButtonKey: {}.", buttonKey);
+
+ mainPanel.removeAll();
+ buttonPanel.removeAll();
+
+ // avoid that dummy label gains focus during load
+ switchFocusDummyLabel.setFocusable(false);
+
+ if (renderHeaderPanel) {
+ titleLabel.setText(getMessage(titleKey));
+ }
- private void registerSwitchFocusListener(ActionListener switchFocusListener) {
- if (switchFocusListener != null) {
- this.switchFocusKeyListener = new SwitchFocusFocusListener(switchFocusListener);
-
- } else {
-
- this.switchFocusKeyListener = new SwitchFocusFocusListener(new ActionListener() {
-
- @Override
- public void actionPerformed(ActionEvent e) {
- log.warn("no switch focus listener registered");
- }
- });
+ helpListener.setHelpTopic(msgKey);
+
+ String msgPattern = getMessage(msgKey);
+ String msg = MessageFormat.format(msgPattern, msgParams);
+
+ // we need to create a new JLabel object every time in order to
+ // ensure
+ // that screen reading software will read each updated label
+ msgLabel = new JLabel();
+
+ msgLabel.setFocusable(true);
+
+ msgLabel.setFont(msgLabel.getFont().deriveFont(
+ msgLabel.getFont().getStyle() & ~Font.BOLD));
+ msgLabel.setText(msg);
+
+ GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
+ mainPanel.setLayout(mainPanelLayout);
+
+ GroupLayout.ParallelGroup mainHorizontal = mainPanelLayout
+ .createParallelGroup(GroupLayout.Alignment.LEADING);
+ GroupLayout.SequentialGroup mainVertical = mainPanelLayout
+ .createSequentialGroup();
+
+ String accessibleData = "";
+
+ if (!renderHeaderPanel) {
+ msgTitleLabel = new JLabel();
+ msgTitleLabel.setFont(msgTitleLabel.getFont().deriveFont(
+ msgTitleLabel.getFont().getStyle() | Font.BOLD));
+ msgTitleLabel.setText(getMessage(titleKey));
+
+ if (titleColor != null) {
+ msgTitleLabel.setForeground(titleColor);
+ }
+
+ accessibleData = accessibleData + getMessage(titleKey);
+
+ GroupLayout.SequentialGroup titleHorizontal = mainPanelLayout
+ .createSequentialGroup()
+ .addComponent(msgTitleLabel);
+
+ GroupLayout.ParallelGroup titleVertical = mainPanelLayout
+ .createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addComponent(msgTitleLabel);
+
+ if (helpListener.implementsListener()) {
+ titleHorizontal.addPreferredGap(
+ LayoutStyle.ComponentPlacement.UNRELATED, 0,
+ Short.MAX_VALUE).addComponent(helpLabel);
+ titleVertical.addComponent(helpLabel);
+ }
+ titleHorizontal.addComponent(switchFocusDummyLabel);
+ titleVertical.addComponent(switchFocusDummyLabel);
+
+ mainHorizontal.addGroup(titleHorizontal);
+ mainVertical.addGroup(titleVertical);
+
+ } else {
+
+ accessibleData = accessibleData + titleLabel.getText();
+ }
+
+ msgLabel.getAccessibleContext().setAccessibleName(
+ accessibleData + msgLabel.getText());
+ msgLabel.getAccessibleContext().setAccessibleDescription(
+ accessibleData + msgLabel.getText());
+
+ msgLabel.addFocusListener(new FocusAdapter() {
+
+ @Override
+ public void focusGained(FocusEvent e) {
+
+ // focus has been set accordingly - re-enable dummy
+ // label
+ switchFocusDummyLabel.setFocusable(true);
+ }
+
+ });
+
+ mainPanelLayout.setHorizontalGroup(mainHorizontal
+ .addComponent(msgLabel));
+ mainPanelLayout.setVerticalGroup(mainVertical
+ .addComponent(msgLabel));
+
+ if (okListener != null) {
+
+ showMessageOKButton = true;
+
+ okButton.setFont(okButton.getFont()
+ .deriveFont(
+ okButton.getFont().getStyle()
+ & ~java.awt.Font.BOLD));
+ okButton.setText(getMessage((buttonKey != null) ? buttonKey
+ : BUTTON_OK));
+ okButton.setActionCommand(okCommand);
+ okButton.addActionListener(okListener);
+
+ renderShowMessageDialogueButtonPanel();
+
+ primaryFocusHolder = msgLabel;
+
+ } else {
+ log.debug("No okListener configured.");
+ showMessageOKButton = false;
+ }
+
+ // okListener might be null (up to windowCloseAdapter what to do)
+ if (windowCloseAdapter != null) {
+ windowCloseAdapter.registerListener(okListener, okCommand);
}
- }
-
- ////////////////////////////////////////////////////////////////////////////
- // INITIALIZERS (MAY BE OVERRIDDEN BY SUBCLASSES)
- ////////////////////////////////////////////////////////////////////////////
-
- /**
- * Load applet messages bundle. Note that getBundle looks for classes based
- * on the default Locale before it selects the base class!
- *
- * Called from constructor.
- * Subclasses may override this method to ensure the message bundle is loaded
- * once initButtonSize (called from constructor as well) is called.
- * (Only relevant if initButtonSize is overridden as well)
- * @param locale
- */
- protected void loadMessageBundle(Locale locale) {
- if (locale != null) {
- // see [#378] Ignoring post parameter 'locale': bundle resolve-order not correct?!
- Locale lang = new Locale(locale.getLanguage().substring(0, 2));
- log.debug("loading applet resources for language: " + lang.toString());
- messages = ResourceBundle.getBundle(MESSAGES_BUNDLE, lang);
- } else {
- log.debug("loading default language applet resources");
- messages = ResourceBundle.getBundle(MESSAGES_BUNDLE);
- }
- // how the f*** you know the default Messages.properties is de?!
- log.debug("applet messages loaded: " + messages.getLocale());
- }
- protected int initButtonSize() {
- int bs = 0;
-
- JButton b = new JButton();
- b.setText(getMessage(BUTTON_OK));
- if (b.getPreferredSize().width > bs) {
- bs = b.getPreferredSize().width;
- }
- // need cancel button for message dialog,
- // even if renderCancelButton == false
- b.setText(getMessage(BUTTON_CANCEL));
- if (b.getPreferredSize().width > bs) {
- bs = b.getPreferredSize().width;
- }
- b.setText(getMessage(BUTTON_SIGN));
- if (b.getPreferredSize().width > bs) {
- bs = b.getPreferredSize().width;
- }
- b.setText(getMessage(BUTTON_BACK));
- if (b.getPreferredSize().width > bs) {
- bs = b.getPreferredSize().width;
- }
- b.setText(getMessage(BUTTON_SAVE));
- if (b.getPreferredSize().width > bs) {
- bs = b.getPreferredSize().width;
- }
- return bs;
- }
+ updateMethodToRunAtResize("at.gv.egiz.bku.gui.BKUGUIImpl",
+ "renderShowMessageDialogueButtonPanel");
+
+ // put focus to msgLabel to guarantee that label is read by
+ // screen reader upon loading
+ msgLabel.requestFocus();
+
+ contentPanel.validate();
+
+ resize();
+ }
+ });
+ }
+
+ public void renderShowMessageDialogueButtonPanel() {
+
+ if (showMessageOKButton) {
+ GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
+ buttonPanel.setLayout(buttonPanelLayout);
+
+ buttonPanelLayout.setHorizontalGroup(buttonPanelLayout
+ .createSequentialGroup().addComponent(okButton,
+ GroupLayout.PREFERRED_SIZE, buttonSize,
+ GroupLayout.PREFERRED_SIZE));
+ buttonPanelLayout.setVerticalGroup(buttonPanelLayout
+ .createSequentialGroup().addComponent(okButton));
+ }
+ }
+
+ @Override
+ public char[] getPin() {
+ if (pinField != null) {
+ char[] pin = pinField.getPassword(); // returns a copy
+ pinField = null; // garbage collect original pin (make sure to clear
+ // char[] after use)
+ return pin;
+ }
+ return null;
+ }
+
+ // //////////////////////////////////////////////////////////////////////////
+ // SECURE VIEWER
+ // //////////////////////////////////////////////////////////////////////////
+
+ /**
+ * @param signedReferences
+ * @param backListener
+ * gets notified if pin-dialog has to be redrawn
+ * (signedRefencesList returns via BACK button)
+ * @param okCommand
+ */
+ @Override
+ public void showSecureViewer(final List<HashDataInput> dataToBeSigned,
+ final ActionListener backListener, final String backCommand) {
+
+ if (dataToBeSigned == null) {
+ showErrorDialog(getMessage(ERR_NO_HASHDATA),
+ new Object[] { "no signature data provided" },
+ backListener, backCommand);
+ } else if (dataToBeSigned.size() == 1) {
+ // TODO pull out (see also SignedReferencesSelectionListener)
+ if (SecureViewerDialog.SUPPORTED_MIME_TYPES.contains(dataToBeSigned
+ .get(0).getMimeType())) {
+ try {
+ log.debug("[{}] Scheduling secure viewer.", Thread.currentThread().getName());
+
+ showMessageDialog(TITLE_SIGNATURE_DATA,
+ MESSAGE_HASHDATA_VIEWER);
+
+ SwingUtilities.invokeLater(new Runnable() {
+
+ @Override
+ public void run() {
+ try {
+ showSecureViewer(dataToBeSigned.get(0),
+ backListener, backCommand);
+ } catch (FontProviderException ex) {
+ log.error("Failed to display secure viewer.", ex);
+ showErrorDialog(ERR_VIEWER, new Object[] { ex
+ .getMessage() }, backListener,
+ backCommand);
+ }
+ }
+ });
+
+ } catch (Exception ex) { // InterruptedException
+ // InvocationTargetException
+ log.error("Failed to display secure viewer. ", ex);
+ showErrorDialog(ERR_UNKNOWN, null, backListener,
+ backCommand);
+ }
+ } else {
+ log.debug("[{}] mime-type not supported by secure viewer, " +
+ "scheduling save dialog.", Thread.currentThread().getName());
+ showMessageDialog(TITLE_SIGNATURE_DATA,
+ MESSAGE_UNSUPPORTED_MIMETYPE,
+ new Object[] { dataToBeSigned.get(0).getMimeType() });
+ SecureViewerSaveDialog.showSaveDialog(dataToBeSigned.get(0),
+ messages, backListener, backCommand,
+ (int) (baseFontSize * getResizeFactor()));
+ }
+ } else {
+ showSignedReferencesListDialog(dataToBeSigned, backListener,
+ backCommand);
+ }
+ }
+
+ /**
+ * has to be called from event dispatcher thread
+ */
+ private void showSecureViewer(HashDataInput dataToBeSigned,
+ ActionListener closeListener, String closeCommand)
+ throws FontProviderException {
+
+ log.debug("[{}] Show secure viewer.");
+ secureViewer = new SecureViewerDialog(null, messages, closeListener,
+ closeCommand, fontProvider, helpListener, getResizeFactor());
+
+ // workaround for [#439]
+ // avoid AlwaysOnTop at least in applet, otherwise make secureViewer
+ // AlwaysOnTop since MOCCA Dialog (JFrame created in LocalSTALFactory)
+ // is always on top.
+ Window window = SwingUtilities.getWindowAncestor(contentPane);
+ if (window != null && window.isAlwaysOnTop()) {
+ log.debug("Make secureViewer alwaysOnTop.");
+ secureViewer.setAlwaysOnTop(true);
+ }
+
+ secureViewer.setContent(dataToBeSigned);
+ log.trace("Viewer setContent returned.");
+ }
+
+ private void openSecureViewerDialog() {
+
+ final HashDataInput storedSelection = signedReferences.get(referenceIndex);
+
+ if (SecureViewerDialog.SUPPORTED_MIME_TYPES.contains(storedSelection
+ .getMimeType())) {
+ log.debug("[{}] Scheduling secure viewer dialog.", Thread.currentThread().getName());
+
+ showMessageDialog(TITLE_SIGNATURE_DATA,
+ MESSAGE_HASHDATA_VIEWER);
+
+ SwingUtilities.invokeLater(new Runnable() {
+
+ @Override
+ public void run() {
+ try {
+ showSecureViewer(storedSelection, storedBackToListListener,
+ null);
+ // SecureViewerDialog.showSecureViewer(selection,
+ // messages, fontProvider,
+ // helpMouseListener.getActionListener(),
+ // false);
+ } catch (FontProviderException ex) {
+ log.error("Failed to display secure viewer.", ex);
+ showErrorDialog(BKUGUIFacade.ERR_VIEWER,
+ new Object[] { ex.getMessage() },
+ storedBackToListListener, null);
+ }
+
+ }
+ });
+ } else {
+ log.debug("[{}] Mime-type not supported by secure viewer, " +
+ "scheduling save dialog.", Thread.currentThread().getName());
+ showMessageDialog(BKUGUIFacade.TITLE_SIGNATURE_DATA,
+ BKUGUIFacade.MESSAGE_UNSUPPORTED_MIMETYPE,
+ new Object[] { storedSelection.getMimeType() });
+ SecureViewerSaveDialog.showSaveDialog(storedSelection, messages,
+ storedBackToListListener, null,
+ (int) (baseFontSize * getResizeFactor()));
+ }
+
+
+ }
+
+ private void showSignedReferencesListDialog(
+ final List<HashDataInput> signedReferences,
+ final ActionListener backListener, final String backCommand) {
+
+ log.debug("[{}] Scheduling signed references list dialog.", Thread.currentThread().getName());
+
+ SwingUtilities.invokeLater(new Runnable() {
+
+ @Override
+ public void run() {
+
+ log.debug("[{}] Show signed references list dialog.", Thread.currentThread().getName());
+
+ mainPanel.removeAll();
+ buttonPanel.removeAll();
+
+ if (renderHeaderPanel) {
+ titleLabel.setText(getMessage(TITLE_SIGNATURE_DATA));
+ }
+
+ helpListener.setHelpTopic(HELP_HASHDATALIST);
+
+ refIdLabel = new JLabel();
+ refIdLabel.setFont(refIdLabel.getFont().deriveFont(
+ refIdLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
+ String refIdLabelPattern = getMessage(MESSAGE_HASHDATALIST);
+ refIdLabel.setText(MessageFormat.format(refIdLabelPattern,
+ new Object[] { signedReferences.size() }));
+
+ HashDataTableModel tableModel = new HashDataTableModel(
+ signedReferences, renderRefId);
+ hashDataTable = new JTable(tableModel);
+
+ hyperlinkRenderer = new HyperlinkRenderer(renderRefId);
+
+ hashDataTable.setDefaultRenderer(HashDataInput.class,
+ hyperlinkRenderer);
+ hashDataTable.setTableHeader(null);
+
+ hashDataTable
+ .addMouseMotionListener(new SignedReferencesMouseMotionListener(
+ hashDataTable));
+
+ hashDataTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+
+ hashDataTable
+ .setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+ hashDataTable.getSelectionModel().addListSelectionListener(
+ new SignedReferencesSelectionListener(signedReferences,
+ backListener, backCommand));
+
+
+ hashDataTable.addMouseListener(new MouseAdapter() {
+
+ @Override
+ public void mouseClicked(MouseEvent e) {
+
+ openSecureViewerDialog();
+ }
+
+ });
+
+ hashDataTable.addKeyListener(new KeyAdapter() {
+
+ @Override
+ public void keyPressed(KeyEvent e) {
+
+ if(e.getKeyCode() == KeyEvent.VK_ENTER) {
+
+ log.debug("Detected Enter Key.");
+
+ openSecureViewerDialog();
+ }
+
+ }
+
+ });
+
+ hashDataScrollPane = new JScrollPane(hashDataTable);
+
+ backButton.setFont(backButton.getFont().deriveFont(
+ backButton.getFont().getStyle() & ~java.awt.Font.BOLD));
+ backButton.setText(getMessage(BUTTON_BACK));
+ backButton.setActionCommand(backCommand);
+ backButton.addActionListener(backListener);
+
+ primaryFocusHolder = hashDataTable;
+
+ updateMethodToRunAtResize("at.gv.egiz.bku.gui.BKUGUIImpl", "renderSignedReferenceListButtonandTable");
+
+ renderSignedReferenceListButtonandTable();
+
+ hashDataTable.requestFocus();
+
+ contentPanel.validate();
+
+ resize();
+ }
+ });
+ }
+
+ public void renderSignedReferenceListButtonandTable() {
+
+ GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
+ mainPanel.setLayout(mainPanelLayout);
+
+ GroupLayout.SequentialGroup messageHorizontal = mainPanelLayout
+ .createSequentialGroup().addComponent(refIdLabel);
+
+ GroupLayout.ParallelGroup messageVertical = mainPanelLayout
+ .createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addComponent(refIdLabel);
+
+ if (!renderHeaderPanel) {
+
+ if (helpListener.implementsListener()) {
+ messageHorizontal.addPreferredGap(
+ LayoutStyle.ComponentPlacement.UNRELATED, 0,
+ Short.MAX_VALUE).addComponent(helpLabel);
+ messageVertical.addComponent(helpLabel);
+ }
+ messageHorizontal.addComponent(switchFocusDummyLabel);
+ messageVertical.addComponent(switchFocusDummyLabel);
+ }
+
+ mainPanelLayout.setHorizontalGroup(mainPanelLayout
+ .createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addGroup(messageHorizontal).addComponent(
+ hashDataScrollPane, 0, 0, Short.MAX_VALUE));
+
+ mainPanelLayout
+ .setVerticalGroup(mainPanelLayout
+ .createSequentialGroup()
+ .addGroup(messageVertical)
+ .addPreferredGap(
+ LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(
+ hashDataScrollPane,
+ 0,
+ 0,
+ hashDataTable.getPreferredSize().height + 3));
+
+
+
+ GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
+ buttonPanel.setLayout(buttonPanelLayout);
+
+ buttonPanelLayout.setHorizontalGroup(buttonPanelLayout
+ .createSequentialGroup().addComponent(backButton,
+ GroupLayout.PREFERRED_SIZE, buttonSize,
+ GroupLayout.PREFERRED_SIZE));
+ buttonPanelLayout.setVerticalGroup(buttonPanelLayout
+ .createSequentialGroup().addComponent(backButton));
+
+ }
+
+ /**
+ * not possible to add mouse listener to TableCellRenderer to change cursor
+ * on specific columns only, use table.columnAtPoint(e.getPoint())
+ *
+ */
+ private class SignedReferencesMouseMotionListener extends
+ MouseMotionAdapter {
+
+ JTable hashDataTable;
+
+ public SignedReferencesMouseMotionListener(JTable table) {
+ this.hashDataTable = table;
+ }
+
+ @Override
+ public void mouseMoved(MouseEvent e) {
+ // if (hashDataTable.columnAtPoint(e.getPoint()) == 0) {
+ hashDataTable.setCursor(Cursor
+ .getPredefinedCursor(Cursor.HAND_CURSOR));
+ }
+ }
+
+ // /////////
+ // SignedReferencesList (TODO pull out)
+
+ public class SignedReferencesSelectionListener implements
+ ListSelectionListener {
+
+// List<HashDataInput> signedReferences;
+ ActionListener backListener;
+ String backCommand;
+
+ public SignedReferencesSelectionListener(
+ List<HashDataInput> signedReferences,
+ ActionListener backListener, String backCommand) {
+// this.signedReferences = signedReferences;
+ BKUGUIImpl.this.signedReferences = signedReferences;
+ this.backListener = backListener;
+ this.backCommand = backCommand;
+ }
+
+ @Override
+ public void valueChanged(ListSelectionEvent event) {
+
+ if (event.getValueIsAdjusting()) {
+ return;
+ }
+
+ ListSelectionModel lsm = (ListSelectionModel) event.getSource();
+ int selectionIdx = lsm.getMinSelectionIndex();
+
+ log.debug("[{}] Reference {} selected.",
+ Thread.currentThread().getName(), selectionIdx);
+
+ if (selectionIdx >= 0) {
+// final HashDataInput selection = signedReferences
+// .get(selectionIdx);
+// final SignedReferencesListDisplayer backToListListener = new SignedReferencesListDisplayer(
+// signedReferences, backListener, backCommand);
+
+ referenceIndex = selectionIdx;
+ storedBackToListListener = new SignedReferencesListDisplayer(
+ signedReferences, backListener, backCommand);
+
+// if (SecureViewerDialog.SUPPORTED_MIME_TYPES.contains(selection
+// .getMimeType())) {
+// log.debug("[" + Thread.currentThread().getName()
+// + "] scheduling secure viewer dialog");
+//
+// showMessageDialog(TITLE_SIGNATURE_DATA,
+// MESSAGE_HASHDATA_VIEWER);
+//
+// SwingUtilities.invokeLater(new Runnable() {
+//
+// @Override
+// public void run() {
+// try {
+// showSecureViewer(selection, backToListListener,
+// null);
+// // SecureViewerDialog.showSecureViewer(selection,
+// // messages, fontProvider,
+// // helpMouseListener.getActionListener(),
+// // false);
+// } catch (FontProviderException ex) {
+// log
+// .error(
+// "failed to display secure viewer",
+// ex);
+// showErrorDialog(BKUGUIFacade.ERR_VIEWER,
+// new Object[] { ex.getMessage() },
+// backToListListener, null);
+// }
+//
+// }
+// });
+// } else {
+// log
+// .debug("["
+// + Thread.currentThread().getName()
+// + "] mime-type not supported by secure viewer, scheduling save dialog");
+// showMessageDialog(BKUGUIFacade.TITLE_SIGNATURE_DATA,
+// BKUGUIFacade.MESSAGE_UNSUPPORTED_MIMETYPE,
+// new Object[] { selection.getMimeType() });
+// SecureViewerSaveDialog.showSaveDialog(selection, messages,
+// backToListListener, null,
+// (int) (baseFontSize * getResizeFactor()));
+// }
+ }
+ }
+
+ /**
+ * ActionListener that returns to signed references list
+ */
+ private class SignedReferencesListDisplayer implements ActionListener {
+ List<HashDataInput> sr;
+ ActionListener bl;
+ String bc;
+
+ public SignedReferencesListDisplayer(
+ List<HashDataInput> signedReferences,
+ ActionListener backListener, String backCommand) {
+ sr = signedReferences;
+ bl = backListener;
+ bc = backCommand;
+ }
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ // log.debug("[" + Thread.currentThread().getName() +
+ // "] displaying signed references list");
+ showSignedReferencesListDialog(sr, bl, bc);
+ }
+ }
+ }
+
+ // //////////////////////////////////////////////////////////////////////////
+ // UTILITY METHODS
+ // //////////////////////////////////////////////////////////////////////////
+
+ private void registerSwitchFocusListener(ActionListener switchFocusListener) {
+ if (switchFocusListener != null) {
+ this.switchFocusKeyListener = new SwitchFocusFocusListener(
+ switchFocusListener);
+
+ } else {
+
+ this.switchFocusKeyListener = new SwitchFocusFocusListener(
+ new ActionListener() {
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ log.warn("No switch focus listener registered.");
+ }
+ });
+ }
+ }
+
+ // //////////////////////////////////////////////////////////////////////////
+ // INITIALIZERS (MAY BE OVERRIDDEN BY SUBCLASSES)
+ // //////////////////////////////////////////////////////////////////////////
+
+ /**
+ * Load applet messages bundle. Note that getBundle looks for classes based
+ * on the default Locale before it selects the base class!
+ *
+ * Called from constructor. Subclasses may override this method to ensure
+ * the message bundle is loaded once initButtonSize (called from constructor
+ * as well) is called. (Only relevant if initButtonSize is overridden as
+ * well)
+ *
+ * @param locale
+ */
+ protected void loadMessageBundle(Locale locale) {
+ if (locale != null) {
+ // see [#378] Ignoring post parameter 'locale': bundle resolve-order
+ // not correct?!
+ Locale lang = new Locale(locale.getLanguage().substring(0, 2));
+ log.debug("Loading message bundle for language: {}.", lang.toString());
+ messages = ResourceBundle.getBundle(MESSAGES_BUNDLE, lang);
+ } else {
+ log.debug("Loading default language message bundle.");
+ messages = ResourceBundle.getBundle(MESSAGES_BUNDLE);
+ }
+
+ if (log.isDebugEnabled()) {
+ if (messages.getLocale() == null
+ || "".equals(messages.getLocale().getLanguage())) {
+ log.info("Fallback to default locale message bundle.");
+ } else {
+ log.info("Applet message bundle loaded for {}.",
+ messages.getLocale());
+ }
+ }
+ }
+
+ protected int initButtonSize() {
+ int bs = 0;
+
+ JButton b = new JButton();
+ b.setText(getMessage(BUTTON_OK));
+ if (b.getPreferredSize().width > bs) {
+ bs = b.getPreferredSize().width;
+ }
+ // need cancel button for message dialog,
+ // even if renderCancelButton == false
+ b.setText(getMessage(BUTTON_CANCEL));
+ if (b.getPreferredSize().width > bs) {
+ bs = b.getPreferredSize().width;
+ }
+ b.setText(getMessage(BUTTON_SIGN));
+ if (b.getPreferredSize().width > bs) {
+ bs = b.getPreferredSize().width;
+ }
+ b.setText(getMessage(BUTTON_BACK));
+ if (b.getPreferredSize().width > bs) {
+ bs = b.getPreferredSize().width;
+ }
+ b.setText(getMessage(BUTTON_SAVE));
+ if (b.getPreferredSize().width > bs) {
+ bs = b.getPreferredSize().width;
+ }
+ return bs;
+ }
@Override
public void getFocusFromBrowser() {
+
+ log.debug("Try setting focus to current component ...");
+ if (primaryFocusHolder == null) {
+ log.debug("No stored component - set focus to contentPanel ...");
+
+ primaryFocusHolder = contentPanel;
+
+ }
+ log.debug("Component to obtain focus: {}.", primaryFocusHolder.getName());
+ primaryFocusHolder.requestFocus();
+
+ }
+
+ protected void updateHelpLabelIcon() {
+
+ if (helpListener.implementsListener()) {
+
+ helpLabel.setIcon(new ImageIcon(getClass().getResource(
+ getHelpLabelResourceName())));
+
+ helpLabel.setBorder(helpLabel.hasFocus() ? helpFocusBorder
+ : BorderFactory.createEmptyBorder());
+ }
+
+ }
+
+ protected String getHelpLabelResourceName() {
+
+ double contentPanelWidth = contentPanel.getSize().getWidth();
+ String resourceName = HELP_IMG;
+
+ if (contentPanelWidth > 300) {
+
+ resourceName = HELP_IMG_L;
+ }
+
+ if (contentPanelWidth > 470) {
+
+ resourceName = HELP_IMG_XL;
+ }
+
+ if (contentPanelWidth > 600) {
+
+ resourceName = HELP_IMG_XXL;
+ }
+
+ return resourceName;
+ }
+
+ protected float getResizeFactor() {
+
+ if (baseWidth == null || baseHeight == null || baseWidth == 0
+ || baseHeight == 0) {
+
+ // first call - determine base width and height
+ baseWidth = contentPanel.getWidth();
+ baseHeight = contentPanel.getHeight();
+ }
+
+ float factor = (float) contentPanel.getSize().getWidth()
+ / (float) baseWidth;
+
+ return factor;
+ }
+
+ public void resize() {
+
+ log.debug("Resizing ...");
+ updateHelpLabelIcon();
+
+ float factor = getResizeFactor();
+
+ this.sigDataFocusBorder.setBorderWidthFactor(factor);
+ this.helpFocusBorder.setBorderWidthFactor(factor);
+
+ buttonSize = (int) ((float) baseButtonSize * factor);
+
+ if (renderHeaderPanel) {
+
+ titleLabel.setFont(titleLabel.getFont().deriveFont(
+ (float) ((baseFontSize + 2) * factor)));
+ }
+
+ if (cancelButton != null) {
+
+ cancelButton.setFont(cancelButton.getFont().deriveFont(
+ (float) (baseFontSize * factor)));
+ }
+
+ if (pinField != null) {
+ pinField.setFont(pinField.getFont().deriveFont(
+ (float) (baseFontSize * factor)));
+
+ }
+
+ if (infoLabel != null) {
+ infoLabel.setFont(infoLabel.getFont().deriveFont(
+ (float) (baseFontSize * factor)));
+ }
+
+ if (pinsizeLabel != null) {
+ pinsizeLabel.setFont(pinsizeLabel.getFont().deriveFont(
+ (float) ((baseFontSize * factor) - 2)));
+
+ }
+
+ if (signPinLabel != null) {
+
+ signPinLabel.setFont(signPinLabel.getFont().deriveFont(
+ (float) (baseFontSize * factor)));
+
+ }
+
+ if (signButton != null) {
+
+ signButton.setFont(signButton.getFont().deriveFont(
+ (float) (baseFontSize * factor)));
+
+ }
+
+ if (cardPinLabel != null) {
+
+ cardPinLabel.setFont(cardPinLabel.getFont().deriveFont(
+ (float) (baseFontSize * factor)));
+
+ }
+
+ if (okButton != null) {
+
+ okButton.setFont(okButton.getFont().deriveFont(
+ (float) (baseFontSize * factor)));
+
+ }
+
+ if (pinLabel != null) {
+
+ pinLabel.setFont(pinLabel.getFont().deriveFont(
+ (float) (baseFontSize * factor)));
+
+ }
+
+ if (pinpadPINField != null) {
+
+ pinpadPINField.setFont(pinpadPINField.getFont().deriveFont(
+ (float) (baseFontSize * factor)));
+
+ }
+
+ if (msgTitleLabel != null) {
+
+ msgTitleLabel.setFont(msgTitleLabel.getFont().deriveFont(
+ (float) (baseFontSize * factor)));
+
+ }
+
+ if (msgLabel != null) {
+
+ msgLabel.setFont(msgLabel.getFont().deriveFont(
+ (float) (baseFontSize * factor)));
+
+ }
+
+ if (enterPINButton != null) {
+
+ enterPINButton.setFont(enterPINButton.getFont().deriveFont(
+ (float) (baseFontSize * factor)));
+
+ }
- // This method puts the focus to the helpLabel as this
- // element is supposed to appear in each dialogue.
- helpLabel.requestFocus();
+ if (refIdLabel != null) {
+
+ refIdLabel.setFont(refIdLabel.getFont().deriveFont(
+ (float) (baseFontSize * factor)));
+ }
+
+
+ if (backButton != null) {
+
+ backButton.setFont(backButton.getFont().deriveFont(
+ (float) (baseFontSize * factor)));
+
+ }
+
+ if (hyperlinkRenderer != null) {
+
+ hyperlinkRenderer.setFontSize((int) (baseFontSize * factor));
+ }
+
+ if (hashDataTable != null) {
+
+ hashDataTable.setRowHeight((int) (baseTableRowHeight * factor));
+
+ }
+ if (secureViewer != null && secureViewer.isVisible()) {
+
+ secureViewer.resize(factor);
+ }
+
+ try {
+
+ if (methodToRunAtResize != null) {
+ log.debug("Running required button panel renderer ...");
+ methodToRunAtResize.invoke(this);
+ } else {
+ log.debug("No MethodToRun stored.");
+ }
+
+ } catch (IllegalArgumentException e) {
+ log.error("Cannot invoke rendering method.", e);
+ } catch (IllegalAccessException e) {
+ log.error("Cannot invoke rendering method.", e);
+ } catch (InvocationTargetException e) {
+ log.error("Cannot invoke rendering method.", e);
+ }
+
+ contentPanel.validate();
+
+ log.debug("Resize done.");
+
+ }
+
+ // TODO: Define FocusTraversalPolicies for other GUIs as well, even if
+ // focus order is currently correct by chance for other GUIs
+ public class AdvancedSigPinGUIFocusTraversalPolicy extends
+ FocusTraversalPolicy {
+
+ @Override
+ public Component getComponentAfter(Container container,
+ Component component) {
+
+ if (component.equals(pinField)) {
+
+ if (signButton.isEnabled()) {
+
+ return signButton;
+ } else {
+
+ return cancelButton;
+ }
+ }
+
+ if (component.equals(signButton)) {
+
+ return cancelButton;
+ }
+
+ if (component.equals(cancelButton)) {
+
+ return infoLabel;
+ }
+ if (component.equals(infoLabel)) {
+
+ if (helpLabel != null && helpLabel.isVisible()) {
+
+ return helpLabel;
+ } else {
+
+ return switchFocusDummyLabel;
+ }
+ }
+
+ if (component.equals(helpLabel)) {
+
+ return switchFocusDummyLabel;
+ }
+
+ // should never be the case
+ if (component.equals(switchFocusDummyLabel)) {
+
+ return pinField;
+ }
+
+ // default
+ return pinField;
+ }
+
+ @Override
+ public Component getComponentBefore(Container container,
+ Component component) {
+
+ if (component.equals(pinField)) {
+
+ return switchFocusDummyLabel;
+ }
+
+ if (component.equals(signButton)) {
+
+ return pinField;
+ }
+
+ if (component.equals(cancelButton)) {
+
+ if (signButton != null && signButton.isVisible()
+ && signButton.isEnabled()) {
+
+ return signButton;
+
+ } else {
+
+ return pinField;
+ }
+ }
+
+ if (component.equals(infoLabel)) {
+
+ return cancelButton;
+ }
+
+ if (component.equals(helpLabel)) {
+
+ return infoLabel;
+ }
+
+ // should never be the case
+ if (component.equals(switchFocusDummyLabel)) {
+
+ if (helpLabel != null && helpLabel.isVisible()) {
+
+ return helpLabel;
+ } else {
+
+ return infoLabel;
+ }
+ }
+
+ // default
+ return pinField;
+ }
+
+ @Override
+ public Component getDefaultComponent(Container container) {
+
+ return pinField;
+ }
+
+ @Override
+ public Component getFirstComponent(Container container) {
+
+ return pinField;
+ }
+
+ @Override
+ public Component getLastComponent(Container container) {
+
+ return switchFocusDummyLabel;
+ }
+ }
+
+ public class AdvancedShowSigDataGUIFocusTraversalPolicy extends
+ FocusTraversalPolicy {
+
+ @Override
+ public Component getComponentAfter(Container container,
+ Component component) {
+
+ if (component.equals(enterPINButton)) {
+
+ return cancelButton;
+ }
+
+ if (component.equals(cancelButton)) {
+
+ return infoLabel;
+ }
+ if (component.equals(infoLabel)) {
+
+ if (helpLabel != null && helpLabel.isVisible()) {
+
+ return helpLabel;
+ } else {
+
+ return switchFocusDummyLabel;
+ }
+ }
+
+ if (component.equals(helpLabel)) {
+
+ return switchFocusDummyLabel;
+ }
+
+ // should never be the case
+ if (component.equals(switchFocusDummyLabel)) {
+
+ return enterPINButton;
+ }
+
+ // default
+ return enterPINButton;
+ }
+
+ @Override
+ public Component getComponentBefore(Container container,
+ Component component) {
+
+ if (component.equals(enterPINButton)) {
+
+ return switchFocusDummyLabel;
+ }
+
+ if (component.equals(cancelButton)) {
+
+ return enterPINButton;
+ }
+
+ if (component.equals(infoLabel)) {
+
+ return cancelButton;
+ }
+
+ if (component.equals(helpLabel)) {
+
+ return infoLabel;
+ }
+
+ // should never be the case
+ if (component.equals(switchFocusDummyLabel)) {
+
+ if (helpLabel != null && helpLabel.isVisible()) {
+
+ return helpLabel;
+ } else {
+
+ return infoLabel;
+ }
+ }
+
+ // default
+ return enterPINButton;
+ }
+
+ @Override
+ public Component getDefaultComponent(Container container) {
+
+ return enterPINButton;
+ }
+
+ @Override
+ public Component getFirstComponent(Container container) {
+
+ return enterPINButton;
+ }
+
+ @Override
+ public Component getLastComponent(Container container) {
+
+ return switchFocusDummyLabel;
+ }
}
}
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUIcons.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUIcons.java
index 92d6897b..b0e43291 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUIcons.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUIcons.java
@@ -22,8 +22,8 @@ import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import javax.imageio.ImageIO;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
*
@@ -31,24 +31,23 @@ import org.apache.commons.logging.LogFactory;
*/
public class BKUIcons {
- protected static final Log log = LogFactory.getLog(BKUIcons.class);
-
- /** 16x16, 24x24, 32x32, 48x48, 128x128 pixels */
+ /** 128x128, 48x48, 32x32, 24x24, 16x16 pixels */
public static final ArrayList<Image> icons = new ArrayList<Image>();
static {
String[] iconResources = new String[] {
- "/at/gv/egiz/bku/gui/chip16.png",
- "/at/gv/egiz/bku/gui/chip24.png",
- "/at/gv/egiz/bku/gui/chip32.png",
+ "/at/gv/egiz/bku/gui/chip128.png",
"/at/gv/egiz/bku/gui/chip48.png",
- "/at/gv/egiz/bku/gui/chip128.png" };
+ "/at/gv/egiz/bku/gui/chip32.png",
+ "/at/gv/egiz/bku/gui/chip24.png",
+ "/at/gv/egiz/bku/gui/chip16.png"};
for (String ir : iconResources) {
URL resource = BKUIcons.class.getResource(ir);
if (ir != null) {
try {
icons.add(ImageIO.read(resource));
} catch (IOException ex) {
+ Logger log = LoggerFactory.getLogger(BKUIcons.class);
log.warn("failed to load mocca icon " + ir, ex);
}
}
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/DeafHelpListener.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/DeafHelpListener.java
new file mode 100644
index 00000000..a4ce79b0
--- /dev/null
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/DeafHelpListener.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2008 Federal Chancellery Austria and
+ * Graz University of Technology
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package at.gv.egiz.bku.gui;
+
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseEvent;
+import java.util.Locale;
+
+public class DeafHelpListener extends HelpListener {
+
+ // localization in helpListener (pass message bundle, getLocale, add language to helpContext) or outside?
+ public DeafHelpListener(String helpURL, Locale locale) {
+ super(helpURL, locale);
+ }
+
+ @Override
+ public boolean implementsListener() {
+ return false;
+ }
+
+ @Override
+ public void mouseClicked(MouseEvent arg0) {
+ }
+
+ @Override
+ public void keyPressed(KeyEvent arg0) {
+ }
+
+ @Override
+ public void mousePressed(MouseEvent e) {
+ }
+
+ @Override
+ public void mouseReleased(MouseEvent e) {
+ }
+
+ @Override
+ public void mouseEntered(MouseEvent e) {
+ }
+
+ @Override
+ public void mouseExited(MouseEvent e) {
+ }
+
+ @Override
+ public void keyTyped(KeyEvent e) {
+ }
+
+ @Override
+ public void keyReleased(KeyEvent e) {
+ }
+
+}
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/DefaultHelpListener.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/DefaultHelpListener.java
deleted file mode 100644
index 032c8fe5..00000000
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/DefaultHelpListener.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright 2008 Federal Chancellery Austria and
- * Graz University of Technology
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package at.gv.egiz.bku.gui;
-
-import java.applet.AppletContext;
-import java.net.URL;
-import java.util.Locale;
-import javax.swing.SwingUtilities;
-
-/**
- *
- * @author Clemens Orthacker <clemens.orthacker@iaik.tugraz.at>
- */
-public class DefaultHelpListener extends AbstractHelpListener {
-
- /**
- * applet context to open external links in help pages,
- * if null, no external links will be opened
- */
- protected AppletContext ctx;
-
- /**
- *
- * @param ctx open external links via applet context
- * @param helpURL
- * @param locale
- */
- public DefaultHelpListener(AppletContext ctx, URL helpURL, Locale locale) {
- super(helpURL, locale);
- this.ctx = ctx;
- }
-
- /**
- * external links in help document are not opened
- * @param helpURL
- * @param locale
- */
- public DefaultHelpListener(URL helpURL, Locale locale) {
- super(helpURL, locale);
- this.ctx = null;
- }
-
- /**
- * blocks until help viewer returns (is closed)
- * @param helpURL
- * @param helpTopic ignored
- */
- @Override
- public void showDocument(final URL helpURL, final String helpTopic) {
- log.debug("schedule help dialog");
-
- SwingUtilities.invokeLater(new Runnable() {
-
- @Override
- public void run() {
-
- log.debug("show help dialog");
-
- if (ctx == null) {
- HelpViewer.showHelpDialog(helpURL, messages);
- } else {
- HelpViewer.showHelpDialog(ctx, helpURL, messages);
- }
- }
- });
- }
-}
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/FocusBorder.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/FocusBorder.java
new file mode 100644
index 00000000..2c25d46b
--- /dev/null
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/FocusBorder.java
@@ -0,0 +1,69 @@
+package at.gv.egiz.bku.gui;
+
+import java.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.Insets;
+import java.awt.geom.Rectangle2D;
+
+import javax.swing.border.Border;
+
+
+public class FocusBorder implements Border {
+
+ private static final Color DEFAULT_COLOR = Color.BLACK;
+
+ private Color color;
+ private float borderWidthFactor;
+
+ public FocusBorder() {
+
+ this.color = DEFAULT_COLOR;
+ this.borderWidthFactor = 1.0f;
+ }
+
+ public FocusBorder(Color borderColor) {
+
+ this.color = borderColor;
+ this.borderWidthFactor = 1.0f;
+ }
+
+ @Override
+ public Insets getBorderInsets(Component c) {
+
+ return new Insets(3, 3, 6, 6);
+ }
+
+ @Override
+ public boolean isBorderOpaque() {
+
+ return true;
+ }
+
+ @Override
+ public void paintBorder(Component c, Graphics g, int x, int y, int width,
+ int height) {
+ Graphics2D g2 = (Graphics2D) g;
+
+ g2.setPaint(color);
+ float[] dash1 = { 2.0f };
+
+ g2.setStroke(new BasicStroke(1.0f * borderWidthFactor, BasicStroke.CAP_BUTT,
+ BasicStroke.JOIN_MITER, 10.0f, dash1, 0.0f));
+
+ g2.draw(new Rectangle2D.Double(x + 1, y + 1, width - 6, height - 6));
+
+ }
+
+ public void setColor(Color color) {
+ this.color = color;
+ }
+
+ public void setBorderWidthFactor(float borderWidthFactor) {
+
+ this.borderWidthFactor = borderWidthFactor;
+ }
+
+}
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataTableModel.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataTableModel.java
index 70842102..320c92a9 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataTableModel.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataTableModel.java
@@ -19,8 +19,6 @@ package at.gv.egiz.bku.gui;
import at.gv.egiz.stal.HashDataInput;
import java.util.List;
import javax.swing.table.DefaultTableModel;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
/**
*
@@ -28,10 +26,10 @@ import org.apache.commons.logging.LogFactory;
*/
class HashDataTableModel extends DefaultTableModel {
- protected static final Log log = LogFactory.getLog(HashDataTableModel.class);
-
+ private static final long serialVersionUID = 1L;
+
/** HashDataInput in first column, register hyperlinkrenderer only here */
- protected Class[] types;
+ protected Class<?>[] types;
protected List<HashDataInput> hashDataInputs;
public HashDataTableModel(List<HashDataInput> hashDataInputs, boolean twoColLayout) {
@@ -52,7 +50,7 @@ class HashDataTableModel extends DefaultTableModel {
}
@Override
- public Class getColumnClass(int columnIndex) {
+ public Class<?> getColumnClass(int columnIndex) {
return types[columnIndex];
}
@@ -60,4 +58,4 @@ class HashDataTableModel extends DefaultTableModel {
public boolean isCellEditable(int rowIndex, int columnIndex) {
return false;
}
-} \ No newline at end of file
+}
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HelpKeyListener.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HelpKeyListener.java
deleted file mode 100644
index 4ca20f7e..00000000
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HelpKeyListener.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package at.gv.egiz.bku.gui;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.KeyAdapter;
-import java.awt.event.KeyEvent;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- *
- * @author Thomas Zefferer <thomas.zefferer@iaik.tugraz.at>
- */
-public class HelpKeyListener extends KeyAdapter {
-
- protected static final Log log = LogFactory.getLog(HelpKeyListener.class);
-
- protected ActionListener helpListener;
- protected String locale;
- protected String topic;
-
- public HelpKeyListener(ActionListener externalHelpListener) {
- super();
- this.helpListener = externalHelpListener;
- }
-
- public void setHelpTopic(String topic) {
- log.trace("setting help topic: " + topic);
- this.topic = topic;
- }
-
- public ActionListener getActionListener() {
- return helpListener;
- }
-
- @Override
- public void keyPressed(KeyEvent arg0) {
-
- if(arg0.getKeyCode() == KeyEvent.VK_ENTER) {
- ActionEvent e = new ActionEvent(this, ActionEvent.ACTION_PERFORMED, topic);
- helpListener.actionPerformed(e);
- }
- }
-
-}
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HelpListener.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HelpListener.java
new file mode 100644
index 00000000..dc597656
--- /dev/null
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HelpListener.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2008 Federal Chancellery Austria and
+ * Graz University of Technology
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package at.gv.egiz.bku.gui;
+
+import java.awt.event.KeyListener;
+import java.awt.event.MouseListener;
+import java.util.Locale;
+import java.util.ResourceBundle;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public abstract class HelpListener implements MouseListener, KeyListener, HelpURLProvider {
+
+ public static final String MESSAGE_BUNDLE = "at/gv/egiz/bku/gui/Messages";
+
+ private final Logger log = LoggerFactory.getLogger(HelpListener.class);
+ private String helpURL;
+ protected String helpTopic;
+ protected ResourceBundle messageBundle;
+
+ // localization in helpListener (pass message bundle, getLocale, add language to helpContext) or outside?
+ public HelpListener(String helpURL, Locale locale) {
+// this.codebase = codebase;
+ this.helpURL = helpURL;
+
+ if (locale != null) {
+ log.trace("Check for support of requested help locale {}.", locale.getLanguage().substring(0,2));
+ messageBundle = ResourceBundle.getBundle(MESSAGE_BUNDLE,
+ new Locale(locale.getLanguage().substring(0, 2)));
+ } else {
+ messageBundle = ResourceBundle.getBundle(MESSAGE_BUNDLE);
+ }
+ if (!"".equals(messageBundle.getLocale().getLanguage())) {
+ log.trace("Using help locale '{}'.", messageBundle.getLocale().getLanguage().substring(0,2));
+ helpURL += messageBundle.getLocale().getLanguage().substring(0,2) + '/';
+ } else {
+ log.trace("Using help locale 'default'.");
+ }
+
+ log.debug("Setting help context to {}.", helpURL);
+ }
+
+ @Override
+ public synchronized void setHelpTopic(String topic) {
+ log.trace("Setting help topic: {}.", topic);
+ helpTopic = topic;
+ }
+
+ @Override
+ public synchronized String getHelpURL() {
+ if (helpTopic == null) {
+ log.debug("No help topic set, return index.");
+ return helpURL + "index.html";
+ }
+ String url = helpURL + helpTopic + ".html";
+ log.debug("Return help topic: {}.", url);
+ return url;
+ }
+
+ /**
+ * By default, HelpListener cannot handle action events and acts as (deaf) help context only.
+ * Subclasses may add listener functionality.
+ *
+ * Whether a listener is available so that GUI elements may be included to provide context help.
+ * (whether a help icon shall be included)
+ * @return true if this HelpListener implements the Mouse/KeyListeners
+ */
+ public abstract boolean implementsListener();
+
+}
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HelpMouseListener.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HelpMouseListener.java
deleted file mode 100644
index b7bbe971..00000000
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HelpMouseListener.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright 2008 Federal Chancellery Austria and
- * Graz University of Technology
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package at.gv.egiz.bku.gui;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-public class HelpMouseListener extends MouseAdapter {
-
- protected static final Log log = LogFactory.getLog(HelpMouseListener.class);
-
- protected ActionListener helpListener;
- protected String locale;
- protected String topic;
-
- public HelpMouseListener(ActionListener externalHelpListener) {
- super();
- this.helpListener = externalHelpListener;
- }
-
- public void setHelpTopic(String topic) {
- log.trace("setting help topic: " + topic);
- this.topic = topic;
- }
-
- public ActionListener getActionListener() {
- return helpListener;
- }
-
- @Override
- public void mouseClicked(MouseEvent arg0) {
- ActionEvent e = new ActionEvent(this, ActionEvent.ACTION_PERFORMED, topic);
- helpListener.actionPerformed(e);
- }
-}
diff --git a/bkucommon/src/test/java/at/gv/egiz/bku/conf/DummyConfiguration.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HelpURLProvider.java
index 1e0e5aa9..f310705c 100644
--- a/bkucommon/src/test/java/at/gv/egiz/bku/conf/DummyConfiguration.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HelpURLProvider.java
@@ -1,13 +1,13 @@
/*
* Copyright 2008 Federal Chancellery Austria and
* Graz University of Technology
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -15,18 +15,19 @@
* limitations under the License.
*/
-package at.gv.egiz.bku.conf;
+
+package at.gv.egiz.bku.gui;
/**
- *
+ * Make current context dependent help topic available (outside the applet).
+ * Updated by the GUI whenever the current help topic changes.
+ *
* @author Clemens Orthacker <clemens.orthacker@iaik.tugraz.at>
*/
-public class DummyConfiguration extends Configuration {
+public interface HelpURLProvider {
- public DummyConfiguration() {
- this.setMaxDataUrlHops(MAX_DATAURL_HOPS_DEFAULT);
- //this.set...
- }
+ void setHelpTopic(String helpTopic);
+ String getHelpURL();
}
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HelpViewer.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HelpViewer.java
index 0f887f78..bfd797e8 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HelpViewer.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HelpViewer.java
@@ -39,8 +39,8 @@ import javax.swing.LayoutStyle;
import javax.swing.SwingUtilities;
import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkListener;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
*
@@ -49,7 +49,10 @@ import org.apache.commons.logging.LogFactory;
public class HelpViewer extends JDialog
implements ActionListener {
- protected static final Log log = LogFactory.getLog(HelpViewer.class);
+ private static final long serialVersionUID = 1L;
+
+ private final Logger log = LoggerFactory.getLogger(HelpViewer.class);
+
private static HelpViewer dialog;
protected ResourceBundle messages;
protected AppletContext ctx;
@@ -128,7 +131,7 @@ public class HelpViewer extends JDialog
}
private JPanel createViewerPanel(URL helpURL) { //String viewerLabelText,
- log.debug("viewer dialog: " + helpURL.toString());
+ log.debug("Viewer dialog: {}.", helpURL.toString());
final JEditorPane viewer = new JEditorPane();
viewer.setEditable(false);
@@ -146,7 +149,7 @@ public class HelpViewer extends JDialog
final URL url = e.getURL();
if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
if (ctx != null) {
- log.debug("open external link in help viewer: " + url);
+ log.debug("Open external link in help viewer: {}.", url);
ctx.showDocument(url, "_blank");
} else {
SwingUtilities.invokeLater(new Runnable() {
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HyperlinkRenderer.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HyperlinkRenderer.java
index 6af22815..9552bdde 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HyperlinkRenderer.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HyperlinkRenderer.java
@@ -26,10 +26,14 @@ import javax.swing.table.DefaultTableCellRenderer;
*/
public class HyperlinkRenderer extends DefaultTableCellRenderer {
+ private static final long serialVersionUID = 1L;
+
protected boolean renderReferenceId;
+ protected int fontSize;
public HyperlinkRenderer(boolean renderReferenceId) {
this.renderReferenceId = renderReferenceId;
+ this.fontSize = super.getFont().getSize();
}
/**
@@ -49,6 +53,13 @@ public class HyperlinkRenderer extends DefaultTableCellRenderer {
}
}
super.setText("<html><u>" + hrefText + "</u></html>");
+ super.setFont(super.getFont().deriveFont((float) (fontSize)));
setForeground(BKUGUIFacade.HYPERLINK_COLOR);
}
+
+ public void setFontSize(int fontSize) {
+
+ this.fontSize = fontSize;
+ }
+
}
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/ImagePanel.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/ImagePanel.java
index 6a738acb..f18bef6b 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/ImagePanel.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/ImagePanel.java
@@ -30,6 +30,8 @@ import javax.swing.JPanel;
*/
public class ImagePanel extends JPanel {
+ private static final long serialVersionUID = 1L;
+
protected Image backgroundImg;
public ImagePanel(URL background) {
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SecureViewerDialog.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SecureViewerDialog.java
index b0c8ecd4..f4942a61 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SecureViewerDialog.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SecureViewerDialog.java
@@ -28,10 +28,6 @@ import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
-import java.awt.event.KeyAdapter;
-import java.awt.event.KeyEvent;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.BufferedReader;
@@ -56,8 +52,8 @@ import javax.swing.text.Document;
import javax.swing.text.EditorKit;
import javax.swing.text.StyledEditorKit;
import javax.swing.text.html.HTMLEditorKit;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
*
@@ -65,7 +61,9 @@ import org.apache.commons.logging.LogFactory;
*/
public class SecureViewerDialog extends JDialog {
- /** don't import BKUFonts in order not to load BKUFonts.jar
+ private static final long serialVersionUID = 1L;
+
+/** don't import BKUFonts in order not to load BKUFonts.jar
* BKUApplet includes BKUFonts as runtime dependency only, the jar is copied to the applet dir in BKUOnline with dependency-plugin
* BKUViewer has compile dependency BKUFonts, transitive in BKUOnline and BKULocal
*/
@@ -77,14 +75,25 @@ public class SecureViewerDialog extends JDialog {
SUPPORTED_MIME_TYPES.add("application/xhtml+xml");
SUPPORTED_MIME_TYPES.add("text/html");
}
- protected static final Log log = LogFactory.getLog(SecureViewerDialog.class);
-// private static SecureViewerDialog dialog;
+ private final Logger log = LoggerFactory.getLogger(SecureViewerDialog.class);
protected ResourceBundle messages;
protected JEditorPane viewer;
protected JLabel viewerLabel;
protected JScrollPane scrollPane;
- protected HashDataInput content; //remember for save dialog
+ protected HashDataInput content; //remember for save dialog and for resizing
protected FontProvider fontProvider;
+ protected HelpListener helpListener;
+
+ protected JButton closeButton;
+ protected JButton saveButton;
+
+ protected int baseFontSize;
+ protected int baseButtonSize;
+
+ protected float resizeFactor;
+
+ protected ActionListener closeListener;
+ protected String closeCommand;
/**
* Create and display a modal SecureViewer dialog.
@@ -95,14 +104,25 @@ public class SecureViewerDialog extends JDialog {
*/
public SecureViewerDialog(Frame owner, ResourceBundle messages,
ActionListener closeListener, String closeCommand,
- FontProvider fontProvider, ActionListener helpListener) {
- super(owner, messages.getString(BKUGUIFacade.WINDOWTITLE_VIEWER), true);
+ FontProvider fontProvider,
+ HelpListener helpListener, float resizeFactor) {
+ super(owner, messages.getString(BKUGUIFacade.WINDOWTITLE_VIEWER), false);
this.setIconImages(BKUIcons.icons);
this.messages = messages;
this.fontProvider = fontProvider;
-
+ this.helpListener = helpListener;
+
+ this.baseFontSize = new JLabel().getFont().getSize();
+
+ this.resizeFactor = 1.0f;
+ this.closeListener = closeListener;
+ this.closeCommand = closeCommand;
+
+ this.resizeFactor = resizeFactor;
+
+
initContentPane(VIEWER_DIMENSION,
- createViewerPanel(helpListener),
+ createViewerPanel(),
createButtonPanel(closeListener, closeCommand));
// also leave defaultWindowClosing HIDE_ON_CLOSE
@@ -115,8 +135,28 @@ public class SecureViewerDialog extends JDialog {
} else {
setLocationByPlatform(true);
}
+
+
}
+ public void resize(float resizeFactor) {
+
+ log.debug("Resizing secure viewer ...");
+ this.resizeFactor = resizeFactor;
+
+ getContentPane().removeAll();
+
+ initContentPane(VIEWER_DIMENSION,
+ createViewerPanel(),
+ createButtonPanel(closeListener, closeCommand));
+
+ this.setContent(content);
+
+ getContentPane().validate();
+
+
+ }
+
private void initContentPane(Dimension preferredSize,
JPanel viewerPanel, JPanel buttonPanel) {
Container contentPane = getContentPane();
@@ -135,9 +175,10 @@ public class SecureViewerDialog extends JDialog {
/**
* @param helpListener may be null
*/
- private JPanel createViewerPanel(final ActionListener helpListener) {
+ private JPanel createViewerPanel() {
viewer = new JEditorPane();
viewer.setEditable(false);
+
viewer.putClientProperty(JEditorPane.HONOR_DISPLAY_PROPERTIES, Boolean.TRUE);
scrollPane = new JScrollPane();
@@ -156,30 +197,13 @@ public class SecureViewerDialog extends JDialog {
infoHorizontal.addComponent(viewerLabel);
infoVertical.addComponent(viewerLabel);
- if (helpListener != null) {
+ if (helpListener.implementsListener()) {
final JLabel helpLabel = new JLabel();
helpLabel.setFocusable(true);
helpLabel.setIcon(new ImageIcon(getClass().getResource(BKUGUIFacade.HELP_IMG)));
helpLabel.getAccessibleContext().setAccessibleName(messages.getString(BKUGUIFacade.ALT_HELP));
- helpLabel.addMouseListener(new MouseAdapter() {
-
- @Override
- public void mouseClicked(MouseEvent arg0) {
- ActionEvent e = new ActionEvent(this, ActionEvent.ACTION_PERFORMED, BKUGUIFacade.HELP_HASHDATAVIEWER);
- helpListener.actionPerformed(e);
- }
- });
- helpLabel.addKeyListener(new KeyAdapter() {
-
- @Override
- public void keyPressed(KeyEvent arg0) {
-
- if (arg0.getKeyCode() == KeyEvent.VK_ENTER) {
- ActionEvent e = new ActionEvent(this, ActionEvent.ACTION_PERFORMED, BKUGUIFacade.HELP_HASHDATAVIEWER);
- helpListener.actionPerformed(e);
- }
- }
- });
+ helpLabel.addMouseListener(helpListener);
+ helpLabel.addKeyListener(helpListener);
helpLabel.addFocusListener(new FocusAdapter() {
@@ -220,7 +244,9 @@ public class SecureViewerDialog extends JDialog {
*/
public void setContent(HashDataInput hashDataInput) { //throws FontProviderException {
- log.debug("[" + Thread.currentThread().getName() + "] set viewer content");
+ log.debug("[{}] set viewer content.", Thread.currentThread().getName());
+
+ helpListener.setHelpTopic(BKUGUIFacade.HELP_HASHDATAVIEWER);
this.content = null;
viewer.setText(null);
@@ -229,7 +255,7 @@ public class SecureViewerDialog extends JDialog {
if (mimeType == null) {
mimeType = "text/plain";
}
- log.debug("secure viewer mime type: " + mimeType);
+ log.debug("Secure viewer mime type: {}.", mimeType);
// loads editorkit for text/plain if unrecognized
viewer.setContentType(mimeType);
@@ -237,11 +263,11 @@ public class SecureViewerDialog extends JDialog {
if ("text/plain".equals(mimeType)) {
viewer.setEditorKit(new StyledEditorKit());
- viewer.setFont(fontProvider.getFont().deriveFont(Font.PLAIN, viewer.getFont().getSize()));
+ viewer.setFont(fontProvider.getFont().deriveFont(Font.PLAIN, viewer.getFont().getSize() * resizeFactor));
} else if ("application/xhtml+xml".equals(mimeType)) {
viewer.setEditorKit(new HTMLEditorKit());
//reset font if fontprovider font was set before (TODO also html font from fontprovider)
- viewer.setFont(new Font("Dialog", Font.PLAIN, viewer.getFont().getSize())); //UIManager.getFont("Label.font"));
+ viewer.setFont(new Font("Dialog", Font.PLAIN, (int)(viewer.getFont().getSize() * resizeFactor))); //UIManager.getFont("Label.font"));
}
EditorKit editorKit = viewer.getEditorKit();
@@ -249,7 +275,7 @@ public class SecureViewerDialog extends JDialog {
// document.putProperty("IgnoreCharsetDirective", new Boolean(true));
Charset cs = (hashDataInput.getEncoding() == null) ? Charset.forName("UTF-8") : Charset.forName(hashDataInput.getEncoding());
- log.debug("secure viewer encoding: " + cs.toString());
+ log.debug("Secure viewer encoding: {}.", cs.toString());
InputStreamReader isr = new InputStreamReader(hashDataInput.getHashDataInput(), cs);
Reader contentReader = new BufferedReader(isr);
@@ -270,6 +296,11 @@ public class SecureViewerDialog extends JDialog {
}
viewer.setCaretPosition(0);
+ if (viewer.getText() != null) {
+ viewer.getAccessibleContext().setAccessibleDescription(
+ viewer.getText());
+ }
+
scrollPane.setViewportView(viewer);
scrollPane.setPreferredSize(viewer.getPreferredSize());
scrollPane.setAlignmentX(LEFT_ALIGNMENT);
@@ -280,21 +311,33 @@ public class SecureViewerDialog extends JDialog {
viewerLabel.setText("");
}
- log.debug("VIEWER FONT: " + viewer.getFont());
+ viewer.setFocusable(Boolean.TRUE);
+
+ log.debug("VIEWER FONT: {}.", viewer.getFont());
setVisible(true);
toFront();
+
+ viewer.requestFocus();
+
}
private JPanel createButtonPanel(ActionListener closeListener, String closeCommand) {
- JButton closeButton = new JButton();
+
+ closeButton = new JButton();
+
closeButton.setText(messages.getString(BKUGUIFacade.BUTTON_CLOSE));
closeButton.setActionCommand(closeCommand);
closeButton.addActionListener(new CloseButtonListener(closeListener));
-
- JButton saveButton = new JButton();
+ closeButton.setFont(closeButton.getFont().deriveFont(
+ (float) (baseFontSize * resizeFactor)));
+
+ saveButton = new JButton();
saveButton.setText(messages.getString(BKUGUIFacade.BUTTON_SAVE));
saveButton.addActionListener(new SaveButtonListener());
+ saveButton.setFont(saveButton.getFont().deriveFont(
+ (float) (baseFontSize * resizeFactor)));
+
int buttonSize = closeButton.getPreferredSize().width;
if (saveButton.getPreferredSize().width > buttonSize) {
buttonSize = saveButton.getPreferredSize().width;
@@ -324,7 +367,7 @@ public class SecureViewerDialog extends JDialog {
@Override
public void windowClosing(WindowEvent e) {
- log.trace("[" + Thread.currentThread().getName() + "] closing secure viewer");
+ log.trace("[{}] closing secure viewer.", Thread.currentThread().getName());
setVisible(false);
if (closeListener != null) {
closeListener.actionPerformed(new ActionEvent(e.getSource(), e.getID(), closeCommand));
@@ -342,7 +385,7 @@ public class SecureViewerDialog extends JDialog {
@Override
public void actionPerformed(ActionEvent e) {
- log.trace("[" + Thread.currentThread().getName() + "] closing secure viewer");
+ log.trace("[{}] closing secure viewer.", Thread.currentThread().getName());
setVisible(false);
if (closeListener != null) {
closeListener.actionPerformed(e);
@@ -354,8 +397,8 @@ public class SecureViewerDialog extends JDialog {
@Override
public void actionPerformed(ActionEvent e) {
- log.trace("[" + Thread.currentThread().getName() + "] display secure viewer save dialog");
- SecureViewerSaveDialog.showSaveDialog(content, messages, null, null);
+ log.trace("[{}] display secure viewer save dialog.", Thread.currentThread().getName());
+ SecureViewerSaveDialog.showSaveDialog(content, messages, null, null, closeButton.getFont().getSize());
}
}
}
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SwitchFocusFocusListener.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SwitchFocusFocusListener.java
index 06e37a89..66679291 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SwitchFocusFocusListener.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SwitchFocusFocusListener.java
@@ -1,38 +1,44 @@
-package at.gv.egiz.bku.gui;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.FocusAdapter;
-import java.awt.event.FocusEvent;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- *
- * @author Thomas Zefferer <thomas.zefferer@iaik.tugraz.at>
- */
-public class SwitchFocusFocusListener extends FocusAdapter {
-
- protected static final Log log = LogFactory.getLog(SwitchFocusFocusListener.class);
-
- protected ActionListener swichFocusListener;
-
- public SwitchFocusFocusListener(ActionListener externalSwitchFocusListener) {
- super();
- this.swichFocusListener = externalSwitchFocusListener;
- }
-
- public ActionListener getActionListener() {
- return swichFocusListener;
- }
-
- @Override
- public void focusGained(FocusEvent arg0) {
-
- ActionEvent e = new ActionEvent(this, ActionEvent.ACTION_PERFORMED, null);
- swichFocusListener.actionPerformed(e);
- }
-
-
-}
+package at.gv.egiz.bku.gui;
+
+import java.awt.Component;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.FocusAdapter;
+import java.awt.event.FocusEvent;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ *
+ * @author Thomas Zefferer <thomas.zefferer@iaik.tugraz.at>
+ */
+public class SwitchFocusFocusListener extends FocusAdapter {
+
+ private final Logger log = LoggerFactory.getLogger(SwitchFocusFocusListener.class);
+
+ protected ActionListener swichFocusListener;
+
+ public SwitchFocusFocusListener(ActionListener externalSwitchFocusListener) {
+ super();
+ this.swichFocusListener = externalSwitchFocusListener;
+ }
+
+ public ActionListener getActionListener() {
+ return swichFocusListener;
+ }
+
+ @Override
+ public void focusGained(FocusEvent arg0) {
+
+ log.debug("SwitchFocusFocusListener detected focusGained event!");
+ Component comp = arg0.getComponent();
+ log.debug("Component that caused event: {}.", comp.getName());
+ comp.transferFocus();
+
+ ActionEvent e = new ActionEvent(this, ActionEvent.ACTION_PERFORMED, null);
+ swichFocusListener.actionPerformed(e);
+ }
+
+
+}
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SwitchFocusListener.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SwitchFocusListener.java
index 48b641e2..171d24b8 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SwitchFocusListener.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SwitchFocusListener.java
@@ -1,44 +1,54 @@
-package at.gv.egiz.bku.gui;
-
-import java.applet.AppletContext;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- *
- * @author Thomas Zefferer <thomas.zefferer@iaik.tugraz.at>
- */
-public class SwitchFocusListener implements ActionListener {
-
- protected final static Log log = LogFactory.getLog(SwitchFocusListener.class);
-
- protected AppletContext ctx;
- protected String javascriptFunction;
-
- public SwitchFocusListener(AppletContext ctx, String javascriptFunction) {
-
- this.ctx = ctx;
- this.javascriptFunction = javascriptFunction;
- }
-
- @Override
- public void actionPerformed(ActionEvent e) {
-
- try {
- ctx.showDocument
- (new URL("javascript:" + javascriptFunction));
- }
- catch (MalformedURLException me) {
-
- log.warn("Unable to call external javascript function.", me);
- }
-
-
- }
-
-}
+package at.gv.egiz.bku.gui;
+
+import java.applet.AppletContext;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ *
+ * @author Thomas Zefferer <thomas.zefferer@iaik.tugraz.at>
+ */
+public class SwitchFocusListener implements ActionListener {
+
+ private final Logger log = LoggerFactory.getLogger(SwitchFocusListener.class);
+
+ protected String functionName;
+ protected AppletContext ctx;
+ protected String javascriptFunction;
+
+ public SwitchFocusListener(AppletContext ctx, String javascriptFunctionName) {
+
+ this.ctx = ctx;
+ this.functionName = javascriptFunctionName;
+ buildJSFunction();
+ }
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+
+ log.debug("SwitchFocusListener fires!");
+
+ try {
+ ctx.showDocument
+ (new URL("javascript:" + javascriptFunction));
+ }
+ catch (MalformedURLException me) {
+
+ log.warn("Unable to call external javascript function.", me);
+ }
+
+
+ }
+
+ protected void buildJSFunction() {
+
+ this.javascriptFunction = functionName + "()";
+
+ }
+
+}
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/ViewerHelpListener.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/ViewerHelpListener.java
new file mode 100644
index 00000000..4860756d
--- /dev/null
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/ViewerHelpListener.java
@@ -0,0 +1,101 @@
+/*
+ * Copyright 2008 Federal Chancellery Austria and
+ * Graz University of Technology
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package at.gv.egiz.bku.gui;
+
+import java.applet.AppletContext;
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseEvent;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Locale;
+import javax.swing.SwingUtilities;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ViewerHelpListener extends HelpListener {
+
+ private final Logger log = LoggerFactory.getLogger(ViewerHelpListener.class);
+
+ protected AppletContext appletCtx;
+
+ public ViewerHelpListener(String helpURL, Locale locale) {
+ super(helpURL, locale);
+ }
+
+ public ViewerHelpListener(AppletContext ctx, String helpURL, Locale locale) {
+ super(helpURL, locale);
+ this.appletCtx = ctx;
+ }
+
+ protected void displayHelpViewer(final String helpURL) {
+ log.debug("Schedule help viewer.");
+
+ SwingUtilities.invokeLater(new Runnable() {
+
+ @Override
+ public void run() {
+
+ log.debug("Show help viewer for {}.", helpURL);
+ try {
+ HelpViewer.showHelpDialog(appletCtx, new URL(helpURL), messageBundle);
+ } catch (MalformedURLException ex) {
+ log.error("Failed to construct help context URL.", ex);
+ }
+ }
+ });
+ }
+
+ @Override
+ public boolean implementsListener() {
+ return true;
+ }
+
+ @Override
+ public void mouseClicked(MouseEvent arg0) {
+ displayHelpViewer(getHelpURL());
+ }
+
+ @Override
+ public void keyPressed(KeyEvent arg0) {
+ displayHelpViewer(getHelpURL());
+ }
+
+ @Override
+ public void mousePressed(MouseEvent e) {
+ }
+
+ @Override
+ public void mouseReleased(MouseEvent e) {
+ }
+
+ @Override
+ public void mouseEntered(MouseEvent e) {
+ }
+
+ @Override
+ public void mouseExited(MouseEvent e) {
+ }
+
+ @Override
+ public void keyTyped(KeyEvent e) {
+ }
+
+ @Override
+ public void keyReleased(KeyEvent e) {
+ }
+}
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/WindowCloseAdapter.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/WindowCloseAdapter.java
new file mode 100644
index 00000000..ad798aed
--- /dev/null
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/WindowCloseAdapter.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2008 Federal Chancellery Austria and
+ * Graz University of Technology
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package at.gv.egiz.bku.gui;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ *
+ * @author Clemens Orthacker <clemens.orthacker@iaik.tugraz.at>
+ */
+public class WindowCloseAdapter extends WindowAdapter {
+
+ private final Logger log = LoggerFactory.getLogger(WindowCloseAdapter.class);
+
+ protected ActionListener closeListener;
+ protected String closeCommand;
+
+ void registerListener(ActionListener closeListener, String closeCommand) {
+ log.debug("Register close listener for action command {}.", closeCommand);
+ this.closeListener = closeListener;
+ this.closeCommand = closeCommand;
+ }
+
+ @Override
+ public void windowClosing(WindowEvent e) {
+ log.debug("Received window closing event: {}.", e.paramString());
+
+ if (closeListener != null) {
+ log.debug("Notifying closeListener ...");
+ closeListener.actionPerformed(new ActionEvent(e.getSource(), e.getID(), closeCommand));
+ }
+ }
+
+
+}
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/html/RestrictedHTMLEditorKit.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/html/RestrictedHTMLEditorKit.java
index 680bf1a4..2ae8f87e 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/html/RestrictedHTMLEditorKit.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/html/RestrictedHTMLEditorKit.java
@@ -29,7 +29,8 @@ import javax.swing.text.html.HTMLEditorKit;
*/
public class RestrictedHTMLEditorKit extends HTMLEditorKit {
-
+ private static final long serialVersionUID = 1L;
+
public static class RestrictedHTMLFactory extends HTMLFactory {
@Override
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/viewer/FontProviderException.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/viewer/FontProviderException.java
index 5a6a277e..ee9b05de 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/viewer/FontProviderException.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/viewer/FontProviderException.java
@@ -23,6 +23,8 @@ package at.gv.egiz.bku.gui.viewer;
*/
public class FontProviderException extends Exception {
+ private static final long serialVersionUID = 1L;
+
public FontProviderException(String msg, Throwable cause) {
super(msg, cause);
}
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/viewer/SecureViewerSaveDialog.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/viewer/SecureViewerSaveDialog.java
index 3303d4ef..335a8599 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/viewer/SecureViewerSaveDialog.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/viewer/SecureViewerSaveDialog.java
@@ -1,5 +1,8 @@
package at.gv.egiz.bku.gui.viewer;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.BufferedOutputStream;
@@ -8,39 +11,51 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.text.MessageFormat;
-import java.util.Locale;
import java.util.ResourceBundle;
import javax.swing.JFileChooser;
+import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
+import javax.swing.UIManager;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import at.gv.egiz.bku.gui.BKUGUIFacade;
import at.gv.egiz.stal.HashDataInput;
public class SecureViewerSaveDialog {
- protected static final Log log = LogFactory.getLog(SecureViewerSaveDialog.class);
-
+ private static void setFileChooserFont(Component[] comp, Font font) {
+ for (int i = 0; i < comp.length; i++) {
+ if (comp[i] instanceof Container)
+ setFileChooserFont(((Container) comp[i]).getComponents(), font);
+ try {
+ comp[i].setFont(font);
+ } catch (Exception e) {
+ Logger log = LoggerFactory.getLogger(SecureViewerSaveDialog.class);
+ log.warn("FileChooser component font could not be set");
+ }
+ }
+ }
+
public static void showSaveDialog(final HashDataInput hashDataInput, final ResourceBundle messages,
- final ActionListener okListener, final String okCommand) {
-
- log.debug("[" + Thread.currentThread().getName()
- + "] scheduling save dialog");
+ final ActionListener okListener, final String okCommand, final int fontSize) {
+
+ final Logger log = LoggerFactory.getLogger(SecureViewerSaveDialog.class);
+ log.debug("[{}] Scheduling save dialog.", Thread.currentThread().getName());
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
- log
- .debug("[" + Thread.currentThread().getName()
- + "] show save dialog");
+ log.debug("[{}] Show save dialog.", Thread.currentThread().getName());
String userHome = System.getProperty("user.home");
+
+ UIManager.put("Button.defaultButtonFollowsFocus", Boolean.TRUE);
JFileChooser fileDialog = new JFileChooser(userHome);
fileDialog.setMultiSelectionEnabled(false);
@@ -58,6 +73,9 @@ public class SecureViewerSaveDialog {
+ MimeFilter.getExtension(mimeType);
fileDialog.setSelectedFile(new File(userHome, filename));
+ setFileChooserFont(fileDialog.getComponents(), new JLabel()
+ .getFont().deriveFont((float) fontSize));
+
// parent contentPane -> placed over applet
switch (fileDialog.showSaveDialog(fileDialog)) {
case JFileChooser.APPROVE_OPTION:
@@ -75,8 +93,8 @@ public class SecureViewerSaveDialog {
}
}
if (log.isDebugEnabled()) {
- log.debug("writing hashdata input " + id + " (" + mimeType
- + ") to file " + file);
+ Object[] args = {id, mimeType, file};
+ log.debug("Writing hashdata input {} ({}) to file {}.", args);
}
FileOutputStream fos = null;
try {
@@ -90,8 +108,7 @@ public class SecureViewerSaveDialog {
bos.flush();
bos.close();
} catch (IOException ex) {
- log.error("Failed to write " + file + ": " + ex.getMessage());
- log.debug(ex);
+ log.error("Failed to write.", ex);
String errPattern = messages
.getString(BKUGUIFacade.ERR_WRITE_HASHDATA);
JOptionPane.showMessageDialog(fileDialog, MessageFormat.format(
@@ -108,7 +125,7 @@ public class SecureViewerSaveDialog {
}
break;
case JFileChooser.CANCEL_OPTION:
- log.debug("cancelled save dialog");
+ log.debug("Cancelled save dialog.");
break;
}
if (okListener != null) {
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/stal/impl/ByteArrayHashDataInput.java b/BKUCommonGUI/src/main/java/at/gv/egiz/stal/impl/ByteArrayHashDataInput.java
index b9416845..7f76619f 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/stal/impl/ByteArrayHashDataInput.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/stal/impl/ByteArrayHashDataInput.java
@@ -21,8 +21,8 @@ import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
*
@@ -30,7 +30,7 @@ import org.apache.commons.logging.LogFactory;
*/
public class ByteArrayHashDataInput implements HashDataInput {
- private static final Log log = LogFactory.getLog(ByteArrayHashDataInput.class);
+ private final Logger log = LoggerFactory.getLogger(ByteArrayHashDataInput.class);
protected byte[] hashData;
protected String id;
@@ -66,7 +66,7 @@ public class ByteArrayHashDataInput implements HashDataInput {
}
this.hashData = baos.toByteArray();
} catch (IOException ex) {
- log.error("Failed to cache provided HashDataInput: " + ex.getMessage(), ex);
+ log.error("Failed to cache provided HashDataInput: {}.", ex.getMessage(), ex);
this.hashData = new byte[0];
}
this.id = hdi.getReferenceId();
diff --git a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
index c09433de..ac8b2777 100644
--- a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
+++ b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
@@ -49,7 +49,7 @@ hashdatalink.tiny.focus=<html><a href=\"anzeige\">[Signaturdaten]</a></html>
#verwenden sie bitte die von ihrem System zur Verf\u00FCgung gestellte {0} Anwendung.
hashdatalist=<html>{0} Signaturdaten:</html>
hashdata.viewer=<html>Signaturdaten werden im Betrachter angezeigt
-unsupported.mimetype=<html>Signaturdaten k\u00F6nnen nicht angezeigt werden
+unsupported.mimetype=<html>Signaturdaten speichern und mit einem geeigneten {0} Betrachter \u00F6ffnen.
retries.last=<html>Letzter Versuch!</html>
retries=<html>Noch {0} Versuche</html>
retries.pinpad.last=<html>Eingabe wiederholen, letzter Versuch!</html>
@@ -76,6 +76,7 @@ mimetype.desc.doc=Microsoft Word-Dateien (.doc)
mimetype.desc.unknown=Alle Dateien (.*)
save.hashdatainput.prefix=Signaturdaten
alt.help=Hilfe
+dialog.sigpin.infolabel.sigdata.tooltiptext=Signaturdaten in neuem Fenster anzeigen
# Error Messages
error.no.hashdata=<html>Keine Signaturdaten verf\u00FCgbar: {0}</html>
diff --git a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_en.properties b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_en.properties
index 4d86d21b..6381bdf9 100644
--- a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_en.properties
+++ b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_en.properties
@@ -47,7 +47,7 @@ hashdatalink.tiny.focus=<html><a href=\"anzeige\">[signature data]</a></html>
#message.hashdata=<html>Remark: This is a preview of the data to-be signed. For standards compliant display see help.</html>
hashdatalist=<html>{0} signature data objects:</html>
hashdata.viewer=<html>Signature data is being displayed in viewer
-unsupported.mimetype=<html>Signature data cannot be displayed
+unsupported.mimetype=<html>Save and open signature data with appropriate {0} viewer.
retries.last=<html>Last try!</html>
retries=<html>{0} tries left</html>
retries.pinpad.last=<html>Re-enter pin, last try!</html>
@@ -74,6 +74,8 @@ mimetype.desc.doc=Microsoft Word-files (.doc)
mimetype.desc.unknown=All files (.*)
save.hashdatainput.prefix=signaturedata
alt.help=help
+dialog.sigpin.infolabel.sigdata.tooltiptext=Show signature data in new window
+
# Error Messages
error.no.hashdata=<html>No signature data available: {0}</html>
diff --git a/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java
index a2a84d6e..373ecaad 100644
--- a/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java
+++ b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java
@@ -20,14 +20,11 @@
*/
package at.gv.egiz.bku.gui;
-import at.gv.egiz.smcc.PINSpec;
-import at.gv.egiz.smcc.STARCOSCard;
+import at.gv.egiz.smcc.PinInfo;
import at.gv.egiz.stal.HashDataInput;
import at.gv.egiz.stal.impl.ByteArrayHashDataInput;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
@@ -47,8 +44,8 @@ public class BKUGUIWorker implements Runnable {
public void run() {
try {
- final PINSpec signPinSpec = new PINSpec(6, 10, "[0-9]", "Test-PIN", (byte) 0x81, null);
- final PINSpec cardPinSpec = new PINSpec(4, 4, "[0-9]", "Test-PIN", (byte) 0x01, null);
+ final PinInfo signPinSpec = new SimplePinInfo(6, 10, "[0-9]", "Test-PIN", (byte) 0x81, null, PinInfo.UNKNOWN_RETRIES);
+ final PinInfo cardPinSpec = new SimplePinInfo(4, 4, "[0-9]", "Test-PIN", (byte) 0x01, null, PinInfo.UNKNOWN_RETRIES);
final ActionListener cancelListener = new ActionListener() {
diff --git a/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/DummyFontLoader.java b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/DummyFontLoader.java
index 505c4247..26fc1a5e 100644
--- a/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/DummyFontLoader.java
+++ b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/DummyFontLoader.java
@@ -21,8 +21,8 @@ import at.gv.egiz.bku.gui.viewer.FontProviderException;
import at.gv.egiz.bku.gui.viewer.FontProvider;
import java.awt.Font;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
*
@@ -30,11 +30,11 @@ import org.apache.commons.logging.LogFactory;
*/
public class DummyFontLoader implements FontProvider {
- protected final static Log log = LogFactory.getLog(DummyFontLoader.class);
+ private final Logger log = LoggerFactory.getLogger(DummyFontLoader.class);
@Override
public Font getFont() throws FontProviderException {
- log.debug("return font");
+ log.debug("Return font.");
return new Font("monospaced", Font.PLAIN, 10);
}
diff --git a/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/SecureViewerDialogTest.java b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/SecureViewerDialogTest.java
index 9bbc1b1a..64f7e744 100644
--- a/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/SecureViewerDialogTest.java
+++ b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/SecureViewerDialogTest.java
@@ -7,8 +7,6 @@ package at.gv.egiz.bku.gui;
import at.gv.egiz.stal.impl.ByteArrayHashDataInput;
import java.awt.Font;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
@@ -35,7 +33,7 @@ public class SecureViewerDialogTest {
@BeforeClass
public static void setUpClass() throws Exception {
messages = ResourceBundle.getBundle("at/gv/egiz/bku/gui/Messages");
- secureViewer = new SecureViewerDialog(null, messages,null, null, new DummyFontLoader(), null);
+ secureViewer = new SecureViewerDialog(null, messages,null, null, new DummyFontLoader(), new DeafHelpListener("../help", messages.getLocale()), 1f);
}
@AfterClass
diff --git a/smccSTALExt/src/main/java/at/gv/egiz/bku/smccstal/GetPINStatusException.java b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/SimplePinInfo.java
index 66b15887..3e583118 100644
--- a/smccSTALExt/src/main/java/at/gv/egiz/bku/smccstal/GetPINStatusException.java
+++ b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/SimplePinInfo.java
@@ -1,41 +1,46 @@
/*
* Copyright 2008 Federal Chancellery Austria and
* Graz University of Technology
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package at.gv.egiz.bku.smccstal;
-import at.gv.egiz.smcc.SignatureCardException;
+package at.gv.egiz.bku.gui;
+
+import at.gv.egiz.smcc.PinInfo;
+import java.util.Locale;
/**
*
* @author Clemens Orthacker <clemens.orthacker@iaik.tugraz.at>
*/
-public class GetPINStatusException extends SignatureCardException {
-
- /**
- * Creates a new instance of <code>GetStatusException</code> without detail message.
- */
- public GetPINStatusException() {
- }
-
-
- /**
- * Constructs an instance of <code>GetStatusException</code> with the specified detail message.
- * @param msg the detail message.
- */
- public GetPINStatusException(String msg) {
- super(msg);
- }
+public class SimplePinInfo extends PinInfo {
+
+ String name;
+
+ public SimplePinInfo(int minLength, int maxLength, String rexepPattern, String name, byte kid, byte[] contextAID, int maxRetries) {
+ super(minLength, maxLength, rexepPattern, null, null, kid, contextAID, maxRetries);
+ this.name = name;
+ }
+
+ @Override
+ public String getLocalizedName() {
+ return name;
+ }
+
+ @Override
+ public String getLocalizedName(Locale locale) {
+ return name;
+ }
+
}
diff --git a/BKUCommonGUI/src/test/resources/commons-logging.properties b/BKUCommonGUI/src/test/resources/commons-logging.properties
deleted file mode 100644
index 29292562..00000000
--- a/BKUCommonGUI/src/test/resources/commons-logging.properties
+++ /dev/null
@@ -1 +0,0 @@
-org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger
diff --git a/BKUFonts/.classpath b/BKUFonts/.classpath
deleted file mode 100644
index d2236dff..00000000
--- a/BKUFonts/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/fonts"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
diff --git a/BKUFonts/.project b/BKUFonts/.project
deleted file mode 100644
index 484ff825..00000000
--- a/BKUFonts/.project
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>BKUFonts</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.wst.common.project.facet.core.builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.maven.ide.eclipse.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.wst.validation.validationbuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
- <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.maven.ide.eclipse.maven2Nature</nature>
- <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
- </natures>
-</projectDescription>
diff --git a/BKUFonts/.settings/org.eclipse.jdt.core.prefs b/BKUFonts/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 9db35b19..00000000
--- a/BKUFonts/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-#Fri Nov 06 15:23:46 CET 2009
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.6
diff --git a/BKUFonts/.settings/org.eclipse.wst.common.component b/BKUFonts/.settings/org.eclipse.wst.common.component
deleted file mode 100644
index d7d79bb4..00000000
--- a/BKUFonts/.settings/org.eclipse.wst.common.component
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project-modules id="moduleCoreId" project-version="1.5.0">
- <wb-module deploy-name="BKUFonts">
- <wb-resource deploy-path="/" source-path="/src/main/fonts"/>
- </wb-module>
-</project-modules>
diff --git a/BKUFonts/.settings/org.eclipse.wst.common.project.facet.core.xml b/BKUFonts/.settings/org.eclipse.wst.common.project.facet.core.xml
deleted file mode 100644
index f68988cf..00000000
--- a/BKUFonts/.settings/org.eclipse.wst.common.project.facet.core.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<faceted-project>
- <installed facet="jst.java" version="6.0"/>
- <installed facet="jst.utility" version="1.0"/>
-</faceted-project>
diff --git a/BKUFonts/.settings/org.maven.ide.eclipse.prefs b/BKUFonts/.settings/org.maven.ide.eclipse.prefs
deleted file mode 100644
index 51d61132..00000000
--- a/BKUFonts/.settings/org.maven.ide.eclipse.prefs
+++ /dev/null
@@ -1,9 +0,0 @@
-#Fri Nov 06 15:23:22 CET 2009
-activeProfiles=
-eclipse.preferences.version=1
-fullBuildGoals=process-test-resources
-includeModules=false
-resolveWorkspaceProjects=true
-resourceFilterGoals=process-resources resources\:testResources
-skipCompilerPlugin=true
-version=1
diff --git a/BKUFonts/pom.xml b/BKUFonts/pom.xml
index 6f0b929e..abcb8339 100644
--- a/BKUFonts/pom.xml
+++ b/BKUFonts/pom.xml
@@ -1,22 +1,28 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
- <artifactId>bku</artifactId>
+ <artifactId>mocca</artifactId>
<groupId>at.gv.egiz</groupId>
- <version>1.2.14-SNAPSHOT</version>
+ <version>1.3.0-SNAPSHOT</version>
</parent>
<groupId>at.gv.egiz</groupId>
<artifactId>BKUFonts</artifactId>
- <version>1.2</version>
+ <version>${mocca.fonts.version}</version>
<name>BKU Fonts</name>
<description>
+ <!--
+ | ResourceFontLoader needs font resources on runtime classpath.
+ | Runtime dependency on BKUFonts ensures that transitive dependency
+ | remains (not true for provided), see BKUViewer, BKULocal and
+ | BKUOnline -->
+
This module is used in validator(s) and viewer and is a direct dependency of
- - BKUViewer (attention, this is the validator!)
- TextValidator depends on the fonts. (compile scope, make available for BKULocal/Online TextValidator)
- (TextValidator should rather use a FontProvider)
- - BKUOnline:
- - direct/provided if jar inclusion in applet dir, but do not enforce inclusion as WEB-INF/lib
- - transitive from BKUViewer if unpack-fonts to applet dir
+ - bkucommon (direct runtime dependency)
+ - BKUViewer (transitive runtime from bkucommon)
+ TextValidator depends on the fonts. (TextValidator should rather use a FontProvider)
+ - BKUOnline (transitive runtime from bkucommon/bkuviewer)
+ unpack-fonts to applet dir and include jar in WEB-INF/lib
+ - BKULocal (transitive runtime from bkucommon/bkuviewer)
- removed the BKUCommonGUI (runtime; propagate dependency to BKUApplet):
no real dependency: BKUCommonGUI contains SecureFontProvider interface only
(which does not state how fonts are loaded); implementations should depend no BKUFonts
@@ -38,4 +44,4 @@
</resource>
</resources>
</build>
-</project> \ No newline at end of file
+</project>
diff --git a/BKUGuiExt/pom.xml b/BKUGuiExt/pom.xml
index beae2480..85f06b1e 100644
--- a/BKUGuiExt/pom.xml
+++ b/BKUGuiExt/pom.xml
@@ -1,24 +1,24 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
- <artifactId>bku</artifactId>
+ <artifactId>mocca</artifactId>
<groupId>at.gv.egiz</groupId>
- <version>1.2.14-SNAPSHOT</version>
+ <version>1.3.0-SNAPSHOT</version>
</parent>
<groupId>at.gv.egiz</groupId>
<artifactId>BKUGuiExt</artifactId>
- <version>1.2.14-SNAPSHOT</version>
+ <version>${project.parent.version}</version>
<name>BKU GUI Extension</name>
<dependencies>
<dependency>
<groupId>at.gv.egiz</groupId>
<artifactId>STALXService</artifactId>
- <version>1.2.14-SNAPSHOT</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>at.gv.egiz</groupId>
<artifactId>smccSTAL</artifactId>
- <version>1.2.14-SNAPSHOT</version>
+ <version>${project.parent.version}</version>
</dependency>
</dependencies>
</project> \ No newline at end of file
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 37f30340..524a8067 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
@@ -30,18 +30,23 @@ import javax.swing.JProgressBar;
import javax.swing.LayoutStyle;
import javax.swing.SwingUtilities;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
/**
*
* @author Clemens Orthacker <clemens.orthacker@iaik.tugraz.at>
*/
public class ActivationGUI extends CardMgmtGUI implements ActivationGUIFacade {
-
+
public static final String TITLE_ACTIVATION = "title.activation";
public static final String LABEL_ACTIVATION = "label.activation";
public static final String LABEL_ACTIVATION_STEP = "label.activation.step";
public static final String LABEL_ACTIVATION_IDLE = "label.activation.idle";
public static final String HELP_ACTIVATION = "help.activation";
+
+ private final Logger log = LoggerFactory.getLogger(ActivationGUI.class);
protected JProgressBar progressBar;
@@ -50,7 +55,7 @@ public class ActivationGUI extends CardMgmtGUI implements ActivationGUIFacade {
Style guiStyle,
URL backgroundImgURL,
FontProvider fontProvider,
- AbstractHelpListener helpListener,
+ HelpListener helpListener,
SwitchFocusListener switchFocusListener) {
super(contentPane, locale, guiStyle, backgroundImgURL, fontProvider, helpListener, switchFocusListener);
@@ -60,14 +65,14 @@ public class ActivationGUI extends CardMgmtGUI implements ActivationGUIFacade {
@Override
public void showActivationProgressDialog(final int currentStep, final int maxProgress, final ActionListener cancelListener, final String cancelCommand) {
- log.debug("scheduling activation progress dialog (step " + currentStep + ")");
+ log.debug("Scheduling activation progress dialog (step {}).", currentStep);
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
- log.debug("show activation progress dialog (step " + currentStep + ")");
+ log.debug("Show activation progress dialog (step {}).", currentStep);
mainPanel.removeAll();
buttonPanel.removeAll();
@@ -85,7 +90,7 @@ public class ActivationGUI extends CardMgmtGUI implements ActivationGUIFacade {
infoLabel.setText(cardmgmtMessages.getString(TITLE_ACTIVATION));
}
- helpMouseListener.setHelpTopic(HELP_ACTIVATION);
+ helpListener.setHelpTopic(HELP_ACTIVATION);
progressBar.setIndeterminate(false);
progressBar.setStringPainted(true);
@@ -163,14 +168,14 @@ public class ActivationGUI extends CardMgmtGUI implements ActivationGUIFacade {
@Override
public void showIdleDialog(final ActionListener cancelListener, final String cancelCommand) {
- log.debug("scheduling idle dialog");
+ log.debug("Scheduling idle dialog.");
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
- log.debug("show idle dialog");
+ log.debug("Show idle dialog.");
mainPanel.removeAll();
buttonPanel.removeAll();
@@ -188,7 +193,7 @@ public class ActivationGUI extends CardMgmtGUI implements ActivationGUIFacade {
infoLabel.setText(cardmgmtMessages.getString(TITLE_ACTIVATION));
}
- helpMouseListener.setHelpTopic(HELP_ACTIVATION);
+ helpListener.setHelpTopic(HELP_ACTIVATION);
progressBar.setIndeterminate(true);
progressBar.setStringPainted(true);
diff --git a/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/ActivationGUIFacade.java b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/ActivationGUIFacade.java
index 3fc14d04..860a1097 100644
--- a/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/ActivationGUIFacade.java
+++ b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/ActivationGUIFacade.java
@@ -16,7 +16,6 @@
*/
package at.gv.egiz.bku.gui;
-import at.gv.egiz.bku.gui.*;
import java.awt.event.ActionListener;
/**
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 98f44d55..b8ffd942 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
@@ -23,6 +23,9 @@ import java.net.URL;
import java.util.Locale;
import java.util.ResourceBundle;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
/**
* Common superclass for Activation and PinManagement GUIs
*
@@ -39,10 +42,9 @@ public class CardMgmtGUI extends BKUGUIImpl {
Style guiStyle,
URL backgroundImgURL,
FontProvider fontProvider,
- AbstractHelpListener helpListener,
+ HelpListener helpListener,
SwitchFocusListener switchFocusListener) {
- super(contentPane, locale, guiStyle, backgroundImgURL, fontProvider, helpListener, switchFocusListener);
-
+ super(contentPane, locale, guiStyle, backgroundImgURL, fontProvider, helpListener, switchFocusListener);
}
@Override
@@ -51,7 +53,8 @@ public class CardMgmtGUI extends BKUGUIImpl {
if (locale != null) {
Locale lang = new Locale(locale.getLanguage().substring(0,2));
- log.debug("loading applet resources for language: " + lang.toString());
+ Logger log = LoggerFactory.getLogger(CardMgmtGUI.class);
+ log.debug("Loading applet resources for language: {}.", lang);
cardmgmtMessages = ResourceBundle.getBundle(CARDMGMT_MESSAGES_BUNDLE, lang);
} else {
cardmgmtMessages = ResourceBundle.getBundle(CARDMGMT_MESSAGES_BUNDLE);
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 4dcc388f..08f148c9 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
@@ -18,7 +18,7 @@
package at.gv.egiz.bku.gui;
import at.gv.egiz.bku.gui.viewer.FontProvider;
-import at.gv.egiz.smcc.PINSpec;
+import at.gv.egiz.smcc.PinInfo;
import java.awt.Container;
import java.awt.Cursor;
import java.awt.Font;
@@ -27,7 +27,6 @@ import java.awt.event.ActionListener;
import java.net.URL;
import java.text.MessageFormat;
import java.util.Locale;
-import java.util.Map;
import javax.swing.GroupLayout;
import javax.swing.JButton;
import javax.swing.JLabel;
@@ -39,49 +38,69 @@ import javax.swing.ListSelectionModel;
import javax.swing.SwingUtilities;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
- * TODO pull out ResourceBundle to common superclass for activationGUI and pinMgmtGUI
+ * TODO pull out ResourceBundle to common superclass for activationGUI and
+ * pinMgmtGUI
+ *
* @author Clemens Orthacker <clemens.orthacker@iaik.tugraz.at>
*/
-public class PINManagementGUI extends CardMgmtGUI implements PINManagementGUIFacade {
+public class PINManagementGUI extends CardMgmtGUI implements
+ PINManagementGUIFacade {
- protected static final Log log = LogFactory.getLog(PINManagementGUI.class);
+ private final Logger log = LoggerFactory.getLogger(PINManagementGUI.class);
/** remember the pinfield to return to worker */
protected JPasswordField oldPinField;
/** remember the pinSpec to return to worker */
- protected PINSpec pinSpec;
-
- public PINManagementGUI(Container contentPane,
- Locale locale,
- Style guiStyle,
- URL backgroundImgURL,
- FontProvider fontProvider,
- AbstractHelpListener helpListener,
- SwitchFocusListener switchFocusListener) {
- super(contentPane, locale, guiStyle, backgroundImgURL, fontProvider, helpListener, switchFocusListener);
- }
-
- @Override
- public char[] getOldPin() {
- if (oldPinField != null) {
- char[] pin = oldPinField.getPassword();
- oldPinField = null;
- return pin;
- }
- return null;
- }
+ protected PinInfo pinSpec;
+
+ protected JButton cancelButton;
+ protected JTable pinStatusTable;
+ protected JLabel mgmtLabel;
+ protected PINStatusRenderer pinStatusRenderer;
+// protected int baseTableRowHeight;
+ protected JButton activateButton;
+
+ protected JLabel pinpadLabel;
+ protected JLabel oldPinLabel;
+ protected JLabel repeatPinLabel;
+ protected JLabel pinLabel;
+ protected JPasswordField repeatPinField;
+ protected JLabel pinsizeLabel;
+
+
+ public PINManagementGUI(Container contentPane, Locale locale,
+ Style guiStyle, URL backgroundImgURL, FontProvider fontProvider,
+ HelpListener helpListener, SwitchFocusListener switchFocusListener) {
+ super(contentPane, locale, guiStyle, backgroundImgURL, fontProvider,
+ helpListener, switchFocusListener);
+
+ cancelButton = new JButton();
+ this.pinStatusRenderer = new PINStatusRenderer(cardmgmtMessages);
+ this.activateButton = new JButton();
+
+ }
+
+ @Override
+ public char[] getOldPin() {
+ if (oldPinField != null) {
+ char[] pin = oldPinField.getPassword();
+ oldPinField = null;
+ return pin;
+ }
+ return null;
+ }
+
+ @Override
+ public PinInfo getSelectedPinInfo() {
+ return pinSpec;
+ }
@Override
- public PINSpec getSelectedPINSpec() {
- return pinSpec;
- }
-
- @Override
- public void showPINManagementDialog(final Map<PINSpec, STATUS> pins,
+ public void showPINManagementDialog(final PinInfo[] pins,
final ActionListener activateListener,
final String activateCmd,
final String changeCmd,
@@ -90,36 +109,35 @@ public class PINManagementGUI extends CardMgmtGUI implements PINManagementGUIFac
final ActionListener cancelListener,
final String cancelCmd) {
- log.debug("scheduling PIN managment dialog");
-
- SwingUtilities.invokeLater(new Runnable() {
+ log.debug("Scheduling PIN managment dialog.");
- @Override
- public void run() {
- log.debug("show PIN management dialog");
+ SwingUtilities.invokeLater(new Runnable() {
- mainPanel.removeAll();
- buttonPanel.removeAll();
+ @Override
+ public void run() {
+ log.debug("Show PIN management dialog.");
- helpMouseListener.setHelpTopic(HELP_PINMGMT);
- helpKeyListener.setHelpTopic(HELP_PINMGMT);
+ mainPanel.removeAll();
+ buttonPanel.removeAll();
+ helpListener.setHelpTopic(HELP_PINMGMT);
- JLabel mgmtLabel = new JLabel();
- mgmtLabel.setFont(mgmtLabel.getFont().deriveFont(mgmtLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
+ mgmtLabel = new JLabel();
+ mgmtLabel.setFont(mgmtLabel.getFont().deriveFont(
+ mgmtLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
- if (renderHeaderPanel) {
- titleLabel.setText(getMessage(TITLE_PINMGMT));
- String infoPattern = getMessage(MESSAGE_PINMGMT);
- mgmtLabel.setText(MessageFormat.format(infoPattern, pins.size()));
- } else {
- mgmtLabel.setText(getMessage(TITLE_PINMGMT));
- }
+ if (renderHeaderPanel) {
+ titleLabel.setText(getMessage(TITLE_PINMGMT));
+ String infoPattern = getMessage(MESSAGE_PINMGMT);
+ mgmtLabel.setText(MessageFormat.format(infoPattern, pins.length));
+ } else {
+ mgmtLabel.setText(getMessage(TITLE_PINMGMT));
+ }
- final PINStatusTableModel tableModel = new PINStatusTableModel(pins);
- final JTable pinStatusTable = new JTable(tableModel);
- pinStatusTable.setDefaultRenderer(PINSpec.class, new PINSpecRenderer());
- pinStatusTable.setDefaultRenderer(STATUS.class, new PINStatusRenderer(cardmgmtMessages));
+ final PINStatusTableModel tableModel = new PINStatusTableModel(pins);
+ pinStatusTable = new JTable(tableModel);
+// pinStatusTable.setDefaultRenderer(PINSpec.class, new PINSpecRenderer());
+ pinStatusTable.setDefaultRenderer(PinInfo.class, pinStatusRenderer);
pinStatusTable.setTableHeader(null);
pinStatusTable.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
// pinStatusTable.addMouseMotionListener(new MouseMotionAdapter() {
@@ -134,42 +152,56 @@ public class PINManagementGUI extends CardMgmtGUI implements PINManagementGUIFac
// }
// });
- final JButton activateButton = new JButton();
- activateButton.setFont(activateButton.getFont().deriveFont(activateButton.getFont().getStyle() & ~java.awt.Font.BOLD));
- activateButton.addActionListener(activateListener);
+ primaryFocusHolder = pinStatusTable;
- pinStatusTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- pinStatusTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
+ activateButton.setFont(activateButton.getFont().deriveFont(
+ activateButton.getFont().getStyle()
+ & ~java.awt.Font.BOLD));
+ activateButton.addActionListener(activateListener);
- @Override
- public void valueChanged(final ListSelectionEvent e) {
- //invoke later to allow thread to paint selection background
- SwingUtilities.invokeLater(new Runnable() {
+ pinStatusTable
+ .setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+ pinStatusTable.getSelectionModel().addListSelectionListener(
+ new ListSelectionListener() {
- @Override
+ @Override
+ public void valueChanged(final ListSelectionEvent e) {
+ // invoke later to allow thread to paint
+ // selection background
+ SwingUtilities.invokeLater(new Runnable() {
+
+ @Override
public void run() {
ListSelectionModel lsm = (ListSelectionModel) e.getSource();
int selectionIdx = lsm.getMinSelectionIndex();
if (selectionIdx >= 0) {
- pinSpec = (PINSpec) tableModel.getValueAt(selectionIdx, 0);
- STATUS status = (STATUS) tableModel.getValueAt(selectionIdx, 1);
+ pinSpec = (PinInfo) tableModel.getValueAt(selectionIdx, 1);
+ PinInfo.STATE status = pinSpec.getState();
- if (status == STATUS.NOT_ACTIV) {
- activateButton.setText(getMessage(BUTTON_ACTIVATE));
+ if (status == PinInfo.STATE.NOT_ACTIV) {
+ activateButton
+ .setText(getMessage(BUTTON_ACTIVATE));
activateButton.setEnabled(true);
- activateButton.setActionCommand(activateCmd);
- } else if (status == STATUS.BLOCKED) {
- activateButton.setText(getMessage(BUTTON_UNBLOCK));
+ activateButton
+ .setActionCommand(activateCmd);
+ } else if (status == PinInfo.STATE.BLOCKED) {
+ activateButton
+ .setText(getMessage(BUTTON_UNBLOCK));
activateButton.setEnabled(true);
- activateButton.setActionCommand(unblockCmd);
- } else if (status == STATUS.ACTIV) {
- activateButton.setText(getMessage(BUTTON_CHANGE));
+ activateButton
+ .setActionCommand(unblockCmd);
+ } else if (status == PinInfo.STATE.ACTIV) {
+ activateButton
+ .setText(getMessage(BUTTON_CHANGE));
activateButton.setEnabled(true);
- activateButton.setActionCommand(changeCmd);
- } else if (status == STATUS.UNKNOWN) {
- activateButton.setText(getMessage(BUTTON_VERIFY));
+ activateButton
+ .setActionCommand(changeCmd);
+ } else if (status == PinInfo.STATE.UNKNOWN) {
+ activateButton
+ .setText(getMessage(BUTTON_VERIFY));
activateButton.setEnabled(true);
- activateButton.setActionCommand(verifyCmd);
+ activateButton
+ .setActionCommand(verifyCmd);
}
}
}
@@ -177,69 +209,129 @@ public class PINManagementGUI extends CardMgmtGUI implements PINManagementGUIFac
}
});
- //select first entry
- pinStatusTable.getSelectionModel().setSelectionInterval(0, 0);
-
- JScrollPane pinStatusScrollPane = new JScrollPane(pinStatusTable);
-
- GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
- mainPanel.setLayout(mainPanelLayout);
-
- GroupLayout.SequentialGroup messageHorizontal = mainPanelLayout.createSequentialGroup()
- .addComponent(mgmtLabel);
- GroupLayout.Group messageVertical = mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addComponent(mgmtLabel);
- if (!renderHeaderPanel) {
- messageHorizontal
- .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
- .addComponent(switchFocusDummyLabel)
- .addComponent(helpLabel);
- messageVertical
- .addComponent(switchFocusDummyLabel)
- .addComponent(helpLabel);
- }
-
- mainPanelLayout.setHorizontalGroup(
- mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addGroup(messageHorizontal)
- .addComponent(pinStatusScrollPane, 0, 0, Short.MAX_VALUE));
-
- mainPanelLayout.setVerticalGroup(
- mainPanelLayout.createSequentialGroup()
- .addGroup(messageVertical)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(pinStatusScrollPane, 0, 0, pinStatusTable.getPreferredSize().height+3));
-
- JButton cancelButton = new JButton();
- cancelButton.setFont(cancelButton.getFont().deriveFont(cancelButton.getFont().getStyle() & ~java.awt.Font.BOLD));
- cancelButton.setText(getMessage(BUTTON_CLOSE));
- cancelButton.setActionCommand(cancelCmd);
- cancelButton.addActionListener(cancelListener);
-
- GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
- buttonPanel.setLayout(buttonPanelLayout);
-
- GroupLayout.SequentialGroup buttonHorizontal = buttonPanelLayout.createSequentialGroup()
- .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(activateButton, GroupLayout.PREFERRED_SIZE, buttonSize, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(cancelButton, GroupLayout.PREFERRED_SIZE, buttonSize, GroupLayout.PREFERRED_SIZE);
-
- GroupLayout.Group buttonVertical = buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
- .addComponent(activateButton)
- .addComponent(cancelButton);
-
- buttonPanelLayout.setHorizontalGroup(buttonHorizontal);
- buttonPanelLayout.setVerticalGroup(buttonVertical);
-
- helpLabel.requestFocus();
- contentPanel.validate();
+ // select first entry
+ pinStatusTable.getSelectionModel().setSelectionInterval(0, 0);
+
+ // JScrollPane pinStatusScrollPane = new
+ // JScrollPane(pinStatusTable);
+ //
+ // GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
+ // mainPanel.setLayout(mainPanelLayout);
+ //
+ // GroupLayout.SequentialGroup messageHorizontal =
+ // mainPanelLayout.createSequentialGroup()
+ // .addComponent(mgmtLabel);
+ // GroupLayout.Group messageVertical =
+ // mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ // .addComponent(mgmtLabel);
+ // if (!renderHeaderPanel) {
+ // messageHorizontal
+ // .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0,
+ // Short.MAX_VALUE)
+ // .addComponent(switchFocusDummyLabel)
+ // .addComponent(helpLabel);
+ // messageVertical
+ // .addComponent(switchFocusDummyLabel)
+ // .addComponent(helpLabel);
+ // }
+ //
+ // mainPanelLayout.setHorizontalGroup(
+ // mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ // .addGroup(messageHorizontal)
+ // .addComponent(pinStatusScrollPane, 0, 0, Short.MAX_VALUE));
+ //
+ // mainPanelLayout.setVerticalGroup(
+ // mainPanelLayout.createSequentialGroup()
+ // .addGroup(messageVertical)
+ // .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ // .addComponent(pinStatusScrollPane, 0, 0,
+ // pinStatusTable.getPreferredSize().height+3));
+ //
+ // // JButton cancelButton = new JButton();
+ cancelButton.setFont(cancelButton.getFont()
+ .deriveFont(
+ cancelButton.getFont().getStyle()
+ & ~java.awt.Font.BOLD));
+ cancelButton.setText(getMessage(BUTTON_CLOSE));
+ cancelButton.setActionCommand(cancelCmd);
+ cancelButton.addActionListener(cancelListener);
+
+ updateMethodToRunAtResize("at.gv.egiz.bku.gui.PINManagementGUI", "renderPINManagmentTableAndButtons");
+
+ renderPINManagmentTableAndButtons();
+
+ pinStatusTable.requestFocus();
+ contentPanel.validate();
+
+ if (windowCloseAdapter != null) {
+ windowCloseAdapter.registerListener(cancelListener, cancelCmd);
}
- });
- }
-
- @Override
- public void showModifyPINDirect(DIALOG type, PINSpec pinSpec, int retries) {
+
+ resize();
+
+ }
+ });
+ }
+
+ public void renderPINManagmentTableAndButtons() {
+
+ // It is necessary to remove old components in order to ensure
+ // the correct rendering of the status table and the button panel
+ mainPanel.removeAll();
+ buttonPanel.removeAll();
+
+ JScrollPane pinStatusScrollPane = new JScrollPane(pinStatusTable);
+
+ GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
+ mainPanel.setLayout(mainPanelLayout);
+
+ GroupLayout.SequentialGroup messageHorizontal = mainPanelLayout
+ .createSequentialGroup().addComponent(mgmtLabel);
+ GroupLayout.Group messageVertical = mainPanelLayout
+ .createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addComponent(mgmtLabel);
+ if (!renderHeaderPanel) {
+ messageHorizontal.addPreferredGap(
+ LayoutStyle.ComponentPlacement.UNRELATED, 0,
+ Short.MAX_VALUE).addComponent(switchFocusDummyLabel)
+ .addComponent(helpLabel);
+ messageVertical.addComponent(switchFocusDummyLabel).addComponent(
+ helpLabel);
+ }
+
+ mainPanelLayout.setHorizontalGroup(mainPanelLayout.createParallelGroup(
+ GroupLayout.Alignment.LEADING).addGroup(messageHorizontal)
+ .addComponent(pinStatusScrollPane, 0, 0, Short.MAX_VALUE));
+
+ mainPanelLayout.setVerticalGroup(mainPanelLayout
+ .createSequentialGroup().addGroup(messageVertical)
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(pinStatusScrollPane, 0, 0,
+ pinStatusTable.getPreferredSize().height + 3));
+
+ GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
+ buttonPanel.setLayout(buttonPanelLayout);
+
+ GroupLayout.SequentialGroup buttonHorizontal = buttonPanelLayout
+ .createSequentialGroup().addContainerGap(
+ GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(activateButton, GroupLayout.PREFERRED_SIZE,
+ buttonSize, GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(cancelButton, GroupLayout.PREFERRED_SIZE,
+ buttonSize, GroupLayout.PREFERRED_SIZE);
+
+ GroupLayout.Group buttonVertical = buttonPanelLayout
+ .createParallelGroup(GroupLayout.Alignment.BASELINE)
+ .addComponent(activateButton).addComponent(cancelButton);
+
+ buttonPanelLayout.setHorizontalGroup(buttonHorizontal);
+ buttonPanelLayout.setVerticalGroup(buttonVertical);
+
+ }
+
+@Override
+ public void showModifyPINDirect(DIALOG type, PinInfo pinSpec, int retries) {
String title, msg;
Object[] params;
if (retries < 0) {
@@ -251,475 +343,616 @@ public class PINManagementGUI extends CardMgmtGUI implements PINManagementGUIFac
}
params[1] = pinSpec.getLocalizedLength();
if (type == DIALOG.CHANGE) {
- log.debug("show change pin dialog");
+ log.debug("Show change pin dialog.");
title = TITLE_CHANGE_PIN;
msg = MESSAGE_CHANGE_PINPAD_DIREKT;
} else if (type == DIALOG.ACTIVATE) {
- log.debug("show activate pin dialog");
+ log.debug("Show activate pin dialog.");
title = TITLE_ACTIVATE_PIN;
msg = MESSAGE_ACTIVATE_PINPAD_DIREKT;
} else if (type == DIALOG.VERIFY) {
- log.debug("show verify pin dialog");
+ log.debug("Show verify pin dialog.");
title = TITLE_VERIFY_PINPAD;
msg = MESSAGE_ENTERPIN_PINPAD_DIRECT;
} else {
- log.debug("show unblock pin dialog");
+ log.debug("Show unblock pin dialog.");
title = TITLE_UNBLOCK_PIN;
msg = MESSAGE_UNBLOCK_PINPAD_DIREKT;
}
- } else {
- log.debug("show retry pin dialog");
- title = TITLE_RETRY;
- msg = (retries < 2) ?
- MESSAGE_LAST_RETRY : MESSAGE_RETRIES;
- params = new Object[] {String.valueOf(retries)};
- }
- showMessageDialog(title, msg, params);
- }
+ } else {
+ log.debug("Show retry pin dialog.");
+ title = TITLE_RETRY;
+ msg = (retries < 2) ? MESSAGE_LAST_RETRY : MESSAGE_RETRIES;
+ params = new Object[] { String.valueOf(retries) };
+ }
+
+ showMessageDialog(title, msg, params);
+ }
@Override
- public void showPINDialog(DIALOG type, PINSpec pinSpec, int retries,
+ public void showPINDialog(DIALOG type, PinInfo pinSpec, int retries,
ActionListener okListener, String okCommand,
ActionListener cancelListener, String cancelCommand) {
- showPINDialog(type, pinSpec, retries, false,
- okListener, okCommand, cancelListener, cancelCommand);
+ showPINDialog(type, pinSpec, retries, false, okListener, okCommand,
+ cancelListener, cancelCommand);
}
-
- private void showPINDialog(final DIALOG type, final PINSpec pinSpec,
+ private void showPINDialog(final DIALOG type, final PinInfo pinSpec,
final int retries, final boolean pinpad,
final ActionListener okListener, final String okCommand,
final ActionListener cancelListener, final String cancelCommand) {
- log.debug("scheduling pin dialog");
-
- SwingUtilities.invokeLater(new Runnable() {
-
- @Override
- public void run() {
-
- String HELP_TOPIC, TITLE, MESSAGE_MGMT, MESSAGE_MGMT_PARAM;
- HELP_TOPIC = HELP_PINMGMT;
-
- if (retries < 0) {
- if (type == DIALOG.CHANGE) {
- log.debug("show change pin dialog");
- TITLE = TITLE_CHANGE_PIN;
- MESSAGE_MGMT = MESSAGE_CHANGE_PIN;
- } else if (type == DIALOG.ACTIVATE) {
- log.debug("show activate pin dialog");
- TITLE = TITLE_ACTIVATE_PIN;
- MESSAGE_MGMT = MESSAGE_ACTIVATE_PIN;
- oldPinField = null;
- } else if (type == DIALOG.VERIFY) {
- log.debug("show verify pin dialog");
- TITLE = TITLE_VERIFY_PIN;
- MESSAGE_MGMT = MESSAGE_ENTERPIN;
- } else {
- log.debug("show unblock pin dialog");
- TITLE = TITLE_UNBLOCK_PIN;
- MESSAGE_MGMT = MESSAGE_UNBLOCK_PIN;
- }
- if (shortText) {
- MESSAGE_MGMT_PARAM = "PIN";
- } else {
- MESSAGE_MGMT_PARAM = pinSpec.getLocalizedName();
- }
- } else {
- log.debug("show retry pin dialog");
- TITLE = TITLE_RETRY;
- MESSAGE_MGMT = (retries < 2) ?
- MESSAGE_LAST_RETRY : MESSAGE_RETRIES;
- MESSAGE_MGMT_PARAM = String.valueOf(retries);
- }
-
- mainPanel.removeAll();
- buttonPanel.removeAll();
-
- helpMouseListener.setHelpTopic(HELP_TOPIC);
- helpKeyListener.setHelpTopic(HELP_TOPIC);
-
- JLabel mgmtLabel = new JLabel();
- if (retries < 0) {
- mgmtLabel.setFont(mgmtLabel.getFont().deriveFont(mgmtLabel.getFont().getStyle() & ~Font.BOLD));
- } else {
- mgmtLabel.setFont(mgmtLabel.getFont().deriveFont(mgmtLabel.getFont().getStyle() | Font.BOLD));
- mgmtLabel.setForeground(ERROR_COLOR);
- helpMouseListener.setHelpTopic(HELP_RETRY);
- helpKeyListener.setHelpTopic(HELP_RETRY);
- }
-
- if (renderHeaderPanel) {
- titleLabel.setText(getMessage(TITLE));
- String mgmtPattern = getMessage(MESSAGE_MGMT);
- mgmtLabel.setText(MessageFormat.format(mgmtPattern, MESSAGE_MGMT_PARAM));
- } else {
- mgmtLabel.setText(getMessage(TITLE));
- }
-
- ////////////////////////////////////////////////////////////////
- // COMMON LAYOUT SECTION
- ////////////////////////////////////////////////////////////////
-
- GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
- mainPanel.setLayout(mainPanelLayout);
-
- GroupLayout.SequentialGroup infoHorizontal = mainPanelLayout.createSequentialGroup()
- .addComponent(mgmtLabel);
- GroupLayout.ParallelGroup infoVertical = mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addComponent(mgmtLabel);
-
- if (!renderHeaderPanel) {
- infoHorizontal
- .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
- .addComponent(switchFocusDummyLabel)
- .addComponent(helpLabel);
- infoVertical
- .addComponent(switchFocusDummyLabel)
- .addComponent(helpLabel);
- }
-
- GroupLayout.ParallelGroup pinHorizontal;
- GroupLayout.SequentialGroup pinVertical;
-
- if (pinpad) {
- JLabel pinpadLabel = new JLabel();
- pinpadLabel.setFont(mgmtLabel.getFont().deriveFont(mgmtLabel.getFont().getStyle() & ~Font.BOLD));
- String pinpadPattern = getMessage(MESSAGE_ENTERPIN_PINPAD);
- pinpadLabel.setText(MessageFormat.format(pinpadPattern,
- new Object[] { pinSpec.getLocalizedName(), pinSpec.getLocalizedLength() }));
-
- pinHorizontal = mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addComponent(pinpadLabel);
- pinVertical = mainPanelLayout.createSequentialGroup()
- .addComponent(pinpadLabel);
- } else {
-
- final JButton okButton = new JButton();
- okButton.setFont(okButton.getFont().deriveFont(okButton.getFont().getStyle() & ~Font.BOLD));
- okButton.setText(getMessage(BUTTON_OK));
- okButton.setEnabled(pinSpec.getMinLength() <= 0);
- okButton.setActionCommand(okCommand);
- okButton.addActionListener(okListener);
-
- JLabel oldPinLabel = null;
- JLabel repeatPinLabel = null;
- JLabel pinLabel = new JLabel();
- pinLabel.setFont(pinLabel.getFont().deriveFont(pinLabel.getFont().getStyle() & ~Font.BOLD));
- String pinLabelPattern = (type == DIALOG.CHANGE || type == DIALOG.UNBLOCK) ? getMessage(LABEL_NEW_PIN) : getMessage(LABEL_PIN);
- pinLabel.setText(MessageFormat.format(pinLabelPattern, new Object[]{pinSpec.getLocalizedName()}));
-
- final JPasswordField repeatPinField = new JPasswordField();
- pinField = new JPasswordField();
- pinField.setText("");
- pinField.setActionCommand(okCommand);
- pinField.addActionListener(new ActionListener() {
-
- @Override
- public void actionPerformed(ActionEvent e) {
- if (pinField.getPassword().length >= pinSpec.getMinLength()) {
- if (type == DIALOG.VERIFY) {
- okListener.actionPerformed(e);
- } else {
- repeatPinField.requestFocusInWindow();
- }
- }
- }
- });
-
- if (type != DIALOG.VERIFY) {
- repeatPinLabel = new JLabel();
- repeatPinLabel.setFont(pinLabel.getFont());
- String repeatPinLabelPattern = getMessage(LABEL_REPEAT_PIN);
- repeatPinLabel.setText(MessageFormat.format(repeatPinLabelPattern, new Object[]{pinSpec.getLocalizedName()}));
-
- repeatPinField.setText("");
- repeatPinField.setActionCommand(okCommand);
- repeatPinField.addActionListener(new ActionListener() {
-
- @Override
- public void actionPerformed(ActionEvent e) {
- if (okButton.isEnabled()) {
- okListener.actionPerformed(e);
- }
- }
- });
-
- if (type == DIALOG.CHANGE || type == DIALOG.UNBLOCK) {
- oldPinLabel = new JLabel();
- oldPinLabel.setFont(oldPinLabel.getFont().deriveFont(oldPinLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
- String oldPinLabelPattern = getMessage((type == DIALOG.CHANGE) ? LABEL_OLD_PIN : LABEL_PUK);
- oldPinLabel.setText(MessageFormat.format(oldPinLabelPattern, new Object[]{pinSpec.getLocalizedName()}));
-
- oldPinField = new JPasswordField();
- oldPinField.setText("");
- oldPinField.setActionCommand(okCommand);
- oldPinField.addActionListener(new ActionListener() {
-
- @Override
- public void actionPerformed(ActionEvent e) {
- if (oldPinField.getPassword().length >= pinSpec.getMinLength()) {
- pinField.requestFocusInWindow();
- }
- }
- });
-
- ExtendedPinDocument oldPinDocument =
- new ExtendedPinDocument(pinSpec.getMinLength(), pinSpec.getMaxLength(),
- pinSpec.getRexepPattern(), okButton);
- ComparePinDocument newPinDocument =
- new ComparePinDocument(pinSpec.getRecMinLength(), pinSpec.getRecMaxLength(), pinSpec.getRexepPattern(),
- okButton);
- ComparePinDocument confirmPinDocument =
- new ComparePinDocument(pinSpec.getRecMinLength(), pinSpec.getRecMaxLength(), pinSpec.getRexepPattern(),
- okButton);
-
- oldPinDocument.newPIN = newPinDocument;
- oldPinDocument.confirmPIN = confirmPinDocument;
-
- newPinDocument.compareTo = confirmPinDocument;
- newPinDocument.currentPIN = oldPinDocument;
- confirmPinDocument.compareTo = newPinDocument;
- confirmPinDocument.currentPIN = oldPinDocument;
-
- oldPinField.setDocument(oldPinDocument);
- pinField.setDocument(newPinDocument);
- repeatPinField.setDocument(confirmPinDocument);
-
- } else {
- // else -> ACTIVATE (not verify, not change)
- ComparePinDocument newPinDocument =
- new ComparePinDocument(pinSpec.getRecMinLength(), pinSpec.getRecMaxLength(), pinSpec.getRexepPattern(),
- okButton);
- ComparePinDocument confirmPinDocument =
- new ComparePinDocument(pinSpec.getRecMinLength(), pinSpec.getRecMaxLength(), pinSpec.getRexepPattern(),
- okButton);
-
- newPinDocument.compareTo = confirmPinDocument;
- confirmPinDocument.compareTo = newPinDocument;
-
- pinField.setDocument(newPinDocument);
- repeatPinField.setDocument(confirmPinDocument);
- }
- } else {
- // VERIFY
- pinField.setDocument(
- new PINDocument(pinSpec.getMinLength(), pinSpec.getMaxLength(), pinSpec.getRexepPattern(), okButton));
- }
-
- JLabel pinsizeLabel = new JLabel();
- pinsizeLabel.setFont(pinsizeLabel.getFont().deriveFont(pinsizeLabel.getFont().getStyle() & ~Font.BOLD, pinsizeLabel.getFont().getSize()-2));
- String pinsizePattern = getMessage(LABEL_PINSIZE);
- pinsizeLabel.setText(MessageFormat.format(pinsizePattern, pinSpec.getLocalizedLength()));
-
- ////////////////////////////////////////////////////////////////
- // NON-PINPAD SPECIFIC LAYOUT SECTION
- ////////////////////////////////////////////////////////////////
-
- pinHorizontal = mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING);
- pinVertical = mainPanelLayout.createSequentialGroup();
-
-// if (pinLabelPos == PinLabelPosition.ABOVE) {
-// if (changePin) {
-// pinHorizontal
-// .addComponent(oldPinLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
-// .addComponent(oldPinField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE);
-// pinVertical
-// .addComponent(oldPinLabel)
-// .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
-// .addComponent(oldPinField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
-// .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED);
-// }
-// pinHorizontal
-// .addComponent(pinLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
-// .addComponent(pinField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
-// .addComponent(repeatPinLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
-// .addComponent(repeatPinField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
-// .addGroup(mainPanelLayout.createSequentialGroup()
-// .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
-// .addComponent(pinsizeLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE));
-// pinVertical
-// .addComponent(pinLabel)
-// .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
-// .addComponent(pinField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
-// .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
-// .addComponent(repeatPinLabel)
-// .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
-// .addComponent(repeatPinField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
-// .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
-// .addComponent(pinsizeLabel);
-// } else {
-
-
- if (type == DIALOG.CHANGE || type == DIALOG.UNBLOCK) {
- pinHorizontal
- .addGroup(mainPanelLayout.createSequentialGroup()
- .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addComponent(oldPinLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addComponent(pinLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addComponent(repeatPinLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addComponent(oldPinField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(pinField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(repeatPinField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
-
- pinVertical
- .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
- .addComponent(oldPinLabel)
- .addComponent(oldPinField))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
- .addComponent(pinLabel)
- .addComponent(pinField))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
- .addComponent(repeatPinLabel)
- .addComponent(repeatPinField))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED);
- } else if (type == DIALOG.ACTIVATE) {
- pinHorizontal
- .addGroup(mainPanelLayout.createSequentialGroup()
- .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addComponent(pinLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addComponent(repeatPinLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addComponent(pinField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(repeatPinField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
-
- pinVertical
- .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
- .addComponent(pinLabel)
- .addComponent(pinField))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
- .addComponent(repeatPinLabel)
- .addComponent(repeatPinField))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED);
- } else { // VERIFY
- pinHorizontal
- .addGroup(mainPanelLayout.createSequentialGroup()
- .addComponent(pinLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(pinField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE));
-
- pinVertical
- .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
- .addComponent(pinLabel)
- .addComponent(pinField))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED);
- }
- pinHorizontal
- .addGroup(mainPanelLayout.createSequentialGroup()
- .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
- .addComponent(pinsizeLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE));
- pinVertical
- .addComponent(pinsizeLabel);
-
- GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
- buttonPanel.setLayout(buttonPanelLayout);
-
- GroupLayout.SequentialGroup buttonHorizontal = buttonPanelLayout.createSequentialGroup()
- .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(okButton, GroupLayout.PREFERRED_SIZE, buttonSize, GroupLayout.PREFERRED_SIZE);
- GroupLayout.Group buttonVertical;
-
- JButton cancelButton = new JButton();
- cancelButton.setFont(cancelButton.getFont().deriveFont(cancelButton.getFont().getStyle() & ~java.awt.Font.BOLD));
- cancelButton.setText(getMessage(BUTTON_CANCEL));
- cancelButton.setActionCommand(cancelCommand);
- cancelButton.addActionListener(cancelListener);
-
- buttonHorizontal
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(cancelButton, GroupLayout.PREFERRED_SIZE, buttonSize, GroupLayout.PREFERRED_SIZE);
- buttonVertical = buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
- .addComponent(okButton)
- .addComponent(cancelButton);
-
- buttonPanelLayout.setHorizontalGroup(buttonHorizontal);
- buttonPanelLayout.setVerticalGroup(buttonVertical);
-
- if (oldPinField != null) {
- oldPinField.requestFocusInWindow();
- } else {
- pinField.requestFocusInWindow();
- }
-
- } // END NON-PINPAD SECTION
-
- mainPanelLayout.setHorizontalGroup(
- mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addGroup(infoHorizontal)
- .addGroup(pinHorizontal));
-
- mainPanelLayout.setVerticalGroup(
- mainPanelLayout.createSequentialGroup()
- .addGroup(infoVertical)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(pinVertical));
-
- helpLabel.requestFocus();
- contentPanel.validate();
-
- }
- });
- }
-
- @Override
- protected int initButtonSize() {
- int bs = super.initButtonSize();
-
- JButton b = new JButton();
- b.setText(getMessage(BUTTON_ACTIVATE));
- if (b.getPreferredSize().width > bs) {
- bs = b.getPreferredSize().width;
- }
- b.setText(getMessage(BUTTON_CHANGE));
- if (b.getPreferredSize().width > bs) {
- bs = b.getPreferredSize().width;
- }
- b.setText(getMessage(BUTTON_UNBLOCK));
- if (b.getPreferredSize().width > bs) {
- bs = b.getPreferredSize().width;
- }
- b.setText(getMessage(BUTTON_CANCEL));
- if (b.getPreferredSize().width > bs) {
- bs = b.getPreferredSize().width;
- }
-
- return bs;
- }
+ log.debug("Scheduling pin dialog.");
+
+ SwingUtilities.invokeLater(new Runnable() {
+
+ @Override
+ public void run() {
+
+ String HELP_TOPIC, TITLE, MESSAGE_MGMT, MESSAGE_MGMT_PARAM;
+ HELP_TOPIC = HELP_PINMGMT;
+
+ if (retries < 0) {
+ if (type == DIALOG.CHANGE) {
+ log.debug("Show change pin dialog.");
+ TITLE = TITLE_CHANGE_PIN;
+ MESSAGE_MGMT = MESSAGE_CHANGE_PIN;
+ } else if (type == DIALOG.ACTIVATE) {
+ log.debug("Show activate pin dialog.");
+ TITLE = TITLE_ACTIVATE_PIN;
+ MESSAGE_MGMT = MESSAGE_ACTIVATE_PIN;
+ oldPinField = null;
+ } else if (type == DIALOG.VERIFY) {
+ log.debug("Show verify pin dialog.");
+ TITLE = TITLE_VERIFY_PIN;
+ MESSAGE_MGMT = MESSAGE_ENTERPIN;
+ } else {
+ log.debug("Show unblock pin dialog.");
+ TITLE = TITLE_UNBLOCK_PIN;
+ MESSAGE_MGMT = MESSAGE_UNBLOCK_PIN;
+ }
+ if (shortText) {
+ MESSAGE_MGMT_PARAM = "PIN";
+ } else {
+ MESSAGE_MGMT_PARAM = pinSpec.getLocalizedName();
+ }
+ } else {
+ log.debug("Show retry pin dialog.");
+ TITLE = TITLE_RETRY;
+ MESSAGE_MGMT = (retries < 2) ? MESSAGE_LAST_RETRY
+ : MESSAGE_RETRIES;
+ MESSAGE_MGMT_PARAM = String.valueOf(retries);
+ }
+
+ mainPanel.removeAll();
+ buttonPanel.removeAll();
+
+ helpListener.setHelpTopic(HELP_TOPIC);
+
+ mgmtLabel = new JLabel();
+ if (retries < 0) {
+ mgmtLabel.setFont(mgmtLabel.getFont().deriveFont(
+ mgmtLabel.getFont().getStyle() & ~Font.BOLD));
+ } else {
+ mgmtLabel.setFont(mgmtLabel.getFont().deriveFont(
+ mgmtLabel.getFont().getStyle() | Font.BOLD));
+ mgmtLabel.setForeground(ERROR_COLOR);
+ helpListener.setHelpTopic(HELP_RETRY);
+ }
+
+ if (renderHeaderPanel) {
+ titleLabel.setText(getMessage(TITLE));
+ String mgmtPattern = getMessage(MESSAGE_MGMT);
+ mgmtLabel.setText(MessageFormat.format(mgmtPattern,
+ MESSAGE_MGMT_PARAM));
+ } else {
+ mgmtLabel.setText(getMessage(TITLE));
+ }
+
+ // //////////////////////////////////////////////////////////////
+ // COMMON LAYOUT SECTION
+ // //////////////////////////////////////////////////////////////
+
+ GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
+ mainPanel.setLayout(mainPanelLayout);
+
+ GroupLayout.SequentialGroup infoHorizontal = mainPanelLayout
+ .createSequentialGroup().addComponent(mgmtLabel);
+ GroupLayout.ParallelGroup infoVertical = mainPanelLayout
+ .createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addComponent(mgmtLabel);
+
+ if (!renderHeaderPanel) {
+ infoHorizontal.addPreferredGap(
+ LayoutStyle.ComponentPlacement.UNRELATED, 0,
+ Short.MAX_VALUE)
+ .addComponent(switchFocusDummyLabel).addComponent(
+ helpLabel);
+ infoVertical.addComponent(switchFocusDummyLabel)
+ .addComponent(helpLabel);
+ }
+
+ GroupLayout.ParallelGroup pinHorizontal;
+ GroupLayout.SequentialGroup pinVertical;
+
+ if (pinpad) {
+ pinpadLabel = new JLabel();
+ pinpadLabel.setFont(mgmtLabel.getFont().deriveFont(
+ mgmtLabel.getFont().getStyle() & ~Font.BOLD));
+ String pinpadPattern = getMessage(MESSAGE_ENTERPIN_PINPAD);
+ pinpadLabel.setText(MessageFormat.format(pinpadPattern,
+ new Object[] { pinSpec.getLocalizedName(),
+ pinSpec.getLocalizedLength() }));
+
+ pinHorizontal = mainPanelLayout.createParallelGroup(
+ GroupLayout.Alignment.LEADING).addComponent(
+ pinpadLabel);
+ pinVertical = mainPanelLayout.createSequentialGroup()
+ .addComponent(pinpadLabel);
+ } else {
+
+ okButton = new JButton();
+ okButton.setFont(okButton.getFont().deriveFont(
+ okButton.getFont().getStyle() & ~Font.BOLD));
+ okButton.setText(getMessage(BUTTON_OK));
+ okButton.setEnabled(pinSpec.getMinLength() <= 0);
+ okButton.setActionCommand(okCommand);
+ okButton.addActionListener(okListener);
+
+ pinLabel = new JLabel();
+ pinLabel.setFont(pinLabel.getFont().deriveFont(
+ pinLabel.getFont().getStyle() & ~Font.BOLD));
+ String pinLabelPattern = (type == DIALOG.CHANGE || type == DIALOG.UNBLOCK) ? getMessage(LABEL_NEW_PIN)
+ : getMessage(LABEL_PIN);
+ pinLabel.setText(MessageFormat.format(pinLabelPattern,
+ new Object[] { pinSpec.getLocalizedName() }));
+
+ repeatPinField = new JPasswordField();
+ pinField = new JPasswordField();
+ pinField.setText("");
+ pinField.setActionCommand(okCommand);
+ pinField.addActionListener(new ActionListener() {
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ if (pinField.getPassword().length >= pinSpec
+ .getMinLength()) {
+ if (type == DIALOG.VERIFY) {
+ okListener.actionPerformed(e);
+ } else {
+ repeatPinField.requestFocusInWindow();
+ }
+ }
+ }
+ });
+
+ if (type != DIALOG.VERIFY) {
+ repeatPinLabel = new JLabel();
+ repeatPinLabel.setFont(pinLabel.getFont());
+ String repeatPinLabelPattern = getMessage(LABEL_REPEAT_PIN);
+ repeatPinLabel.setText(MessageFormat.format(
+ repeatPinLabelPattern, new Object[] { pinSpec
+ .getLocalizedName() }));
+
+ repeatPinField.setText("");
+ repeatPinField.setActionCommand(okCommand);
+ repeatPinField.addActionListener(new ActionListener() {
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ if (okButton.isEnabled()) {
+ okListener.actionPerformed(e);
+ }
+ }
+ });
+
+ if (type == DIALOG.CHANGE || type == DIALOG.UNBLOCK) {
+ oldPinLabel = new JLabel();
+ oldPinLabel.setFont(oldPinLabel.getFont()
+ .deriveFont(
+ oldPinLabel.getFont().getStyle()
+ & ~java.awt.Font.BOLD));
+ String oldPinLabelPattern = getMessage((type == DIALOG.CHANGE) ? LABEL_OLD_PIN
+ : LABEL_PUK);
+ oldPinLabel.setText(MessageFormat.format(
+ oldPinLabelPattern, new Object[] { pinSpec
+ .getLocalizedName() }));
+
+ oldPinField = new JPasswordField();
+ oldPinField.setText("");
+ oldPinField.setActionCommand(okCommand);
+ oldPinField.addActionListener(new ActionListener() {
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ if (oldPinField.getPassword().length >= pinSpec
+ .getMinLength()) {
+ pinField.requestFocusInWindow();
+ }
+ }
+ });
+
+ ExtendedPinDocument oldPinDocument = new ExtendedPinDocument(
+ pinSpec.getMinLength(), pinSpec
+ .getMaxLength(), pinSpec
+ .getRexepPattern(), okButton);
+ ComparePinDocument newPinDocument = new ComparePinDocument(
+ pinSpec.getRecMinLength(), pinSpec
+ .getRecMaxLength(), pinSpec
+ .getRexepPattern(), okButton);
+ ComparePinDocument confirmPinDocument = new ComparePinDocument(
+ pinSpec.getRecMinLength(), pinSpec
+ .getRecMaxLength(), pinSpec
+ .getRexepPattern(), okButton);
+
+ oldPinDocument.newPIN = newPinDocument;
+ oldPinDocument.confirmPIN = confirmPinDocument;
+
+ newPinDocument.compareTo = confirmPinDocument;
+ newPinDocument.currentPIN = oldPinDocument;
+ confirmPinDocument.compareTo = newPinDocument;
+ confirmPinDocument.currentPIN = oldPinDocument;
+
+ oldPinField.setDocument(oldPinDocument);
+ pinField.setDocument(newPinDocument);
+ repeatPinField.setDocument(confirmPinDocument);
+
+ primaryFocusHolder = oldPinField;
+
+ } else {
+ // else -> ACTIVATE (not verify, not change)
+ ComparePinDocument newPinDocument = new ComparePinDocument(
+ pinSpec.getRecMinLength(), pinSpec
+ .getRecMaxLength(), pinSpec
+ .getRexepPattern(), okButton);
+ ComparePinDocument confirmPinDocument = new ComparePinDocument(
+ pinSpec.getRecMinLength(), pinSpec
+ .getRecMaxLength(), pinSpec
+ .getRexepPattern(), okButton);
+
+ newPinDocument.compareTo = confirmPinDocument;
+ confirmPinDocument.compareTo = newPinDocument;
+
+ pinField.setDocument(newPinDocument);
+ repeatPinField.setDocument(confirmPinDocument);
+
+ primaryFocusHolder = pinField;
+ }
+ } else {
+ // VERIFY
+ pinField.setDocument(new PINDocument(pinSpec
+ .getMinLength(), pinSpec.getMaxLength(),
+ pinSpec.getRexepPattern(), okButton));
+
+ primaryFocusHolder = pinField;
+ }
+
+ pinsizeLabel = new JLabel();
+ pinsizeLabel.setFont(pinsizeLabel.getFont().deriveFont(
+ pinsizeLabel.getFont().getStyle() & ~Font.BOLD,
+ pinsizeLabel.getFont().getSize() - 2));
+ String pinsizePattern = getMessage(LABEL_PINSIZE);
+ pinsizeLabel.setText(MessageFormat.format(pinsizePattern,
+ pinSpec.getLocalizedLength()));
+
+ // //////////////////////////////////////////////////////////////
+ // NON-PINPAD SPECIFIC LAYOUT SECTION
+ // //////////////////////////////////////////////////////////////
+
+ pinHorizontal = mainPanelLayout
+ .createParallelGroup(GroupLayout.Alignment.LEADING);
+ pinVertical = mainPanelLayout.createSequentialGroup();
+
+ // if (pinLabelPos == PinLabelPosition.ABOVE) {
+ // if (changePin) {
+ // pinHorizontal
+ // .addComponent(oldPinLabel, GroupLayout.PREFERRED_SIZE,
+ // GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+ // .addComponent(oldPinField, GroupLayout.PREFERRED_SIZE,
+ // GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE);
+ // pinVertical
+ // .addComponent(oldPinLabel)
+ // .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ // .addComponent(oldPinField, GroupLayout.PREFERRED_SIZE,
+ // GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+ // .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED);
+ // }
+ // pinHorizontal
+ // .addComponent(pinLabel, GroupLayout.PREFERRED_SIZE,
+ // GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+ // .addComponent(pinField, GroupLayout.PREFERRED_SIZE,
+ // GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ // .addComponent(repeatPinLabel, GroupLayout.PREFERRED_SIZE,
+ // GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+ // .addComponent(repeatPinField, GroupLayout.PREFERRED_SIZE,
+ // GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ // .addGroup(mainPanelLayout.createSequentialGroup()
+ // .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED,
+ // 0, Short.MAX_VALUE)
+ // .addComponent(pinsizeLabel, GroupLayout.PREFERRED_SIZE,
+ // GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE));
+ // pinVertical
+ // .addComponent(pinLabel)
+ // .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ // .addComponent(pinField, GroupLayout.PREFERRED_SIZE,
+ // GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+ // .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ // .addComponent(repeatPinLabel)
+ // .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ // .addComponent(repeatPinField, GroupLayout.PREFERRED_SIZE,
+ // GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+ // .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ // .addComponent(pinsizeLabel);
+ // } else {
+
+//<<<<<<< .mine
+// if (windowCloseAdapter != null) {
+// windowCloseAdapter.registerListener(cancelListener, cancelCommand);
+// }
+//=======
+ if (type == DIALOG.CHANGE || type == DIALOG.UNBLOCK) {
+ pinHorizontal
+ .addGroup(mainPanelLayout
+ .createSequentialGroup()
+ .addGroup(
+ mainPanelLayout
+ .createParallelGroup(
+ GroupLayout.Alignment.LEADING)
+ .addComponent(
+ oldPinLabel,
+ GroupLayout.PREFERRED_SIZE,
+ GroupLayout.DEFAULT_SIZE,
+ GroupLayout.PREFERRED_SIZE)
+ .addComponent(
+ pinLabel,
+ GroupLayout.PREFERRED_SIZE,
+ GroupLayout.DEFAULT_SIZE,
+ GroupLayout.PREFERRED_SIZE)
+ .addComponent(
+ repeatPinLabel,
+ GroupLayout.PREFERRED_SIZE,
+ GroupLayout.DEFAULT_SIZE,
+ GroupLayout.PREFERRED_SIZE))
+ .addPreferredGap(
+ LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(
+ mainPanelLayout
+ .createParallelGroup(
+ GroupLayout.Alignment.LEADING)
+ .addComponent(
+ oldPinField,
+ GroupLayout.PREFERRED_SIZE,
+ GroupLayout.DEFAULT_SIZE,
+ Short.MAX_VALUE)
+ .addComponent(
+ pinField,
+ GroupLayout.PREFERRED_SIZE,
+ GroupLayout.DEFAULT_SIZE,
+ Short.MAX_VALUE)
+ .addComponent(
+ repeatPinField,
+ GroupLayout.PREFERRED_SIZE,
+ GroupLayout.DEFAULT_SIZE,
+ Short.MAX_VALUE)));
+//>>>>>>> .r684
+
+ pinVertical.addGroup(
+ mainPanelLayout.createParallelGroup(
+ GroupLayout.Alignment.BASELINE)
+ .addComponent(oldPinLabel)
+ .addComponent(oldPinField))
+ .addPreferredGap(
+ LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(
+ mainPanelLayout.createParallelGroup(
+ GroupLayout.Alignment.BASELINE)
+ .addComponent(pinLabel)
+ .addComponent(pinField))
+ .addPreferredGap(
+ LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(
+ mainPanelLayout.createParallelGroup(
+ GroupLayout.Alignment.BASELINE)
+ .addComponent(repeatPinLabel)
+ .addComponent(repeatPinField))
+ .addPreferredGap(
+ LayoutStyle.ComponentPlacement.RELATED);
+ } else if (type == DIALOG.ACTIVATE) {
+ pinHorizontal
+ .addGroup(mainPanelLayout
+ .createSequentialGroup()
+ .addGroup(
+ mainPanelLayout
+ .createParallelGroup(
+ GroupLayout.Alignment.LEADING)
+ .addComponent(
+ pinLabel,
+ GroupLayout.PREFERRED_SIZE,
+ GroupLayout.DEFAULT_SIZE,
+ GroupLayout.PREFERRED_SIZE)
+ .addComponent(
+ repeatPinLabel,
+ GroupLayout.PREFERRED_SIZE,
+ GroupLayout.DEFAULT_SIZE,
+ GroupLayout.PREFERRED_SIZE))
+ .addPreferredGap(
+ LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(
+ mainPanelLayout
+ .createParallelGroup(
+ GroupLayout.Alignment.LEADING)
+ .addComponent(
+ pinField,
+ GroupLayout.PREFERRED_SIZE,
+ GroupLayout.DEFAULT_SIZE,
+ Short.MAX_VALUE)
+ .addComponent(
+ repeatPinField,
+ GroupLayout.PREFERRED_SIZE,
+ GroupLayout.DEFAULT_SIZE,
+ Short.MAX_VALUE)));
+
+ pinVertical.addGroup(
+ mainPanelLayout.createParallelGroup(
+ GroupLayout.Alignment.BASELINE)
+ .addComponent(pinLabel).addComponent(
+ pinField)).addPreferredGap(
+ LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(
+ mainPanelLayout.createParallelGroup(
+ GroupLayout.Alignment.BASELINE)
+ .addComponent(repeatPinLabel)
+ .addComponent(repeatPinField))
+ .addPreferredGap(
+ LayoutStyle.ComponentPlacement.RELATED);
+ } else { // VERIFY
+ pinHorizontal.addGroup(mainPanelLayout
+ .createSequentialGroup().addComponent(pinLabel,
+ GroupLayout.PREFERRED_SIZE,
+ GroupLayout.DEFAULT_SIZE,
+ GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(
+ LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(pinField,
+ GroupLayout.PREFERRED_SIZE,
+ GroupLayout.DEFAULT_SIZE,
+ Short.MAX_VALUE));
+
+ pinVertical.addGroup(
+ mainPanelLayout.createParallelGroup(
+ GroupLayout.Alignment.BASELINE)
+ .addComponent(pinLabel).addComponent(
+ pinField)).addPreferredGap(
+ LayoutStyle.ComponentPlacement.RELATED);
+ }
+ pinHorizontal.addGroup(mainPanelLayout
+ .createSequentialGroup().addPreferredGap(
+ LayoutStyle.ComponentPlacement.UNRELATED,
+ 0, Short.MAX_VALUE).addComponent(
+ pinsizeLabel, GroupLayout.PREFERRED_SIZE,
+ GroupLayout.DEFAULT_SIZE,
+ GroupLayout.PREFERRED_SIZE));
+ pinVertical.addComponent(pinsizeLabel);
+
+ cancelButton = new JButton();
+ cancelButton.setFont(cancelButton.getFont().deriveFont(
+ cancelButton.getFont().getStyle()
+ & ~java.awt.Font.BOLD));
+ cancelButton.setText(getMessage(BUTTON_CANCEL));
+ cancelButton.setActionCommand(cancelCommand);
+ cancelButton.addActionListener(cancelListener);
+
+
+ updateMethodToRunAtResize("at.gv.egiz.bku.gui.PINManagementGUI", "renderPINDialogButtonPanel");
+
+ renderPINDialogButtonPanel();
+
+ if (oldPinField != null) {
+ oldPinField.requestFocusInWindow();
+ } else {
+ pinField.requestFocusInWindow();
+ }
+
+ } // END NON-PINPAD SECTION
+
+ mainPanelLayout.setHorizontalGroup(mainPanelLayout
+ .createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addGroup(infoHorizontal).addGroup(pinHorizontal));
+
+ mainPanelLayout
+ .setVerticalGroup(mainPanelLayout
+ .createSequentialGroup().addGroup(infoVertical)
+ .addPreferredGap(
+ LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(pinVertical));
+
+ contentPanel.validate();
+
+ if (windowCloseAdapter != null) {
+ windowCloseAdapter.registerListener(cancelListener, cancelCommand);
+ }
+
+ resize();
+
+ }
+ });
+ }
+
+ public void renderPINDialogButtonPanel() {
+
+ GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
+ buttonPanel.setLayout(buttonPanelLayout);
+
+ GroupLayout.SequentialGroup buttonHorizontal = buttonPanelLayout
+ .createSequentialGroup().addContainerGap(
+ GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(okButton, GroupLayout.PREFERRED_SIZE, buttonSize,
+ GroupLayout.PREFERRED_SIZE);
+ GroupLayout.Group buttonVertical;
+
+
+ buttonHorizontal
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(cancelButton, GroupLayout.PREFERRED_SIZE,
+ buttonSize, GroupLayout.PREFERRED_SIZE);
+ buttonVertical = buttonPanelLayout.createParallelGroup(
+ GroupLayout.Alignment.BASELINE).addComponent(okButton)
+ .addComponent(cancelButton);
+
+ buttonPanelLayout.setHorizontalGroup(buttonHorizontal);
+ buttonPanelLayout.setVerticalGroup(buttonVertical);
+
+ }
+
+ @Override
+ protected int initButtonSize() {
+ int bs = super.initButtonSize();
+
+ JButton b = new JButton();
+ b.setText(getMessage(BUTTON_ACTIVATE));
+ if (b.getPreferredSize().width > bs) {
+ bs = b.getPreferredSize().width;
+ }
+ b.setText(getMessage(BUTTON_CHANGE));
+ if (b.getPreferredSize().width > bs) {
+ bs = b.getPreferredSize().width;
+ }
+ b.setText(getMessage(BUTTON_UNBLOCK));
+ if (b.getPreferredSize().width > bs) {
+ bs = b.getPreferredSize().width;
+ }
+ b.setText(getMessage(BUTTON_CANCEL));
+ if (b.getPreferredSize().width > bs) {
+ bs = b.getPreferredSize().width;
+ }
+
+ return bs;
+ }
@Override
- public void showEnterCurrentPIN(DIALOG type, PINSpec pinSpec, int retries) {
+ public void showEnterCurrentPIN(DIALOG type, PinInfo pinSpec, int retries) {
String title, message;
// Object[] params = null;
-
+
if (type == PINManagementGUIFacade.DIALOG.VERIFY) {
title = PINManagementGUIFacade.TITLE_VERIFY_PINPAD;
message = BKUGUIFacade.MESSAGE_ENTERPIN_PINPAD;
-// params = new Object[]{pinSpec.getLocalizedName(), pinSpec.getLocalizedLength()};
} else if (type == PINManagementGUIFacade.DIALOG.ACTIVATE) {
title = PINManagementGUIFacade.TITLE_ACTIVATE_PIN;
message = PINManagementGUIFacade.MESSAGE_ACTIVATE_PINPAD_CURRENT;
-// params = new Object[]{pinSpec.getLocalizedName(), pinSpec.getLocalizedLength()};
} else if (type == PINManagementGUIFacade.DIALOG.CHANGE) {
title = PINManagementGUIFacade.TITLE_CHANGE_PIN;
message = PINManagementGUIFacade.MESSAGE_CHANGE_PINPAD_CURRENT;
-// params = new Object[]{pinSpec.getLocalizedName(), pinSpec.getLocalizedLength()};
} else { //if (type == DIALOG.UNBLOCK) {
title = PINManagementGUIFacade.TITLE_UNBLOCK_PIN;
message = PINManagementGUIFacade.MESSAGE_UNBLOCK_PINPAD_CURRENT;
-// params = new Object[]{pinSpec.getLocalizedName(), pinSpec.getLocalizedLength()};
}
showEnterPIN(pinSpec, retries, title, message, null);
}
@Override
- public void showEnterNewPIN(DIALOG type, PINSpec pinSpec) {
+ public void showEnterNewPIN(DIALOG type, PinInfo pinSpec) {
String title, message;
if (type == PINManagementGUIFacade.DIALOG.ACTIVATE) {
title = PINManagementGUIFacade.TITLE_ACTIVATE_PIN;
@@ -731,7 +964,7 @@ public class PINManagementGUI extends CardMgmtGUI implements PINManagementGUIFac
title = PINManagementGUIFacade.TITLE_UNBLOCK_PIN;
message = PINManagementGUIFacade.MESSAGE_UNBLOCK_PINPAD_NEW;
} else {
- log.error("enterNewPIN not supported for dialog type " + type);
+ log.error("EnterNewPIN not supported for dialog type {}.", type);
showErrorDialog(ERR_UNKNOWN, null);
return;
}
@@ -739,7 +972,7 @@ public class PINManagementGUI extends CardMgmtGUI implements PINManagementGUIFac
}
@Override
- public void showConfirmNewPIN(DIALOG type, PINSpec pinSpec) {
+ public void showConfirmNewPIN(DIALOG type, PinInfo pinSpec) {
String title, message;
if (type == PINManagementGUIFacade.DIALOG.ACTIVATE) {
title = PINManagementGUIFacade.TITLE_ACTIVATE_PIN;
@@ -751,11 +984,104 @@ public class PINManagementGUI extends CardMgmtGUI implements PINManagementGUIFac
title = PINManagementGUIFacade.TITLE_UNBLOCK_PIN;
message = PINManagementGUIFacade.MESSAGE_UNBLOCK_PINPAD_CONFIRM;
} else {
- log.error("enterNewPIN not supported for dialog type " + type);
+ log.error("EnterNewPIN not supported for dialog type {}.", type);
showErrorDialog(ERR_UNKNOWN, null);
return;
}
showEnterPIN(pinSpec, -1, title, message, null);
}
+ @Override
+ public void resize() {
+
+ log.debug("Resizing PINManagementApplet ...");
+
+ float factor = getResizeFactor();
+
+ if (mgmtLabel != null) {
+
+ mgmtLabel.setFont(mgmtLabel.getFont().deriveFont(
+ (float) (baseFontSize * factor)));
+ }
+
+ if (pinStatusRenderer != null) {
+
+ pinStatusRenderer.setFontSize((int) (baseFontSize * factor));
+ }
+
+ if (pinStatusTable != null) {
+
+ pinStatusTable.setRowHeight((int) (baseTableRowHeight * factor));
+ pinStatusTable.setFont(pinStatusTable.getFont().deriveFont(
+ (float) (baseFontSize * factor)));
+
+ }
+
+ if (activateButton != null) {
+
+ activateButton.setFont(activateButton.getFont().deriveFont(
+ (float) (baseFontSize * factor)));
+
+ }
+
+ if (cancelButton != null) {
+
+ cancelButton.setFont(cancelButton.getFont().deriveFont(
+ (float) (baseFontSize * factor)));
+
+ }
+
+
+ if (pinpadLabel != null) {
+ pinpadLabel.setFont(pinpadLabel.getFont().deriveFont(
+ (float) (baseFontSize * factor)));
+ }
+
+ if (okButton != null) {
+ okButton.setFont(okButton.getFont().deriveFont(
+ (float) (baseFontSize * factor)));
+ }
+
+ if (pinLabel != null) {
+ pinLabel.setFont(pinLabel.getFont().deriveFont(
+ (float) (baseFontSize * factor)));
+ }
+
+ if (repeatPinLabel != null) {
+ repeatPinLabel.setFont(repeatPinLabel.getFont().deriveFont(
+ (float) (baseFontSize * factor)));
+ }
+
+ if (oldPinLabel != null) {
+ oldPinLabel.setFont(oldPinLabel.getFont().deriveFont(
+ (float) (baseFontSize * factor)));
+ }
+
+ if (pinField != null) {
+ pinField.setFont(pinField.getFont().deriveFont(
+ (float) (baseFontSize * factor)));
+ }
+
+ if (repeatPinField != null) {
+
+ repeatPinField.setFont(repeatPinField.getFont().deriveFont(
+ (float) (baseFontSize * factor)));
+ }
+
+ if (oldPinField != null) {
+
+ oldPinField.setFont(oldPinField.getFont().deriveFont(
+ (float) (baseFontSize * factor)));
+ }
+
+ if (pinsizeLabel != null) {
+ pinsizeLabel.setFont(pinsizeLabel.getFont().deriveFont(
+ (float) ((baseFontSize-2) * factor)));
+ }
+
+ super.resize();
+
+
+ }
+
}
diff --git a/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINManagementGUIFacade.java b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINManagementGUIFacade.java
index 46ae18b9..c768a1e9 100644
--- a/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINManagementGUIFacade.java
+++ b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINManagementGUIFacade.java
@@ -17,9 +17,8 @@
package at.gv.egiz.bku.gui;
-import at.gv.egiz.smcc.PINSpec;
+import at.gv.egiz.smcc.PinInfo;
import java.awt.event.ActionListener;
-import java.util.Map;
/**
*
@@ -91,39 +90,40 @@ public interface PINManagementGUIFacade extends BKUGUIFacade {
public static final String STATUS_NOT_ACTIVE = "status.not.active";
public static final String STATUS_UNKNOWN = "status.unknown";
- public enum STATUS { ACTIV, NOT_ACTIV, BLOCKED, UNKNOWN };
+// public enum STATUS { ACTIV, NOT_ACTIV, BLOCKED, UNKNOWN };
public enum DIALOG { VERIFY, ACTIVATE, CHANGE, UNBLOCK };
+ public enum PIN_MANAGEMENT_DIALOG_TYPE {DIALOGUE_UNDEFINED, DIALOGUE_PIN_MANAGEMENT, DIALOGUE_PIN};
/**
* list pins
*/
- public void showPINManagementDialog(Map<PINSpec, STATUS> pins,
+ public void showPINManagementDialog(PinInfo[] pins,
ActionListener activateListener, String activateCmd, String changeCmd, String unblockCmd, String verifyCmd,
ActionListener cancelListener, String cancelCmd);
/**
* "software" pin-entry dialog (activate, change, unblock, verify)
*/
- public void showPINDialog(DIALOG type, PINSpec pinSpec, int retries,
+ public void showPINDialog(DIALOG type, PinInfo pinSpec, int retries,
ActionListener okListener, String okCmd,
ActionListener cancelListener, String cancelCmd);
/**
* <b>direct</b> pinpad pin-entry dialog
*/
- public void showModifyPINDirect(DIALOG type, PINSpec pinSpec, int retries);
+ public void showModifyPINDirect(DIALOG type, PinInfo pinSpec, int retries);
/**
* <b>start/finish</b> pinpad pin-entry dialog
*/
- public void showEnterCurrentPIN(DIALOG type, PINSpec pinSpec, int retries);
+ public void showEnterCurrentPIN(DIALOG type, PinInfo pinSpec, int retries);
- public void showEnterNewPIN(DIALOG type, PINSpec pinSpec);
+ public void showEnterNewPIN(DIALOG type, PinInfo pinSpec);
- public void showConfirmNewPIN(DIALOG type, PINSpec pinSpec);
+ public void showConfirmNewPIN(DIALOG type, PinInfo pinSpec);
public char[] getOldPin();
- public PINSpec getSelectedPINSpec();
+ public PinInfo getSelectedPinInfo();
}
diff --git a/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINSpecRenderer.java b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINSpecRenderer.java
index e3d73e1f..7504965e 100644
--- a/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINSpecRenderer.java
+++ b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINSpecRenderer.java
@@ -17,10 +17,8 @@
package at.gv.egiz.bku.gui;
-import at.gv.egiz.smcc.PINSpec;
+import at.gv.egiz.smcc.PinInfo;
import javax.swing.table.DefaultTableCellRenderer;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
/**
*
@@ -28,12 +26,25 @@ import org.apache.commons.logging.LogFactory;
*/
public class PINSpecRenderer extends DefaultTableCellRenderer {
- private static final Log log = LogFactory.getLog(PINSpecRenderer.class);
+ private static final long serialVersionUID = 1L;
+
+ protected int fontSize;
+
+ public PINSpecRenderer() {
+ this.fontSize = super.getFont().getSize();
+ }
+
@Override
protected void setValue(Object value) {
- PINSpec pinSpec = (PINSpec) value;
+ PinInfo pinSpec = (PinInfo) value;
super.setText(pinSpec.getLocalizedName());
+ super.setFont(super.getFont().deriveFont((float) (fontSize)));
}
+ public void setFontSize(int fontSize) {
+
+ this.fontSize = fontSize;
+ }
+
}
diff --git a/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINStatusRenderer.java b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINStatusRenderer.java
index 83ff74f2..d3fd61d1 100644
--- a/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINStatusRenderer.java
+++ b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINStatusRenderer.java
@@ -17,7 +17,7 @@
package at.gv.egiz.bku.gui;
-import at.gv.egiz.bku.gui.PINManagementGUIFacade.STATUS;
+import at.gv.egiz.smcc.PinInfo;
import java.awt.Color;
import java.awt.Font;
import java.util.ResourceBundle;
@@ -29,33 +29,45 @@ import javax.swing.table.DefaultTableCellRenderer;
*/
public class PINStatusRenderer extends DefaultTableCellRenderer {
-// private static final Log log = LogFactory.getLog(PINStatusRenderer.class);
-
+ private static final long serialVersionUID = 1L;
+
public static final Color RED = new Color(0.9f, 0.0f, 0.0f);
public static final Color GREEN = new Color(0.0f, 0.8f, 0.0f);
protected ResourceBundle messages;
+ protected int fontSize;
public PINStatusRenderer(ResourceBundle messages) {
this.messages = messages;
+ this.fontSize = super.getFont().getSize();
}
@Override
protected void setValue(Object value) {
- STATUS pinStatus = (STATUS) value;
+ PinInfo.STATE pinStatus = ((PinInfo) value).getState();
+
super.setFont(super.getFont().deriveFont(super.getFont().getStyle() | Font.BOLD));
+ super.setFont(super.getFont().deriveFont((float) (fontSize)));
- if (pinStatus == STATUS.NOT_ACTIV) {
+ if (pinStatus == PinInfo.STATE.NOT_ACTIV) {
super.setForeground(RED);
- super.setText("<html>" + messages.getString(PINManagementGUIFacade.STATUS_NOT_ACTIVE) + "</html>");
- } else if (pinStatus == STATUS.ACTIV) {
+ super.setText("<html>" + messages.getString(PINManagementGUIFacade.STATUS_NOT_ACTIVE));
+ } else if (pinStatus == PinInfo.STATE.ACTIV) {
super.setForeground(GREEN);
- super.setText("<html>" + messages.getString(PINManagementGUIFacade.STATUS_ACTIVE) + "</html>");
- } else if (pinStatus == STATUS.BLOCKED) {
+ super.setText("<html>" + messages.getString(PINManagementGUIFacade.STATUS_ACTIVE) + " (" + ((PinInfo) value).getRetries() + ")");
+ } else if (pinStatus == PinInfo.STATE.BLOCKED) {
super.setForeground(RED);
- super.setText("<html>" + messages.getString(PINManagementGUIFacade.STATUS_BLOCKED) + "</html>");
- } else {
+ super.setText("<html>" + messages.getString(PINManagementGUIFacade.STATUS_BLOCKED));
+ } else if (pinStatus == PinInfo.STATE.UNKNOWN) {
super.setForeground(Color.BLACK);
- super.setText("<html>" + messages.getString(PINManagementGUIFacade.STATUS_UNKNOWN) + "</html>");
+ super.setText("<html>" + messages.getString(PINManagementGUIFacade.STATUS_UNKNOWN));
+ } else {
+ super.setForeground(Color.RED);
+ super.setText("<html>" + messages.getString(PINManagementGUIFacade.STATUS_UNKNOWN));
}
}
+
+ public void setFontSize(int fontSize) {
+
+ this.fontSize = fontSize;
+ }
}
diff --git a/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINStatusTableModel.java b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINStatusTableModel.java
index 052c13b2..18ab5e88 100644
--- a/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINStatusTableModel.java
+++ b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINStatusTableModel.java
@@ -16,9 +16,7 @@
*/
package at.gv.egiz.bku.gui;
-import at.gv.egiz.bku.gui.PINManagementGUIFacade.STATUS;
-import at.gv.egiz.smcc.PINSpec;
-import java.util.Map;
+import at.gv.egiz.smcc.PinInfo;
import javax.swing.table.DefaultTableModel;
/**
@@ -27,27 +25,20 @@ import javax.swing.table.DefaultTableModel;
*/
public class PINStatusTableModel extends DefaultTableModel {
-// protected static final Log log = LogFactory.getLog(PINStatusTableModel.class);
- protected Class[] types;
+ private static final long serialVersionUID = 1L;
- public PINStatusTableModel(Map<PINSpec, STATUS> pinStatuses) {
+ protected Class<?>[] types;
+
+ public PINStatusTableModel(PinInfo[] pinSpecs) {
super(0, 2);
- if (pinStatuses == null) {
- throw new RuntimeException("pinStatuses must not be null");
- }
-// log.trace(pinStatuses.size() + " PINs");
- types = new Class[] { PINSpec.class, STATUS.class };
- for (PINSpec pinSpec : pinStatuses.keySet()) {
- addRow(new Object[] { pinSpec, pinStatuses.get(pinSpec) });
+ types = new Class<?>[] { String.class, PinInfo.class };
+ for (PinInfo pinSpec : pinSpecs) {
+ addRow(new Object[] { pinSpec.getLocalizedName(), pinSpec });
}
-// PINSpec activePIN = new PINSpec(0, 1, null, "active-PIN", (byte) 0x01);
-// PINSpec blockedPIN = new PINSpec(0, 1, null, "blocked-PIN", (byte) 0x01);
-// addRow(new Object[] { activePIN, PINStatusProvider.STATUS.ACTIV });
-// addRow(new Object[] { blockedPIN, PINStatusProvider.STATUS.BLOCKED });
}
@Override
- public Class getColumnClass(int columnIndex) {
+ public Class<?> getColumnClass(int columnIndex) {
return types[columnIndex];
}
diff --git a/BKUGuiExt/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java b/BKUGuiExt/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java
index b9c0e5f8..0dcdf033 100644
--- a/BKUGuiExt/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java
+++ b/BKUGuiExt/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java
@@ -20,7 +20,7 @@
*/
package at.gv.egiz.bku.gui;
-import at.gv.egiz.smcc.PINSpec;
+import at.gv.egiz.smcc.PinInfo;
import at.gv.egiz.stal.HashDataInput;
import at.gv.egiz.stal.impl.ByteArrayHashDataInput;
import java.awt.event.ActionEvent;
@@ -44,7 +44,7 @@ public class BKUGUIWorker implements Runnable {
public void run() {
try {
- final PINSpec signPinSpec = new PINSpec(6, 10, "[0-9]", "Signatur-PIN", (byte)0x00, null);
+ final PinInfo signPinSpec = new SimplePinInfo(6, 10, "[0-9]", "Signatur-PIN", (byte)0x00, null, PinInfo.UNKNOWN_RETRIES);
final ActionListener cancelListener = new ActionListener() {
diff --git a/BKUGuiExt/src/test/java/at/gv/egiz/bku/gui/SimplePinInfo.java b/BKUGuiExt/src/test/java/at/gv/egiz/bku/gui/SimplePinInfo.java
new file mode 100644
index 00000000..3e583118
--- /dev/null
+++ b/BKUGuiExt/src/test/java/at/gv/egiz/bku/gui/SimplePinInfo.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2008 Federal Chancellery Austria and
+ * Graz University of Technology
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package at.gv.egiz.bku.gui;
+
+import at.gv.egiz.smcc.PinInfo;
+import java.util.Locale;
+
+/**
+ *
+ * @author Clemens Orthacker <clemens.orthacker@iaik.tugraz.at>
+ */
+public class SimplePinInfo extends PinInfo {
+
+ String name;
+
+ public SimplePinInfo(int minLength, int maxLength, String rexepPattern, String name, byte kid, byte[] contextAID, int maxRetries) {
+ super(minLength, maxLength, rexepPattern, null, null, kid, contextAID, maxRetries);
+ this.name = name;
+ }
+
+ @Override
+ public String getLocalizedName() {
+ return name;
+ }
+
+ @Override
+ public String getLocalizedName(Locale locale) {
+ return name;
+ }
+
+}
diff --git a/BKUHelp/pom.xml b/BKUHelp/pom.xml
index 9fabf80d..8d8001e3 100644
--- a/BKUHelp/pom.xml
+++ b/BKUHelp/pom.xml
@@ -1,13 +1,13 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
- <artifactId>bku</artifactId>
+ <artifactId>mocca</artifactId>
<groupId>at.gv.egiz</groupId>
- <version>1.2.14-SNAPSHOT</version>
+ <version>1.3.0-SNAPSHOT</version>
</parent>
<groupId>at.gv.egiz</groupId>
<artifactId>BKUHelp</artifactId>
- <version>1.2.14-SNAPSHOT</version>
+ <version>${project.parent.version}</version>
<name>BKU Help</name>
<build>
<resources>
diff --git a/BKUHelp/src/main/webapp/help/cardnotsupported.html b/BKUHelp/src/main/webapp/help/cardnotsupported.html
new file mode 100644
index 00000000..3da1a7e0
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/cardnotsupported.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<title>Bürgerkarte - Hilfe</title>
+<link href="/help/css/help.css" rel="stylesheet" type="text/css" />
+<link rel="shortcut icon" href="/help/chip16.ico" type="image/x-icon"/>
+<!--[if IE]>
+<style type="text/css">
+/* place css fixes for all versions of IE in this conditional comment */
+.twoColElsLtHdr #sidebar1 { padding-top: 30px; }
+.twoColElsLtHdr #mainContent { zoom: 1; padding-top: 15px; }
+/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
+</style>
+<![endif]-->
+</head>
+
+<body class="twoColElsLtHdr">
+
+<div id="container">
+ <div id="header">
+ <h1>Online-Hilfe</h1>
+ <!-- end #header --></div>
+ <div id="sidebar1">
+ <p><img src="cardnotsupported.png" alt="Bildschirmfoto des Applets" width="190" height="130"/></p>
+ <p><strong>Hinweis:</strong> Das Bildschirmfoto oben kann von der Darstellung in der Webseite abweichen.</p>
+ <!-- end #sidebar1 --></div>
+ <div id="mainContent">
+ <h1> Die Karte wird nicht unterstützt</h1>
+ <p>Die im Kartenleser gesteckte Chipkarte wird nicht unterstützt.</p>
+ <p>Bitte stecken Sie eine unterstützte Chipkarte (Bürgerkarte) in den Kartenleser. Derzeit werden die folgenden Chipkarten unterstützt:</p>
+ <ul>
+ <li><strong>e-card</strong> <br />
+ Chipkarte der <a href="http://www.sozialversicherung.at">Österreichischen Sozialversicherung</a></li>
+ <li><strong>a-sign premium</strong> <br />
+ Chipkarte der <a href="http://www.a-trust.at">A-Trust GmbH</a> bzw. diverse andere Chipkarten mit der Aufschrift 'a-sign premium'.</li>
+ </ul>
+ <p>Sind mehrere unterstützte Kartenleser angeschlossen, stecken sie eine unterstützte Chipkarte (Bürgerkarte) in einen der angeschlossenen Kartenleser. Wird die Chipkarte erkannt wechselt die Bildschirmanzeige. Wird die Chipkarte nicht erkannt, wird der Kartenleser möglicherweise nicht unterstützt. Stecken Sie die Chipkarte daher in einen anderen Kartenleser.</p>
+ <p><br class="clearfloat" /></p>
+ </div>
+ <div id="footer">
+ <p>
+ <a href="http://www.buergerkarte.at">Österreichische Bürgerkarte</a> | <a href="http://mocca.egovlabs.gv.at">Bürgerkartensoftware MOCCA</a>
+ </p>
+ </div>
+<!-- end #container --></div>
+</body>
+</html>
diff --git a/BKUHelp/src/main/webapp/help/cardnotsupported.png b/BKUHelp/src/main/webapp/help/cardnotsupported.png
new file mode 100644
index 00000000..c3b7ce6b
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/cardnotsupported.png
Binary files differ
diff --git a/BKUHelp/src/main/webapp/help/css/help.css b/BKUHelp/src/main/webapp/help/css/help.css
new file mode 100644
index 00000000..28f9767b
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/css/help.css
@@ -0,0 +1,81 @@
+@charset "UTF-8";
+body {
+ font: 100% Verdana, Arial, Helvetica, sans-serif;
+ background: #666666;
+ margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */
+ padding: 0;
+ text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
+ color: #000000;
+}
+
+/* Tips for Elastic layouts
+1. Since the elastic layouts overall sizing is based on the user's default fonts size, they are more unpredictable. Used correctly, they are also more accessible for those that need larger fonts size since the line length remains proportionate.
+2. Sizing of divs in this layout are based on the 100% font size in the body element. If you decrease the text size overall by using a font-size: 80% on the body element or the #container, remember that the entire layout will downsize proportionately. You may want to increase the widths of the various divs to compensate for this.
+3. If font sizing is changed in differing amounts on each div instead of on the overall design (ie: #sidebar1 is given a 70% font size and #mainContent is given an 85% font size), this will proportionately change each of the divs overall size. You may want to adjust based on your final font sizing.
+*/
+.twoColElsLtHdr #container {
+ width: 46em; /* this width will create a container that will fit in an 800px browser window if text is left at browser default font sizes */
+ background: #FFFFFF;
+ margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */
+ border: 1px solid #000000;
+ text-align: left; /* this overrides the text-align: center on the body element. */
+}
+.twoColElsLtHdr #header {
+ background: #DDDDDD;
+ padding: 0 10px; /* this padding matches the left alignment of the elements in the divs that appear beneath it. If an image is used in the #header instead of text, you may want to remove the padding. */
+}
+.twoColElsLtHdr #header h1 {
+ margin: 0; /* zeroing the margin of the last element in the #header div will avoid margin collapse - an unexplainable space between divs. If the div has a border around it, this is not necessary as that also avoids the margin collapse */
+ padding: 10px 0; /* using padding instead of margin will allow you to keep the element away from the edges of the div */
+}
+
+/* Tips for sidebar1:
+1. Be aware that if you set a font-size value on this div, the overall width of the div will be adjusted accordingly.
+2. Since we are working in ems, it's best not to use padding on the sidebar itself. It will be added to the width for standards compliant browsers creating an unknown actual width.
+3. Space between the side of the div and the elements within it can be created by placing a left and right margin on those elements as seen in the ".twoColElsLtHdr #sidebar1 p" rule.
+*/
+.twoColElsLtHdr #sidebar1 {
+ float: left;
+ width: 210px;
+ padding: 15px 0; /* top and bottom padding create visual space within this div */
+ background-color: #FFFFFF;
+}
+.twoColElsLtHdr #sidebar1 h3, .twoColElsLtHdr #sidebar1 p {
+ margin-left: 10px; /* the left and right margin should be given to every element that will be placed in the side columns */
+ margin-right: 10px;
+}
+
+/* Tips for mainContent:
+1. If you give this #mainContent div a font-size value different than the #sidebar1 div, the margins of the #mainContent div will be based on its font-size and the width of the #sidebar1 div will be based on its font-size. You may wish to adjust the values of these divs.
+2. The space between the mainContent and sidebar1 is created with the left margin on the mainContent div. No matter how much content the sidebar1 div contains, the column space will remain. You can remove this left margin if you want the #mainContent div's text to fill the #sidebar1 space when the content in #sidebar1 ends.
+3. To avoid float drop, you may need to test to determine the approximate maximum image/element size since this layout is based on the user's font sizing combined with the values you set. However, if the user has their browser font size set lower than normal, less space will be available in the #mainContent div than you may see on testing.
+4. In the Internet Explorer Conditional Comment below, the zoom property is used to give the mainContent "hasLayout." This avoids several IE-specific bugs that may occur.
+*/
+.twoColElsLtHdr #mainContent {
+ margin: 0 1.5em 0 15em; /* the right margin can be given in ems or pixels. It creates the space down the right side of the page. */
+ padding: 0 10px;
+}
+.twoColElsLtHdr #footer {
+ padding: 0 10px; /* this padding matches the left alignment of the elements in the divs that appear above it. */
+ background:#DDDDDD;
+}
+.twoColElsLtHdr #footer p {
+ margin: 0; /* zeroing the margins of the first element in the footer will avoid the possibility of margin collapse - a space between divs */
+ padding: 10px 0; /* padding on this element will create space, just as the the margin would have, without the margin collapse issue */
+}
+
+/* Miscellaneous classes for reuse */
+.fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
+ float: right;
+ margin-left: 8px;
+}
+.fltlft { /* this class can be used to float an element left in your page */
+ float: left;
+ margin-right: 8px;
+}
+.clearfloat { /* this class should be placed on a div or break element and should be the final element before the close of a container that should fully contain a float */
+ clear:both;
+ height:0;
+ font-size: 1px;
+ line-height: 0px;
+} \ No newline at end of file
diff --git a/BKUHelp/src/main/webapp/help/en/cardnotsupported.html b/BKUHelp/src/main/webapp/help/en/cardnotsupported.html
new file mode 100644
index 00000000..92a23c04
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/en/cardnotsupported.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<title>CitizenCard - Help</title>
+<link href="/help/css/help.css" rel="stylesheet" type="text/css" />
+<link rel="shortcut icon" href="/help/chip16.ico" type="image/x-icon"/>
+<!--[if IE]>
+<style type="text/css">
+/* place css fixes for all versions of IE in this conditional comment */
+.twoColElsLtHdr #sidebar1 { padding-top: 30px; }
+.twoColElsLtHdr #mainContent { zoom: 1; padding-top: 15px; }
+/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
+</style>
+<![endif]-->
+</head>
+
+<body class="twoColElsLtHdr">
+
+<div id="container">
+ <div id="header">
+ <h1>Online Help</h1>
+ <!-- end #header --></div>
+ <div id="sidebar1">
+ <p><img src="cardnotsupported.png" alt="applet screenshot" width="190" height="130"/></p>
+ <p><strong>Note</strong> that the screenshot may differ slightly from the actual web page.</p>
+ <!-- end #sidebar1 --></div>
+ <div id="mainContent">
+ <h1> Die Karte wird nicht unterstützt</h1>
+ <p>Die im Kartenleser gesteckte Chipkarte wird nicht unterstützt.</p>
+ <p>Bitte stecken Sie eine unterstützte Chipkarte (Bürgerkarte) in den Kartenleser. Derzeit werden die folgenden Chipkarten unterstützt:</p>
+ <ul>
+ <li><strong>e-card</strong> <br />
+ Chipkarte der <a href="http://www.sozialversicherung.at">Österreichischen Sozialversicherung</a></li>
+ <li><strong>a-sign premium</strong> <br />
+ Chipkarte der <a href="http://www.a-trust.at">A-Trust GmbH</a> bzw. diverse andere Chipkarten mit der Aufschrift 'a-sign premium'.</li>
+ </ul>
+ <p>Sind mehrere unterstützte Kartenleser angeschlossen, stecken sie eine unterstützte Chipkarte (Bürgerkarte) in einen der angeschlossenen Kartenleser. Wird die Chipkarte erkannt wechselt die Bildschirmanzeige. Wird die Chipkarte nicht erkannt, wird der Kartenleser möglicherweise nicht unterstützt. Stecken Sie die Chipkarte daher in einen anderen Kartenleser.</p>
+ <p><br class="clearfloat" /></p>
+ </div>
+ <div id="footer">
+ <p>
+ <a href="http://www.buergerkarte.at">Austrian CitizenCard</a> | <a href="http://mocca.egovlabs.gv.at">CitizenCard Environment MOCCA</a>
+ </p>
+ </div>
+<!-- end #container --></div>
+</body>
+</html>
diff --git a/BKUHelp/src/main/webapp/help/en/cardnotsupported.png b/BKUHelp/src/main/webapp/help/en/cardnotsupported.png
new file mode 100644
index 00000000..c3b7ce6b
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/en/cardnotsupported.png
Binary files differ
diff --git a/BKUHelp/src/main/webapp/help/en/error.card.locked.html b/BKUHelp/src/main/webapp/help/en/error.card.locked.html
new file mode 100644
index 00000000..01c67de5
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/en/error.card.locked.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<title>CitizenCard - Help</title>
+<link href="/help/css/help.css" rel="stylesheet" type="text/css" />
+<link rel="shortcut icon" href="/help/chip16.ico" type="image/x-icon"/>
+<!--[if IE]>
+<style type="text/css">
+/* place css fixes for all versions of IE in this conditional comment */
+.twoColElsLtHdr #sidebar1 { padding-top: 30px; }
+.twoColElsLtHdr #mainContent { zoom: 1; padding-top: 15px; }
+/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
+</style>
+<![endif]-->
+</head>
+
+<body class="twoColElsLtHdr">
+
+<div id="container">
+ <div id="header">
+ <h1>Online Help</h1>
+ <!-- end #header --></div>
+ <div id="sidebar1">
+ <p><img src="error.card.locked.png" alt="Bildschirmfoto des Applets" width="190" height="130"/></p>
+ <p><strong>Note</strong> that the screenshot may differ slightly from the actual web page.</p>
+ <!-- end #sidebar1 --></div>
+ <div id="mainContent">
+ <h1> Fehler: Bürgerkarte ist gesperrt</h1>
+ <p>Die Bürgerkartenfunktion auf der gesteckten Chipkarte ist gesperrt. Es stehen keine weiteren Versuche zur Eingabe einer PIN zur Verfügung, da zu oft eine falsche PIN eingegeben wurde.</p>
+ <p>Bitte wenden sie sich an den Aussteller der Karte.</p>
+<ul>
+ <li><strong>e-card</strong> <br />
+ Chipkarte der <a href="http://www.sozialversicherung.at">Österreichischen Sozialversicherung</a></li>
+ <li><strong>a-sign premium</strong> <br />
+ Chipkarte der <a href="http://www.a-trust.at">A-Trust GmbH</a> bzw. diverse andere Chipkarten mit der Aufschrift 'a-sign premium'.</li>
+ </ul>
+ <p><br class="clearfloat" /></p>
+ </div>
+ <div id="footer">
+ <p>
+ <a href="http://www.buergerkarte.at">Austrian CitizenCard</a> | <a href="http://mocca.egovlabs.gv.at">CitizenCard Environment MOCCA</a>
+ </p>
+ </div>
+<!-- end #container --></div>
+</body>
+</html>
diff --git a/BKUHelp/src/main/webapp/help/en/error.card.locked.png b/BKUHelp/src/main/webapp/help/en/error.card.locked.png
new file mode 100644
index 00000000..3e50661a
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/en/error.card.locked.png
Binary files differ
diff --git a/BKUHelp/src/main/webapp/help/en/error.card.notactivated.html b/BKUHelp/src/main/webapp/help/en/error.card.notactivated.html
new file mode 100644
index 00000000..ff55ea27
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/en/error.card.notactivated.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<title>CitizenCard - Help</title>
+<link href="/help/css/help.css" rel="stylesheet" type="text/css" />
+<link rel="shortcut icon" href="/help/chip16.ico" type="image/x-icon"/>
+<!--[if IE]>
+<style type="text/css">
+/* place css fixes for all versions of IE in this conditional comment */
+.twoColElsLtHdr #sidebar1 { padding-top: 30px; }
+.twoColElsLtHdr #mainContent { zoom: 1; padding-top: 15px; }
+/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
+</style>
+<![endif]-->
+</head>
+
+<body class="twoColElsLtHdr">
+
+<div id="container">
+ <div id="header">
+ <h1>Online Help</h1>
+ <!-- end #header --></div>
+ <div id="sidebar1">
+ <p><img src="error.card.notactivated.png" alt="applet screenshot" width="190" height="130"/></p>
+ <p><strong>Note</strong> that the screenshot may differ slightly from the actual web page.</p>
+ <!-- end #sidebar1 --></div>
+ <div id="mainContent">
+ <h1> Fehler: Bürgerkartenfunktion ist nicht aktiviert.</h1>
+ <p>Die im Kartenleser gesteckte Chipkarte wird unterstützt, jedoch ist die Bürgerkartenfunktion auf der Chipkarte noch nicht aktiviert.</p>
+ <p>Um die gesteckte Chipkarte als Bürgerkarte verwenden zu können,
+ muss zuerst die
+ Bürgerkartenfunktion aktiviert werden. Für Informationen dazu siehe <a href="http://www.buergerkarte.at/de/aktivieren/">Aktivierung der Bürgerkartenfunktion</a> auf <a href="http://www.buergerkarte.at">www.buergerkarte.at</a>.</p>
+ <p><br class="clearfloat" />
+ </p>
+ </div>
+ <div id="footer">
+ <p>
+ <a href="http://www.buergerkarte.at">Austrian CitizenCard</a> | <a href="http://mocca.egovlabs.gv.at">CitizenCard Environment MOCCA</a>
+ </p>
+ </div>
+<!-- end #container --></div>
+</body>
+</html>
diff --git a/BKUHelp/src/main/webapp/help/en/error.card.notactivated.png b/BKUHelp/src/main/webapp/help/en/error.card.notactivated.png
new file mode 100644
index 00000000..5761a110
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/en/error.card.notactivated.png
Binary files differ
diff --git a/BKUHelp/src/main/webapp/help/en/error.cardterminal.html b/BKUHelp/src/main/webapp/help/en/error.cardterminal.html
new file mode 100644
index 00000000..737e9877
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/en/error.cardterminal.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<title>CitizenCard - Help</title>
+<link href="/help/css/help.css" rel="stylesheet" type="text/css" />
+<link rel="shortcut icon" href="/help/chip16.ico" type="image/x-icon"/>
+<!--[if IE]>
+<style type="text/css">
+/* place css fixes for all versions of IE in this conditional comment */
+.twoColElsLtHdr #sidebar1 { padding-top: 30px; }
+.twoColElsLtHdr #mainContent { zoom: 1; padding-top: 15px; }
+/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
+</style>
+<![endif]-->
+</head>
+
+<body class="twoColElsLtHdr">
+
+<div id="container">
+ <div id="header">
+ <h1>Online Help</h1>
+ <!-- end #header --></div>
+ <div id="sidebar1">
+ <p><img src="error.cardterminal.png" alt="Bildschirmfoto des Applets" width="190" height="130"/></p>
+ <p><strong>Note</strong> that the screenshot may differ slightly from the actual web page.</p>
+ <!-- end #sidebar1 --></div>
+ <div id="mainContent">
+ <h1> Fehler: Es konnte kein Kartenleser gefunden werden.</h1>
+ <p>Für den Zugriff auf die Bürgerkarte ist ein Chipkartenleser erforderlich. Es werden grundsätzlich alle Kartenleser unterstützt, die über die PC/SC-Schnittstelle angesprochen werden können und im Betriebssystem erfolgreich installiert wurden. Es können mehrere unterstützte Kartenleser gleichzeitig angeschlossen werden.</p>
+ <p>Kartenleser die, die nicht über die PC/SC-Schnittstelle angesprochen werden können (z.B. Kartenleser für die nur CT-API-Treiber verfügbar sind) werden nicht unterstützt.</p>
+
+ <p><br class="clearfloat" />
+ </p>
+ </div>
+ <div id="footer">
+ <p>
+ <a href="http://www.buergerkarte.at">Austrian CitizenCard</a> | <a href="http://mocca.egovlabs.gv.at">CitizenCard Environment MOCCA</a>
+ </p>
+ </div>
+<!-- end #container --></div>
+</body>
+</html>
diff --git a/BKUHelp/src/main/webapp/help/en/error.cardterminal.png b/BKUHelp/src/main/webapp/help/en/error.cardterminal.png
new file mode 100644
index 00000000..1a7c8c70
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/en/error.cardterminal.png
Binary files differ
diff --git a/BKUHelp/src/main/webapp/help/en/error.pcsc.html b/BKUHelp/src/main/webapp/help/en/error.pcsc.html
new file mode 100644
index 00000000..1a093eb6
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/en/error.pcsc.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<title>CitizenCard - Help</title>
+<link href="/help/css/help.css" rel="stylesheet" type="text/css" />
+<link rel="shortcut icon" href="/help/chip16.ico" type="image/x-icon"/>
+<!--[if IE]>
+<style type="text/css">
+/* place css fixes for all versions of IE in this conditional comment */
+.twoColElsLtHdr #sidebar1 { padding-top: 30px; }
+.twoColElsLtHdr #mainContent { zoom: 1; padding-top: 15px; }
+/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
+</style>
+<![endif]-->
+</head>
+
+<body class="twoColElsLtHdr">
+
+<div id="container">
+ <div id="header">
+ <h1>Online Help</h1>
+ <!-- end #header --></div>
+ <div id="sidebar1">
+ <p><img src="error.pcsc.png" alt="Bildschirmfoto des Applets" width="190" height="130"/></p>
+ <p><strong>Note</strong> that the screenshot may differ slightly from the actual web page.</p>
+ <!-- end #sidebar1 --></div>
+ <div id="mainContent">
+ <h1> Fehler: Es konnte keine PC/SC-Schnittstelle gefunden werden</h1>
+ <p>Die Software für den Zugriff auf die Bürgerkarte konnte keine PC/SC-Schnittstelle für den Zugriff auf Kartenleser erkennen.
+ Das Betriebssystem scheint keine PC/SC-Schnittstelle zur Verfügung zu stellen.</p>
+ <p>Häufige Ursachen für dieses Problem sind
+ <ul>
+ <li>Der PC/SC Dienst läuft nicht</li>
+ <li>Die entsprechende PC/SC Bibliothek kann von Java nicht gefunden werden
+ (<a href="http://java.sun.com/javase/6/docs/technotes/guides/security/SunProviders.html#SunPCSCProvider">weitere Informationen</a>).</li>
+ </ul>
+ </p>
+ <p>Unter Betriebssystemen die PCSC-Lite verwenden (Linux u.a.) tritt dieses Problem auch auf,
+ wenn kein Kartenleser angeschlossen ist und daher der entsprechende Dienst nicht gestartet wurde.
+ <br class="clearfloat" />
+ </p>
+ <p><br class="clearfloat" /></p>
+ </div>
+ <div id="footer">
+ <p>
+ <a href="http://www.buergerkarte.at">Austrian CitizenCard</a> | <a href="http://mocca.egovlabs.gv.at">CitizenCard Environment MOCCA</a>
+ </p>
+ </div>
+<!-- end #container --></div>
+</body>
+</html>
diff --git a/BKUHelp/src/main/webapp/help/en/error.pcsc.png b/BKUHelp/src/main/webapp/help/en/error.pcsc.png
new file mode 100644
index 00000000..cc022615
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/en/error.pcsc.png
Binary files differ
diff --git a/BKUHelp/src/main/webapp/help/en/error.pin.timeout.html b/BKUHelp/src/main/webapp/help/en/error.pin.timeout.html
new file mode 100644
index 00000000..7c965dbc
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/en/error.pin.timeout.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<title>CitizenCard - Help</title>
+<link href="/help/css/help.css" rel="stylesheet" type="text/css" />
+<link rel="shortcut icon" href="/help/chip16.ico" type="image/x-icon"/>
+<!--[if IE]>
+<style type="text/css">
+/* place css fixes for all versions of IE in this conditional comment */
+.twoColElsLtHdr #sidebar1 { padding-top: 30px; }
+.twoColElsLtHdr #mainContent { zoom: 1; padding-top: 15px; }
+/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
+</style>
+<![endif]-->
+</head>
+
+<body class="twoColElsLtHdr">
+
+<div id="container">
+ <div id="header">
+ <h1>Online Help</h1>
+ <!-- end #header --></div>
+ <div id="sidebar1">
+ <p><img src="error.pin.timeout.png" alt="Bildschirmfoto des Applets" width="190" height="130"/></p>
+ <p><strong>Note</strong> that the screenshot may differ slightly from the actual web page.</p>
+ <!-- end #sidebar1 --></div>
+ <div id="mainContent">
+ <h1> Fehler: Zeitüberschreitung bei der PIN-Eingabe am Kartenleser.</h1>
+ <p>Bei sicheren Kartenlesern mit integrierter PIN-Eingabe wird der Signaturvorgang aus Sicherheitsgründen nach Ablauf einer definierten Zeitspanne abgebrochen.
+ Diese beträgt im Normalfall eine Minute bis zur Eingabe der ersten Stelle des PINs.
+ Für die Eingabe jeder weiteren Stelle ist diese Zeitspanne jedoch - abhängig vom verwendeten Kartenleser - kürzer.
+ </p>
+
+ <p><br class="clearfloat" />
+ </p>
+ </div>
+ <div id="footer">
+ <p>
+ <a href="http://www.buergerkarte.at">Austrian CitizenCard</a> | <a href="http://mocca.egovlabs.gv.at">CitizenCard Environment MOCCA</a>
+ </p>
+ </div>
+<!-- end #container --></div>
+</body>
+</html>
diff --git a/BKUHelp/src/main/webapp/help/en/error.pin.timeout.png b/BKUHelp/src/main/webapp/help/en/error.pin.timeout.png
new file mode 100644
index 00000000..961d58da
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/en/error.pin.timeout.png
Binary files differ
diff --git a/BKUHelp/src/main/webapp/help/en/error.ws.unreachable.html b/BKUHelp/src/main/webapp/help/en/error.ws.unreachable.html
new file mode 100644
index 00000000..707a0aa1
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/en/error.ws.unreachable.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<title>Bürgerkarte - Hilfe</title>
+<link href="/help/css/help.css" rel="stylesheet" type="text/css" />
+<link rel="shortcut icon" href="/help/chip16.ico" type="image/x-icon"/>
+<!--[if IE]>
+<style type="text/css">
+/* place css fixes for all versions of IE in this conditional comment */
+.twoColElsLtHdr #sidebar1 { padding-top: 30px; }
+.twoColElsLtHdr #mainContent { zoom: 1; padding-top: 15px; }
+/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
+</style>
+<![endif]-->
+</head>
+
+<body class="twoColElsLtHdr">
+
+<div id="container">
+ <div id="header">
+ <h1>Online Help</h1>
+ <!-- end #header --></div>
+ <div id="sidebar1">
+ <p><img src="error.ws.unreachable.png" alt="Bildschirmfoto des Applets" width="190" height="130"/></p>
+ <p><strong>Note</strong> that the screenshot may differ slightly from the actual web page.</p>
+ <!-- end #sidebar1 --></div>
+ <div id="mainContent">
+ <h1> Fehler: Der Server ist nicht erreichbar</h1>
+ <p>Die Software zum Zugriff auf die Bürgerkarte konnte den Server nicht erreichen. Möglicherweise besteht derzeit ein Problem mit dem Dienst. Probieren Sie es daher zu einem späteren Zeitpunkt nochmal. Sollte das Problem dauerhaft bestehen, wenden Sie sich bitte an den Betreiber der Anwendung.</p>
+ <p><br class="clearfloat" /></p>
+ </div>
+ <div id="footer">
+ <p>
+ <a href="http://www.buergerkarte.at">Austrian CitizenCard</a> | <a href="http://mocca.egovlabs.gv.at">CitizenCard Environment MOCCA</a>
+ </p>
+ </div>
+<!-- end #container --></div>
+</body>
+</html>
diff --git a/BKUHelp/src/main/webapp/help/en/error.ws.unreachable.png b/BKUHelp/src/main/webapp/help/en/error.ws.unreachable.png
new file mode 100644
index 00000000..80019733
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/en/error.ws.unreachable.png
Binary files differ
diff --git a/BKUHelp/src/main/webapp/help/en/help.activate.pin.html b/BKUHelp/src/main/webapp/help/en/help.activate.pin.html
new file mode 100644
index 00000000..cdd304f0
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/en/help.activate.pin.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<title>CitizenCard - Help</title>
+<link href="/help/css/help.css" rel="stylesheet" type="text/css" />
+<link rel="shortcut icon" href="/help/chip16.ico" type="image/x-icon"/>
+<!--[if IE]>
+<style type="text/css">
+/* place css fixes for all versions of IE in this conditional comment */
+.twoColElsLtHdr #sidebar1 { padding-top: 30px; }
+.twoColElsLtHdr #mainContent { zoom: 1; padding-top: 15px; }
+/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
+</style>
+<![endif]-->
+</head>
+
+<body class="twoColElsLtHdr">
+
+<div id="container">
+ <div id="header">
+ <h1>Online Help</h1>
+ <!-- end #header --></div>
+ <div id="sidebar1">
+ <p><img src="help.pin.mgmt.png" alt="applet screenshot" width="190" height="130"/></p>
+ <p><strong>Note</strong> that the screenshot may differ slightly from the actual web page.</p>
+ <!-- end #sidebar1 --></div>
+ <div id="mainContent">
+ <h1>Aktivieren der PIN</h1>
+ <p>Noch nicht aktivierte PINs werden als <em style="color:red; font-weight:bold">NICHT AKTIV</em> angeführt
+ und können über die Schaltfläche 'Aktivieren' gesetzt werden.
+ </p>
+ <p style="text-align: center"><img src="help.pin.mgmt-1.png" alt="Bildschirmfoto" width="295" height="200" /></p>
+ <p>Geben Sie dazu die gewünschte PIN im dafür vorgesehenen Feld ein und wiederholen Sie diese im Feld 'Bestätigung'.
+ </p>
+ <p style="text-align: center"><img src="help.pin.activate.png" alt="Bildschirmfoto" width="295" height="200" /></p>
+
+ <p><br class="clearfloat" /></p>
+ </div>
+ <div id="footer">
+ <p>
+ <a href="http://www.buergerkarte.at">Austrian CitizenCard</a> | <a href="http://mocca.egovlabs.gv.at">CitizenCard Environment MOCCA</a>
+ </p>
+ </div>
+<!-- end #container --></div>
+</body>
+</html>
diff --git a/BKUHelp/src/main/webapp/help/en/help.cardpin.html b/BKUHelp/src/main/webapp/help/en/help.cardpin.html
new file mode 100644
index 00000000..bba7f5c0
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/en/help.cardpin.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<title>CitizenCard - Help</title>
+<link href="/help/css/help.css" rel="stylesheet" type="text/css" />
+<link rel="shortcut icon" href="/help/chip16.ico" type="image/x-icon"/>
+<!--[if IE]>
+<style type="text/css">
+/* place css fixes for all versions of IE in this conditional comment */
+.twoColElsLtHdr #sidebar1 { padding-top: 30px; }
+.twoColElsLtHdr #mainContent { zoom: 1; padding-top: 15px; }
+/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
+</style>
+<![endif]-->
+</head>
+
+<body class="twoColElsLtHdr">
+
+<div id="container">
+ <div id="header">
+ <h1>Online Help</h1>
+ <!-- end #header --></div>
+ <div id="sidebar1">
+ <p><img src="help.cardpin1.png" alt="applet screenshot" width="190" height="130"/></p>
+ <p><img src="help.cardpin2.png" alt="Bildschirmfoto des Applets" width="190" height="130"/></p>
+ <p><strong>Note</strong> that the screenshot may differ slightly from the actual web page.</p>
+ <!-- end #sidebar1 --></div>
+ <div id="mainContent">
+ <h1> Lesen von Informationen von der Chipkarte</h1>
+ <p>Sie werden aufgefordert ihre Karten-PIN bzw. Infobox-PIN (abhängig von der verwendeten Bürgerkarte) einzugeben um das Auslesen von Informationen zur Identifikation (Personenbindung) bzw. Vollmachten zu ermöglichen.</p>
+ <p><a href="http://www.buergerkarte.at/de/datenschutz-sicherheit/">Details</a> zu den auf der Bürgerkarte gespeicherten Informationen finden sie auf <a href="http://www.buergerkarte.at">www.buergerkarte.at</a>.</p>
+ <p><br class="clearfloat" /></p>
+ </div>
+ <div id="footer">
+ <p>
+ <a href="http://www.buergerkarte.at">Austrian CitizenCard</a> | <a href="http://mocca.egovlabs.gv.at">CitizenCard Environment MOCCA</a>
+ </p>
+ </div>
+<!-- end #container --></div>
+</body>
+</html>
diff --git a/BKUHelp/src/main/webapp/help/en/help.cardpin1.png b/BKUHelp/src/main/webapp/help/en/help.cardpin1.png
new file mode 100644
index 00000000..1bceccf5
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/en/help.cardpin1.png
Binary files differ
diff --git a/BKUHelp/src/main/webapp/help/en/help.cardpin2.png b/BKUHelp/src/main/webapp/help/en/help.cardpin2.png
new file mode 100644
index 00000000..12d17be0
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/en/help.cardpin2.png
Binary files differ
diff --git a/BKUHelp/src/main/webapp/help/en/help.change.pin.html b/BKUHelp/src/main/webapp/help/en/help.change.pin.html
new file mode 100644
index 00000000..204f323b
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/en/help.change.pin.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<title>CitizenCard - Help</title>
+<link href="/help/css/help.css" rel="stylesheet" type="text/css" />
+<link rel="shortcut icon" href="/help/chip16.ico" type="image/x-icon"/>
+<!--[if IE]>
+<style type="text/css">
+/* place css fixes for all versions of IE in this conditional comment */
+.twoColElsLtHdr #sidebar1 { padding-top: 30px; }
+.twoColElsLtHdr #mainContent { zoom: 1; padding-top: 15px; }
+/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
+</style>
+<![endif]-->
+</head>
+
+<body class="twoColElsLtHdr">
+
+<div id="container">
+ <div id="header">
+ <h1>Online Help</h1>
+ <!-- end #header --></div>
+ <div id="sidebar1">
+ <p><img src="help.pin.mgmt.png" alt="applet screenshot" width="190" height="130"/></p>
+ <p><strong>Note</strong> that the screenshot may differ slightly from the actual web page.</p>
+ <!-- end #sidebar1 --></div>
+ <div id="mainContent">
+ <h1>Ändern der PIN</h1>
+ <p>Bereits aktivierte PINs werden als <em style="color:green; font-weight:bold">AKTIV</em> angeführt
+ und können über die Schaltfläche 'Ändern' geändert werden.
+ </p>
+ <p style="text-align: center"><img src="help.pin.mgmt.png" alt="Bildschirmfoto" width="295" height="200" /></p>
+ <p>Geben Sie dazu die alte und neue PIN im jeweils dafür vorgesehenen Feld ein und wiederholen Sie die
+ neue PIN im Feld 'Bestätigung'.
+ </p>
+ <p style="text-align: center"><img src="help.pin.change.png" alt="Bildschirmfoto" width="295" height="200" /></p>
+
+ <p><br class="clearfloat" /></p>
+ </div>
+ <div id="footer">
+ <p>
+ <a href="http://www.buergerkarte.at">Austrian CitizenCard</a> | <a href="http://mocca.egovlabs.gv.at">CitizenCard Environment MOCCA</a>
+ </p>
+ </div>
+<!-- end #container --></div>
+</body>
+</html>
diff --git a/BKUHelp/src/main/webapp/help/en/help.hashdataviewer.html b/BKUHelp/src/main/webapp/help/en/help.hashdataviewer.html
new file mode 100644
index 00000000..874cec3a
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/en/help.hashdataviewer.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<title>CitizenCard - Help</title>
+<link href="/help/css/help.css" rel="stylesheet" type="text/css" />
+<link rel="shortcut icon" href="/help/chip16.ico" type="image/x-icon"/>
+<!--[if IE]>
+<style type="text/css">
+/* place css fixes for all versions of IE in this conditional comment */
+.twoColElsLtHdr #sidebar1 { padding-top: 30px; }
+.twoColElsLtHdr #mainContent { zoom: 1; padding-top: 15px; }
+/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
+</style>
+<![endif]-->
+</head>
+
+<body class="twoColElsLtHdr">
+
+<div id="container">
+ <div id="header">
+ <h1>Online Help</h1>
+ <!-- end #header --></div>
+ <div id="sidebar1">
+ <p><img src="help.hashdataviewer.png" alt="Bildschirmfoto des Applets" height="130" width="150"/></p>
+ <p><strong>Note</strong> that the screenshot may differ slightly from the actual web page.</p>
+ <!-- end #sidebar1 --></div>
+ <div id="mainContent">
+ <h1> Anzeige der Signaturdaten </h1>
+ <p>Dieses Fenster zeigt die zu signierenden Daten an. Dies k&ouml;nnen entweder reine Textdaten oder XHTML sein. Im Falle von XHML erhalten Sie den Hinweis, dass es sich bei den dargestellten Daten nur um eine Voransicht handelt. Um die Daten standardkonform darzustellen, m&uuml;ssen diese abgespeichert und mit einem geeigneten XHTML Betrachter ge&ouml;ffnen werden.</p>
+ <p>In jedem Fall k&ouml;nnen die zu signierenden abgespeichert werden.</p>
+ <p><img src="help.hashdataviewer.png" alt="Bildschirmfoto des Applets" height="300" width="353"/></p>
+ <p><br class="clearfloat" /></p>
+ </div>
+ <div id="footer">
+ <p>
+ <a href="http://www.buergerkarte.at">Austrian CitizenCard</a> | <a href="http://mocca.egovlabs.gv.at">CitizenCard Environment MOCCA</a>
+ </p>
+ </div>
+<!-- end #container --></div>
+</body>
+</html>
diff --git a/BKUHelp/src/main/webapp/help/en/help.hashdataviewer.png b/BKUHelp/src/main/webapp/help/en/help.hashdataviewer.png
new file mode 100644
index 00000000..83004322
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/en/help.hashdataviewer.png
Binary files differ
diff --git a/BKUHelp/src/main/webapp/help/en/help.install.cacert.html b/BKUHelp/src/main/webapp/help/en/help.install.cacert.html
new file mode 100644
index 00000000..f2071ba0
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/en/help.install.cacert.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<title>CitizenCard - Help</title>
+<link href="/help/css/help.css" rel="stylesheet" type="text/css" />
+<link rel="shortcut icon" href="/help/chip16.ico" type="image/x-icon"/>
+<!--[if IE]>
+<style type="text/css">
+/* place css fixes for all versions of IE in this conditional comment */
+.twoColElsLtHdr #sidebar1 { padding-top: 30px; }
+.twoColElsLtHdr #mainContent { zoom: 1; padding-top: 15px; }
+/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
+</style>
+<![endif]-->
+</head>
+
+<body class="twoColElsLtHdr">
+
+<div id="container">
+ <div id="header">
+ <h1>Online Help</h1>
+ <!-- end #header --></div>
+ <div id="mainContent" style="margin: 1.5em 1.5em 0 1.5em">
+ <h1>Installation des CA Zertifikats</h1>
+ <p>Die lokale Bürgerkartenumgebung (MOCCA Webstart) authentifiziert sich mittels eines TLS Zertifikats ausgestellt auf
+ <code>CN=127.0.0.1, O=MOCCA, OU=MOCCA TLS Server</code>.
+ Beim Aufruf der Bürgerkartenumgebung (zum Beispiel bei einem Anmeldevorgang mit Bürgerkarte)
+ wird dieses Zertifikat vom Web-Browser überprüft.
+ Um diese Überprüfung zu ermöglichen ist es notwendig das Ausstellerzertifikat, lautend auf
+ <code>O=MOCCA, OU=MOCCA TLS Server CA</code>, im Web-Browser zu installieren.
+ </p>
+
+ <p><strong>Achtung:</strong> Eine automatische Installation des CA Zertifikats als 'Vertrauenswürdiges Stammzertifikat' im Microsoft Zertifikatsspeicher ist in Windows Vista leider nicht möglich.
+ Sollten Sie Internet Explorer oder Safari in Windows Vista oder 7 benutzen, dann wählen Sie bei der Installation des Zertifikats ausdrücklich 'zu vertrauenswürdigen Stammzertifizierungsstellen hinzufügen'.
+ </p>
+
+ <p>
+ Klicken Sie dazu auf die Verknüpfung <a href="/ca.crt">CA Zertifikat installieren</a>
+ und wählen Sie im angezeigten Dialog die Option 'Dieser CA vertrauen um Websites zu identifizieren'.
+ (Anmerkung: Der genaue Wortlaut hängt vom verwendeten Web-Browser ab).
+ </p>
+ <p><img src="help.install.cacert.png" alt="Bildschirmfoto des Zertifikatsinstallationsdialogs" height="287" width="565"/></p>
+ <p style="font-size:70%;"><strong>Hinweis:</strong> Der tatsächliche Dialog kann vom oben dargestellten abweichen und hängt vom verwendeten Web-Browser ab.</p>
+ <p>Kopieren Sie diese Verknüpfung und rufen Sie sie in weiteren Web-Browsern ihrer Wahl auf um das Zertifikat auch dort zu installieren.</p>
+
+ <p>Das CA Zertifikat wird ausschließlich zur Identifikation der lokalen Bürgerkartenumgebung verwendet
+ und kann bei der Deinstallation der Bürgerkartenumgebung aus dem Web-Browser entfernt werden.</p>
+ <p><br class="clearfloat" /></p>
+ </div>
+ <div id="footer">
+ <p>
+ <a href="http://www.buergerkarte.at">Austrian CitizenCard</a> | <a href="http://mocca.egovlabs.gv.at">CitizenCard Environment MOCCA</a>
+ </p>
+ </div>
+<!-- end #container --></div>
+</body>
+</html>
diff --git a/BKUHelp/src/main/webapp/help/en/help.install.cacert.png b/BKUHelp/src/main/webapp/help/en/help.install.cacert.png
new file mode 100644
index 00000000..0c1b2564
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/en/help.install.cacert.png
Binary files differ
diff --git a/BKUHelp/src/main/webapp/help/en/help.pin.activate.png b/BKUHelp/src/main/webapp/help/en/help.pin.activate.png
new file mode 100644
index 00000000..4790cdf6
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/en/help.pin.activate.png
Binary files differ
diff --git a/BKUHelp/src/main/webapp/help/en/help.pin.change.png b/BKUHelp/src/main/webapp/help/en/help.pin.change.png
new file mode 100644
index 00000000..a0fa8643
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/en/help.pin.change.png
Binary files differ
diff --git a/BKUHelp/src/main/webapp/help/en/help.pin.mgmt-1.png b/BKUHelp/src/main/webapp/help/en/help.pin.mgmt-1.png
new file mode 100644
index 00000000..b17b3b40
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/en/help.pin.mgmt-1.png
Binary files differ
diff --git a/BKUHelp/src/main/webapp/help/en/help.pin.mgmt-2.png b/BKUHelp/src/main/webapp/help/en/help.pin.mgmt-2.png
new file mode 100644
index 00000000..429c87eb
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/en/help.pin.mgmt-2.png
Binary files differ
diff --git a/BKUHelp/src/main/webapp/help/en/help.pin.mgmt-3.png b/BKUHelp/src/main/webapp/help/en/help.pin.mgmt-3.png
new file mode 100644
index 00000000..76b11f69
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/en/help.pin.mgmt-3.png
Binary files differ
diff --git a/BKUHelp/src/main/webapp/help/en/help.pin.mgmt-4.png b/BKUHelp/src/main/webapp/help/en/help.pin.mgmt-4.png
new file mode 100644
index 00000000..5be7c709
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/en/help.pin.mgmt-4.png
Binary files differ
diff --git a/BKUHelp/src/main/webapp/help/en/help.pin.mgmt.html b/BKUHelp/src/main/webapp/help/en/help.pin.mgmt.html
new file mode 100644
index 00000000..9bafec39
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/en/help.pin.mgmt.html
@@ -0,0 +1,78 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<title>CitizenCard - Help</title>
+<link href="/help/css/help.css" rel="stylesheet" type="text/css" />
+<link rel="shortcut icon" href="/help/chip16.ico" type="image/x-icon"/>
+<!--[if IE]>
+<style type="text/css">
+/* place css fixes for all versions of IE in this conditional comment */
+.twoColElsLtHdr #sidebar1 { padding-top: 30px; }
+.twoColElsLtHdr #mainContent { zoom: 1; padding-top: 15px; }
+/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
+</style>
+<![endif]-->
+</head>
+
+<body class="twoColElsLtHdr">
+
+<div id="container">
+ <div id="header">
+ <h1>Online Help</h1>
+ <!-- end #header --></div>
+ <div id="sidebar1">
+ <p><img src="help.pin.mgmt.png" alt="applet screenshot" width="190" height="130"/></p>
+ <p><strong>Note</strong> that the screenshot may differ slightly from the actual web page.</p>
+ <!-- end #sidebar1 --></div>
+ <div id="mainContent">
+ <h1>PIN Verwaltung</h1>
+ <p>Mit Hilfe der PIN Verwaltung können Sie Karten-PINs <a href="#activate">aktivieren</a>, <a href="#change">ändern</a> und <a href="#unblock">entsperren</a>,
+ wobei der unterstützte Funktionsumfang vom Typ und Zustand der verwendeten Karte abhängt.
+ </p>
+ <h3><a name="change">Ändern der PIN</a></h3>
+ <p>Bereits aktivierte PINs werden als <em style="color:green; font-weight:bold">AKTIV</em> angeführt
+ und können über die Schaltfläche 'Ändern' geändert werden.
+ </p>
+ <p style="text-align: center"><img src="help.pin.mgmt.png" alt="Bildschirmfoto" width="295" height="200" /></p>
+ <p>Geben Sie dazu die alte und neue PIN im jeweils dafür vorgesehenen Feld ein und wiederholen Sie die
+ neue PIN im Feld 'Bestätigung'.
+ </p>
+ <p style="text-align: center"><img src="help.pin.change.png" alt="Bildschirmfoto" width="295" height="200" /></p>
+ <p>Bei Karten mit dem ACOS Betriebssystem müssen die PINs verifiziert werden um ihren Status zu ermitteln.
+ Den Status dieser als <em style="color:black; font-weight:bold">UNBEKANNT</em> angeführten PINs können Sie über die Schaltfläche 'Abfragen' verifizieren.
+ </p>
+ <p style="text-align: center"><img src="help.pin.mgmt-3.png" alt="Bildschirmfoto" width="295" height="200" /></p>
+ <p>
+ Geben Sie dazu die PIN im dafür vorgesehenen Feld ein.
+ </p>
+ <p style="text-align: center"><img src="help.pin.verify.png" alt="Bildschirmfoto" width="295" height="200" /></p>
+
+ <h3><a name="activate">Aktivieren der PIN</a></h3>
+ <p>Noch nicht aktivierte PINs werden als <em style="color:red; font-weight:bold">NICHT AKTIV</em> angeführt
+ und können über die Schaltfläche 'Aktivieren' gesetzt werden.
+ </p>
+ <p style="text-align: center"><img src="help.pin.mgmt-1.png" alt="Bildschirmfoto" width="295" height="200" /></p>
+ <p>Geben Sie dazu die gewünschte PIN im dafür vorgesehenen Feld ein und wiederholen Sie diese im Feld 'Bestätigung'.
+ </p>
+ <p style="text-align: center"><img src="help.pin.activate.png" alt="Bildschirmfoto" width="295" height="200" /></p>
+
+ <h3><a name="unblock">Entsperren der PIN</a></h3>
+ <p>Durch mehrmalige falsche Eingabe gesperrte PINs werden als <em style="color:red; font-weight:bold">GESPERRT</em> angeführt
+ und können über die Schaltfläche 'Entsperren' mit einer PUK neu gesetzt werden.
+ Das Entsperren wird nur von Karten mit dem ACOS Betriebssystem unterstützt.
+ </p>
+ <p style="text-align: center"><img src="help.pin.mgmt-2.png" alt="Bildschirmfoto" width="295" height="200" /></p>
+ <p>Momentan wird das Entsperren von PINs noch nicht unterstützt.
+ </p>
+
+ <p><br class="clearfloat" /></p>
+ </div>
+ <div id="footer">
+ <p>
+ <a href="http://www.buergerkarte.at">Austrian CitizenCard</a> | <a href="http://mocca.egovlabs.gv.at">CitizenCard Environment MOCCA</a>
+ </p>
+ </div>
+<!-- end #container --></div>
+</body>
+</html>
diff --git a/BKUHelp/src/main/webapp/help/en/help.pin.mgmt.png b/BKUHelp/src/main/webapp/help/en/help.pin.mgmt.png
new file mode 100644
index 00000000..44ad3398
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/en/help.pin.mgmt.png
Binary files differ
diff --git a/BKUHelp/src/main/webapp/help/en/help.pin.verify.png b/BKUHelp/src/main/webapp/help/en/help.pin.verify.png
new file mode 100644
index 00000000..0c7a7852
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/en/help.pin.verify.png
Binary files differ
diff --git a/BKUHelp/src/main/webapp/help/en/help.retry.html b/BKUHelp/src/main/webapp/help/en/help.retry.html
new file mode 100644
index 00000000..9e18fe63
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/en/help.retry.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<title>CitizenCard - Help</title>
+<link href="/help/css/help.css" rel="stylesheet" type="text/css" />
+<link rel="shortcut icon" href="/help/chip16.ico" type="image/x-icon"/>
+<!--[if IE]>
+<style type="text/css">
+/* place css fixes for all versions of IE in this conditional comment */
+.twoColElsLtHdr #sidebar1 { padding-top: 30px; }
+.twoColElsLtHdr #mainContent { zoom: 1; padding-top: 15px; }
+/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
+</style>
+<![endif]-->
+</head>
+
+<body class="twoColElsLtHdr">
+
+<div id="container">
+ <div id="header">
+ <h1>Online Help</h1>
+ <!-- end #header --></div>
+ <div id="sidebar1">
+ <p><img src="help.retry.png" alt="Bildschirmfoto des Applets" width="190" height="130"/></p>
+ <p><strong>Note</strong> that the screenshot may differ slightly from the actual web page.</p>
+ <!-- end #sidebar1 --></div>
+ <div id="mainContent">
+ <h1> Falsche PIN</h1>
+ <p>Die eingegebene PIN war falsch. Bitte geben Sie die korrekte PIN ein.</p>
+ <p>Die Anzahl der noch möglichen Versuche wird angezeigt.</p>
+ <p><br class="clearfloat" /></p>
+ </div>
+ <div id="footer">
+ <p>
+ <a href="http://www.buergerkarte.at">Austrian CitizenCard</a> | <a href="http://mocca.egovlabs.gv.at">CitizenCard Environment MOCCA</a>
+ </p>
+ </div>
+<!-- end #container --></div>
+</body>
+</html>
diff --git a/BKUHelp/src/main/webapp/help/en/help.retry.png b/BKUHelp/src/main/webapp/help/en/help.retry.png
new file mode 100644
index 00000000..00716afb
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/en/help.retry.png
Binary files differ
diff --git a/BKUHelp/src/main/webapp/help/en/help.signpin-1.png b/BKUHelp/src/main/webapp/help/en/help.signpin-1.png
new file mode 100644
index 00000000..1c5c8570
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/en/help.signpin-1.png
Binary files differ
diff --git a/BKUHelp/src/main/webapp/help/en/help.signpin.html b/BKUHelp/src/main/webapp/help/en/help.signpin.html
new file mode 100644
index 00000000..2bd61447
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/en/help.signpin.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<title>CitizenCard - Help</title>
+<link href="/help/css/help.css" rel="stylesheet" type="text/css" />
+<link rel="shortcut icon" href="/help/chip16.ico" type="image/x-icon"/>
+<!--[if IE]>
+<style type="text/css">
+/* place css fixes for all versions of IE in this conditional comment */
+.twoColElsLtHdr #sidebar1 { padding-top: 30px; }
+.twoColElsLtHdr #mainContent { zoom: 1; padding-top: 15px; }
+/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
+</style>
+<![endif]-->
+</head>
+
+<body class="twoColElsLtHdr">
+
+<div id="container">
+ <div id="header">
+ <h1>Online Help</h1>
+ <!-- end #header --></div>
+ <div id="sidebar1">
+ <p><img src="help.signpin.png" alt="applet screenshot" width="190" height="130"/></p>
+ <p><strong>Note</strong> that the screenshot may differ slightly from the actual web page.</p>
+ <!-- end #sidebar1 --></div>
+ <div id="mainContent">
+ <h1> Erstellen einer elektronischen Signatur</h1>
+ <p>Sie werden aufgefordert die Signatur-PIN einzugeben, um eine elektronische Signatur zu erstellen.</p>
+ <p style="text-align: center"><img src="help.signpin-1.png" alt="Bildschirmfoto" width="278" height="146" /></p>
+ <ol>
+ <li>Klicken Sie auf 'Signaturdaten anzeigen' um die zu signierenden Daten anzuzeigen.</li>
+ <li>Geben Sie im Formularfeld die Signatur-PIN ein.</li>
+ <li>Klicken Sie auf die Schaltfläche 'Signieren' um die elektronische Signatur zu erstellen.</li>
+ </ol>
+ <p><br class="clearfloat" /></p>
+ </div>
+ <div id="footer">
+ <p>
+ <a href="http://www.buergerkarte.at">Austrian CitizenCard</a> | <a href="http://mocca.egovlabs.gv.at">CitizenCard Environment MOCCA</a>
+ </p>
+ </div>
+<!-- end #container --></div>
+</body>
+</html>
diff --git a/BKUHelp/src/main/webapp/help/en/help.signpin.png b/BKUHelp/src/main/webapp/help/en/help.signpin.png
new file mode 100644
index 00000000..37bef2d5
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/en/help.signpin.png
Binary files differ
diff --git a/BKUHelp/src/main/webapp/help/en/help.unblock.pin.html b/BKUHelp/src/main/webapp/help/en/help.unblock.pin.html
new file mode 100644
index 00000000..6c62c421
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/en/help.unblock.pin.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<title>CitizenCard - Help</title>
+<link href="/help/css/help.css" rel="stylesheet" type="text/css" />
+<link rel="shortcut icon" href="/help/chip16.ico" type="image/x-icon"/>
+<!--[if IE]>
+<style type="text/css">
+/* place css fixes for all versions of IE in this conditional comment */
+.twoColElsLtHdr #sidebar1 { padding-top: 30px; }
+.twoColElsLtHdr #mainContent { zoom: 1; padding-top: 15px; }
+/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
+</style>
+<![endif]-->
+</head>
+
+<body class="twoColElsLtHdr">
+
+<div id="container">
+ <div id="header">
+ <h1>Online Help</h1>
+ <!-- end #header --></div>
+ <div id="sidebar1">
+ <p><img src="help.pin.mgmt.png" alt="applet screenshot" width="190" height="130"/></p>
+ <p><strong>Note</strong> that the screenshot may differ slightly from the actual web page.</p>
+ <!-- end #sidebar1 --></div>
+ <div id="mainContent">
+ <h1>Entsperren der PIN</h1>
+ <p>Durch mehrmalige falsche Eingabe gesperrte PINs werden als <em style="color:red; font-weight:bold">GESPERRT</em> angeführt
+ und können über die Schaltfläche 'Entsperren' mit einer PUK neu gesetzt werden.
+ Das Entsperren wird nur von Karten mit dem ACOS Betriebssystem unterstützt.
+ </p>
+ <p style="text-align: center"><img src="help.pin.mgmt-2.png" alt="Bildschirmfoto" width="295" height="200" /></p>
+ <p>Momentan wird das Entsperren von PINs noch nicht unterstützt.
+ </p>
+
+ <p><br class="clearfloat" /></p>
+ </div>
+ <div id="footer">
+ <p>
+ <a href="http://www.buergerkarte.at">Austrian CitizenCard</a> | <a href="http://mocca.egovlabs.gv.at">CitizenCard Environment MOCCA</a>
+ </p>
+ </div>
+<!-- end #container --></div>
+</body>
+</html>
diff --git a/BKUHelp/src/main/webapp/help/en/help.unsupported.mimetype.html b/BKUHelp/src/main/webapp/help/en/help.unsupported.mimetype.html
new file mode 100644
index 00000000..79c06cac
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/en/help.unsupported.mimetype.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<title>CitizenCard - Help</title>
+<link href="/help/css/help.css" rel="stylesheet" type="text/css" />
+<link rel="shortcut icon" href="/help/chip16.ico" type="image/x-icon"/>
+<!--[if IE]>
+<style type="text/css">
+/* place css fixes for all versions of IE in this conditional comment */
+.twoColElsLtHdr #sidebar1 { padding-top: 30px; }
+.twoColElsLtHdr #mainContent { zoom: 1; padding-top: 15px; }
+/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
+</style>
+<![endif]-->
+</head>
+
+<body class="twoColElsLtHdr">
+
+<div id="container">
+ <div id="header">
+ <h1>Online Help</h1>
+ <!-- end #header --></div>
+ <div id="sidebar1">
+ <p><img src="help.unsupported.mimetype.png" alt="applet screenshot" height="130" width="150"/></p>
+ <p><strong>Note</strong> that the screenshot may differ slightly from the actual web page.</p>
+ <!-- end #sidebar1 --></div>
+ <div id="mainContent">
+ <h1>Signaturdaten können nicht dargestellt werden</h1>
+ <p>Die Signaturdatenanzeige unterstützt reine Textdaten sowie XHTML, andere MIME-Typen k&ouml;nnen nicht angezeigt werden.
+ Um die Daten standardkonform darzustellen, m&uuml;ssen diese abgespeichert und mit einem geeigneten externen Betrachter ge&ouml;ffnen werden.</p>
+ <p><br class="clearfloat" /></p>
+ </div>
+ <div id="footer">
+ <p>
+ <a href="http://www.buergerkarte.at">Austrian CitizenCard</a> | <a href="http://mocca.egovlabs.gv.at">CitizenCard Environment MOCCA</a>
+ </p>
+ </div>
+<!-- end #container --></div>
+</body>
+</html>
diff --git a/BKUHelp/src/main/webapp/help/en/help.verify.pin.html b/BKUHelp/src/main/webapp/help/en/help.verify.pin.html
new file mode 100644
index 00000000..e97b1163
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/en/help.verify.pin.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<title>CitizenCard - Help</title>
+<link href="/help/css/help.css" rel="stylesheet" type="text/css" />
+<link rel="shortcut icon" href="/help/chip16.ico" type="image/x-icon"/>
+<!--[if IE]>
+<style type="text/css">
+/* place css fixes for all versions of IE in this conditional comment */
+.twoColElsLtHdr #sidebar1 { padding-top: 30px; }
+.twoColElsLtHdr #mainContent { zoom: 1; padding-top: 15px; }
+/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
+</style>
+<![endif]-->
+</head>
+
+<body class="twoColElsLtHdr">
+
+<div id="container">
+ <div id="header">
+ <h1>Online Help</h1>
+ <!-- end #header --></div>
+ <div id="sidebar1">
+ <p><img src="help.pin.mgmt.png" alt="applet screenshot" width="190" height="130"/></p>
+ <p><strong>Note</strong> that the screenshot may differ slightly from the actual web page.</p>
+ <!-- end #sidebar1 --></div>
+ <div id="mainContent">
+ <h1>PIN Abfragen</h1>
+ <p>Bei Karten mit dem ACOS Betriebssystem müssen die PINs verifiziert werden um ihren Status zu ermitteln.
+ Den Status dieser als <em style="color:black; font-weight:bold">UNBEKANNT</em> angeführten PINs können Sie über die Schaltfläche 'Abfragen' verifizieren.
+ </p>
+ <p style="text-align: center"><img src="help.pin.mgmt-3.png" alt="Bildschirmfoto" width="295" height="200" /></p>
+ <p>
+ Geben Sie dazu die PIN im dafür vorgesehenen Feld ein.
+ </p>
+ <p style="text-align: center"><img src="help.pin.verify.png" alt="Bildschirmfoto" width="295" height="200" /></p>
+ <p>Nach erfolgreicher Eingabe wird die PIN entsprechend ihrem Status als <em style="color:green; font-weight:bold">AKTIV</em>, <em style="color:red; font-weight:bold">NICHT AKTIV</em> oder <em style="color:red; font-weight:bold">GESPERRT</em> angeführt.
+ </p>
+ <p style="text-align: center"><img src="help.pin.mgmt-4.png" alt="Bildschirmfoto" width="295" height="200" /></p>
+
+ <p><br class="clearfloat" /></p>
+ </div>
+ <div id="footer">
+ <p>
+ <a href="http://www.buergerkarte.at">Austrian CitizenCard</a> | <a href="http://mocca.egovlabs.gv.at">CitizenCard Environment MOCCA</a>
+ </p>
+ </div>
+<!-- end #container --></div>
+</body>
+</html>
diff --git a/BKUHelp/src/main/webapp/help/en/index.html b/BKUHelp/src/main/webapp/help/en/index.html
new file mode 100644
index 00000000..e0f86909
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/en/index.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <title>CitizenCard - Help</title>
+ <link href="/help/css/help.css" rel="stylesheet" type="text/css" />
+ <link rel="shortcut icon" href="/help/chip16.ico" type="image/x-icon"/>
+ </head>
+
+ <body class="twoColElsLtHdr">
+
+ <div id="container">
+ <div id="header">
+ <h1>Online Help</h1>
+ <!-- end #header --></div>
+ <div id="sidebar1">
+ <p><img src="welcome.png" alt="applet screenshot" width="190" height="130"/></p>
+ <p>Help icon above CitizenCard dialog</p>
+ <!-- end #sidebar1 --></div>
+ <div id="mainContent">
+ <h1>CitizenCard-Environment Help</h1>
+ <p>
+ The context-dependent CitizenCard Environment help is available via
+ the help icon in the top right corner above the CitizenCard dialog.
+ Alternatively, the individual help pages can be accessed or bookmarked directly from the browser.
+ </p>
+ <p>Answers to frequently asked questions can be found in the following help pages: </p>
+ <ul>
+ <li><a href="help.install.cacert.html">CA certificate installation (MOCCA Webstart only)</a></li>
+ <li><a href="error.pcsc.html">PC/SC installation error</a></li>
+ <li><a href="cardnotsupported.html">Supported signature cards</a></li>
+ <li><a href="help.cardpin.html">Accessing protected card data (pin entry)</a></li>
+ <li><a href="help.signpin.html">Signature creation</a></li>
+ <li><a href="help.retry.html">Wrong PIN</a></li>
+ <li><a href="help.hashdataviewer.html">Signature data display</a></li>
+ <li><a href="help.pin.mgmt.html">PIN management</a></li>
+ <li><a href="help.change.pin.html">Change PIN</a></li>
+ </ul>
+
+ <p><br class="clearfloat" /></p>
+ </div>
+ <div id="footer">
+ <p>
+ <a href="http://www.buergerkarte.at">Austrian CitizenCard</a> | <a href="http://mocca.egovlabs.gv.at">CitizenCard Environment MOCCA</a>
+ </p>
+ </div>
+ <!-- end #container --></div>
+ </body>
+</html>
diff --git a/BKUHelp/src/main/webapp/help/en/insertcard.html b/BKUHelp/src/main/webapp/help/en/insertcard.html
new file mode 100644
index 00000000..7216a3fe
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/en/insertcard.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<title>CitizenCard - Help</title>
+<link href="/help/css/help.css" rel="stylesheet" type="text/css" />
+<link rel="shortcut icon" href="/help/chip16.ico" type="image/x-icon"/>
+<!--[if IE]>
+<style type="text/css">
+/* place css fixes for all versions of IE in this conditional comment */
+.twoColElsLtHdr #sidebar1 { padding-top: 30px; }
+.twoColElsLtHdr #mainContent { zoom: 1; padding-top: 15px; }
+/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
+</style>
+<![endif]-->
+</head>
+
+<body class="twoColElsLtHdr">
+
+<div id="container">
+ <div id="header">
+ <h1>Online Help</h1>
+ <!-- end #header --></div>
+ <div id="sidebar1">
+ <p><img src="insertcard.png" alt="Bildschirmfoto des Applets" width="190" height="130"/></p>
+ <p><strong>Note</strong> that the screenshot may differ slightly from the actual web page.</p>
+ <!-- end #sidebar1 --></div>
+ <div id="mainContent">
+ <h1> Bitte die Bürgerkarte in den Kartenleser stecken</h1>
+ <p>Die Software für den Zugriff auf die Bürgerkarte hat einen oder mehrere unterstützte Kartenleser gefunden.</p>
+ <p>Bitte stecken Sie nun ihre Bürgerkarte in den Kartenleser. Wird die Karte erkannt, welchselt die Bildschirmanzeige.</p>
+ <p>Sollten Sie mehrere Kartenleser angeschlossen haben, wählen Sie einen beliebigen aus. Wird die Karte im ausgewählten Kartenleser nicht erkannt, wird dieser Kartenleser eventuell nicht unterstützt. Probieren Sie es daher in einem anderen Kartenleser nochmal.
+ </p>
+ <p><br class="clearfloat" /></p>
+ </div>
+ <div id="footer">
+ <p>
+ <a href="http://www.buergerkarte.at">Austrian CitizenCard</a> | <a href="http://mocca.egovlabs.gv.at">CitizenCard Environment MOCCA</a>
+ </p>
+ </div>
+<!-- end #container --></div>
+</body>
+</html>
diff --git a/BKUHelp/src/main/webapp/help/en/insertcard.png b/BKUHelp/src/main/webapp/help/en/insertcard.png
new file mode 100644
index 00000000..62a22975
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/en/insertcard.png
Binary files differ
diff --git a/BKUHelp/src/main/webapp/help/en/wait.html b/BKUHelp/src/main/webapp/help/en/wait.html
new file mode 100644
index 00000000..73ca8200
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/en/wait.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<title>CitizenCard - Help</title>
+<link href="/help/css/help.css" rel="stylesheet" type="text/css" />
+<link rel="shortcut icon" href="/help/chip16.ico" type="image/x-icon"/>
+<!--[if IE]>
+<style type="text/css">
+/* place css fixes for all versions of IE in this conditional comment */
+.twoColElsLtHdr #sidebar1 { padding-top: 30px; }
+.twoColElsLtHdr #mainContent { zoom: 1; padding-top: 15px; }
+/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
+</style>
+<![endif]-->
+</head>
+
+<body class="twoColElsLtHdr">
+
+<div id="container">
+ <div id="header">
+ <h1>Online Help</h1>
+ <!-- end #header --></div>
+ <div id="sidebar1">
+ <p><img src="wait.png" alt="Bildschirmfoto des Applets" width="190" height="130"/></p>
+ <p><strong>Note</strong> that the screenshot may differ slightly from the actual web page.</p>
+ <!-- end #sidebar1 --></div>
+ <div id="mainContent">
+ <h1> Bitte warten ...</h1>
+ <p>Die Software für den Zugriff auf die Bürgerkarte ist damit beschäftigt, einen Befehl auszuführen bzw. auf einen neuen Befehl vom Server zu warten. </p>
+ <p><br class="clearfloat" /></p>
+ </div>
+ <div id="footer">
+ <p>
+ <a href="http://www.buergerkarte.at">Austrian CitizenCard</a> | <a href="http://mocca.egovlabs.gv.at">CitizenCard Environment MOCCA</a>
+ </p>
+ </div>
+<!-- end #container --></div>
+</body>
+</html>
diff --git a/BKUHelp/src/main/webapp/help/en/wait.png b/BKUHelp/src/main/webapp/help/en/wait.png
new file mode 100644
index 00000000..63a38fbf
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/en/wait.png
Binary files differ
diff --git a/BKUHelp/src/main/webapp/help/en/welcome.html b/BKUHelp/src/main/webapp/help/en/welcome.html
new file mode 100644
index 00000000..a26df4ac
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/en/welcome.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<title>CitizenCard - Help</title>
+<link href="/help/css/help.css" rel="stylesheet" type="text/css" />
+<link rel="shortcut icon" href="/help/chip16.ico" type="image/x-icon"/>
+<!--[if IE]>
+<style type="text/css">
+/* place css fixes for all versions of IE in this conditional comment */
+.twoColElsLtHdr #sidebar1 { padding-top: 30px; }
+.twoColElsLtHdr #mainContent { zoom: 1; padding-top: 15px; }
+/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
+</style>
+<![endif]-->
+</head>
+
+<body class="twoColElsLtHdr">
+
+<div id="container">
+ <div id="header">
+ <h1>Online Help</h1>
+ <!-- end #header --></div>
+ <div id="sidebar1">
+ <p><img src="welcome.png" alt="applet screenshot" width="190" height="130"/></p>
+ <p><strong>Note</strong> that the screenshot may differ slightly from the actual web page.</p>
+ <!-- end #sidebar1 --></div>
+ <div id="mainContent">
+ <h1> Willkommen </h1>
+ <p>Die Anzeige &quot;Willkommen&quot; erfolgt unmittelbar nachdem die Software für den Zugriff auf die Bürgerkarte erfolgreich im Browser geladen wurde.</p>
+ <p>Die Software versucht nun eine Verbindung mit dem Server aufzunehmen um Befehle für den Zugriff auf die Bürgerkarte zu erhalten.</p>
+ <p><br class="clearfloat" /></p>
+ </div>
+ <div id="footer">
+ <p>
+ <a href="http://www.buergerkarte.at">Austrian CitizenCard</a> | <a href="http://mocca.egovlabs.gv.at">CitizenCard Environment MOCCA</a>
+ </p>
+ </div>
+<!-- end #container --></div>
+</body>
+</html>
diff --git a/BKUHelp/src/main/webapp/help/en/welcome.png b/BKUHelp/src/main/webapp/help/en/welcome.png
new file mode 100644
index 00000000..78133b4d
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/en/welcome.png
Binary files differ
diff --git a/BKUHelp/src/main/webapp/help/error.card.locked.html b/BKUHelp/src/main/webapp/help/error.card.locked.html
new file mode 100644
index 00000000..d49bc1e9
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/error.card.locked.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<title>Bürgerkarte - Hilfe</title>
+<link href="/help/css/help.css" rel="stylesheet" type="text/css" />
+<link rel="shortcut icon" href="/help/chip16.ico" type="image/x-icon"/>
+<!--[if IE]>
+<style type="text/css">
+/* place css fixes for all versions of IE in this conditional comment */
+.twoColElsLtHdr #sidebar1 { padding-top: 30px; }
+.twoColElsLtHdr #mainContent { zoom: 1; padding-top: 15px; }
+/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
+</style>
+<![endif]-->
+</head>
+
+<body class="twoColElsLtHdr">
+
+<div id="container">
+ <div id="header">
+ <h1>Online-Hilfe</h1>
+ <!-- end #header --></div>
+ <div id="sidebar1">
+ <p><img src="error.card.locked.png" alt="Bildschirmfoto des Applets" width="190" height="130"/></p>
+ <p><strong>Hinweis:</strong> Das Bildschirmfoto oben kann von der Darstellung in der Webseite abweichen.</p>
+ <!-- end #sidebar1 --></div>
+ <div id="mainContent">
+ <h1> Fehler: Bürgerkarte ist gesperrt</h1>
+ <p>Die Bürgerkartenfunktion auf der gesteckten Chipkarte ist gesperrt. Es stehen keine weiteren Versuche zur Eingabe einer PIN zur Verfügung, da zu oft eine falsche PIN eingegeben wurde.</p>
+ <p>Bitte wenden sie sich an den Aussteller der Karte.</p>
+<ul>
+ <li><strong>e-card</strong> <br />
+ Chipkarte der <a href="http://www.sozialversicherung.at">Österreichischen Sozialversicherung</a></li>
+ <li><strong>a-sign premium</strong> <br />
+ Chipkarte der <a href="http://www.a-trust.at">A-Trust GmbH</a> bzw. diverse andere Chipkarten mit der Aufschrift 'a-sign premium'.</li>
+ </ul>
+ <p><br class="clearfloat" /></p>
+ </div>
+ <div id="footer">
+ <p>
+ <a href="http://www.buergerkarte.at">Österreichische Bürgerkarte</a> | <a href="http://mocca.egovlabs.gv.at">Bürgerkartensoftware MOCCA</a>
+ </p>
+ </div>
+<!-- end #container --></div>
+</body>
+</html>
diff --git a/BKUHelp/src/main/webapp/help/error.card.locked.png b/BKUHelp/src/main/webapp/help/error.card.locked.png
new file mode 100644
index 00000000..3e50661a
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/error.card.locked.png
Binary files differ
diff --git a/BKUHelp/src/main/webapp/help/error.card.notactivated.html b/BKUHelp/src/main/webapp/help/error.card.notactivated.html
new file mode 100644
index 00000000..3e04cc93
--- /dev/null
+++ b/BKUHelp/src/main/webapp/help/error.card.notactivated.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<title>Bürgerkarte - Hilfe</title>
+<link href="/help/css/help.css" rel="stylesheet" type="text/css" />
+<link rel="shortcut icon" href="/help/chip16.ico" type="image/x-icon"/>
+<!--[if IE]>
+<style type="text/css">
+/* place css fixes for all versions of IE in this conditional comment */
+.twoColElsLtHdr #sidebar1 { padding-top: 30px; }
+.twoColElsLtHdr #mainContent { zoom: 1; padding-top: 15px; }
+/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
+</style>
+<![endif]-->
+</head>
+
+<body class="twoColElsLtHdr">
+
+<div id="container">
+ <div id="header">
+ <h1>Online-Hilfe</h1>
+ <!-- end #header --></div>
+ <div id="sidebar1">
+ <p><img src="error.card.notactivated.png" alt="Bildschirmfoto des Applets" width="190" height="130"/></p>
+ <p><strong>Hinweis:</strong> Das Bildschirmfoto oben kann von der Darstellung in der Webseite abweichen.</p>
+ <!-- end #sidebar1 --></div>
+ <div id="mainContent">
+ <h1> Fehler: Bürgerkartenfunktion ist nicht aktiviert.</h1>
+ <p>Die im Kartenleser gesteckte Chipkarte wird unterstützt, jedoch ist die Bürgerkartenfunktion auf der Chipkarte noch nicht aktiviert.</p>
+ <p>Um die gesteckte Chipkarte als Bürgerkarte verwenden zu können,
+ muss zuerst die
+ Bürgerkartenfunktion aktiviert werden. Für Informationen dazu siehe <a href="http://www.buergerkarte.at/de/aktivieren/">Aktivierung der Bürgerkartenfunktion</a> auf <a href="http://www.buergerkarte.at">www.buergerkarte.at</a>.</p>
+ <p><br class="clearfloat" />
+ </p>
+ </div>
+ <div id="footer">
+ <p>
+ <a href="http://www.buergerkarte.at">Österreichische Bürgerkarte</a> | <a href="http://mocca.egovlabs.gv.at">Bürgerkartensoftware MOCCA</a>
+ </p>
+ </div>
+<!-- end #container --></div>
+</body>
+</html>
diff --git a/BKUHelp/src/main/webapp/help/error.card.notactivated.png b/BKUHelp/src/main/webapp/help/error.card.notactivated.png
new file mode 100644
index 00000000..5761a110
--- /dev/null
+++ b/