summaryrefslogtreecommitdiff
path: root/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls
diff options
context:
space:
mode:
authortkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7>2013-04-10 19:24:18 +0000
committertkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7>2013-04-10 19:24:18 +0000
commita58079ea355e29c7daf65a0b7a31fd1e698186e7 (patch)
treefc193d5455f67bddcb32f1e669063a170f66036a /pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls
parentcda57f2454ded9fc57489c6d160a9ed25d95d201 (diff)
downloadpdf-over-a58079ea355e29c7daf65a0b7a31fd1e698186e7.tar.gz
pdf-over-a58079ea355e29c7daf65a0b7a31fd1e698186e7.tar.bz2
pdf-over-a58079ea355e29c7daf65a0b7a31fd1e698186e7.zip
Fix ErrorMarker display - set fixed size
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@302 174cde9d-5d70-4d2a-aa98-46368bc2aaf7
Diffstat (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls')
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/ErrorMarker.java11
1 files changed, 5 insertions, 6 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/ErrorMarker.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/ErrorMarker.java
index 655a0975..546b0088 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/ErrorMarker.java
+++ b/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