diff options
author | Tobias Kellner <tobias.kellner@iaik.tugraz.at> | 2012-11-06 21:23:50 +0100 |
---|---|---|
committer | Tobias Kellner <tobias.kellner@iaik.tugraz.at> | 2012-11-06 21:23:50 +0100 |
commit | 59524937b956cf1f91cfefa55274402cd0f618ef (patch) | |
tree | 0f0ee1452080e845f2ca45bf76a91b7296ebbdf2 /trunk/pdf-over-gui/src/main/java | |
parent | 4241e2e4bdec2e4ac7dd3fcb2e42fe677be7ce20 (diff) | |
download | pdf-over-59524937b956cf1f91cfefa55274402cd0f618ef.tar.gz pdf-over-59524937b956cf1f91cfefa55274402cd0f618ef.tar.bz2 pdf-over-59524937b956cf1f91cfefa55274402cd0f618ef.zip |
Localize signature note stuff
Diffstat (limited to 'trunk/pdf-over-gui/src/main/java')
2 files changed, 54 insertions, 55 deletions
diff --git a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java index e69b735c..7683f837 100644 --- a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java +++ b/trunk/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/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java index 04b10d9c..902d3435 100644 --- a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java +++ b/trunk/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(); - } - } - }); } /** |