Example #1
0
 /** Called by UIManager when this look and feel is uninstalled. */
 @Override
 public void uninitialize() {
   super.uninitialize();
   defaults.uninitialize();
   // clear all cached images to free memory
   ImageCache.getInstance().flush();
   UIManager.getDefaults().removePropertyChangeListener(defaultsListener);
 }
Example #2
0
 /** Called by UIManager when this look and feel is installed. */
 @Override
 public void initialize() {
   super.initialize();
   defaults.initialize();
   // create synth style factory
   setStyleFactory(
       new SynthStyleFactory() {
         @Override
         public SynthStyle getStyle(JComponent c, Region r) {
           return defaults.getStyle(c, r);
         }
       });
 }
Example #3
0
 /**
  * Gets the style associated with the given component and region. This will never return null. If
  * an appropriate component and region cannot be determined, then a default style is returned.
  *
  * @param c a non-null reference to a JComponent
  * @param r a non-null reference to the region of the component c
  * @return a non-null reference to a NimbusStyle.
  */
 public static NimbusStyle getStyle(JComponent c, Region r) {
   return (NimbusStyle) SynthLookAndFeel.getStyle(c, r);
 }