From fb19cf7cc24fae16eb4db69863f120ac9913f591 Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Wed, 02 Apr 2008 16:01:39 +0000
Subject: [PATCH] Protect the code in FramePanel so that it can handle the case where we do not have a background icon to use in transparency mode.
---
opends/src/quicksetup/org/opends/quicksetup/ui/FramePanel.java | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/opends/src/quicksetup/org/opends/quicksetup/ui/FramePanel.java b/opends/src/quicksetup/org/opends/quicksetup/ui/FramePanel.java
index 11403e8..2628a4a 100644
--- a/opends/src/quicksetup/org/opends/quicksetup/ui/FramePanel.java
+++ b/opends/src/quicksetup/org/opends/quicksetup/ui/FramePanel.java
@@ -126,16 +126,22 @@
backgroundIcon =
UIFactory.getImageIcon(UIFactory.IconType.BACKGROUND);
+ int backGroundIconWidth = 0;
+ int backGroundIconHeight = 0;
+ if (backgroundIcon != null)
+ {
+ backGroundIconWidth = backgroundIcon.getIconWidth();
+ backGroundIconHeight = backgroundIcon.getIconHeight();
+ }
+
this.buttonsPanel = buttonsPanel;
this.stepsPanel = stepsPanel;
int width =
- Math.max((int) getPreferredSize().getWidth(), backgroundIcon
- .getIconWidth()
+ Math.max((int) getPreferredSize().getWidth(), backGroundIconWidth
+ UIFactory.LEFT_INSET_BACKGROUND
+ UIFactory.RIGHT_INSET_BACKGROUND);
int height =
- Math.max((int) getPreferredSize().getHeight(), backgroundIcon
- .getIconHeight()
+ Math.max((int) getPreferredSize().getHeight(), backGroundIconHeight
+ UIFactory.TOP_INSET_BACKGROUND
+ UIFactory.BOTTOM_INSET_BACKGROUND);
setPreferredSize(new Dimension(width, height));
--
Gitblit v1.10.0