summaryrefslogtreecommitdiff
path: root/BKUCommonGUI/src/main/java/at/gv
diff options
context:
space:
mode:
authortkellner <tkellner@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2012-12-21 16:05:12 +0000
committertkellner <tkellner@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2012-12-21 16:05:12 +0000
commit1200cf2e87d82efeedd69e7782f7a66376421d6d (patch)
tree95d4cf5b26a3e06eacfc50cbf78e4457ece0da50 /BKUCommonGUI/src/main/java/at/gv
parentb61707b8dad60b339c4ef0f7f694cea92a362bfb (diff)
downloadmocca-1200cf2e87d82efeedd69e7782f7a66376421d6d.tar.gz
mocca-1200cf2e87d82efeedd69e7782f7a66376421d6d.tar.bz2
mocca-1200cf2e87d82efeedd69e7782f7a66376421d6d.zip
Only limit initial size in main GUI
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@1158 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
Diffstat (limited to 'BKUCommonGUI/src/main/java/at/gv')
-rw-r--r--BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java20
1 files changed, 16 insertions, 4 deletions
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java
index 4074978b..a44ceb82 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java
@@ -2411,8 +2411,7 @@ public class BKUGUIImpl implements BKUGUIFacade {
return resourceName;
}
- protected float getResizeFactor() {
-
+ protected float getResizeFactor(int maxBaseWidth) {
if (baseWidth == null || baseHeight == null || baseWidth == 0
|| baseHeight == 0) {
@@ -2420,7 +2419,7 @@ public class BKUGUIImpl implements BKUGUIFacade {
int width = contentPanel.getWidth();
int height = contentPanel.getHeight();
float ratio = ((float) width / height);
- baseWidth = width < 166 ? width : 166;
+ baseWidth = width < maxBaseWidth ? width : maxBaseWidth;
baseHeight = (int) (baseWidth / ratio);
if (baseHeight > height) {
baseHeight = height;
@@ -2434,12 +2433,25 @@ public class BKUGUIImpl implements BKUGUIFacade {
return factor;
}
+ protected float getResizeFactor() {
+ if (baseWidth == null || baseHeight == null || baseWidth == 0
+ || baseHeight == 0) {
+
+ // first call - determine base width and height
+ baseWidth = contentPanel.getWidth();
+ baseHeight = contentPanel.getHeight();
+ }
+
+ float factor = (float) contentPanel.getSize().getWidth() / baseWidth;
+ return factor;
+ }
+
public void resize() {
log.debug("Resizing ...");
updateHelpLabelIcon();
- float factor = getResizeFactor();
+ float factor = getResizeFactor(166);
this.sigDataFocusBorder.setBorderWidthFactor(factor);
this.helpFocusBorder.setBorderWidthFactor(factor);