JIDE: made used fonts "active" and restored fonts modified in LookAndFeelFactory.installJideExtension()

This commit is contained in:
Karl Tauber
2021-03-16 23:23:40 +01:00
parent 3d0df51839
commit 310a4989dc
4 changed files with 29 additions and 47 deletions

View File

@@ -473,7 +473,7 @@ public abstract class FlatLaf
// use active value for all fonts to allow changing fonts in all components // use active value for all fonts to allow changing fonts in all components
// (similar as in Nimbus L&F) with: // (similar as in Nimbus L&F) with:
// UIManager.put( "defaultFont", myFont ); // UIManager.put( "defaultFont", myFont );
Object activeFont = new ActiveFont( 1 ); Object activeFont = new ActiveFont( 1 );
// override fonts // override fonts
for( Object key : defaults.keySet() ) { for( Object key : defaults.keySet() ) {
@@ -496,6 +496,10 @@ public abstract class FlatLaf
return (font instanceof FontUIResource) ? (FontUIResource) font : new FontUIResource( font ); return (font instanceof FontUIResource) ? (FontUIResource) font : new FontUIResource( font );
} }
public static ActiveValue createActiveFontValue( float scaleFactor ) {
return new ActiveFont( scaleFactor );
}
/** /**
* Adds the default color palette for action icons and object icons to the given UIDefaults. * Adds the default color palette for action icons and object icons to the given UIDefaults.
* <p> * <p>

View File

@@ -21,6 +21,7 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
import javax.swing.LookAndFeel; import javax.swing.LookAndFeel;
import javax.swing.UIDefaults; import javax.swing.UIDefaults;
import javax.swing.UIDefaults.ActiveValue;
import com.formdev.flatlaf.FlatDefaultsAddon; import com.formdev.flatlaf.FlatDefaultsAddon;
import com.formdev.flatlaf.FlatLaf; import com.formdev.flatlaf.FlatLaf;
import com.formdev.flatlaf.jideoss.ui.FlatJidePainter; import com.formdev.flatlaf.jideoss.ui.FlatJidePainter;
@@ -103,6 +104,19 @@ public class FlatJideOssDefaultsAddon
// painter // painter
UIDefaultsLookup.put( defaults, "Theme.painter", FlatJidePainter.getInstance() ); UIDefaultsLookup.put( defaults, "Theme.painter", FlatJidePainter.getInstance() );
// fonts
ActiveValue font = FlatLaf.createActiveFontValue( 1f );
defaults.put( "JideButton.font", font );
defaults.put( "JideLabel.font", font );
defaults.put( "JideSplitButton.font", font );
defaults.put( "JideTabbedPane.font", font );
defaults.put( "JideTabbedPane.selectedTabFont", font );
// reset standard fonts modified by LookAndFeelFactory.installJideExtension()
defaults.put( "FormattedTextField.font", font );
defaults.put( "Spinner.font", font );
defaults.put( "TextArea.font", font );
// TristateCheckBox // TristateCheckBox
defaults.put( "TristateCheckBox.icon", null ); defaults.put( "TristateCheckBox.icon", null );
} }

View File

@@ -39,12 +39,6 @@
+ FolderChooserUI com.jidesoft.plaf.basic.BasicFolderChooserUI + FolderChooserUI com.jidesoft.plaf.basic.BasicFolderChooserUI
#---- FormattedTextField ----
- FormattedTextField.font [active] $defaultFont [UI]
+ FormattedTextField.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI]
#---- Gripper ---- #---- Gripper ----
+ Gripper.foreground [active] #b2b2b2 javax.swing.plaf.ColorUIResource [UI] + Gripper.foreground [active] #b2b2b2 javax.swing.plaf.ColorUIResource [UI]
@@ -66,7 +60,7 @@
#---- JideButton ---- #---- JideButton ----
+ JideButton.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] + JideButton.font [active] $defaultFont [UI]
+ JideButton.textShiftOffset 0 + JideButton.textShiftOffset 0
@@ -77,7 +71,7 @@
#---- JideLabel ---- #---- JideLabel ----
+ JideLabel.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] + JideLabel.font [active] $defaultFont [UI]
#---- JidePopup ---- #---- JidePopup ----
@@ -94,7 +88,7 @@
+ JideSplitButton.border 0,0,0,0 false javax.swing.plaf.basic.BasicBorders$MarginBorder [UI] + JideSplitButton.border 0,0,0,0 false javax.swing.plaf.basic.BasicBorders$MarginBorder [UI]
+ JideSplitButton.borderPainted false + JideSplitButton.borderPainted false
+ JideSplitButton.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] + JideSplitButton.font [active] $defaultFont [UI]
+ JideSplitButton.margin 3,3,3,7 javax.swing.plaf.InsetsUIResource [UI] + JideSplitButton.margin 3,3,3,7 javax.swing.plaf.InsetsUIResource [UI]
+ JideSplitButton.selectionForeground [active] #000000 javax.swing.plaf.ColorUIResource [UI] + JideSplitButton.selectionForeground [active] #000000 javax.swing.plaf.ColorUIResource [UI]
+ JideSplitButton.textIconGap 4 + JideSplitButton.textIconGap 4
@@ -139,7 +133,7 @@
+ JideTabbedPane.fitStyleIconMinWidth 24 + JideTabbedPane.fitStyleIconMinWidth 24
+ JideTabbedPane.fitStyleTextMinWidth 16 + JideTabbedPane.fitStyleTextMinWidth 16
+ JideTabbedPane.fixedStyleRectSize 60 + JideTabbedPane.fixedStyleRectSize 60
+ JideTabbedPane.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] + JideTabbedPane.font [active] $defaultFont [UI]
+ JideTabbedPane.gripLeftMargin 4 + JideTabbedPane.gripLeftMargin 4
+ JideTabbedPane.gripperPainter [unknown type] com.jidesoft.plaf.vsnet.VsnetWindowsUtils$9 [UI] + JideTabbedPane.gripperPainter [unknown type] com.jidesoft.plaf.vsnet.VsnetWindowsUtils$9 [UI]
+ JideTabbedPane.highlight [active] #ffffff javax.swing.plaf.ColorUIResource [UI] + JideTabbedPane.highlight [active] #ffffff javax.swing.plaf.ColorUIResource [UI]
@@ -150,7 +144,7 @@
+ JideTabbedPane.selectedTabBackground [active] #f0f0f0 javax.swing.plaf.ColorUIResource [UI] + JideTabbedPane.selectedTabBackground [active] #f0f0f0 javax.swing.plaf.ColorUIResource [UI]
+ JideTabbedPane.selectedTabBackgroundDk #ffc73c javax.swing.plaf.ColorUIResource [UI] + JideTabbedPane.selectedTabBackgroundDk #ffc73c javax.swing.plaf.ColorUIResource [UI]
+ JideTabbedPane.selectedTabBackgroundLt #e68b2c javax.swing.plaf.ColorUIResource [UI] + JideTabbedPane.selectedTabBackgroundLt #e68b2c javax.swing.plaf.ColorUIResource [UI]
+ JideTabbedPane.selectedTabFont Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] + JideTabbedPane.selectedTabFont [active] $defaultFont [UI]
+ JideTabbedPane.selectedTabTextForeground [active] #000000 javax.swing.plaf.ColorUIResource [UI] + JideTabbedPane.selectedTabTextForeground [active] #000000 javax.swing.plaf.ColorUIResource [UI]
+ JideTabbedPane.showCloseButtonOnTab false + JideTabbedPane.showCloseButtonOnTab false
+ JideTabbedPane.showIconOnTab true + JideTabbedPane.showIconOnTab true
@@ -176,23 +170,11 @@
+ MeterProgressBarUI com.jidesoft.plaf.basic.MeterProgressBarUI + MeterProgressBarUI com.jidesoft.plaf.basic.MeterProgressBarUI
#---- Spinner ----
- Spinner.font [active] $defaultFont [UI]
+ Spinner.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI]
#---- StyledLabel ---- #---- StyledLabel ----
+ StyledLabelUI com.jidesoft.plaf.basic.BasicStyledLabelUI + StyledLabelUI com.jidesoft.plaf.basic.BasicStyledLabelUI
#---- TextArea ----
- TextArea.font [active] $defaultFont [UI]
+ TextArea.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI]
#---- Theme ---- #---- Theme ----
+ Theme.highContrast [active] false + Theme.highContrast [active] false

View File

@@ -39,12 +39,6 @@
+ FolderChooserUI com.jidesoft.plaf.basic.BasicFolderChooserUI + FolderChooserUI com.jidesoft.plaf.basic.BasicFolderChooserUI
#---- FormattedTextField ----
- FormattedTextField.font [active] $defaultFont [UI]
+ FormattedTextField.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI]
#---- Gripper ---- #---- Gripper ----
+ Gripper.foreground [active] #b2b2b2 javax.swing.plaf.ColorUIResource [UI] + Gripper.foreground [active] #b2b2b2 javax.swing.plaf.ColorUIResource [UI]
@@ -66,7 +60,7 @@
#---- JideButton ---- #---- JideButton ----
+ JideButton.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] + JideButton.font [active] $defaultFont [UI]
+ JideButton.textShiftOffset 0 + JideButton.textShiftOffset 0
@@ -77,7 +71,7 @@
#---- JideLabel ---- #---- JideLabel ----
+ JideLabel.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] + JideLabel.font [active] $defaultFont [UI]
#---- JidePopup ---- #---- JidePopup ----
@@ -94,7 +88,7 @@
+ JideSplitButton.border 0,0,0,0 false javax.swing.plaf.basic.BasicBorders$MarginBorder [UI] + JideSplitButton.border 0,0,0,0 false javax.swing.plaf.basic.BasicBorders$MarginBorder [UI]
+ JideSplitButton.borderPainted false + JideSplitButton.borderPainted false
+ JideSplitButton.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] + JideSplitButton.font [active] $defaultFont [UI]
+ JideSplitButton.margin 3,3,3,7 javax.swing.plaf.InsetsUIResource [UI] + JideSplitButton.margin 3,3,3,7 javax.swing.plaf.InsetsUIResource [UI]
+ JideSplitButton.selectionForeground [active] #000000 javax.swing.plaf.ColorUIResource [UI] + JideSplitButton.selectionForeground [active] #000000 javax.swing.plaf.ColorUIResource [UI]
+ JideSplitButton.textIconGap 4 + JideSplitButton.textIconGap 4
@@ -139,7 +133,7 @@
+ JideTabbedPane.fitStyleIconMinWidth 24 + JideTabbedPane.fitStyleIconMinWidth 24
+ JideTabbedPane.fitStyleTextMinWidth 16 + JideTabbedPane.fitStyleTextMinWidth 16
+ JideTabbedPane.fixedStyleRectSize 60 + JideTabbedPane.fixedStyleRectSize 60
+ JideTabbedPane.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] + JideTabbedPane.font [active] $defaultFont [UI]
+ JideTabbedPane.gripLeftMargin 4 + JideTabbedPane.gripLeftMargin 4
+ JideTabbedPane.gripperPainter [unknown type] com.jidesoft.plaf.vsnet.VsnetWindowsUtils$9 [UI] + JideTabbedPane.gripperPainter [unknown type] com.jidesoft.plaf.vsnet.VsnetWindowsUtils$9 [UI]
+ JideTabbedPane.highlight [active] #ffffff javax.swing.plaf.ColorUIResource [UI] + JideTabbedPane.highlight [active] #ffffff javax.swing.plaf.ColorUIResource [UI]
@@ -150,7 +144,7 @@
+ JideTabbedPane.selectedTabBackground [active] #f0f0f0 javax.swing.plaf.ColorUIResource [UI] + JideTabbedPane.selectedTabBackground [active] #f0f0f0 javax.swing.plaf.ColorUIResource [UI]
+ JideTabbedPane.selectedTabBackgroundDk #ffc73c javax.swing.plaf.ColorUIResource [UI] + JideTabbedPane.selectedTabBackgroundDk #ffc73c javax.swing.plaf.ColorUIResource [UI]
+ JideTabbedPane.selectedTabBackgroundLt #e68b2c javax.swing.plaf.ColorUIResource [UI] + JideTabbedPane.selectedTabBackgroundLt #e68b2c javax.swing.plaf.ColorUIResource [UI]
+ JideTabbedPane.selectedTabFont Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] + JideTabbedPane.selectedTabFont [active] $defaultFont [UI]
+ JideTabbedPane.selectedTabTextForeground [active] #000000 javax.swing.plaf.ColorUIResource [UI] + JideTabbedPane.selectedTabTextForeground [active] #000000 javax.swing.plaf.ColorUIResource [UI]
+ JideTabbedPane.showCloseButtonOnTab false + JideTabbedPane.showCloseButtonOnTab false
+ JideTabbedPane.showIconOnTab true + JideTabbedPane.showIconOnTab true
@@ -176,23 +170,11 @@
+ MeterProgressBarUI com.jidesoft.plaf.basic.MeterProgressBarUI + MeterProgressBarUI com.jidesoft.plaf.basic.MeterProgressBarUI
#---- Spinner ----
- Spinner.font [active] $defaultFont [UI]
+ Spinner.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI]
#---- StyledLabel ---- #---- StyledLabel ----
+ StyledLabelUI com.jidesoft.plaf.basic.BasicStyledLabelUI + StyledLabelUI com.jidesoft.plaf.basic.BasicStyledLabelUI
#---- TextArea ----
- TextArea.font [active] $defaultFont [UI]
+ TextArea.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI]
#---- Theme ---- #---- Theme ----
+ Theme.highContrast [active] false + Theme.highContrast [active] false