From 3e1fe87fa6b264d431e899222421fbf7a7ede32d Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Wed, 10 Jan 2007 15:23:13 +0000
Subject: [PATCH] Fix a bug in the FramePanel that made not to have distinct colors when running under Java Desktop 3 and Java. It seems that in this environment the panel is not opaque so the code was skipped. The fix consists of basically painting always the background colors regardless of whether the panel is marked as opaque or not.
---
opends/src/quicksetup/org/opends/quicksetup/ui/FramePanel.java | 41 ++++++++++++++++++++---------------------
1 files changed, 20 insertions(+), 21 deletions(-)
diff --git a/opends/src/quicksetup/org/opends/quicksetup/ui/FramePanel.java b/opends/src/quicksetup/org/opends/quicksetup/ui/FramePanel.java
index f82a9a2..3370c9e 100644
--- a/opends/src/quicksetup/org/opends/quicksetup/ui/FramePanel.java
+++ b/opends/src/quicksetup/org/opends/quicksetup/ui/FramePanel.java
@@ -149,38 +149,37 @@
*/
protected void paintComponent(Graphics g)
{
- if (isOpaque())
- { // paint background
+ // paint background
g.setColor(UIFactory.DEFAULT_BACKGROUND);
int width = getWidth();
int height = getHeight();
- int buttonsTotalHeight =
- buttonsPanel.getHeight() + buttonsPanelVerticalInsets;
- int stepsPanelTotalWidth =
- stepsPanel.getWidth() + stepsPanelHorizontalInsets;
+ int buttonsTotalHeight = buttonsPanel.getHeight()
+ + buttonsPanelVerticalInsets;
+ int stepsPanelTotalWidth = stepsPanel.getWidth()
+ + stepsPanelHorizontalInsets;
g.fillRect(0, 0, stepsPanelTotalWidth, height);
g.fillRect(stepsPanelTotalWidth, height - buttonsTotalHeight, width,
- height);
+ height);
g.setColor(UIFactory.CURRENT_STEP_PANEL_BACKGROUND);
g.fillRect(stepsPanelTotalWidth, 0, width, height - buttonsTotalHeight);
- }
- if (backgroundIcon != null)
- {
- // Draw the icon over and over, right aligned.
- // Copy the Graphics object, which is actually
- // a Graphics2D object. Cast it so we can
- // set alpha composite.
- Graphics2D g2d = (Graphics2D) g.create();
+ if (backgroundIcon != null)
+ {
+ // Draw the icon over and over, right aligned.
+ // Copy the Graphics object, which is actually
+ // a Graphics2D object. Cast it so we can
+ // set alpha composite.
+ Graphics2D g2d = (Graphics2D) g.create();
- g2d.setComposite(AlphaComposite
- .getInstance(AlphaComposite.SRC_OVER, 0.1f));
+ g2d.setComposite(AlphaComposite.getInstance(
+ AlphaComposite.SRC_OVER, 0.1f));
- backgroundIcon.paintIcon(this, g2d, UIFactory.LEFT_INSET_BACKGROUND,
- UIFactory.TOP_INSET_BACKGROUND);
+ backgroundIcon.paintIcon(this, g2d,
+ UIFactory.LEFT_INSET_BACKGROUND,
+ UIFactory.TOP_INSET_BACKGROUND);
- g2d.dispose(); //clean up
- }
+ g2d.dispose(); //clean up
+ }
}
}
--
Gitblit v1.10.0