Package com.krischik

Class Resizeable_Nimbus

  • All Implemented Interfaces:
    Serializable

    public class Resizeable_Nimbus
    extends NimbusLookAndFeel
    A Look & Feel based on the new Nimbus Look & Feel but with a sightly larger font. Normally one would not need this class but the Nimbus Look & Feel has some bugs in the handling of default values which this class works around.
    See Also:
    Serialized Form
    • Field Detail

      • COMPONENT_KEYS

        private static final String[] COMPONENT_KEYS
      • Default_Font_Name

        public static final String Default_Font_Name
        Name of system property to set the default font name
        See Also:
        Constant Field Values
      • Default_Font_Size

        public static final String Default_Font_Size
        Name of system property to set the default font size
        See Also:
        Constant Field Values
      • Default_Font_Style

        public static final String Default_Font_Style
        Name of system property to set the default font style
        See Also:
        Constant Field Values
      • logger

        private static final Logger logger
        class logger instance
      • serialVersionUID

        private static final long serialVersionUID
        version UID for serializable classes
        See Also:
        Constant Field Values
    • Constructor Detail

      • Resizeable_Nimbus

        public Resizeable_Nimbus()
    • Method Detail

      • setAllFonts

        public static void setAllFonts​(Font normatFont,
                                       Font largeFont,
                                       Font smallFont)
      • setAllFonts

        public static void setAllFonts​(FontUIResource normalFont,
                                       FontUIResource largeFont,
                                       FontUIResource smallFont)
        Set all fonts.

        Default of macOS is:

         CheckBoxMenuItem.acceleratorFont    = [family=Lucida Grande,name=Lucida Grande,style=plain,size=14]
         Button.font                         = [family=Lucida Grande,name=Lucida Grande,style=plain,size=13]
         ToggleButton.font                   = [family=Lucida Grande,name=Lucida Grande,style=plain,size=13]
         RadioButton.font                    = [family=Lucida Grande,name=Lucida Grande,style=plain,size=13]
         CheckBox.font                       = [family=Lucida Grande,name=Lucida Grande,style=plain,size=13]
         ColorChooser.font                   = [family=Dialog,name=Dialog,style=plain,size=12]
         ComboBox.font                       = [family=Lucida Grande,name=Lucida Grande,style=plain,size=13]
         Label.font                          = [family=Lucida Grande,name=Lucida Grande,style=plain,size=13]
         List.font                           = [family=Lucida Grande,name=Lucida Grande,style=plain,size=12]
         MenuBar.font                        = [family=Lucida Grande,name=Lucida Grande,style=plain,size=14]
         Menu.acceleratorFont                = [family=Lucida Grande,name=Lucida Grande,style=plain,size=14]
         RadioButtonMenuItem.acceleratorFont = [family=Lucida Grande,name=Lucida Grande,style=plain,size=14]
         MenuItem.acceleratorFont            = [family=Lucida Grande,name=Lucida Grande,style=plain,size=14]
         MenuItem.font                       = [family=Lucida Grande,name=Lucida Grande,style=plain,size=14]
         RadioButtonMenuItem.font            = [family=Lucida Grande,name=Lucida Grande,style=plain,size=14]
         CheckBoxMenuItem.font               = [family=Lucida Grande,name=Lucida Grande,style=plain,size=14]
         OptionPane.buttonFont               = [family=Lucida Grande,name=Lucida Grande,style=plain,size=13]
         OptionPane.messageFont              = [family=Lucida Grande,name=Lucida Grande,style=plain,size=13]
         Menu.font                           = [family=Lucida Grande,name=Lucida Grande,style=plain,size=14]
         PopupMenu.font                      = [family=Lucida Grande,name=Lucida Grande,style=plain,size=14]
         OptionPane.font                     = [family=Lucida Grande,name=Lucida Grande,style=bold,size=13]
         Panel.font                          = [family=Lucida Grande,name=Lucida Grande,style=plain,size=13]
         ProgressBar.font                    = [family=Lucida Grande,name=Lucida Grande,style=plain,size=13]
         ScrollPane.font                     = [family=Lucida Grande,name=Lucida Grande,style=plain,size=13]
         Viewport.font                       = [family=Lucida Grande,name=Lucida Grande,style=plain,size=13]
         TabbedPane.font                     = [family=Lucida Grande,name=Lucida Grande,style=plain,size=13]
         Slider.font                         = [family=Lucida Grande,name=Lucida Grande,style=plain,size=11]
         Table.font                          = [family=Lucida Grande,name=Lucida Grande,style=plain,size=12]
         TableHeader.font                    = [family=Lucida Grande,name=Lucida Grande,style=plain,size=11]
         TextField.font                      = [family=Lucida Grande,name=Lucida Grande,style=plain,size=13]
         Spinner.font                        = [family=Lucida Grande,name=Lucida Grande,style=plain,size=13]
         PasswordField.font                  = [family=Lucida Grande,name=Lucida Grande,style=plain,size=13]
         TextArea.font                       = [family=Lucida Grande,name=Lucida Grande,style=plain,size=13]
         TextPane.font                       = [family=Lucida Grande,name=Lucida Grande,style=plain,size=13]
         EditorPane.font                     = [family=Lucida Grande,name=Lucida Grande,style=plain,size=13]
         TabbedPane.smallFont                = [family=Lucida Grande,name=Lucida Grande,style=plain,size=11]
         TitledBorder.font                   = [family=Lucida Grande,name=Lucida Grande,style=plain,size=13]
         ToolBar.font                        = [family=Lucida Grande,name=Lucida Grande,style=plain,size=13]
         ToolTip.font                        = [family=Lucida Grande,name=Lucida Grande,style=plain,size=11]
         Tree.font                           = [family=Lucida Grande,name=Lucida Grande,style=plain,size=12]
         FormattedTextField.font             = [family=Lucida Grande,name=Lucida Grande,style=plain,size=13]
         IconButton.font                     = [family=Lucida Grande,name=Lucida Grande,style=plain,size=11]
         InternalFrame.optionDialogTitleFont = [family=Lucida Grande,name=Lucida Grande,style=plain,size=14]
         InternalFrame.paletteTitleFont      = [family=Lucida Grande,name=Lucida Grande,style=plain,size=14]
         InternalFrame.titleFont             = [family=Lucida Grande,name=Lucida Grande,style=plain,size=14]
         
        Parameters:
        normalFont - normal dialog font
        largeFont - large dialog font (currently unused)
        smallFont - small dialog font.
      • logAllFonts

        public static void logAllFonts()
        log all fonts for reference.
      • getDefaults

        public UIDefaults getDefaults()
        Returns the defaults for this SynthLookAndFeel.

        OK, this is a hack to work around a bug in the Nimbus Look & Feel. Normally one would use the javax.swing.UIManager.put method to set the font.

        However, Nimbus set's sets its own fonts when the getDefaults() method is called for the first time overwriting any fonts and any other parameters set in the UIManager so you can only configure the Nimbus Look & Feel after it was created. Which is to late.

        Overrides:
        getDefaults in class NimbusLookAndFeel
        Returns:
        default value.