From f844bf08c0377a157e3edaa7377baf00b0c4b537 Mon Sep 17 00:00:00 2001 From: tkellner Date: Wed, 10 Apr 2013 19:14:05 +0000 Subject: Localize signature note stuff git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@212 174cde9d-5d70-4d2a-aa98-46368bc2aaf7 --- .../pdfover/gui/composites/SignaturePanel.java | 2 +- .../composites/SimpleConfigurationComposite.java | 107 ++++++++++----------- 2 files changed, 54 insertions(+), 55 deletions(-) (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites') diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java index e69b735c..7683f837 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java @@ -342,7 +342,7 @@ public class SignaturePanel extends JPanel { float scale = (((float) this.sigScreenWidth) / this.sigPlaceholder.getWidth(null)) * 150; log.debug(Float.toString(scale)); g_phs.setFont(getFont().deriveFont(scale)); - g_phs.setColor(sigPlaceholderBorderColor); + g_phs.setColor(this.sigPlaceholderBorderColor); Rectangle2D overlay_size = g_phs.getFontMetrics().getStringBounds(overlay, g_phs); int width = (int) overlay_size.getWidth(); int height = (int) overlay_size.getHeight(); diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java index 04b10d9c..902d3435 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java @@ -490,6 +490,59 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { } }); + Group grpSignatureNote = new Group(this, SWT.NONE); + FormData fd_grpSignatureNote = new FormData(); + fd_grpSignatureNote.right = new FormAttachment(100, -5); + fd_grpSignatureNote.top = new FormAttachment(grpProxy, 5); + fd_grpSignatureNote.left = new FormAttachment(0, 5); + grpSignatureNote.setLayoutData(fd_grpSignatureNote); + grpSignatureNote.setLayout(new GridLayout(2, false)); + grpSignatureNote.setText(Messages.getString("simple_config.Note_Title")); //$NON-NLS-1$ + + FontData[] fD_grpSignatureNote = grpSignatureNote.getFont().getFontData(); + fD_grpSignatureNote[0].setHeight(Constants.TEXT_SIZE_NORMAL); + grpSignatureNote.setFont(new Font(Display.getCurrent(), fD_grpSignatureNote[0])); + + Label lblSignatureNote = new Label(grpSignatureNote, SWT.NONE); + GridData gd_lblSignatureNote = new GridData(SWT.LEFT, SWT.CENTER, false, + false, 1, 1); + gd_lblSignatureNote.widthHint = 66; + lblSignatureNote.setLayoutData(gd_lblSignatureNote); + lblSignatureNote.setBounds(0, 0, 57, 15); + lblSignatureNote.setText(Messages.getString("simple_config.Note")); //$NON-NLS-1$ + + FontData[] fD_lblSignatureNote = lblSignatureNote.getFont().getFontData(); + fD_lblSignatureNote[0].setHeight(Constants.TEXT_SIZE_NORMAL); + lblSignatureNote.setFont(new Font(Display.getCurrent(), fD_lblSignatureNote[0])); + + this.txtSignatureNote = new Text(grpSignatureNote, SWT.BORDER); + this.txtSignatureNote.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, + 1, 1)); + this.txtSignatureNote.setToolTipText(Messages.getString("simple_config.Note_Tooltip")); //$NON-NLS-1$ + + FontData[] fD_txtSignatureNote = this.txtProxyHost.getFont().getFontData(); + fD_txtSignatureNote[0].setHeight(Constants.TEXT_SIZE_NORMAL); + this.txtSignatureNote.setFont(new Font(Display.getCurrent(), + fD_txtSignatureNote[0])); + + this.txtSignatureNote.addFocusListener(new FocusAdapter() { + + @Override + public void focusLost(FocusEvent e) { + processSignatureNoteChanged(); + } + }); + + this.txtSignatureNote.addTraverseListener(new TraverseListener() { + + @Override + public void keyTraversed(TraverseEvent e) { + if (e.detail == SWT.TRAVERSE_RETURN) { + processSignatureNoteChanged(); + } + } + }); + this.addListener(SWT.Resize, new Listener() { @Override @@ -522,60 +575,6 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { 100, -1 * (portSize.y + 10)); } }); - - // TODO: localize ... - Group grpSignatureNote = new Group(this, SWT.NONE); - FormData fd_grpSignatureNote = new FormData(); - fd_grpSignatureNote.right = new FormAttachment(100, -5); - fd_grpSignatureNote.top = new FormAttachment(grpProxy, 5); - fd_grpSignatureNote.left = new FormAttachment(0, 5); - grpSignatureNote.setLayoutData(fd_grpSignatureNote); - grpSignatureNote.setLayout(new GridLayout(2, false)); - grpSignatureNote.setText("Signature Note"); - - FontData[] fD_grpSignatureNote = grpSignatureNote.getFont().getFontData(); - fD_grpSignatureNote[0].setHeight(Constants.TEXT_SIZE_NORMAL); - grpSignatureNote.setFont(new Font(Display.getCurrent(), fD_grpSignatureNote[0])); - - - Label lblSignatureNote = new Label(grpSignatureNote, SWT.NONE); - GridData gd_lblSignatureNote = new GridData(SWT.LEFT, SWT.CENTER, false, - false, 1, 1); - gd_lblSignatureNote.widthHint = 66; - lblSignatureNote.setLayoutData(gd_lblSignatureNote); - lblSignatureNote.setBounds(0, 0, 57, 15); - lblSignatureNote.setText("Text:"); - - FontData[] fD_lblSignatureNote = lblSignatureNote.getFont().getFontData(); - fD_lblSignatureNote[0].setHeight(Constants.TEXT_SIZE_NORMAL); - lblSignatureNote.setFont(new Font(Display.getCurrent(), fD_lblSignatureNote[0])); - - this.txtSignatureNote = new Text(grpSignatureNote, SWT.BORDER); - this.txtSignatureNote.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, - 1, 1)); - - FontData[] fD_txtSignatureNote = this.txtProxyHost.getFont().getFontData(); - fD_txtSignatureNote[0].setHeight(Constants.TEXT_SIZE_NORMAL); - this.txtSignatureNote.setFont(new Font(Display.getCurrent(), - fD_txtSignatureNote[0])); - - this.txtSignatureNote.addFocusListener(new FocusAdapter() { - - @Override - public void focusLost(FocusEvent e) { - processSignatureNoteChanged(); - } - }); - - this.txtSignatureNote.addTraverseListener(new TraverseListener() { - - @Override - public void keyTraversed(TraverseEvent e) { - if (e.detail == SWT.TRAVERSE_RETURN) { - processSignatureNoteChanged(); - } - } - }); } /** -- cgit v1.2.3