From c986aa5fc0915b1b1ff733c331e336ca4bc95497 Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Wed, 26 Nov 2008 10:50:48 +0000
Subject: [PATCH] Fix for issue 3263 (jdk 6 supported fonts has to be used in GUI module (quicksetup))
---
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/ui/UIFactory.java | 60 +++++++++++++++++++++++++++++++++++-------------------------
1 files changed, 35 insertions(+), 25 deletions(-)
diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/ui/UIFactory.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/ui/UIFactory.java
index 4d5cbdd..2753429 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/ui/UIFactory.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/ui/UIFactory.java
@@ -360,31 +360,44 @@
public static final Border DIALOG_PANEL_BORDER =
BorderFactory.createMatteBorder(0, 0, 2, 0, PANEL_BORDER_COLOR);
+ private static Font defaultFont;
+ static
+ {
+ try
+ {
+ defaultFont = UIManager.getFont("Label.font").deriveFont(Font.PLAIN).
+ deriveFont(12f);
+ }
+ catch (Throwable t)
+ {
+ defaultFont = Font.decode("SansSerif-PLAIN-12");
+ }
+ }
+
+
/**
* Specifies the font for the step which is not the current one in the steps
* panel.
*/
- public static final Font NOT_CURRENT_STEP_FONT =
- Font.decode("SansSerif-PLAIN-14");
+ public static final Font NOT_CURRENT_STEP_FONT = defaultFont.deriveFont(14f);
/**
* Specifies the font for the step which is the current one in the steps
* panel.
*/
public static final Font CURRENT_STEP_FONT =
- Font.decode("SansSerif-BOLD-14");
+ defaultFont.deriveFont(14f).deriveFont(Font.BOLD);
/**
* Specifies the font for the title of the current panel.
*/
public static final Font TITLE_FONT =
- Font.decode("SansSerif-BOLD-14");
+ defaultFont.deriveFont(14f).deriveFont(Font.BOLD);
/**
* Specifies the font for the instructions of the current panel.
*/
- public static final Font INSTRUCTIONS_FONT =
- Font.decode("SansSerif-PLAIN-12");
+ public static final Font INSTRUCTIONS_FONT = defaultFont;
/**
* Specifies the font for the instructions of the current panel.
@@ -396,63 +409,61 @@
* Specifies the font for the primary valid field.
*/
public static final Font PRIMARY_FIELD_VALID_FONT =
- Font.decode("SansSerif-BOLD-12");
+ defaultFont.deriveFont(Font.BOLD);
/**
* Specifies the font for the secondary valid field.
*/
- public static final Font SECONDARY_FIELD_VALID_FONT =
- Font.decode("SansSerif-PLAIN-12");
+ public static final Font SECONDARY_FIELD_VALID_FONT = defaultFont;
/**
* Specifies the font for the primary invalid field.
*/
public static final Font PRIMARY_FIELD_INVALID_FONT =
- Font.decode("SansSerif-BOLDITALIC-12");
+ defaultFont.deriveFont(Font.BOLD | Font.ITALIC);
/**
* Specifies the font for the secondary invalid field.
*/
public static final Font SECONDARY_FIELD_INVALID_FONT =
- Font.decode("SansSerif-ITALIC-12");
+ defaultFont.deriveFont(Font.ITALIC);
/**
- * Specifies the font for the secondary invalid field.
+ * Specifies the font for the secondary status field.
*/
public static final Font SECONDARY_STATUS_FONT =
- Font.decode("SansSerif-ITALIC-12");
+ defaultFont.deriveFont(Font.ITALIC);
/**
* Specifies the font for read only text.
*/
- public static final Font READ_ONLY_FONT = Font.decode("SansSerif-PLAIN-12");
+ public static final Font READ_ONLY_FONT = defaultFont;
/**
* Specifies the font for the check box text.
*/
- public static final Font CHECKBOX_FONT = Font.decode("SansSerif-PLAIN-12");
+ public static final Font CHECKBOX_FONT = defaultFont;
/**
* Specifies the font for the progress text.
*/
- public static final Font PROGRESS_FONT = Font.decode("SansSerif-PLAIN-12");
+ public static final Font PROGRESS_FONT = defaultFont;
/**
* Specifies the font for the text field text.
*/
- public static final Font TEXTFIELD_FONT = Font.decode("SansSerif-PLAIN-12");
+ public static final Font TEXTFIELD_FONT = defaultFont;
/**
* Specifies the font for the password field text.
*/
- public static final Font PASSWORD_FIELD_FONT =
- Font.decode("SansSerif-PLAIN-12");
+ public static final Font PASSWORD_FIELD_FONT = defaultFont;
/**
* Specifies the font for the points '....' in the progress panel.
*/
public static final Font PROGRESS_POINTS_FONT =
- Font.decode("SansSerif-BOLD-12");
+ defaultFont.deriveFont(Font.BOLD);
/**
* Specifies the font for the done text 'Done' in the progress panel.
@@ -475,24 +486,23 @@
* Specifies the font for the error messages in the progress panel.
*/
public static final Font PROGRESS_ERROR_FONT =
- Font.decode("SansSerif-BOLD-12");
+ defaultFont.deriveFont(Font.BOLD);
/**
* Specifies the font for the warning messages in the progress panel.
*/
public static final Font PROGRESS_WARNING_FONT =
- Font.decode("SansSerif-BOLD-12");
+ defaultFont.deriveFont(Font.BOLD);
/**
* Specifies the font for the stack trace in the progress panel.
*/
- public static final Font STACK_FONT = Font.decode("SansSerif-PLAIN-12");
+ public static final Font STACK_FONT = defaultFont;
/**
* Specifies the font for the text in the WebBrowserErrorDialog.
*/
- public static final Font ERROR_DIALOG_FONT =
- Font.decode("SansSerif-PLAIN-12");
+ public static final Font ERROR_DIALOG_FONT = defaultFont;
private static final String SPAN_CLOSE = "</span>";
--
Gitblit v1.10.0