From 22001c93bca360d1b15c252cb22d2a4147ff350d Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 20 Aug 2009 16:24:55 +0000 Subject: [#430] Activation/PIN-management in MOCCA Web Start - new Modules: smccSTALExt, BKUGuiExt in order not to depend on BKUAppletExt in BKULocal - provide stal-request handler de-registration in abstractSMCCSTAL git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@448 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUGuiExt/pom.xml | 27 + .../java/at/gv/egiz/bku/gui/ActivationGUI.java | 250 ++++++++ .../at/gv/egiz/bku/gui/ActivationGUIFacade.java | 34 ++ .../main/java/at/gv/egiz/bku/gui/CardMgmtGUI.java | 71 +++ .../java/at/gv/egiz/bku/gui/PINManagementGUI.java | 670 +++++++++++++++++++++ .../at/gv/egiz/bku/gui/PINManagementGUIFacade.java | 118 ++++ .../java/at/gv/egiz/bku/gui/PINSpecRenderer.java | 39 ++ .../java/at/gv/egiz/bku/gui/PINStatusRenderer.java | 61 ++ .../at/gv/egiz/bku/gui/PINStatusTableModel.java | 58 ++ .../gv/egiz/bku/gui/ActivationMessages.properties | 69 +++ .../egiz/bku/gui/ActivationMessages_en.properties | 68 +++ .../java/at/gv/egiz/bku/gui/ActivationGuiTest.java | 63 ++ .../test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java | 203 +++++++ 13 files changed, 1731 insertions(+) create mode 100644 BKUGuiExt/pom.xml create mode 100644 BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/ActivationGUI.java create mode 100644 BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/ActivationGUIFacade.java create mode 100644 BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/CardMgmtGUI.java create mode 100644 BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINManagementGUI.java create mode 100644 BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINManagementGUIFacade.java create mode 100644 BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINSpecRenderer.java create mode 100644 BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINStatusRenderer.java create mode 100644 BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINStatusTableModel.java create mode 100644 BKUGuiExt/src/main/resources/at/gv/egiz/bku/gui/ActivationMessages.properties create mode 100644 BKUGuiExt/src/main/resources/at/gv/egiz/bku/gui/ActivationMessages_en.properties create mode 100644 BKUGuiExt/src/test/java/at/gv/egiz/bku/gui/ActivationGuiTest.java create mode 100644 BKUGuiExt/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java (limited to 'BKUGuiExt') diff --git a/BKUGuiExt/pom.xml b/BKUGuiExt/pom.xml new file mode 100644 index 00000000..87520232 --- /dev/null +++ b/BKUGuiExt/pom.xml @@ -0,0 +1,27 @@ + + + 4.0.0 + + bku + at.gv.egiz + 1.2.2-SNAPSHOT + + at.gv.egiz + BKUGuiExt + 1.2.2-SNAPSHOT + BKU GUI Extension + + + at.gv.egiz + STALXService + 1.2.2-SNAPSHOT + + + at.gv.egiz + smccSTAL + 1.2.2-SNAPSHOT + + + + 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 new file mode 100644 index 00000000..c8927e1e --- /dev/null +++ b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/ActivationGUI.java @@ -0,0 +1,250 @@ +/* + * 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.bku.gui.*; +import java.awt.Container; +import java.awt.Cursor; +import java.awt.event.ActionListener; +import java.net.URL; +import java.text.MessageFormat; +import java.util.Locale; +import java.util.ResourceBundle; +import javax.swing.GroupLayout; +import javax.swing.JButton; +import javax.swing.JLabel; +import javax.swing.JProgressBar; +import javax.swing.LayoutStyle; +import javax.swing.SwingUtilities; + +/** + * + * @author Clemens Orthacker + */ +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"; + + protected JProgressBar progressBar; + + public ActivationGUI(Container contentPane, + Locale locale, + Style guiStyle, + URL backgroundImgURL, + AbstractHelpListener helpListener) { + super(contentPane, locale, guiStyle, backgroundImgURL, helpListener); + + progressBar = new JProgressBar(); + } + + @Override + public void showActivationProgressDialog(final int currentStep, final int maxProgress, final ActionListener cancelListener, final String cancelCommand) { + + log.debug("scheduling activation progress dialog (step " + currentStep + ")"); + + SwingUtilities.invokeLater(new Runnable() { + + @Override + public void run() { + + log.debug("show activation progress dialog (step " + currentStep + ")"); + + mainPanel.removeAll(); + buttonPanel.removeAll(); + + mainPanel.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); + + + JLabel infoLabel = new JLabel(); + infoLabel.setFont(infoLabel.getFont().deriveFont(infoLabel.getFont().getStyle() & ~java.awt.Font.BOLD)); + + if (renderHeaderPanel) { + titleLabel.setText(cardmgmtMessages.getString(TITLE_ACTIVATION)); + infoLabel.setText(cardmgmtMessages.getString(LABEL_ACTIVATION)); + } else { + infoLabel.setText(cardmgmtMessages.getString(TITLE_ACTIVATION)); + } + + helpListener.setHelpTopic(HELP_ACTIVATION); + + progressBar.setIndeterminate(false); + progressBar.setStringPainted(true); + progressBar.setString(null); //reset to percentage + progressBar.setMinimum(0); + progressBar.setMaximum(maxProgress); + + JLabel stepLabel = new JLabel(); + stepLabel.setFont(stepLabel.getFont().deriveFont(stepLabel.getFont().getStyle() & ~java.awt.Font.BOLD, stepLabel.getFont().getSize()-2)); + String stepPattern = cardmgmtMessages.getString(LABEL_ACTIVATION_STEP); + stepLabel.setText(MessageFormat.format(stepPattern, new Object[]{ currentStep })); + + 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(helpLabel); + infoVertical.addComponent(helpLabel); + } + + mainPanelLayout.setHorizontalGroup( + mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING) + .addGroup(infoHorizontal) + .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING) + .addComponent(stepLabel) + .addComponent(progressBar))); + + mainPanelLayout.setVerticalGroup( + mainPanelLayout.createSequentialGroup() + .addGroup(infoVertical) + .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) + .addGroup(mainPanelLayout.createSequentialGroup() + .addComponent(stepLabel) + .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) + .addComponent(progressBar))); + + JButton cancelButton = new JButton(); + cancelButton.setFont(cancelButton.getFont().deriveFont(cancelButton.getFont().getStyle() & ~java.awt.Font.BOLD)); + cancelButton.setText(messages.getString(BUTTON_CANCEL)); + cancelButton.addActionListener(cancelListener); + cancelButton.setActionCommand(cancelCommand); + + GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel); + buttonPanel.setLayout(buttonPanelLayout); + + buttonPanelLayout.setHorizontalGroup( + buttonPanelLayout.createSequentialGroup() + .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(cancelButton, GroupLayout.PREFERRED_SIZE, buttonSize, GroupLayout.PREFERRED_SIZE)); + buttonPanelLayout.setVerticalGroup( + buttonPanelLayout.createSequentialGroup() + .addComponent(cancelButton)); + + contentPanel.validate(); + + } + }); + + } + + @Override + public void incrementProgress() { + SwingUtilities.invokeLater(new Runnable() { + + @Override + public void run() { + progressBar.setValue(progressBar.getValue() + 1); + } + }); + + } + + @Override + public void showIdleDialog(final ActionListener cancelListener, final String cancelCommand) { + log.debug("scheduling idle dialog"); + + SwingUtilities.invokeLater(new Runnable() { + + @Override + public void run() { + + log.debug("show idle dialog"); + + mainPanel.removeAll(); + buttonPanel.removeAll(); + + mainPanel.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); + + + JLabel infoLabel = new JLabel(); + infoLabel.setFont(infoLabel.getFont().deriveFont(infoLabel.getFont().getStyle() & ~java.awt.Font.BOLD)); + + if (renderHeaderPanel) { + titleLabel.setText(cardmgmtMessages.getString(TITLE_ACTIVATION)); + infoLabel.setText(cardmgmtMessages.getString(LABEL_ACTIVATION)); + } else { + infoLabel.setText(cardmgmtMessages.getString(TITLE_ACTIVATION)); + } + + helpListener.setHelpTopic(HELP_ACTIVATION); + + progressBar.setIndeterminate(true); + progressBar.setStringPainted(true); + progressBar.setString(""); //not string painted progressbar is smaller + + JLabel stepLabel = new JLabel(); + stepLabel.setFont(stepLabel.getFont().deriveFont(stepLabel.getFont().getStyle() & ~java.awt.Font.BOLD, stepLabel.getFont().getSize()-2)); + stepLabel.setText(cardmgmtMessages.getString(LABEL_ACTIVATION_IDLE)); + + 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(helpLabel); + infoVertical.addComponent(helpLabel); + } + + mainPanelLayout.setHorizontalGroup( + mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING) + .addGroup(infoHorizontal) + .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING) + .addComponent(stepLabel) + .addComponent(progressBar))); + + mainPanelLayout.setVerticalGroup( + mainPanelLayout.createSequentialGroup() + .addGroup(infoVertical) + .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) + .addGroup(mainPanelLayout.createSequentialGroup() + .addComponent(stepLabel) + .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) + .addComponent(progressBar))); + + JButton cancelButton = new JButton(); + cancelButton.setFont(cancelButton.getFont().deriveFont(cancelButton.getFont().getStyle() & ~java.awt.Font.BOLD)); + cancelButton.setText(messages.getString(BUTTON_CANCEL)); + cancelButton.addActionListener(cancelListener); + cancelButton.setActionCommand(cancelCommand); + + GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel); + buttonPanel.setLayout(buttonPanelLayout); + + buttonPanelLayout.setHorizontalGroup( + buttonPanelLayout.createSequentialGroup() + .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(cancelButton, GroupLayout.PREFERRED_SIZE, buttonSize, GroupLayout.PREFERRED_SIZE)); + buttonPanelLayout.setVerticalGroup( + buttonPanelLayout.createSequentialGroup() + .addComponent(cancelButton)); + + contentPanel.validate(); + + } + }); + + } +} 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 new file mode 100644 index 00000000..3fc14d04 --- /dev/null +++ b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/ActivationGUIFacade.java @@ -0,0 +1,34 @@ +/* + * 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.bku.gui.*; +import java.awt.event.ActionListener; + +/** + * + * @author Clemens Orthacker + */ +public interface ActivationGUIFacade extends BKUGUIFacade { + + public void showActivationProgressDialog(int currentStep, int maxProgress, ActionListener cancelListener, String cancelCommand); + + public void incrementProgress(); + + public void showIdleDialog(ActionListener cancelListener, String cancelCommand); + +} 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 new file mode 100644 index 00000000..c8e1826c --- /dev/null +++ b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/CardMgmtGUI.java @@ -0,0 +1,71 @@ +/* + * 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.bku.gui.*; +import java.awt.Container; +import java.net.URL; +import java.util.Locale; +import java.util.ResourceBundle; + +/** + * Common superclass for Activation and PinManagement GUIs + * + * @author Clemens Orthacker + */ +public class CardMgmtGUI extends BKUGUIImpl { + + public static final String CARDMGMT_MESSAGES_BUNDLE = "at/gv/egiz/bku/gui/ActivationMessages"; + + protected ResourceBundle cardmgmtMessages; + + public CardMgmtGUI(Container contentPane, + Locale locale, + Style guiStyle, + URL backgroundImgURL, + AbstractHelpListener helpListener) { + super(contentPane, locale, guiStyle, backgroundImgURL, helpListener); + + } + + @Override + protected void loadMessageBundle(Locale locale) { + super.loadMessageBundle(locale); + + if (locale != null) { + Locale lang = new Locale(locale.getLanguage().substring(0,2)); + log.debug("loading applet resources for language: " + lang.toString()); + cardmgmtMessages = ResourceBundle.getBundle(CARDMGMT_MESSAGES_BUNDLE, lang); + } else { + cardmgmtMessages = ResourceBundle.getBundle(CARDMGMT_MESSAGES_BUNDLE); + } + } + + @Override + protected String getMessage(String key) { + if (super.hasMessage(key)) { + return super.getMessage(key); + } + return cardmgmtMessages.getString(key); + } + + @Override + protected boolean hasMessage(String key) { + return (cardmgmtMessages.containsKey(key) || super.hasMessage(key)); + } +} 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 new file mode 100644 index 00000000..3d503510 --- /dev/null +++ b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINManagementGUI.java @@ -0,0 +1,670 @@ +/* + * 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.bku.gui.*; +import at.gv.egiz.smcc.PINSpec; +import java.awt.Container; +import java.awt.Cursor; +import java.awt.Font; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseEvent; +import java.awt.event.MouseMotionAdapter; +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; +import javax.swing.JPasswordField; +import javax.swing.JScrollPane; +import javax.swing.JTable; +import javax.swing.LayoutStyle; +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; + +/** + * TODO pull out ResourceBundle to common superclass for activationGUI and pinMgmtGUI + * @author Clemens Orthacker + */ +public class PINManagementGUI extends CardMgmtGUI implements PINManagementGUIFacade { + + protected static final Log log = LogFactory.getLog(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, + AbstractHelpListener helpListener) { + super(contentPane, locale, guiStyle, backgroundImgURL, helpListener); + } + + @Override + public char[] getOldPin() { + if (oldPinField != null) { + char[] pin = oldPinField.getPassword(); + oldPinField = null; + return pin; + } + return null; + } + + @Override + public PINSpec getSelectedPINSpec() { + return pinSpec; + } + + @Override + public void showPINManagementDialog(final Map pins, + final ActionListener activateListener, + final String activateCmd, + final String changeCmd, + final String unblockCmd, + final String verifyCmd, + final ActionListener cancelListener, + final String cancelCmd) { + + log.debug("scheduling PIN managment dialog"); + + SwingUtilities.invokeLater(new Runnable() { + + @Override + public void run() { + log.debug("show PIN management dialog"); + + mainPanel.removeAll(); + buttonPanel.removeAll(); + + helpListener.setHelpTopic(HELP_PINMGMT); + + JLabel 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)); + } + + 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)); + pinStatusTable.setTableHeader(null); + pinStatusTable.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); +// pinStatusTable.addMouseMotionListener(new MouseMotionAdapter() { +// +// @Override +// public void mouseMoved(MouseEvent e) { +// if (pinStatusTable.columnAtPoint(e.getPoint()) == 0) { +// pinStatusTable.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); +// } else { +// pinStatusTable.setCursor(Cursor.getDefaultCursor()); +// } +// } +// }); + + final JButton activateButton = new JButton(); + activateButton.setFont(activateButton.getFont().deriveFont(activateButton.getFont().getStyle() & ~java.awt.Font.BOLD)); + activateButton.addActionListener(activateListener); + + pinStatusTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); + pinStatusTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() { + + @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); + + if (status == STATUS.NOT_ACTIV) { + activateButton.setText(getMessage(BUTTON_ACTIVATE)); + activateButton.setEnabled(true); + activateButton.setActionCommand(activateCmd); + } else if (status == STATUS.BLOCKED) { + activateButton.setText(getMessage(BUTTON_UNBLOCK)); + activateButton.setEnabled(true); + activateButton.setActionCommand(unblockCmd); + } else if (status == STATUS.ACTIV) { + activateButton.setText(getMessage(BUTTON_CHANGE)); + activateButton.setEnabled(true); + activateButton.setActionCommand(changeCmd); + } else if (status == STATUS.UNKNOWN) { + activateButton.setText(getMessage(BUTTON_VERIFY)); + activateButton.setEnabled(true); + activateButton.setActionCommand(verifyCmd); + } + } + } + }); + } + }); + + //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(helpLabel); + messageVertical + .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); + + contentPanel.validate(); + } + }); + } + + @Override + public void showPINDialog(DIALOG type, PINSpec pinSpec, + ActionListener okListener, String okCommand, + ActionListener cancelListener, String cancelCommand) { + showPINDialog(type, pinSpec, -1, false, + okListener, okCommand, cancelListener, cancelCommand); + } + + @Override + public void showPINDialog(DIALOG type, PINSpec pinSpec, int retries, + ActionListener okListener, String okCommand, + ActionListener cancelListener, String cancelCommand) { + showPINDialog(type, pinSpec, retries, false, + okListener, okCommand, cancelListener, cancelCommand); + } + + @Override + public void showPinpadPINDialog(DIALOG type, PINSpec pinSpec, int retries) { + String title, msg; + Object[] params; + if (retries < 0) { + params = new Object[2]; + if (shortText) { + params[0] = "PIN"; + } else { + params[0] = pinSpec.getLocalizedName(); + } + params[1] = pinSpec.getLocalizedLength(); + if (type == DIALOG.CHANGE) { + log.debug("show change pin dialog"); + title = TITLE_CHANGE_PIN; + msg = MESSAGE_CHANGEPIN_PINPAD; + } else if (type == DIALOG.ACTIVATE) { + log.debug("show activate pin dialog"); + title = TITLE_ACTIVATE_PIN; + msg = MESSAGE_ENTERPIN_PINPAD; + } else if (type == DIALOG.VERIFY) { + log.debug("show verify pin dialog"); + title = TITLE_VERIFY_PIN; + msg = MESSAGE_ENTERPIN_PINPAD; + } else { + log.debug("show unblock pin dialog"); + title = TITLE_UNBLOCK_PIN; + msg = MESSAGE_ENTERPIN_PINPAD; + } + + } 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); + } + + private void showPINDialog(final DIALOG type, final PINSpec 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, PINSIZE; + HELP_TOPIC = HELP_PINMGMT; + + PINSIZE = (pinSpec.getMaxLength() > pinSpec.getMinLength()) ? + pinSpec.getMinLength() + "-" + pinSpec.getMaxLength() : + String.valueOf(pinSpec.getMinLength()); + + 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; + PINSIZE = pinSpec.getLocalizedLength(); + } else if (type == DIALOG.VERIFY) { + log.debug("show verify pin dialog"); + TITLE = TITLE_VERIFY_PIN; + MESSAGE_MGMT = MESSAGE_VERIFY_PIN; + } 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); + + 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); + 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(helpLabel); + infoVertical + .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_VERIFYPIN_PINPAD); + pinpadLabel.setText(MessageFormat.format(pinpadPattern, + new Object[] { pinSpec.getLocalizedName(), PINSIZE })); + + pinHorizontal = mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING) + .addComponent(pinpadLabel); + pinVertical = mainPanelLayout.createSequentialGroup() + .addComponent(pinpadLabel); + } else { + + 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) ? 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) { + pinField.setDocument(new PINDocument(pinSpec, null)); + 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.setDocument(new PINDocument(pinSpec, okButton, pinField.getDocument())); + repeatPinField.setActionCommand(okCommand); + repeatPinField.addActionListener(new ActionListener() { + + @Override + public void actionPerformed(ActionEvent e) { + if (pinField.getPassword().length >= pinSpec.getMinLength()) { + okListener.actionPerformed(e); + } + } + }); + + if (type == DIALOG.CHANGE) { + oldPinLabel = new JLabel(); + oldPinLabel.setFont(oldPinLabel.getFont().deriveFont(oldPinLabel.getFont().getStyle() & ~java.awt.Font.BOLD)); + String oldPinLabelPattern = getMessage(LABEL_OLD_PIN); + oldPinLabel.setText(MessageFormat.format(oldPinLabelPattern, new Object[]{pinSpec.getLocalizedName()})); + + oldPinField = new JPasswordField(); + oldPinField.setText(""); + oldPinField.setDocument(new PINDocument(pinSpec, null)); + oldPinField.setActionCommand(okCommand); + oldPinField.addActionListener(new ActionListener() { + + @Override + public void actionPerformed(ActionEvent e) { + if (oldPinField.getPassword().length >= pinSpec.getMinLength()) { + pinField.requestFocusInWindow(); + } + } + }); + + repeatPinField.setDocument(new PINDocument( + pinSpec, okButton, + pinField.getDocument(), oldPinField.getDocument())); + } else { + // else -> ACTIVATE (not verify, not change) + repeatPinField.setDocument(new PINDocument( + pinSpec, okButton, pinField.getDocument())); + } + } else { + pinField.setDocument(new PINDocument(pinSpec, 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, new Object[]{PINSIZE})); + + //////////////////////////////////////////////////////////////// + // 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) { + 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)); + + 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; + } + +} 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 new file mode 100644 index 00000000..297173d9 --- /dev/null +++ b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINManagementGUIFacade.java @@ -0,0 +1,118 @@ +/* + * 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.bku.gui.*; +import at.gv.egiz.smcc.PINSpec; +import java.awt.event.ActionListener; +import java.util.Map; + +/** + * + * @author Clemens Orthacker + */ +public interface PINManagementGUIFacade extends BKUGUIFacade { + + public static final String HELP_PINMGMT = "help.pin.mgmt"; +// public static final String HELP_VERIFY_PIN = "help.pin.verify"; + public static final String TITLE_PINMGMT = "title.pin.mgmt"; + public static final String TITLE_ACTIVATE_PIN = "title.activate.pin"; + public static final String TITLE_CHANGE_PIN = "title.change.pin"; + public static final String TITLE_VERIFY_PIN = "title.verify.pin"; + public static final String TITLE_UNBLOCK_PIN = "title.unblock.pin"; + public static final String TITLE_ACTIVATE_SUCCESS = "title.activate.success"; + public static final String TITLE_CHANGE_SUCCESS = "title.change.success"; + + // removed message.* prefix to reuse keys as help keys + public static final String MESSAGE_ACTIVATE_SUCCESS = "activate.success"; + public static final String MESSAGE_CHANGE_SUCCESS = "change.success"; + public static final String MESSAGE_PINMGMT = "pin.mgmt"; +// public static final String MESSAGE_PINPAD = "pinpad"; + public static final String MESSAGE_ACTIVATE_PIN = "activate.pin"; + public static final String MESSAGE_CHANGE_PIN = "change.pin"; + public static final String MESSAGE_VERIFY_PIN = "verify.pin"; + public static final String MESSAGE_UNBLOCK_PIN = "unblock.pin"; + public static final String MESSAGE_ACTIVATEPIN_PINPAD = "activate.pinpad"; + public static final String MESSAGE_CHANGEPIN_PINPAD = "change.pinpad"; + public static final String MESSAGE_VERIFYPIN_PINPAD = "verify.pinpad"; + public static final String MESSAGE_UNBLOCKPIN_PINPAD = "unblock.pinpad"; + + public static final String LABEL_OLD_PIN = "label.old.pin"; + public static final String LABEL_NEW_PIN = "label.new.pin"; + public static final String LABEL_REPEAT_PIN = "label.repeat.pin"; + + public static final String ERR_STATUS = "err.status"; + public static final String ERR_ACTIVATE = "err.activate"; + public static final String ERR_CHANGE = "err.change"; + public static final String ERR_UNBLOCK = "err.unblock"; + public static final String ERR_VERIFY = "err.verify"; + public static final String ERR_RETRIES = "err.retries"; + public static final String ERR_LOCKED = "err.locked"; + public static final String ERR_NOT_ACTIVE = "err.not.active"; + public static final String ERR_PIN_FORMAT = "err.pin.format"; + public static final String ERR_PIN_CONFIRMATION = "err.pin.confirmation"; + public static final String ERR_PIN_OPERATION_ABORTED = "err.pin.operation.aborted"; + public static final String ERR_UNSUPPORTED_CARD = "err.unsupported.card"; + + public static final String BUTTON_ACTIVATE = "button.activate"; + public static final String BUTTON_UNBLOCK = "button.unblock"; + public static final String BUTTON_CHANGE = "button.change"; + public static final String BUTTON_VERIFY = "button.verify"; + + public static final String STATUS_ACTIVE = "status.active"; + public static final String STATUS_BLOCKED = "status.blocked"; + 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 DIALOG { VERIFY, ACTIVATE, CHANGE, UNBLOCK }; + + public void showPINManagementDialog(Map pins, + ActionListener activateListener, String activateCmd, String changeCmd, String unblockCmd, String verifyCmd, + ActionListener cancelListener, String cancelCmd); + + public void showPINDialog(DIALOG type, PINSpec pin, + ActionListener okListener, String okCmd, + ActionListener cancelListener, String cancelCmd); + + public void showPINDialog(DIALOG type, PINSpec pin, int retries, + ActionListener okListener, String okCmd, + ActionListener cancelListener, String cancelCmd); + + public void showPinpadPINDialog(DIALOG type, PINSpec pin, int retries); + +// public void showActivatePINDialog(PINSpec pin, +// ActionListener okListener, String okCmd, +// ActionListener cancelListener, String cancelCmd); +// +// public void showChangePINDialog(PINSpec pin, +// ActionListener okListener, String okCmd, +// ActionListener cancelListener, String cancelCmd); +// +// public void showUnblockPINDialog(PINSpec pin, +// ActionListener okListener, String okCmd, +// ActionListener cancelListener, String cancelCmd); +// +// public void showVerifyPINDialog(PINSpec pin, +// ActionListener okListener, String okCmd, +// ActionListener cancelListener, String cancelCmd); + + public char[] getOldPin(); + + public PINSpec getSelectedPINSpec(); +} 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 new file mode 100644 index 00000000..e3d73e1f --- /dev/null +++ b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINSpecRenderer.java @@ -0,0 +1,39 @@ +/* + * 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.PINSpec; +import javax.swing.table.DefaultTableCellRenderer; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * + * @author Clemens Orthacker + */ +public class PINSpecRenderer extends DefaultTableCellRenderer { + + private static final Log log = LogFactory.getLog(PINSpecRenderer.class); + + @Override + protected void setValue(Object value) { + PINSpec pinSpec = (PINSpec) value; + super.setText(pinSpec.getLocalizedName()); + } + +} 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 new file mode 100644 index 00000000..83ff74f2 --- /dev/null +++ b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINStatusRenderer.java @@ -0,0 +1,61 @@ +/* + * 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.bku.gui.PINManagementGUIFacade.STATUS; +import java.awt.Color; +import java.awt.Font; +import java.util.ResourceBundle; +import javax.swing.table.DefaultTableCellRenderer; + +/** + * + * @author Clemens Orthacker + */ +public class PINStatusRenderer extends DefaultTableCellRenderer { + +// private static final Log log = LogFactory.getLog(PINStatusRenderer.class); + + 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; + + public PINStatusRenderer(ResourceBundle messages) { + this.messages = messages; + } + + @Override + protected void setValue(Object value) { + STATUS pinStatus = (STATUS) value; + super.setFont(super.getFont().deriveFont(super.getFont().getStyle() | Font.BOLD)); + + if (pinStatus == STATUS.NOT_ACTIV) { + super.setForeground(RED); + super.setText("" + messages.getString(PINManagementGUIFacade.STATUS_NOT_ACTIVE) + ""); + } else if (pinStatus == STATUS.ACTIV) { + super.setForeground(GREEN); + super.setText("" + messages.getString(PINManagementGUIFacade.STATUS_ACTIVE) + ""); + } else if (pinStatus == STATUS.BLOCKED) { + super.setForeground(RED); + super.setText("" + messages.getString(PINManagementGUIFacade.STATUS_BLOCKED) + ""); + } else { + super.setForeground(Color.BLACK); + super.setText("" + messages.getString(PINManagementGUIFacade.STATUS_UNKNOWN) + ""); + } + } +} 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 new file mode 100644 index 00000000..052c13b2 --- /dev/null +++ b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINStatusTableModel.java @@ -0,0 +1,58 @@ +/* + * 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.bku.gui.PINManagementGUIFacade.STATUS; +import at.gv.egiz.smcc.PINSpec; +import java.util.Map; +import javax.swing.table.DefaultTableModel; + +/** + * + * @author Clemens Orthacker + */ +public class PINStatusTableModel extends DefaultTableModel { + +// protected static final Log log = LogFactory.getLog(PINStatusTableModel.class); + protected Class[] types; + + public PINStatusTableModel(Map pinStatuses) { + 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) }); + } +// 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) { + return types[columnIndex]; + } + + @Override + public boolean isCellEditable(int rowIndex, int columnIndex) { + return false; + } +} diff --git a/BKUGuiExt/src/main/resources/at/gv/egiz/bku/gui/ActivationMessages.properties b/BKUGuiExt/src/main/resources/at/gv/egiz/bku/gui/ActivationMessages.properties new file mode 100644 index 00000000..977d6e3a --- /dev/null +++ b/BKUGuiExt/src/main/resources/at/gv/egiz/bku/gui/ActivationMessages.properties @@ -0,0 +1,69 @@ +# 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. + +title.activation=Aktivierung +title.pin.mgmt=PIN Verwaltung +title.activate.pin=PIN Aktivieren +title.change.pin=PIN \u00C4ndern +title.unblock.pin=PIN Entsperren +title.verify.pin=PIN Eingeben +title.activate.success=Erfolg +title.change.success=Erfolg + +# removed message.* prefix to reuse keys as help keys +pin.mgmt=Die Karte verf\u00FCgt \u00FCber {0} PINs +activate.pin={0} eingeben und best\u00E4tigen +change.pin={0} eingeben und best\u00E4tigen +unblock.pin=PUK zu {0} eingeben +verify.pin={0} eingeben +verify.pinpad={0} ({1} stellig) am Kartenleser eingeben (und best\u00E4tigen). +activate.pinpad={0} ({1} stellig) am Kartenleser eingeben und wiederholen (jeweils best\u00E4tigen). +change.pinpad=Alte {0} ({1} stellig) am Kartenleser eingeben, danach neue {0} eingeben und wiederholen (jeweils best\u00E4tigen). +unblock.pinpad={0} ({1} stellig) am Kartenleser eingeben (und best\u00E4tigen). +activate.success={0} wurde erfolgreich aktiviert. +change.success={0} wurde erfolgreich ge\u00E4ndert. + +label.activation=e-card Aktivierungsprozess +label.activation.step=Schritt {0} +label.activation.idle=Warte auf Server... +label.old.pin=Alte {0}: +label.new.pin=Neue {0}: +label.repeat.pin=Best\u00E4tigung: + +button.activate=Aktivieren +button.change=\u00C4ndern +button.unblock=Entsperren +button.verify=Abfragen + +help.activation=help.activation +help.pin.mgmt=help.pin.mgmt + +err.status=Der Status der PINs konnte nicht \u00FCberpr\u00FCft werden. +err.activate=Beim Aktivieren der {0} trat ein Fehler auf. +err.change=Beim \u00C4ndern der {0} trat ein Fehler auf. +err.unblock=Das Entsperren der {0} wird nicht unterst\u00FCtzt. +err.verify=VERIFY ERROR (TODO) +err.retries=Falsche {0}, noch {1} Versuche +err.locked={0} gesperrt. +err.not.active={0} nicht aktiviert. +err.pin.format=Ung\u00FCltige {0} L\u00E4nge, verlangt sind {1} Stellen. +err.pin.confirmation={0} und Best\u00E4tigung stimmen nicht \u00FCberein. +err.pin.operation.aborted=Der Vorgang f\u00FCr {0} wurde abgebrochen. +err.unsupported.card=Die Karte wird nicht unterst\u00FCtzt + +status.not.active=NICHT AKTIV +status.active=AKTIV +status.blocked=GESPERRT +status.unknown=UNBEKANNT diff --git a/BKUGuiExt/src/main/resources/at/gv/egiz/bku/gui/ActivationMessages_en.properties b/BKUGuiExt/src/main/resources/at/gv/egiz/bku/gui/ActivationMessages_en.properties new file mode 100644 index 00000000..7f01971b --- /dev/null +++ b/BKUGuiExt/src/main/resources/at/gv/egiz/bku/gui/ActivationMessages_en.properties @@ -0,0 +1,68 @@ +# 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. + +title.activation=Activation +title.pin.mgmt=PIN Management +title.activate.pin=Activate PIN +title.verify.pin=Enter PIN +title.change.pin=Change PIN +title.unblock.pin=Unblock PIN +title.activate.success=Success +title.change.success=Success + +# removed message.* prefix to reuse keys as help keys +pin.mgmt=The smartcard has {0} PINs +activate.pin=Enter and confirm {0} +change.pin=Enter and confirm {0} +unblock.pin=Enter PUK for {0} +verify.pin=Enter {0} +verify.pinpad=Enter {0} ({1} digits) on cardreader (and confirm). +activate.pinpad=Enter {0} ({1} digits) on cardreader and repeat (confirm in each case). +change.pinpad=Enter old {0} ({1} digits) on cardreader, then enter new {0} and repeat (confirm in each case). +unblock.pinpad=Enter {0} ({1} digits) on cardreader (and confirm). +activate.success={0} successfully activated +change.success={0} successfully changed + +label.activation=e-card activation process +label.activation.step=Step {0} +label.activation.idle=Wait for server... +label.old.pin=Old {0}: +label.new.pin=New {0}: +label.repeat.pin=Confirmation: + +button.activate=Activate +button.change=Change +button.unblock=Unblock +button.verify=Query + +help.activation=help.activation +help.pin.mgmt=help.pin.mgmt + +err.status=PIN statuses could not be read. +err.activate=An error occured during the activation of {0}. +err.change=An error occured during the changing of {0}. +err.unblock=Unblocking of {0} is not supported. +err.retries=Wrong {0}, {1} tries remaining +err.locked={0} locked +err.not.active={0} not activated. +err.pin.format=Invalid {0} length, {1} digit(s) required. +err.pin.confirmation={0} and confirmation do not match. +err.pin.operation.aborted=The operation on {0} was aborted. +err.unsupported.card=This card is not supported + +status.not.active=NOT ACTIVE +status.active=ACTIVE +status.blocked=BLOCKED +status.unknown=UNKNOWN diff --git a/BKUGuiExt/src/test/java/at/gv/egiz/bku/gui/ActivationGuiTest.java b/BKUGuiExt/src/test/java/at/gv/egiz/bku/gui/ActivationGuiTest.java new file mode 100644 index 00000000..49ae577b --- /dev/null +++ b/BKUGuiExt/src/test/java/at/gv/egiz/bku/gui/ActivationGuiTest.java @@ -0,0 +1,63 @@ +/* +* 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. +*/ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package at.gv.egiz.bku.gui; + +import at.gv.egiz.bku.gui.*; +import java.awt.Container; +import java.awt.Dimension; +import javax.swing.JFrame; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * + * @author clemens + */ +@Ignore +public class ActivationGuiTest { + + @Test + public void testBKUGUI() { + JFrame testFrame = new JFrame("BKUGUITest"); + Container contentPane = testFrame.getContentPane(); + contentPane.setPreferredSize(new Dimension(152, 145)); +// contentPane.setPreferredSize(new Dimension(300, 190)); + ActivationGUIFacade gui = new ActivationGUI(contentPane, null, BKUGUIFacade.Style.tiny, null, null); + BKUGUIWorker worker = new BKUGUIWorker(); + worker.init(gui); + testFrame.pack(); + testFrame.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); + testFrame.setVisible(true); + new Thread(worker).start(); + + while(true) ; + } + + @Test + public void dummyTest() { + } + +// public static void main(String[] args) { +// new BKUGUITest().testBKUGUI(); +// } +} 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 new file mode 100644 index 00000000..74ea8952 --- /dev/null +++ b/BKUGuiExt/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java @@ -0,0 +1,203 @@ +/* + * 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. + */ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package at.gv.egiz.bku.gui; + +import at.gv.egiz.bku.gui.*; +import at.gv.egiz.smcc.PINSpec; +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.util.ArrayList; +import java.util.List; + +/** + * + * @author clemens + */ +public class BKUGUIWorker implements Runnable { + + ActivationGUIFacade gui; + + public void init(ActivationGUIFacade gui) { + this.gui = gui; + } + + @Override + public void run() { + try { + + final PINSpec signPinSpec = new PINSpec(6, 10, "[0-9]", "Signatur-PIN", (byte)0x00, null); + + + final ActionListener cancelListener = new ActionListener() { + + public void actionPerformed(ActionEvent e) { + System.out.println("CANCEL EVENT OCCURED: " + e); + } + }; + ActionListener okListener = new ActionListener() { + + @Override + public void actionPerformed(ActionEvent e) { + System.out.println("OK EVENT OCCURED: " + e); + } + }; + final ActionListener signListener = new ActionListener() { + + public void actionPerformed(ActionEvent e) { + System.out.println("SIGN EVENT OCCURED: " + e); + } + }; + ActionListener hashdataListener = new ActionListener() { + + public void actionPerformed(ActionEvent e) { + System.out.println("HASHDATA EVENT OCCURED: " + e); + ActionListener returnListener = new ActionListener() { + + @Override + public void actionPerformed(ActionEvent e) { + gui.showSignaturePINDialog(signPinSpec, -1, signListener, "sign", cancelListener, "cancel", null, "hashdata"); + } + }; + HashDataInput signedRef1 = new ByteArrayHashDataInput( + "Ich bin ein einfacher Text mit Umlauten: öäüßéç@€\n123\n456\n\tHello, world!\n\nlkjsd\nnksdjf".getBytes(), + "ref-id-0000000000000000000000001", + "text/plain", + "UTF-8"); + + HashDataInput signedRef2 = new ByteArrayHashDataInput( + "HashDataInput_002".getBytes(), + "ref-id-000000002", + "application/xhtml+xml", + "UTF-8"); + + HashDataInput signedRef3 = new ByteArrayHashDataInput( + "HashDataInput_003".getBytes(), + "ref-id-000000003", + "application/xhtml+xml", + "UTF-8"); + + HashDataInput signedRef4 = new ByteArrayHashDataInput( + "HashDataInput_004".getBytes(), + "ref-id-000000004", + "text/xml", + "UTF-8"); + + // + List signedRefs = new ArrayList(); + signedRefs.add(signedRef1); + signedRefs.add(signedRef2); + signedRefs.add(signedRef3); + signedRefs.add(signedRef4); +// signedRefs.add(signedRef4); +// signedRefs.add(signedRef4); +// signedRefs.add(signedRef4); +// signedRefs.add(signedRef4); +// signedRefs = Collections.singletonList(signedRef1); + gui.showSecureViewer(signedRefs, returnListener, "return"); + } + }; + + + +// gui.showWelcomeDialog(); +// +// Thread.sleep(2000); +// +// gui.showWaitDialog(null); +// +// Thread.sleep(1000); +// +// gui.showWaitDialog("test"); +// +// Thread.sleep(1000); +// +// +// gui.showInsertCardDialog(cancelListener, "cancel"); +// +// Thread.sleep(2000); +// +// gui.showCardNotSupportedDialog(cancelListener, "cancel"); +// +// Thread.sleep(2000); +// +// PINSpec cardPinSpec = new PINSpec(4, 4, "[0-9]", "Karten-PIN"); +// +// gui.showCardPINDialog(cardPinSpec, okListener, "ok", cancelListener, "cancel"); +// +// Thread.sleep(2000); +// +// gui.showSignaturePINDialog(signPinSpec, signListener, "sign", cancelListener, "cancel", hashdataListener, "hashdata"); +// +// Thread.sleep(4000); +// + +// gui.showErrorDialog(BKUGUIFacade.ERR_NO_PCSC, null, null, null); + +// gui.showSignaturePINRetryDialog(signPinSpec, 2, signListener, "sign", cancelListener, "cancel", hashdataListener, "hashdata"); +// +// Thread.sleep(2000); +// +// gui.showErrorDialog(BKUGUIFacade.ERR_UNKNOWN, new Object[] {"Testfehler"}, null, null); +// +// Thread.sleep(2000); +// +// gui.showErrorDialog("error.test", new Object[] {"Testfehler", "noch ein TestFehler"}); +// +// Thread.sleep(2000); +// +// gui.showErrorDialog("error.no.hashdata", null); +// +// Thread.sleep(2000); +// +// gui.showErrorDialog(BKUGUIFacade.ERR_UNKNOWN, new Object[] {"Testfehler"}); +// +// Thread.sleep(2000); +// +// gui.showErrorDialog("error.unknown", null); + + gui.showActivationProgressDialog(1, 3, null, null); + + gui.incrementProgress(); + + Thread.sleep(1000); + + gui.incrementProgress(); + + Thread.sleep(1000); + + gui.incrementProgress(); + + + Thread.sleep(1000); + + gui.showIdleDialog(null, null); + +// gui.showTextPlainHashDataInput("hallo,\n welt!", "12345", null, "cancel", null, "save"); +// gui.showTextPlainHashDataInput("hallo,\n welt!", "12345", null, "cancel", null, "save"); +// Thread.sleep(2000); + + } catch (InterruptedException ex) { + ex.printStackTrace(); + } + } +} -- cgit v1.2.3 From ac6d2a37ee43ddc48cc0a1e40371366607624db7 Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 20 Aug 2009 17:08:58 +0000 Subject: [maven-release-plugin] prepare for next development iteration git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@453 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUGuiExt/pom.xml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'BKUGuiExt') diff --git a/BKUGuiExt/pom.xml b/BKUGuiExt/pom.xml index 87520232..42a9f57d 100644 --- a/BKUGuiExt/pom.xml +++ b/BKUGuiExt/pom.xml @@ -1,15 +1,13 @@ - - + 4.0.0 bku at.gv.egiz - 1.2.2-SNAPSHOT + 1.2.3-SNAPSHOT at.gv.egiz BKUGuiExt - 1.2.2-SNAPSHOT + 1.2.3-SNAPSHOT BKU GUI Extension @@ -23,5 +21,4 @@ 1.2.2-SNAPSHOT - - + \ No newline at end of file -- cgit v1.2.3 From ada7c53ce1c19ba26b988e43da51a1a99d584b14 Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 20 Aug 2009 17:10:52 +0000 Subject: [maven-release-plugin] rollback the release of mocca-1.2.2 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@454 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUGuiExt/pom.xml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'BKUGuiExt') diff --git a/BKUGuiExt/pom.xml b/BKUGuiExt/pom.xml index 42a9f57d..87520232 100644 --- a/BKUGuiExt/pom.xml +++ b/BKUGuiExt/pom.xml @@ -1,13 +1,15 @@ - + + 4.0.0 bku at.gv.egiz - 1.2.3-SNAPSHOT + 1.2.2-SNAPSHOT at.gv.egiz BKUGuiExt - 1.2.3-SNAPSHOT + 1.2.2-SNAPSHOT BKU GUI Extension @@ -21,4 +23,5 @@ 1.2.2-SNAPSHOT - \ No newline at end of file + + -- cgit v1.2.3 From e676ab1e361aff7ff7417f8f6e93ad176ef6cb60 Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 20 Aug 2009 17:27:08 +0000 Subject: [maven-release-plugin] prepare release mocca-1.2.2 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@455 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUGuiExt/pom.xml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'BKUGuiExt') diff --git a/BKUGuiExt/pom.xml b/BKUGuiExt/pom.xml index 87520232..064ceefa 100644 --- a/BKUGuiExt/pom.xml +++ b/BKUGuiExt/pom.xml @@ -1,27 +1,24 @@ - - + 4.0.0 bku at.gv.egiz - 1.2.2-SNAPSHOT + 1.2.2 at.gv.egiz BKUGuiExt - 1.2.2-SNAPSHOT + 1.2.2 BKU GUI Extension at.gv.egiz STALXService - 1.2.2-SNAPSHOT + 1.2.2 at.gv.egiz smccSTAL - 1.2.2-SNAPSHOT + 1.2.2 - - + \ No newline at end of file -- cgit v1.2.3 From 1102477bc94590a21eaf3bcbd50baa0b6ed13529 Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 20 Aug 2009 17:32:58 +0000 Subject: [maven-release-plugin] prepare for next development iteration git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@458 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUGuiExt/pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'BKUGuiExt') diff --git a/BKUGuiExt/pom.xml b/BKUGuiExt/pom.xml index 064ceefa..4de8ac39 100644 --- a/BKUGuiExt/pom.xml +++ b/BKUGuiExt/pom.xml @@ -3,22 +3,22 @@ bku at.gv.egiz - 1.2.2 + 1.2.3-SNAPSHOT at.gv.egiz BKUGuiExt - 1.2.2 + 1.2.3-SNAPSHOT BKU GUI Extension at.gv.egiz STALXService - 1.2.2 + 1.2.3-SNAPSHOT at.gv.egiz smccSTAL - 1.2.2 + 1.2.3-SNAPSHOT \ No newline at end of file -- cgit v1.2.3 From 06cd22f6acac2bd9edb373c7bb32c9a85cb34b21 Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 21 Aug 2009 16:00:33 +0000 Subject: icons 2.0 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@462 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINManagementGUI.java | 3 --- 1 file changed, 3 deletions(-) (limited to 'BKUGuiExt') 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 3d503510..e9065d51 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 @@ -17,15 +17,12 @@ package at.gv.egiz.bku.gui; -import at.gv.egiz.bku.gui.*; import at.gv.egiz.smcc.PINSpec; import java.awt.Container; import java.awt.Cursor; import java.awt.Font; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.awt.event.MouseEvent; -import java.awt.event.MouseMotionAdapter; import java.net.URL; import java.text.MessageFormat; import java.util.Locale; -- cgit v1.2.3 From 45bae5a2d8b414ccb3ed4421eeee867b2a6e88b7 Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 21 Aug 2009 16:31:49 +0000 Subject: [maven-release-plugin] prepare release mocca-1.2.3 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@467 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUGuiExt/pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'BKUGuiExt') diff --git a/BKUGuiExt/pom.xml b/BKUGuiExt/pom.xml index 4de8ac39..158feaac 100644 --- a/BKUGuiExt/pom.xml +++ b/BKUGuiExt/pom.xml @@ -3,22 +3,22 @@ bku at.gv.egiz - 1.2.3-SNAPSHOT + 1.2.3 at.gv.egiz BKUGuiExt - 1.2.3-SNAPSHOT + 1.2.3 BKU GUI Extension at.gv.egiz STALXService - 1.2.3-SNAPSHOT + 1.2.3 at.gv.egiz smccSTAL - 1.2.3-SNAPSHOT + 1.2.3 \ No newline at end of file -- cgit v1.2.3 From 1f0a54980e6b3f60c3b3d935f22537ceba179100 Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 21 Aug 2009 16:32:05 +0000 Subject: [maven-release-plugin] prepare for next development iteration git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@469 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUGuiExt/pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'BKUGuiExt') diff --git a/BKUGuiExt/pom.xml b/BKUGuiExt/pom.xml index 158feaac..517e17ee 100644 --- a/BKUGuiExt/pom.xml +++ b/BKUGuiExt/pom.xml @@ -3,22 +3,22 @@ bku at.gv.egiz - 1.2.3 + 1.2.4-SNAPSHOT at.gv.egiz BKUGuiExt - 1.2.3 + 1.2.4-SNAPSHOT BKU GUI Extension at.gv.egiz STALXService - 1.2.3 + 1.2.4-SNAPSHOT at.gv.egiz smccSTAL - 1.2.3 + 1.2.4-SNAPSHOT \ No newline at end of file -- cgit v1.2.3 From 598f62c5b30d6e40f6983fc3eec17613d19cdc0e Mon Sep 17 00:00:00 2001 From: clemenso Date: Tue, 25 Aug 2009 12:49:43 +0000 Subject: [#436] resolve "#pin digits" message via resource bundle (now, all dialogs - not only pinactivation - get pinLength from resource bundle) git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@472 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../src/main/java/at/gv/egiz/bku/gui/PINManagementGUI.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'BKUGuiExt') 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 e9065d51..9c698d79 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 @@ -298,13 +298,9 @@ public class PINManagementGUI extends CardMgmtGUI implements PINManagementGUIFac @Override public void run() { - String HELP_TOPIC, TITLE, MESSAGE_MGMT, MESSAGE_MGMT_PARAM, PINSIZE; + String HELP_TOPIC, TITLE, MESSAGE_MGMT, MESSAGE_MGMT_PARAM; HELP_TOPIC = HELP_PINMGMT; - PINSIZE = (pinSpec.getMaxLength() > pinSpec.getMinLength()) ? - pinSpec.getMinLength() + "-" + pinSpec.getMaxLength() : - String.valueOf(pinSpec.getMinLength()); - if (retries < 0) { if (type == DIALOG.CHANGE) { log.debug("show change pin dialog"); @@ -315,7 +311,6 @@ public class PINManagementGUI extends CardMgmtGUI implements PINManagementGUIFac TITLE = TITLE_ACTIVATE_PIN; MESSAGE_MGMT = MESSAGE_ACTIVATE_PIN; oldPinField = null; - PINSIZE = pinSpec.getLocalizedLength(); } else if (type == DIALOG.VERIFY) { log.debug("show verify pin dialog"); TITLE = TITLE_VERIFY_PIN; @@ -388,7 +383,7 @@ public class PINManagementGUI extends CardMgmtGUI implements PINManagementGUIFac pinpadLabel.setFont(mgmtLabel.getFont().deriveFont(mgmtLabel.getFont().getStyle() & ~Font.BOLD)); String pinpadPattern = getMessage(MESSAGE_VERIFYPIN_PINPAD); pinpadLabel.setText(MessageFormat.format(pinpadPattern, - new Object[] { pinSpec.getLocalizedName(), PINSIZE })); + new Object[] { pinSpec.getLocalizedName(), pinSpec.getLocalizedLength() })); pinHorizontal = mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(pinpadLabel); @@ -483,7 +478,7 @@ public class PINManagementGUI extends CardMgmtGUI implements PINManagementGUIFac 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, new Object[]{PINSIZE})); + pinsizeLabel.setText(MessageFormat.format(pinsizePattern, pinSpec.getLocalizedLength())); //////////////////////////////////////////////////////////////// // NON-PINPAD SPECIFIC LAYOUT SECTION -- cgit v1.2.3 From 6d515d832b0c0828a63d0b68d7823054543761ff Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 27 Aug 2009 20:32:15 +0000 Subject: [maven-release-plugin] prepare release mocca-1.2.4 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@479 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUGuiExt/pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'BKUGuiExt') diff --git a/BKUGuiExt/pom.xml b/BKUGuiExt/pom.xml index 517e17ee..d25cbb87 100644 --- a/BKUGuiExt/pom.xml +++ b/BKUGuiExt/pom.xml @@ -3,22 +3,22 @@ bku at.gv.egiz - 1.2.4-SNAPSHOT + 1.2.4 at.gv.egiz BKUGuiExt - 1.2.4-SNAPSHOT + 1.2.4 BKU GUI Extension at.gv.egiz STALXService - 1.2.4-SNAPSHOT + 1.2.4 at.gv.egiz smccSTAL - 1.2.4-SNAPSHOT + 1.2.4 \ No newline at end of file -- cgit v1.2.3 From 5eb05982f2e98f56569b4ea07b1961e3eed617d7 Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 27 Aug 2009 20:32:33 +0000 Subject: [maven-release-plugin] prepare for next development iteration git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@481 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUGuiExt/pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'BKUGuiExt') diff --git a/BKUGuiExt/pom.xml b/BKUGuiExt/pom.xml index d25cbb87..b4421309 100644 --- a/BKUGuiExt/pom.xml +++ b/BKUGuiExt/pom.xml @@ -3,22 +3,22 @@ bku at.gv.egiz - 1.2.4 + 1.2.5-SNAPSHOT at.gv.egiz BKUGuiExt - 1.2.4 + 1.2.5-SNAPSHOT BKU GUI Extension at.gv.egiz STALXService - 1.2.4 + 1.2.5-SNAPSHOT at.gv.egiz smccSTAL - 1.2.4 + 1.2.5-SNAPSHOT \ No newline at end of file -- cgit v1.2.3 From 44ee3259546bdcfbdc54563aa2766cce3f5cd704 Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 28 Aug 2009 20:13:07 +0000 Subject: [maven-release-plugin] prepare release mocca-1.2.3 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@488 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUGuiExt/pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'BKUGuiExt') diff --git a/BKUGuiExt/pom.xml b/BKUGuiExt/pom.xml index b4421309..d9a34ff5 100644 --- a/BKUGuiExt/pom.xml +++ b/BKUGuiExt/pom.xml @@ -3,22 +3,22 @@ bku at.gv.egiz - 1.2.5-SNAPSHOT + 1.2.5 at.gv.egiz BKUGuiExt - 1.2.5-SNAPSHOT + 1.2.5 BKU GUI Extension at.gv.egiz STALXService - 1.2.5-SNAPSHOT + 1.2.5 at.gv.egiz smccSTAL - 1.2.5-SNAPSHOT + 1.2.5 \ No newline at end of file -- cgit v1.2.3 From 68ebb57a05d44b25b886749719e7bd9997b0bd11 Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 28 Aug 2009 20:16:01 +0000 Subject: [maven-release-plugin] prepare for next development iteration git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@490 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUGuiExt/pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'BKUGuiExt') diff --git a/BKUGuiExt/pom.xml b/BKUGuiExt/pom.xml index d9a34ff5..d03d7ccb 100644 --- a/BKUGuiExt/pom.xml +++ b/BKUGuiExt/pom.xml @@ -3,22 +3,22 @@ bku at.gv.egiz - 1.2.5 + 1.2.6-SNAPSHOT at.gv.egiz BKUGuiExt - 1.2.5 + 1.2.6-SNAPSHOT BKU GUI Extension at.gv.egiz STALXService - 1.2.5 + 1.2.6-SNAPSHOT at.gv.egiz smccSTAL - 1.2.5 + 1.2.6-SNAPSHOT \ No newline at end of file -- cgit v1.2.3 From 025657248e87001b91a5eb90cdc24fb20bc2c62b Mon Sep 17 00:00:00 2001 From: mcentner Date: Wed, 9 Sep 2009 07:54:21 +0000 Subject: [maven-release-plugin] prepare release mocca-1.2.6 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@506 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUGuiExt/pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'BKUGuiExt') diff --git a/BKUGuiExt/pom.xml b/BKUGuiExt/pom.xml index d03d7ccb..6e2cf079 100644 --- a/BKUGuiExt/pom.xml +++ b/BKUGuiExt/pom.xml @@ -3,22 +3,22 @@ bku at.gv.egiz - 1.2.6-SNAPSHOT + 1.2.6 at.gv.egiz BKUGuiExt - 1.2.6-SNAPSHOT + 1.2.6 BKU GUI Extension at.gv.egiz STALXService - 1.2.6-SNAPSHOT + 1.2.6 at.gv.egiz smccSTAL - 1.2.6-SNAPSHOT + 1.2.6 \ No newline at end of file -- cgit v1.2.3 From ce450c6eee4977040072b5f51a91183c15846b1a Mon Sep 17 00:00:00 2001 From: mcentner Date: Wed, 9 Sep 2009 07:54:58 +0000 Subject: [maven-release-plugin] prepare for next development iteration git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@508 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUGuiExt/pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'BKUGuiExt') diff --git a/BKUGuiExt/pom.xml b/BKUGuiExt/pom.xml index 6e2cf079..b3220ede 100644 --- a/BKUGuiExt/pom.xml +++ b/BKUGuiExt/pom.xml @@ -3,22 +3,22 @@ bku at.gv.egiz - 1.2.6 + 1.2.7-SNAPSHOT at.gv.egiz BKUGuiExt - 1.2.6 + 1.2.7-SNAPSHOT BKU GUI Extension at.gv.egiz STALXService - 1.2.6 + 1.2.7-SNAPSHOT at.gv.egiz smccSTAL - 1.2.6 + 1.2.7-SNAPSHOT \ No newline at end of file -- cgit v1.2.3 From 390f6aab59c3fb7a9250d087dc9aec77b6bd865b Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 2 Oct 2009 17:56:27 +0000 Subject: [maven-release-plugin] prepare release mocca-1.2.7 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@519 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUGuiExt/pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'BKUGuiExt') diff --git a/BKUGuiExt/pom.xml b/BKUGuiExt/pom.xml index b3220ede..7510706f 100644 --- a/BKUGuiExt/pom.xml +++ b/BKUGuiExt/pom.xml @@ -3,22 +3,22 @@ bku at.gv.egiz - 1.2.7-SNAPSHOT + 1.2.7 at.gv.egiz BKUGuiExt - 1.2.7-SNAPSHOT + 1.2.7 BKU GUI Extension at.gv.egiz STALXService - 1.2.7-SNAPSHOT + 1.2.7 at.gv.egiz smccSTAL - 1.2.7-SNAPSHOT + 1.2.7 \ No newline at end of file -- cgit v1.2.3 From a47eafbbc567163f0319b066f65eaa7d2d9226c2 Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 2 Oct 2009 17:56:38 +0000 Subject: [maven-release-plugin] prepare for next development iteration git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@521 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUGuiExt/pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'BKUGuiExt') diff --git a/BKUGuiExt/pom.xml b/BKUGuiExt/pom.xml index 7510706f..2291d7d6 100644 --- a/BKUGuiExt/pom.xml +++ b/BKUGuiExt/pom.xml @@ -3,22 +3,22 @@ bku at.gv.egiz - 1.2.7 + 1.2.8-SNAPSHOT at.gv.egiz BKUGuiExt - 1.2.7 + 1.2.8-SNAPSHOT BKU GUI Extension at.gv.egiz STALXService - 1.2.7 + 1.2.8-SNAPSHOT at.gv.egiz smccSTAL - 1.2.7 + 1.2.8-SNAPSHOT \ No newline at end of file -- cgit v1.2.3 From e202da94b60691d3c1ba86f736ffb9367a49f7b5 Mon Sep 17 00:00:00 2001 From: tzefferer Date: Fri, 16 Oct 2009 09:54:59 +0000 Subject: Keyboard accessibility for Online-BKU git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@529 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../main/java/at/gv/egiz/bku/gui/ActivationGUI.java | 9 +++++---- .../main/java/at/gv/egiz/bku/gui/CardMgmtGUI.java | 5 +++-- .../java/at/gv/egiz/bku/gui/PINManagementGUI.java | 21 ++++++++++++++++----- .../java/at/gv/egiz/bku/gui/ActivationGuiTest.java | 2 +- 4 files changed, 25 insertions(+), 12 deletions(-) (limited to 'BKUGuiExt') diff --git a/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/ActivationGUI.java b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/ActivationGUI.java index c8927e1e..1a1426a5 100644 --- a/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/ActivationGUI.java +++ b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/ActivationGUI.java @@ -50,8 +50,9 @@ public class ActivationGUI extends CardMgmtGUI implements ActivationGUIFacade { Locale locale, Style guiStyle, URL backgroundImgURL, - AbstractHelpListener helpListener) { - super(contentPane, locale, guiStyle, backgroundImgURL, helpListener); + AbstractHelpListener helpListener, + SwitchFocusListener switchFocusListener) { + super(contentPane, locale, guiStyle, backgroundImgURL, helpListener, switchFocusListener); progressBar = new JProgressBar(); } @@ -84,7 +85,7 @@ public class ActivationGUI extends CardMgmtGUI implements ActivationGUIFacade { infoLabel.setText(cardmgmtMessages.getString(TITLE_ACTIVATION)); } - helpListener.setHelpTopic(HELP_ACTIVATION); + helpMouseListener.setHelpTopic(HELP_ACTIVATION); progressBar.setIndeterminate(false); progressBar.setStringPainted(true); @@ -187,7 +188,7 @@ public class ActivationGUI extends CardMgmtGUI implements ActivationGUIFacade { infoLabel.setText(cardmgmtMessages.getString(TITLE_ACTIVATION)); } - helpListener.setHelpTopic(HELP_ACTIVATION); + helpMouseListener.setHelpTopic(HELP_ACTIVATION); progressBar.setIndeterminate(true); progressBar.setStringPainted(true); diff --git a/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/CardMgmtGUI.java b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/CardMgmtGUI.java index c8e1826c..68b2a2ba 100644 --- a/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/CardMgmtGUI.java +++ b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/CardMgmtGUI.java @@ -38,8 +38,9 @@ public class CardMgmtGUI extends BKUGUIImpl { Locale locale, Style guiStyle, URL backgroundImgURL, - AbstractHelpListener helpListener) { - super(contentPane, locale, guiStyle, backgroundImgURL, helpListener); + AbstractHelpListener helpListener, + SwitchFocusListener switchFocusListener) { + super(contentPane, locale, guiStyle, backgroundImgURL, helpListener, switchFocusListener); } diff --git a/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINManagementGUI.java b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINManagementGUI.java index 9c698d79..12f032d8 100644 --- a/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINManagementGUI.java +++ b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINManagementGUI.java @@ -58,8 +58,9 @@ public class PINManagementGUI extends CardMgmtGUI implements PINManagementGUIFac Locale locale, Style guiStyle, URL backgroundImgURL, - AbstractHelpListener helpListener) { - super(contentPane, locale, guiStyle, backgroundImgURL, helpListener); + AbstractHelpListener helpListener, + SwitchFocusListener switchFocusListener) { + super(contentPane, locale, guiStyle, backgroundImgURL, helpListener, switchFocusListener); } @Override @@ -98,7 +99,9 @@ public class PINManagementGUI extends CardMgmtGUI implements PINManagementGUIFac mainPanel.removeAll(); buttonPanel.removeAll(); - helpListener.setHelpTopic(HELP_PINMGMT); + helpMouseListener.setHelpTopic(HELP_PINMGMT); + helpKeyListener.setHelpTopic(HELP_PINMGMT); + JLabel mgmtLabel = new JLabel(); mgmtLabel.setFont(mgmtLabel.getFont().deriveFont(mgmtLabel.getFont().getStyle() & ~java.awt.Font.BOLD)); @@ -187,8 +190,10 @@ public class PINManagementGUI extends CardMgmtGUI implements PINManagementGUIFac if (!renderHeaderPanel) { messageHorizontal .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE) + .addComponent(switchFocusDummyLabel) .addComponent(helpLabel); messageVertical + .addComponent(switchFocusDummyLabel) .addComponent(helpLabel); } @@ -225,6 +230,7 @@ public class PINManagementGUI extends CardMgmtGUI implements PINManagementGUIFac buttonPanelLayout.setHorizontalGroup(buttonHorizontal); buttonPanelLayout.setVerticalGroup(buttonVertical); + helpLabel.requestFocus(); contentPanel.validate(); } }); @@ -336,7 +342,8 @@ public class PINManagementGUI extends CardMgmtGUI implements PINManagementGUIFac mainPanel.removeAll(); buttonPanel.removeAll(); - helpListener.setHelpTopic(HELP_TOPIC); + helpMouseListener.setHelpTopic(HELP_TOPIC); + helpKeyListener.setHelpTopic(HELP_TOPIC); JLabel mgmtLabel = new JLabel(); if (retries < 0) { @@ -344,7 +351,8 @@ public class PINManagementGUI extends CardMgmtGUI implements PINManagementGUIFac } else { mgmtLabel.setFont(mgmtLabel.getFont().deriveFont(mgmtLabel.getFont().getStyle() | Font.BOLD)); mgmtLabel.setForeground(ERROR_COLOR); - helpListener.setHelpTopic(HELP_RETRY); + helpMouseListener.setHelpTopic(HELP_RETRY); + helpKeyListener.setHelpTopic(HELP_RETRY); } if (renderHeaderPanel) { @@ -370,8 +378,10 @@ public class PINManagementGUI extends CardMgmtGUI implements PINManagementGUIFac if (!renderHeaderPanel) { infoHorizontal .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE) + .addComponent(switchFocusDummyLabel) .addComponent(helpLabel); infoVertical + .addComponent(switchFocusDummyLabel) .addComponent(helpLabel); } @@ -628,6 +638,7 @@ public class PINManagementGUI extends CardMgmtGUI implements PINManagementGUIFac .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addGroup(pinVertical)); + helpLabel.requestFocus(); contentPanel.validate(); } diff --git a/BKUGuiExt/src/test/java/at/gv/egiz/bku/gui/ActivationGuiTest.java b/BKUGuiExt/src/test/java/at/gv/egiz/bku/gui/ActivationGuiTest.java index 49ae577b..fd562a21 100644 --- a/BKUGuiExt/src/test/java/at/gv/egiz/bku/gui/ActivationGuiTest.java +++ b/BKUGuiExt/src/test/java/at/gv/egiz/bku/gui/ActivationGuiTest.java @@ -42,7 +42,7 @@ public class ActivationGuiTest { Container contentPane = testFrame.getContentPane(); contentPane.setPreferredSize(new Dimension(152, 145)); // contentPane.setPreferredSize(new Dimension(300, 190)); - ActivationGUIFacade gui = new ActivationGUI(contentPane, null, BKUGUIFacade.Style.tiny, null, null); + ActivationGUIFacade gui = new ActivationGUI(contentPane, null, BKUGUIFacade.Style.tiny, null, null, null); BKUGUIWorker worker = new BKUGUIWorker(); worker.init(gui); testFrame.pack(); -- cgit v1.2.3 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 --- .../java/at/gv/egiz/bku/gui/ActivationGUI.java | 6 ++-- .../main/java/at/gv/egiz/bku/gui/CardMgmtGUI.java | 5 ++-- .../java/at/gv/egiz/bku/gui/PINManagementGUI.java | 4 ++- .../at/gv/egiz/bku/gui/PINManagementGUIFacade.java | 1 - .../java/at/gv/egiz/bku/gui/ActivationGuiTest.java | 3 +- .../test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java | 1 - .../java/at/gv/egiz/bku/gui/DummyFontLoader.java | 35 ++++++++++++++++++++++ 7 files changed, 45 insertions(+), 10 deletions(-) create mode 100644 BKUGuiExt/src/test/java/at/gv/egiz/bku/gui/DummyFontLoader.java (limited to 'BKUGuiExt') 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 1a1426a5..37f30340 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 @@ -16,14 +16,13 @@ */ package at.gv.egiz.bku.gui; -import at.gv.egiz.bku.gui.*; +import at.gv.egiz.bku.gui.viewer.FontProvider; import java.awt.Container; import java.awt.Cursor; import java.awt.event.ActionListener; import java.net.URL; import java.text.MessageFormat; import java.util.Locale; -import java.util.ResourceBundle; import javax.swing.GroupLayout; import javax.swing.JButton; import javax.swing.JLabel; @@ -50,9 +49,10 @@ public class ActivationGUI extends CardMgmtGUI implements ActivationGUIFacade { Locale locale, Style guiStyle, URL backgroundImgURL, + FontProvider fontProvider, AbstractHelpListener helpListener, SwitchFocusListener switchFocusListener) { - super(contentPane, locale, guiStyle, backgroundImgURL, helpListener, switchFocusListener); + super(contentPane, locale, guiStyle, backgroundImgURL, fontProvider, helpListener, switchFocusListener); progressBar = new JProgressBar(); } 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 68b2a2ba..98f44d55 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 @@ -17,7 +17,7 @@ package at.gv.egiz.bku.gui; -import at.gv.egiz.bku.gui.*; +import at.gv.egiz.bku.gui.viewer.FontProvider; import java.awt.Container; import java.net.URL; import java.util.Locale; @@ -38,9 +38,10 @@ public class CardMgmtGUI extends BKUGUIImpl { Locale locale, Style guiStyle, URL backgroundImgURL, + FontProvider fontProvider, AbstractHelpListener helpListener, SwitchFocusListener switchFocusListener) { - super(contentPane, locale, guiStyle, backgroundImgURL, helpListener, switchFocusListener); + super(contentPane, locale, guiStyle, backgroundImgURL, fontProvider, helpListener, switchFocusListener); } diff --git a/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINManagementGUI.java b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINManagementGUI.java index 12f032d8..6699554e 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 @@ -17,6 +17,7 @@ package at.gv.egiz.bku.gui; +import at.gv.egiz.bku.gui.viewer.FontProvider; import at.gv.egiz.smcc.PINSpec; import java.awt.Container; import java.awt.Cursor; @@ -58,9 +59,10 @@ public class PINManagementGUI extends CardMgmtGUI implements PINManagementGUIFac Locale locale, Style guiStyle, URL backgroundImgURL, + FontProvider fontProvider, AbstractHelpListener helpListener, SwitchFocusListener switchFocusListener) { - super(contentPane, locale, guiStyle, backgroundImgURL, helpListener, switchFocusListener); + super(contentPane, locale, guiStyle, backgroundImgURL, fontProvider, helpListener, switchFocusListener); } @Override 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 297173d9..f99bcfd1 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,7 +17,6 @@ package at.gv.egiz.bku.gui; -import at.gv.egiz.bku.gui.*; import at.gv.egiz.smcc.PINSpec; import java.awt.event.ActionListener; import java.util.Map; diff --git a/BKUGuiExt/src/test/java/at/gv/egiz/bku/gui/ActivationGuiTest.java b/BKUGuiExt/src/test/java/at/gv/egiz/bku/gui/ActivationGuiTest.java index fd562a21..cb05e5f1 100644 --- a/BKUGuiExt/src/test/java/at/gv/egiz/bku/gui/ActivationGuiTest.java +++ b/BKUGuiExt/src/test/java/at/gv/egiz/bku/gui/ActivationGuiTest.java @@ -21,7 +21,6 @@ package at.gv.egiz.bku.gui; -import at.gv.egiz.bku.gui.*; import java.awt.Container; import java.awt.Dimension; import javax.swing.JFrame; @@ -42,7 +41,7 @@ public class ActivationGuiTest { Container contentPane = testFrame.getContentPane(); contentPane.setPreferredSize(new Dimension(152, 145)); // contentPane.setPreferredSize(new Dimension(300, 190)); - ActivationGUIFacade gui = new ActivationGUI(contentPane, null, BKUGUIFacade.Style.tiny, null, null, null); + ActivationGUIFacade gui = new ActivationGUI(contentPane, null, BKUGUIFacade.Style.tiny, null, new DummyFontLoader(), null, null); BKUGUIWorker worker = new BKUGUIWorker(); worker.init(gui); testFrame.pack(); 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 74ea8952..b01abe72 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,6 @@ */ package at.gv.egiz.bku.gui; -import at.gv.egiz.bku.gui.*; import at.gv.egiz.smcc.PINSpec; import at.gv.egiz.stal.HashDataInput; import at.gv.egiz.stal.impl.ByteArrayHashDataInput; diff --git a/BKUGuiExt/src/test/java/at/gv/egiz/bku/gui/DummyFontLoader.java b/BKUGuiExt/src/test/java/at/gv/egiz/bku/gui/DummyFontLoader.java new file mode 100644 index 00000000..87d67adc --- /dev/null +++ b/BKUGuiExt/src/test/java/at/gv/egiz/bku/gui/DummyFontLoader.java @@ -0,0 +1,35 @@ +/* + * 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.bku.gui.viewer.FontProviderException; +import at.gv.egiz.bku.gui.viewer.FontProvider; +import java.awt.Font; + +/** + * + * @author Clemens Orthacker + */ +public class DummyFontLoader implements FontProvider { + + @Override + public Font getFont() throws FontProviderException { + return new Font("monospaced", Font.PLAIN, 10); + } + +} -- cgit v1.2.3 From 68651bf67987905980734f5c2199f337a232f427 Mon Sep 17 00:00:00 2001 From: mcentner Date: Thu, 12 Nov 2009 20:48:57 +0000 Subject: Added support for enforcing a PIN length in a CHANGE REFERENCE DATA to match the recommended PIN length via Applet parameter. git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@541 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../java/at/gv/egiz/bku/gui/PINManagementGUI.java | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'BKUGuiExt') 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 6699554e..5bbed096 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 @@ -436,14 +436,14 @@ public class PINManagementGUI extends CardMgmtGUI implements PINManagementGUIFac }); if (type != DIALOG.VERIFY) { - pinField.setDocument(new PINDocument(pinSpec, null)); + pinField.setDocument( + new PINDocument(pinSpec.getRecMinLength(), pinSpec.getRecMaxLength(), pinSpec.getRexepPattern(), null)); 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.setDocument(new PINDocument(pinSpec, okButton, pinField.getDocument())); repeatPinField.setActionCommand(okCommand); repeatPinField.addActionListener(new ActionListener() { @@ -463,7 +463,8 @@ public class PINManagementGUI extends CardMgmtGUI implements PINManagementGUIFac oldPinField = new JPasswordField(); oldPinField.setText(""); - oldPinField.setDocument(new PINDocument(pinSpec, null)); + oldPinField.setDocument( + new PINDocument(pinSpec.getMinLength(), pinSpec.getMaxLength(), pinSpec.getRexepPattern(), null)); oldPinField.setActionCommand(okCommand); oldPinField.addActionListener(new ActionListener() { @@ -475,16 +476,18 @@ public class PINManagementGUI extends CardMgmtGUI implements PINManagementGUIFac } }); - repeatPinField.setDocument(new PINDocument( - pinSpec, okButton, - pinField.getDocument(), oldPinField.getDocument())); + repeatPinField.setDocument( + new PINDocument(pinSpec.getRecMinLength(), pinSpec.getRecMaxLength(), pinSpec.getRexepPattern(), + okButton, pinField.getDocument(), oldPinField.getDocument())); } else { // else -> ACTIVATE (not verify, not change) - repeatPinField.setDocument(new PINDocument( - pinSpec, okButton, pinField.getDocument())); + repeatPinField.setDocument( + new PINDocument(pinSpec.getRecMinLength(), pinSpec.getRecMaxLength(), pinSpec.getRexepPattern(), + okButton, pinField.getDocument())); } } else { - pinField.setDocument(new PINDocument(pinSpec, okButton)); + pinField.setDocument( + new PINDocument(pinSpec.getMinLength(), pinSpec.getMaxLength(), pinSpec.getRexepPattern(), okButton)); } JLabel pinsizeLabel = new JLabel(); -- cgit v1.2.3 From 04f0881563fdbecd8223627a7752e27690cc99c2 Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 13 Nov 2009 16:18:32 +0000 Subject: [maven-release-plugin] prepare release mocca-1.2.8 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@549 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUGuiExt/pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'BKUGuiExt') diff --git a/BKUGuiExt/pom.xml b/BKUGuiExt/pom.xml index 2291d7d6..3735e870 100644 --- a/BKUGuiExt/pom.xml +++ b/BKUGuiExt/pom.xml @@ -3,22 +3,22 @@ bku at.gv.egiz - 1.2.8-SNAPSHOT + 1.2.8 at.gv.egiz BKUGuiExt - 1.2.8-SNAPSHOT + 1.2.8 BKU GUI Extension at.gv.egiz STALXService - 1.2.8-SNAPSHOT + 1.2.8 at.gv.egiz smccSTAL - 1.2.8-SNAPSHOT + 1.2.8 \ No newline at end of file -- cgit v1.2.3 From 8814f7675055585933d8dae365cf3a95906fac05 Mon Sep 17 00:00:00 2001 From: clemenso Date: Wed, 18 Nov 2009 17:04:48 +0000 Subject: [maven-release-plugin] prepare for next development iteration git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@551 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUGuiExt/pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'BKUGuiExt') diff --git a/BKUGuiExt/pom.xml b/BKUGuiExt/pom.xml index 3735e870..29e01aed 100644 --- a/BKUGuiExt/pom.xml +++ b/BKUGuiExt/pom.xml @@ -3,22 +3,22 @@ bku at.gv.egiz - 1.2.8 + 1.2.9-SNAPSHOT at.gv.egiz BKUGuiExt - 1.2.8 + 1.2.9-SNAPSHOT BKU GUI Extension at.gv.egiz STALXService - 1.2.8 + 1.2.9-SNAPSHOT at.gv.egiz smccSTAL - 1.2.8 + 1.2.9-SNAPSHOT \ No newline at end of file -- cgit v1.2.3 From 78d71d9db6ee7b4b900ee66a1b0c05f381d6b894 Mon Sep 17 00:00:00 2001 From: clemenso Date: Wed, 25 Nov 2009 11:05:31 +0000 Subject: Filenames derived from reference URI git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@554 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUGuiExt/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'BKUGuiExt') 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 b01abe72..b9c0e5f8 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 @@ -81,25 +81,29 @@ public class BKUGUIWorker implements Runnable { "Ich bin ein einfacher Text mit Umlauten: öäüßéç@€\n123\n456\n\tHello, world!\n\nlkjsd\nnksdjf".getBytes(), "ref-id-0000000000000000000000001", "text/plain", - "UTF-8"); + "UTF-8", + "filename.txt"); HashDataInput signedRef2 = new ByteArrayHashDataInput( "HashDataInput_002".getBytes(), "ref-id-000000002", "application/xhtml+xml", - "UTF-8"); + "UTF-8", + "filename.xhtml"); HashDataInput signedRef3 = new ByteArrayHashDataInput( "HashDataInput_003".getBytes(), "ref-id-000000003", "application/xhtml+xml", - "UTF-8"); + "UTF-8", + "filename.xhtml"); HashDataInput signedRef4 = new ByteArrayHashDataInput( "HashDataInput_004".getBytes(), "ref-id-000000004", "text/xml", - "UTF-8"); + "UTF-8", + "filename.xml"); // List signedRefs = new ArrayList(); -- cgit v1.2.3 From ceeaeb1790d1ed1ef9565f7c47e8bf247a83f28c Mon Sep 17 00:00:00 2001 From: clemenso Date: Wed, 2 Dec 2009 09:19:40 +0000 Subject: [maven-release-plugin] prepare release mocca-1.2.9 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@558 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUGuiExt/pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'BKUGuiExt') diff --git a/BKUGuiExt/pom.xml b/BKUGuiExt/pom.xml index 29e01aed..ccf1567f 100644 --- a/BKUGuiExt/pom.xml +++ b/BKUGuiExt/pom.xml @@ -3,22 +3,22 @@ bku at.gv.egiz - 1.2.9-SNAPSHOT + 1.2.9 at.gv.egiz BKUGuiExt - 1.2.9-SNAPSHOT + 1.2.9 BKU GUI Extension at.gv.egiz STALXService - 1.2.9-SNAPSHOT + 1.2.9 at.gv.egiz smccSTAL - 1.2.9-SNAPSHOT + 1.2.9 \ No newline at end of file -- cgit v1.2.3 From f03ce51929e344a92d04aeb4bba473ae47a913b2 Mon Sep 17 00:00:00 2001 From: clemenso Date: Wed, 2 Dec 2009 09:23:50 +0000 Subject: [maven-release-plugin] prepare for next development iteration git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@560 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUGuiExt/pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'BKUGuiExt') diff --git a/BKUGuiExt/pom.xml b/BKUGuiExt/pom.xml index ccf1567f..1d918331 100644 --- a/BKUGuiExt/pom.xml +++ b/BKUGuiExt/pom.xml @@ -3,22 +3,22 @@ bku at.gv.egiz - 1.2.9 + 1.2.10-SNAPSHOT at.gv.egiz BKUGuiExt - 1.2.9 + 1.2.10-SNAPSHOT BKU GUI Extension at.gv.egiz STALXService - 1.2.9 + 1.2.10-SNAPSHOT at.gv.egiz smccSTAL - 1.2.9 + 1.2.10-SNAPSHOT \ No newline at end of file -- cgit v1.2.3 From 3da4655d011dfc2f04f9e4ac28b38aee42d01bc0 Mon Sep 17 00:00:00 2001 From: clemenso Date: Tue, 5 Jan 2010 10:06:47 +0000 Subject: Features [#437] Handle pinpad [64:03] response apdu correctly [#445] pin entry feedback for VERIFY_PIN_START/FINISH [#471] Provide SecureViewer Link before Pinpad PinEntry timeout starts Bugs [#479] PIN Managment Applet allows unmatching new pin and pin confirmation [#480] PIN Management displays blocked PINs as ACTIVE [#486] Not possible to select 3 times in series the same item from signedReferencesList for display in secureViewer [#506] change pin dialog (gui) issues [#508] e-card G3 PIN activation (with TransportPIN) not supported [#509] closing secure viewer window (WINDOW_CLOSING) leaves "signature data is displayed in viewer" dialog in applet git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@565 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../at/gv/egiz/bku/gui/ComparePinDocument.java | 102 +++++++++++++ .../at/gv/egiz/bku/gui/ExtendedPinDocument.java | 108 ++++++++++++++ .../java/at/gv/egiz/bku/gui/PINManagementGUI.java | 163 ++++++++++++++++----- .../at/gv/egiz/bku/gui/PINManagementGUIFacade.java | 66 +++++---- .../gv/egiz/bku/gui/ActivationMessages.properties | 36 +++-- .../egiz/bku/gui/ActivationMessages_en.properties | 34 +++-- 6 files changed, 421 insertions(+), 88 deletions(-) create mode 100644 BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/ComparePinDocument.java create mode 100644 BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/ExtendedPinDocument.java (limited to 'BKUGuiExt') diff --git a/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/ComparePinDocument.java b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/ComparePinDocument.java new file mode 100644 index 00000000..623f6fad --- /dev/null +++ b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/ComparePinDocument.java @@ -0,0 +1,102 @@ +/* + * 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.util.regex.Matcher; +import java.util.regex.Pattern; +import javax.swing.JButton; +import javax.swing.text.AttributeSet; +import javax.swing.text.BadLocationException; +import javax.swing.text.Document; +import javax.swing.text.PlainDocument; + +/** + * Checks if the pin confirmation (compareTo) corresponds to this pin. + * Additionally, checks if currentPIN (optional) meets the requirements before enabling the OK button. + * @author clemens + */ +class ComparePinDocument extends PlainDocument { + + private static final long serialVersionUID = 1L; + protected Pattern pinPattern; + protected int minLength; + protected int maxLength; + protected JButton enterButton; + protected Document compareTo; + protected Document currentPIN; + + /** + * Constructor without compareTo Document parameter (allow null and set later to avoid cyclic dependencies) + */ + public ComparePinDocument(int minLength, int maxLength, String pattern, JButton enterButton) { + if (enterButton == null) { + throw new NullPointerException("OK button null"); + } + if (pattern != null) { + pinPattern = Pattern.compile(pattern); + } else { + pinPattern = Pattern.compile("."); + } + this.minLength = minLength; + this.maxLength = maxLength; + this.enterButton = enterButton; + } + + /** + * @param compareTo should not be null (allow null and set later to avoid cyclic dependencies) + */ + public ComparePinDocument(int minLength, int maxLength, String pattern, + JButton enterButton, Document compareTo) { + this(minLength, maxLength, pattern, enterButton); + this.compareTo = compareTo; + } + + public ComparePinDocument(int minLength, int maxLength, String pattern, + JButton enterButton, Document compareTo, Document currentPIN) { + this(minLength, maxLength, pattern, enterButton, compareTo); + this.currentPIN = currentPIN; + } + + @Override + public void insertString(int offs, String str, AttributeSet a) throws BadLocationException { + if (maxLength < 0 || maxLength >= (getLength() + str.length())) { + boolean matches = true; + for (int i = 0; i < str.length(); i++) { + Matcher m = pinPattern.matcher(str.substring(i, i + 1)); + if (!m.matches()) { + matches = false; + } + } + if (matches) { + super.insertString(offs, str, a); + enterButton.setEnabled( + getLength() >= minLength + && (currentPIN == null || currentPIN.getLength() >= minLength) + && compareTo.getText(0, compareTo.getLength()).equals(getText(0, getLength()))); + } + } + } + + @Override + public void remove(int offs, int len) throws BadLocationException { + super.remove(offs, len); + enterButton.setEnabled( + getLength() >= minLength + && (currentPIN == null || currentPIN.getLength() >= minLength) + && compareTo.getText(0, compareTo.getLength()).equals(getText(0, getLength()))); + } +} diff --git a/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/ExtendedPinDocument.java b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/ExtendedPinDocument.java new file mode 100644 index 00000000..3a0d7a66 --- /dev/null +++ b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/ExtendedPinDocument.java @@ -0,0 +1,108 @@ +/* + * 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.util.regex.Matcher; +import java.util.regex.Pattern; +import javax.swing.JButton; +import javax.swing.text.AttributeSet; +import javax.swing.text.BadLocationException; +import javax.swing.text.Document; +import javax.swing.text.PlainDocument; + +/** + * This PINDocument also checks if the additional (optional) pinDocuments also meet the requirements + * to enable the OK button. + * Checks if (optional) newPIN and confirmPIN correspond + * + * @author clemens + */ +class ExtendedPinDocument extends PlainDocument { + + private static final long serialVersionUID = 1L; + protected Pattern pinPattern; + protected int minLength; + protected int maxLength; + protected JButton enterButton; + protected Document newPIN; + protected Document confirmPIN; + + public ExtendedPinDocument(int minLength, int maxLength, String pattern, JButton enterButton) { + if (enterButton == null) { + throw new NullPointerException("OK Button null"); + } + if (pattern != null) { + pinPattern = Pattern.compile(pattern); + } else { + pinPattern = Pattern.compile("."); + } + this.minLength = minLength; + this.maxLength = maxLength; + this.enterButton = enterButton; + } + + /** + * @param pinSpec + * @param enterButton + * @param newPIN, confirmPIN + */ + public ExtendedPinDocument(int minLength, int maxLength, String pattern, JButton enterButton, Document newPIN, Document confirmPIN) { + this(minLength, maxLength, pattern, enterButton); + this.newPIN = newPIN; + this.confirmPIN = confirmPIN; + } + + @Override + public void insertString(int offs, String str, AttributeSet a) throws BadLocationException { + if (maxLength < 0 || maxLength >= (getLength() + str.length())) { + boolean matches = true; + for (int i = 0; i < str.length(); i++) { + Matcher m = pinPattern.matcher(str.substring(i, i + 1)); + if (!m.matches()) { + matches = false; + } + } + if (matches) { + super.insertString(offs, str, a); + enterButton.setEnabled( + getLength() >= minLength + && (newPIN == null || newPIN.getLength() >= minLength) + && (confirmPIN == null || compare())); + } + } + } + + @Override + public void remove(int offs, int len) throws BadLocationException { + super.remove(offs, len); + enterButton.setEnabled( + getLength() >= minLength + && (newPIN == null || newPIN.getLength() >= minLength) + && (confirmPIN == null || compare())); + } + + /** + * assume confirmPIN != null + * @return + */ + private boolean compare() throws BadLocationException { + if (newPIN != null) { + return confirmPIN.getText(0, confirmPIN.getLength()).equals(newPIN.getText(0, newPIN.getLength())); + } + return false; + } +} 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 5bbed096..4dcc388f 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 @@ -239,23 +239,7 @@ public class PINManagementGUI extends CardMgmtGUI implements PINManagementGUIFac } @Override - public void showPINDialog(DIALOG type, PINSpec pinSpec, - ActionListener okListener, String okCommand, - ActionListener cancelListener, String cancelCommand) { - showPINDialog(type, pinSpec, -1, false, - okListener, okCommand, cancelListener, cancelCommand); - } - - @Override - public void showPINDialog(DIALOG type, PINSpec pinSpec, int retries, - ActionListener okListener, String okCommand, - ActionListener cancelListener, String cancelCommand) { - showPINDialog(type, pinSpec, retries, false, - okListener, okCommand, cancelListener, cancelCommand); - } - - @Override - public void showPinpadPINDialog(DIALOG type, PINSpec pinSpec, int retries) { + public void showModifyPINDirect(DIALOG type, PINSpec pinSpec, int retries) { String title, msg; Object[] params; if (retries < 0) { @@ -269,19 +253,19 @@ public class PINManagementGUI extends CardMgmtGUI implements PINManagementGUIFac if (type == DIALOG.CHANGE) { log.debug("show change pin dialog"); title = TITLE_CHANGE_PIN; - msg = MESSAGE_CHANGEPIN_PINPAD; + msg = MESSAGE_CHANGE_PINPAD_DIREKT; } else if (type == DIALOG.ACTIVATE) { log.debug("show activate pin dialog"); title = TITLE_ACTIVATE_PIN; - msg = MESSAGE_ENTERPIN_PINPAD; + msg = MESSAGE_ACTIVATE_PINPAD_DIREKT; } else if (type == DIALOG.VERIFY) { log.debug("show verify pin dialog"); - title = TITLE_VERIFY_PIN; - msg = MESSAGE_ENTERPIN_PINPAD; + title = TITLE_VERIFY_PINPAD; + msg = MESSAGE_ENTERPIN_PINPAD_DIRECT; } else { log.debug("show unblock pin dialog"); title = TITLE_UNBLOCK_PIN; - msg = MESSAGE_ENTERPIN_PINPAD; + msg = MESSAGE_UNBLOCK_PINPAD_DIREKT; } } else { @@ -294,6 +278,15 @@ public class PINManagementGUI extends CardMgmtGUI implements PINManagementGUIFac showMessageDialog(title, msg, params); } + @Override + public void showPINDialog(DIALOG type, PINSpec pinSpec, int retries, + ActionListener okListener, String okCommand, + ActionListener cancelListener, String cancelCommand) { + showPINDialog(type, pinSpec, retries, false, + okListener, okCommand, cancelListener, cancelCommand); + } + + private void showPINDialog(final DIALOG type, final PINSpec pinSpec, final int retries, final boolean pinpad, final ActionListener okListener, final String okCommand, @@ -322,7 +315,7 @@ public class PINManagementGUI extends CardMgmtGUI implements PINManagementGUIFac } else if (type == DIALOG.VERIFY) { log.debug("show verify pin dialog"); TITLE = TITLE_VERIFY_PIN; - MESSAGE_MGMT = MESSAGE_VERIFY_PIN; + MESSAGE_MGMT = MESSAGE_ENTERPIN; } else { log.debug("show unblock pin dialog"); TITLE = TITLE_UNBLOCK_PIN; @@ -393,7 +386,7 @@ public class PINManagementGUI extends CardMgmtGUI implements PINManagementGUIFac if (pinpad) { JLabel pinpadLabel = new JLabel(); pinpadLabel.setFont(mgmtLabel.getFont().deriveFont(mgmtLabel.getFont().getStyle() & ~Font.BOLD)); - String pinpadPattern = getMessage(MESSAGE_VERIFYPIN_PINPAD); + String pinpadPattern = getMessage(MESSAGE_ENTERPIN_PINPAD); pinpadLabel.setText(MessageFormat.format(pinpadPattern, new Object[] { pinSpec.getLocalizedName(), pinSpec.getLocalizedLength() })); @@ -403,7 +396,7 @@ public class PINManagementGUI extends CardMgmtGUI implements PINManagementGUIFac .addComponent(pinpadLabel); } else { - JButton okButton = new JButton(); + 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); @@ -414,7 +407,7 @@ public class PINManagementGUI extends CardMgmtGUI implements PINManagementGUIFac JLabel repeatPinLabel = null; JLabel pinLabel = new JLabel(); pinLabel.setFont(pinLabel.getFont().deriveFont(pinLabel.getFont().getStyle() & ~Font.BOLD)); - String pinLabelPattern = (type == DIALOG.CHANGE) ? getMessage(LABEL_NEW_PIN) : getMessage(LABEL_PIN); + 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(); @@ -436,8 +429,6 @@ public class PINManagementGUI extends CardMgmtGUI implements PINManagementGUIFac }); if (type != DIALOG.VERIFY) { - pinField.setDocument( - new PINDocument(pinSpec.getRecMinLength(), pinSpec.getRecMaxLength(), pinSpec.getRexepPattern(), null)); repeatPinLabel = new JLabel(); repeatPinLabel.setFont(pinLabel.getFont()); String repeatPinLabelPattern = getMessage(LABEL_REPEAT_PIN); @@ -449,22 +440,20 @@ public class PINManagementGUI extends CardMgmtGUI implements PINManagementGUIFac @Override public void actionPerformed(ActionEvent e) { - if (pinField.getPassword().length >= pinSpec.getMinLength()) { + if (okButton.isEnabled()) { okListener.actionPerformed(e); } } }); - if (type == DIALOG.CHANGE) { + 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(LABEL_OLD_PIN); + 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.setDocument( - new PINDocument(pinSpec.getMinLength(), pinSpec.getMaxLength(), pinSpec.getRexepPattern(), null)); oldPinField.setActionCommand(okCommand); oldPinField.addActionListener(new ActionListener() { @@ -476,16 +465,45 @@ public class PINManagementGUI extends CardMgmtGUI implements PINManagementGUIFac } }); - repeatPinField.setDocument( - new PINDocument(pinSpec.getRecMinLength(), pinSpec.getRecMaxLength(), pinSpec.getRexepPattern(), - okButton, pinField.getDocument(), oldPinField.getDocument())); + 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) - repeatPinField.setDocument( - new PINDocument(pinSpec.getRecMinLength(), pinSpec.getRecMaxLength(), pinSpec.getRexepPattern(), - okButton, pinField.getDocument())); + 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)); } @@ -534,7 +552,7 @@ public class PINManagementGUI extends CardMgmtGUI implements PINManagementGUIFac // } else { - if (type == DIALOG.CHANGE) { + if (type == DIALOG.CHANGE || type == DIALOG.UNBLOCK) { pinHorizontal .addGroup(mainPanelLayout.createSequentialGroup() .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING) @@ -675,4 +693,69 @@ public class PINManagementGUI extends CardMgmtGUI implements PINManagementGUIFac return bs; } + @Override + public void showEnterCurrentPIN(DIALOG type, PINSpec 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) { + String title, message; + if (type == PINManagementGUIFacade.DIALOG.ACTIVATE) { + title = PINManagementGUIFacade.TITLE_ACTIVATE_PIN; + message = PINManagementGUIFacade.MESSAGE_ACTIVATE_PINPAD_NEW; + } else if (type == PINManagementGUIFacade.DIALOG.CHANGE) { + title = PINManagementGUIFacade.TITLE_CHANGE_PIN; + message = PINManagementGUIFacade.MESSAGE_CHANGE_PINPAD_NEW; + } else if (type == DIALOG.UNBLOCK) { + title = PINManagementGUIFacade.TITLE_UNBLOCK_PIN; + message = PINManagementGUIFacade.MESSAGE_UNBLOCK_PINPAD_NEW; + } else { + log.error("enterNewPIN not supported for dialog type " + type); + showErrorDialog(ERR_UNKNOWN, null); + return; + } + showEnterPIN(pinSpec, -1, title, message, null); + } + + @Override + public void showConfirmNewPIN(DIALOG type, PINSpec pinSpec) { + String title, message; + if (type == PINManagementGUIFacade.DIALOG.ACTIVATE) { + title = PINManagementGUIFacade.TITLE_ACTIVATE_PIN; + message = PINManagementGUIFacade.MESSAGE_ACTIVATE_PINPAD_CONFIRM; + } else if (type == PINManagementGUIFacade.DIALOG.CHANGE) { + title = PINManagementGUIFacade.TITLE_CHANGE_PIN; + message = PINManagementGUIFacade.MESSAGE_CHANGE_PINPAD_CONFIRM; + } else if (type == DIALOG.UNBLOCK) { + title = PINManagementGUIFacade.TITLE_UNBLOCK_PIN; + message = PINManagementGUIFacade.MESSAGE_UNBLOCK_PINPAD_CONFIRM; + } else { + log.error("enterNewPIN not supported for dialog type " + type); + showErrorDialog(ERR_UNKNOWN, null); + return; + } + showEnterPIN(pinSpec, -1, title, message, null); + } + } 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 f99bcfd1..46ae18b9 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 @@ -32,26 +32,39 @@ public interface PINManagementGUIFacade extends BKUGUIFacade { public static final String TITLE_PINMGMT = "title.pin.mgmt"; public static final String TITLE_ACTIVATE_PIN = "title.activate.pin"; public static final String TITLE_CHANGE_PIN = "title.change.pin"; - public static final String TITLE_VERIFY_PIN = "title.verify.pin"; +// public static final String TITLE_VERIFY_PIN = "title.verify.pin"; public static final String TITLE_UNBLOCK_PIN = "title.unblock.pin"; public static final String TITLE_ACTIVATE_SUCCESS = "title.activate.success"; + public static final String TITLE_UNBLOCK_SUCCESS = "title.unblock.success"; public static final String TITLE_CHANGE_SUCCESS = "title.change.success"; // removed message.* prefix to reuse keys as help keys public static final String MESSAGE_ACTIVATE_SUCCESS = "activate.success"; public static final String MESSAGE_CHANGE_SUCCESS = "change.success"; + public static final String MESSAGE_UNBLOCK_SUCCESS = "unblock.success"; public static final String MESSAGE_PINMGMT = "pin.mgmt"; // public static final String MESSAGE_PINPAD = "pinpad"; + public static final String MESSAGE_ACTIVATE_PIN = "activate.pin"; public static final String MESSAGE_CHANGE_PIN = "change.pin"; - public static final String MESSAGE_VERIFY_PIN = "verify.pin"; public static final String MESSAGE_UNBLOCK_PIN = "unblock.pin"; - public static final String MESSAGE_ACTIVATEPIN_PINPAD = "activate.pinpad"; - public static final String MESSAGE_CHANGEPIN_PINPAD = "change.pinpad"; - public static final String MESSAGE_VERIFYPIN_PINPAD = "verify.pinpad"; - public static final String MESSAGE_UNBLOCKPIN_PINPAD = "unblock.pinpad"; + + public static final String MESSAGE_ACTIVATE_PINPAD_CURRENT = "activate.pinpad.current"; + public static final String MESSAGE_CHANGE_PINPAD_CURRENT = "change.pinpad.current"; + public static final String MESSAGE_UNBLOCK_PINPAD_CURRENT = "unblock.pinpad.current"; + public static final String MESSAGE_ACTIVATE_PINPAD_NEW = "activate.pinpad.new"; + public static final String MESSAGE_CHANGE_PINPAD_NEW = "change.pinpad.new"; + public static final String MESSAGE_UNBLOCK_PINPAD_NEW = "unblock.pinpad.new"; + public static final String MESSAGE_ACTIVATE_PINPAD_CONFIRM = "activate.pinpad.confirm"; + public static final String MESSAGE_CHANGE_PINPAD_CONFIRM = "change.pinpad.confirm"; + public static final String MESSAGE_UNBLOCK_PINPAD_CONFIRM = "unblock.pinpad.confirm"; + + public static final String MESSAGE_ACTIVATE_PINPAD_DIREKT = "activate.pinpad.direct"; + public static final String MESSAGE_CHANGE_PINPAD_DIREKT = "change.pinpad.direct"; + public static final String MESSAGE_UNBLOCK_PINPAD_DIREKT = "unblock.pinpad.direct"; public static final String LABEL_OLD_PIN = "label.old.pin"; + public static final String LABEL_PUK = "label.puk"; public static final String LABEL_NEW_PIN = "label.new.pin"; public static final String LABEL_REPEAT_PIN = "label.repeat.pin"; @@ -81,35 +94,34 @@ public interface PINManagementGUIFacade extends BKUGUIFacade { public enum STATUS { ACTIV, NOT_ACTIV, BLOCKED, UNKNOWN }; public enum DIALOG { VERIFY, ACTIVATE, CHANGE, UNBLOCK }; + /** + * list pins + */ public void showPINManagementDialog(Map pins, ActionListener activateListener, String activateCmd, String changeCmd, String unblockCmd, String verifyCmd, ActionListener cancelListener, String cancelCmd); - public void showPINDialog(DIALOG type, PINSpec pin, + /** + * "software" pin-entry dialog (activate, change, unblock, verify) + */ + public void showPINDialog(DIALOG type, PINSpec pinSpec, int retries, ActionListener okListener, String okCmd, ActionListener cancelListener, String cancelCmd); - public void showPINDialog(DIALOG type, PINSpec pin, int retries, - ActionListener okListener, String okCmd, - ActionListener cancelListener, String cancelCmd); + /** + * direct pinpad pin-entry dialog + */ + public void showModifyPINDirect(DIALOG type, PINSpec pinSpec, int retries); + + /** + * start/finish pinpad pin-entry dialog + */ + public void showEnterCurrentPIN(DIALOG type, PINSpec pinSpec, int retries); + + public void showEnterNewPIN(DIALOG type, PINSpec pinSpec); + + public void showConfirmNewPIN(DIALOG type, PINSpec pinSpec); - public void showPinpadPINDialog(DIALOG type, PINSpec pin, int retries); - -// public void showActivatePINDialog(PINSpec pin, -// ActionListener okListener, String okCmd, -// ActionListener cancelListener, String cancelCmd); -// -// public void showChangePINDialog(PINSpec pin, -// ActionListener okListener, String okCmd, -// ActionListener cancelListener, String cancelCmd); -// -// public void showUnblockPINDialog(PINSpec pin, -// ActionListener okListener, String okCmd, -// ActionListener cancelListener, String cancelCmd); -// -// public void showVerifyPINDialog(PINSpec pin, -// ActionListener okListener, String okCmd, -// ActionListener cancelListener, String cancelCmd); public char[] getOldPin(); diff --git a/BKUGuiExt/src/main/resources/at/gv/egiz/bku/gui/ActivationMessages.properties b/BKUGuiExt/src/main/resources/at/gv/egiz/bku/gui/ActivationMessages.properties index 977d6e3a..5ef3edee 100644 --- a/BKUGuiExt/src/main/resources/at/gv/egiz/bku/gui/ActivationMessages.properties +++ b/BKUGuiExt/src/main/resources/at/gv/egiz/bku/gui/ActivationMessages.properties @@ -15,30 +15,44 @@ title.activation=Aktivierung title.pin.mgmt=PIN Verwaltung -title.activate.pin=PIN Aktivieren -title.change.pin=PIN \u00C4ndern -title.unblock.pin=PIN Entsperren -title.verify.pin=PIN Eingeben +title.activate.pin=PIN aktivieren +title.change.pin=PIN \u00E4ndern +title.unblock.pin=PIN entsperren +#title.verify.pin=PIN Eingeben title.activate.success=Erfolg title.change.success=Erfolg +title.unblock.success=Erfolg # removed message.* prefix to reuse keys as help keys pin.mgmt=Die Karte verf\u00FCgt \u00FCber {0} PINs +# software pin-entry messages activate.pin={0} eingeben und best\u00E4tigen change.pin={0} eingeben und best\u00E4tigen unblock.pin=PUK zu {0} eingeben -verify.pin={0} eingeben -verify.pinpad={0} ({1} stellig) am Kartenleser eingeben (und best\u00E4tigen). -activate.pinpad={0} ({1} stellig) am Kartenleser eingeben und wiederholen (jeweils best\u00E4tigen). -change.pinpad=Alte {0} ({1} stellig) am Kartenleser eingeben, danach neue {0} eingeben und wiederholen (jeweils best\u00E4tigen). -unblock.pinpad={0} ({1} stellig) am Kartenleser eingeben (und best\u00E4tigen). -activate.success={0} wurde erfolgreich aktiviert. -change.success={0} wurde erfolgreich ge\u00E4ndert. +# start/finish pin-entry messages +activate.pinpad.current=Transport-PIN am Kartenleser eingeben +activate.pinpad.new=Neue PIN am Kartenleser eingeben +activate.pinpad.confirm=Neue PIN am Kartenleser best\u00E4tigen +change.pinpad.current=Alte PIN am Kartenleser eingeben +change.pinpad.new=Neue PIN am Kartenleser eingeben +change.pinpad.confirm=Neue PIN am Kartenleser best\u00E4tigen +unblock.pinpad.current=PUK am Kartenleser eingeben +unblock.pinpad.new=Neue PIN am Kartenleser eingeben +unblock.pinpad.confirm=Neue PIN am Kartenleser best\u00E4tigen +# direct pin-entry messages +activate.pinpad.direct={0} ({1} stellig) am Kartenleser eingeben und wiederholen (jeweils best\u00E4tigen). +change.pinpad.direct=Alte {0} ({1} stellig) am Kartenleser eingeben, danach neue {0} eingeben und wiederholen (jeweils best\u00E4tigen). +unblock.pinpad.direct={0} ({1} stellig) am Kartenleser eingeben (und best\u00E4tigen). +# response messages +activate.success={0} wurde erfolgreich aktiviert +change.success={0} wurde erfolgreich ge\u00E4ndert +unblock.success={0} wurde erfolgreich entsperrt label.activation=e-card Aktivierungsprozess label.activation.step=Schritt {0} label.activation.idle=Warte auf Server... label.old.pin=Alte {0}: +label.puk={0} PUK: label.new.pin=Neue {0}: label.repeat.pin=Best\u00E4tigung: diff --git a/BKUGuiExt/src/main/resources/at/gv/egiz/bku/gui/ActivationMessages_en.properties b/BKUGuiExt/src/main/resources/at/gv/egiz/bku/gui/ActivationMessages_en.properties index 7f01971b..87e3f181 100644 --- a/BKUGuiExt/src/main/resources/at/gv/egiz/bku/gui/ActivationMessages_en.properties +++ b/BKUGuiExt/src/main/resources/at/gv/egiz/bku/gui/ActivationMessages_en.properties @@ -16,29 +16,43 @@ title.activation=Activation title.pin.mgmt=PIN Management title.activate.pin=Activate PIN -title.verify.pin=Enter PIN +#title.verify.pin=Enter PIN title.change.pin=Change PIN title.unblock.pin=Unblock PIN title.activate.success=Success title.change.success=Success +title.unblock.success=Success # removed message.* prefix to reuse keys as help keys -pin.mgmt=The smartcard has {0} PINs -activate.pin=Enter and confirm {0} -change.pin=Enter and confirm {0} -unblock.pin=Enter PUK for {0} -verify.pin=Enter {0} -verify.pinpad=Enter {0} ({1} digits) on cardreader (and confirm). -activate.pinpad=Enter {0} ({1} digits) on cardreader and repeat (confirm in each case). -change.pinpad=Enter old {0} ({1} digits) on cardreader, then enter new {0} and repeat (confirm in each case). -unblock.pinpad=Enter {0} ({1} digits) on cardreader (and confirm). +pin.mgmt={0} PINs available +# software pin-entry messages +activate.pin=Enter and confirm {0} +change.pin=Enter and confirm {0} +unblock.pin=Enter PUK for {0} +# start/finish pin-entry messages +activate.pinpad.current=Enter transport-PIN on cardreader +activate.pinpad.new=Enter new PIN on cardreader +activate.pinpad.confirm=Confirm new PIN on cardreader +change.pinpad.current=Enter old PIN on cardreader +change.pinpad.new=Enter new PIN on cardreader +change.pinpad.confirm=Confirm new PIN on cardreader +unblock.pinpad.current=Enter PUK on cardreader +unblock.pinpad.new=Enter new PIN on cardreader +unblock.pinpad.confirm=Confirm new PIN on cardreader +# direct pin-entry messages +activate.pinpad.direct=Enter {0} ({1} digits) on cardreader and repeat (confirm in each case) +change.pinpad.direct=Enter old {0} ({1} digits) on cardreader, then enter new {0} and repeat (confirm in each case) +unblock.pinpad.direct=Enter {0} ({1} digits) on cardreader, then enter new {0} and repeat (confirm in each case) +# response messages activate.success={0} successfully activated change.success={0} successfully changed +unblock.success={0} successfully unblocked label.activation=e-card activation process label.activation.step=Step {0} label.activation.idle=Wait for server... label.old.pin=Old {0}: +label.puk={0} PUK: label.new.pin=New {0}: label.repeat.pin=Confirmation: -- cgit v1.2.3 From dbffe94889d61a98733103b43ed30e53cdefd6ac Mon Sep 17 00:00:00 2001 From: clemenso Date: Tue, 5 Jan 2010 12:18:12 +0000 Subject: [maven-release-plugin] prepare release mocca-1.2.10 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@567 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUGuiExt/pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'BKUGuiExt') diff --git a/BKUGuiExt/pom.xml b/BKUGuiExt/pom.xml index 1d918331..2ddbbe54 100644 --- a/BKUGuiExt/pom.xml +++ b/BKUGuiExt/pom.xml @@ -3,22 +3,22 @@ bku at.gv.egiz - 1.2.10-SNAPSHOT + 1.2.10 at.gv.egiz BKUGuiExt - 1.2.10-SNAPSHOT + 1.2.10 BKU GUI Extension at.gv.egiz STALXService - 1.2.10-SNAPSHOT + 1.2.10 at.gv.egiz smccSTAL - 1.2.10-SNAPSHOT + 1.2.10 \ No newline at end of file -- cgit v1.2.3 From 73065b1be0f839c09e8ca481a20f398167404ce4 Mon Sep 17 00:00:00 2001 From: clemenso Date: Tue, 5 Jan 2010 12:21:05 +0000 Subject: [maven-release-plugin] prepare for next development iteration git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@569 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUGuiExt/pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'BKUGuiExt') diff --git a/BKUGuiExt/pom.xml b/BKUGuiExt/pom.xml index 2ddbbe54..0fd6db27 100644 --- a/BKUGuiExt/pom.xml +++ b/BKUGuiExt/pom.xml @@ -3,22 +3,22 @@ bku at.gv.egiz - 1.2.10 + 1.2.11-SNAPSHOT at.gv.egiz BKUGuiExt - 1.2.10 + 1.2.11-SNAPSHOT BKU GUI Extension at.gv.egiz STALXService - 1.2.10 + 1.2.11-SNAPSHOT at.gv.egiz smccSTAL - 1.2.10 + 1.2.11-SNAPSHOT \ No newline at end of file -- cgit v1.2.3 From b2d6b1c93152bf94d25e992815d97d2322941de6 Mon Sep 17 00:00:00 2001 From: clemenso Date: Tue, 19 Jan 2010 16:07:11 +0000 Subject: [maven-release-plugin] copy for tag mocca-1.2.11 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/tags/mocca-1.2.11@587 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUGuiExt/pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'BKUGuiExt') diff --git a/BKUGuiExt/pom.xml b/BKUGuiExt/pom.xml index 0fd6db27..73e9df63 100644 --- a/BKUGuiExt/pom.xml +++ b/BKUGuiExt/pom.xml @@ -3,22 +3,22 @@ bku at.gv.egiz - 1.2.11-SNAPSHOT + 1.2.11 at.gv.egiz BKUGuiExt - 1.2.11-SNAPSHOT + 1.2.11 BKU GUI Extension at.gv.egiz STALXService - 1.2.11-SNAPSHOT + 1.2.11 at.gv.egiz smccSTAL - 1.2.11-SNAPSHOT + 1.2.11 \ No newline at end of file -- cgit v1.2.3