From 83e8c95ea7d257166d350a59bfd81e9833ec14fd Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 5 Nov 2009 19:05:14 +0000 Subject: [#484] European Language support git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@535 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java | 27 +++++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java') 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 e83502a8..8df4bd72 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 @@ -17,6 +17,8 @@ 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.smcc.PINSpec; import at.gv.egiz.stal.HashDataInput; import java.awt.Color; @@ -73,6 +75,7 @@ public class BKUGUIImpl implements BKUGUIFacade { protected HelpKeyListener helpKeyListener; protected SwitchFocusFocusListener switchFocusKeyListener; protected SecureViewerDialog secureViewer; + protected FontProvider fontProvider; protected Container contentPane; protected ResourceBundle messages; @@ -115,8 +118,9 @@ public class BKUGUIImpl implements BKUGUIFacade { */ public BKUGUIImpl(Container contentPane, Locale locale, - Style guiStyle, + Style guiStyle, URL background, + FontProvider fontProvider, ActionListener helpListener, SwitchFocusListener switchFocusListener) { this.contentPane = contentPane; @@ -139,7 +143,8 @@ public class BKUGUIImpl implements BKUGUIFacade { registerHelpListener(helpListener); registerSwitchFocusListener(switchFocusListener); - + + this.fontProvider = fontProvider; createGUI(background); } @@ -1386,7 +1391,12 @@ public class BKUGUIImpl implements BKUGUIFacade { @Override public void run() { - showSecureViewer(dataToBeSigned.get(0)); + try { + showSecureViewer(dataToBeSigned.get(0)); + } catch (FontProviderException ex) { + log.error("failed to display secure viewer", ex); + showErrorDialog(ERR_VIEWER, new Object[] {ex.getMessage()}, backListener, backCommand); + } } }); @@ -1407,12 +1417,12 @@ public class BKUGUIImpl implements BKUGUIFacade { * @param saveListener * @param saveCommand */ - private void showSecureViewer(HashDataInput dataToBeSigned) { + private void showSecureViewer(HashDataInput dataToBeSigned) throws FontProviderException { log.debug("show secure viewer [" + Thread.currentThread().getName() + "]"); if (secureViewer == null) { secureViewer = new SecureViewerDialog(null, messages, - helpMouseListener.getActionListener()); + 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. @@ -1485,7 +1495,12 @@ public class BKUGUIImpl implements BKUGUIFacade { int selectionIdx = lsm.getMinSelectionIndex(); if (selectionIdx >= 0) { final HashDataInput selection = signedReferences.get(selectionIdx); - showSecureViewer(selection); + try { + showSecureViewer(selection); + } catch (FontProviderException ex) { + log.error("failed to display secure viewer", ex); + showErrorDialog(ERR_VIEWER, new Object[] {ex.getMessage()}, backListener, backCommand); + } } } }); -- cgit v1.2.3