diff options
author | Tobias Kellner <tobias.kellner@iaik.tugraz.at> | 2012-11-13 17:04:51 +0100 |
---|---|---|
committer | Tobias Kellner <tobias.kellner@iaik.tugraz.at> | 2012-11-13 17:04:51 +0100 |
commit | a68479faf73d951f0e609ccbd2010ff8fcda10d5 (patch) | |
tree | d943b1e05c41b9589138800753406620e3cc6636 /trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui | |
parent | 8fd43080841ad5e0430a74e025e77f7a2c79cd9b (diff) | |
download | pdf-over-a68479faf73d951f0e609ccbd2010ff8fcda10d5.tar.gz pdf-over-a68479faf73d951f0e609ccbd2010ff8fcda10d5.tar.bz2 pdf-over-a68479faf73d951f0e609ccbd2010ff8fcda10d5.zip |
Fix ErrorMarker display - set fixed size
Diffstat (limited to 'trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui')
-rw-r--r-- | trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java | 6 | ||||
-rw-r--r-- | trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/ErrorMarker.java | 11 |
2 files changed, 11 insertions, 6 deletions
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 2e3e7e81..7c127e04 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 @@ -174,8 +174,10 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { SWT.NONE, ""); //$NON-NLS-1$ this.txtMobileNumberErrorMarker.setVisible(false); this.fd_txtMobileNumberErrorMarker = new FormData(); + this.fd_txtMobileNumberErrorMarker.left = new FormAttachment(100, -32); this.fd_txtMobileNumberErrorMarker.right = new FormAttachment(100); this.fd_txtMobileNumberErrorMarker.top = new FormAttachment(0); + this.fd_txtMobileNumberErrorMarker.bottom = new FormAttachment(0, 32); this.txtMobileNumberErrorMarker .setLayoutData(this.fd_txtMobileNumberErrorMarker); @@ -567,8 +569,10 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { this.proxyHostErrorMarker = new ErrorMarker(compProxyHostContainer, SWT.NONE, ""); //$NON-NLS-1$ FormData fd_proxyHostErrorMarker = new FormData(); + fd_proxyHostErrorMarker.left = new FormAttachment(100, -32); fd_proxyHostErrorMarker.right = new FormAttachment(100); fd_proxyHostErrorMarker.top = new FormAttachment(0); + fd_proxyHostErrorMarker.bottom = new FormAttachment(0, 32); this.proxyHostErrorMarker.setLayoutData(fd_proxyHostErrorMarker); this.proxyHostErrorMarker.setVisible(false); @@ -630,8 +634,10 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { this.txtProxyPortErrorMarker = new ErrorMarker(compProxyPortContainer, SWT.NONE, ""); //$NON-NLS-1$ this.fd_txtProxyPortErrorMarker = new FormData(); + this.fd_txtProxyPortErrorMarker.left = new FormAttachment(100, -32); this.fd_txtProxyPortErrorMarker.right = new FormAttachment(100); this.fd_txtProxyPortErrorMarker.top = new FormAttachment(0); + this.fd_txtProxyPortErrorMarker.bottom = new FormAttachment(0, 32); this.txtProxyPortErrorMarker .setLayoutData(this.fd_txtProxyPortErrorMarker); this.txtProxyPortErrorMarker.setVisible(false); diff --git a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/ErrorMarker.java b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/ErrorMarker.java index 655a0975..546b0088 100644 --- a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/ErrorMarker.java +++ b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/ErrorMarker.java @@ -57,21 +57,20 @@ public class ErrorMarker extends Label { InputStream stream = this.getClass().getResourceAsStream(IMG_PATH); this.errorImg = new Image(getDisplay(), new ImageData(stream)); + this.addPaintListener(new PaintListener() { + final Rectangle imgSize = ErrorMarker.this.errorImg.getBounds(); + @Override public void paintControl(PaintEvent e) { - Image img = ErrorMarker.this.errorImg; - Rectangle imgSize = img.getBounds(); Rectangle dstSize = ErrorMarker.this.getBounds(); - e.gc.fillRectangle(0, 0, dstSize.width, dstSize.height); - e.gc.drawImage(img, 0, 0, imgSize.width, imgSize.height, + e.gc.drawImage(ErrorMarker.this.errorImg, + 0, 0, this.imgSize.width, this.imgSize.height, 0, 0, dstSize.width, dstSize.height); } }); setToolTipText(message); - - setImage(this.errorImg); } @Override |