Home » openjdk-7 » javax.swing.plaf.nimbus » [javadoc | source]
javax.swing.plaf.nimbus
public class: NimbusLookAndFeel [javadoc | source]
java.lang.Object
   javax.swing.LookAndFeel
      javax.swing.plaf.basic.BasicLookAndFeel
         javax.swing.plaf.synth.SynthLookAndFeel
            javax.swing.plaf.nimbus.NimbusLookAndFeel

All Implemented Interfaces:
    java$io$Serializable

The NimbusLookAndFeel class.

Fields inherited from javax.swing.plaf.synth.SynthLookAndFeel:
EMPTY_UIRESOURCE_INSETS,  selectedUI,  selectedUIState
Fields inherited from javax.swing.plaf.basic.BasicLookAndFeel:
needsEventHelper,  invocator
Constructor:
 public NimbusLookAndFeel() 
Method from javax.swing.plaf.nimbus.NimbusLookAndFeel Summary:
deriveARGB,   getDefaults,   getDefaultsForPrefix,   getDerivedColor,   getDerivedColor,   getDerivedColor,   getDescription,   getDisabledIcon,   getID,   getName,   getStyle,   initialize,   parsePrefix,   register,   resolveToolbarConstraint,   shouldUpdateStyleOnAncestorChanged,   shouldUpdateStyleOnEvent,   uninitialize
Methods from javax.swing.plaf.synth.SynthLookAndFeel:
createUI,   getComponentState,   getDefaults,   getDescription,   getID,   getName,   getPaintingInsets,   getRegion,   getStyle,   getStyleFactory,   getUIOfType,   initialize,   isLeftToRight,   isNativeLookAndFeel,   isSupportedLookAndFeel,   load,   load,   resetSelectedUI,   setSelectedUI,   setStyleFactory,   shouldUpdateStyle,   shouldUpdateStyleOnAncestorChanged,   shouldUpdateStyleOnEvent,   uninitialize,   update,   updateStyle,   updateStyles,   updateSubregion
Methods from javax.swing.plaf.basic.BasicLookAndFeel:
createAudioAction,   getAudioActionMap,   getDefaults,   getUIOfType,   initClassDefaults,   initComponentDefaults,   initSystemColorDefaults,   initialize,   installAWTEventListener,   installAudioActionMap,   loadSystemColors,   playSound,   playSound,   uninitialize
Methods from javax.swing.LookAndFeel:
getDefaults,   getDescription,   getDesktopPropertyValue,   getDisabledIcon,   getDisabledSelectedIcon,   getID,   getLayoutStyle,   getName,   getSupportsWindowDecorations,   initialize,   installBorder,   installColors,   installColorsAndFont,   installProperty,   isNativeLookAndFeel,   isSupportedLookAndFeel,   loadKeyBindings,   makeComponentInputMap,   makeIcon,   makeInputMap,   makeKeyBindings,   provideErrorFeedback,   toString,   uninitialize,   uninstallBorder
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from javax.swing.plaf.nimbus.NimbusLookAndFeel Detail:
 static int deriveARGB(Color color1,
    Color color2,
    float midPoint) 
    Derives the ARGB value for a color based on an offset between two other colors.
 public UIDefaults getDefaults() 
 Map<String, Object> getDefaultsForPrefix(String prefix) 
 protected final Color getDerivedColor(Color color1,
    Color color2,
    float midPoint) 
    Decodes and returns a color, which is derived from a offset between two other colors.
 protected final Color getDerivedColor(Color color1,
    Color color2,
    float midPoint,
    boolean uiResource) 
    Decodes and returns a color, which is derived from an offset between two other colors.
 public Color getDerivedColor(String uiDefaultParentName,
    float hOffset,
    float sOffset,
    float bOffset,
    int aOffset,
    boolean uiResource) 
    Get a derived color, derived colors are shared instances and is color value will change when its parent UIDefault color changes.
 public String getDescription() 
    Returns a textual description of this look and feel.
 public Icon getDisabledIcon(JComponent component,
    Icon icon) 
 public String getID() 
    Return a string that identifies this look and feel. This String will be the unquoted String "Nimbus".
 public String getName() 
    Return a short string that identifies this look and feel. This String will be the unquoted String "Nimbus".
 public static NimbusStyle getStyle(JComponent c,
    Region r) 
    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.
 public  void initialize() 
    Called by UIManager when this look and feel is installed.
 static String parsePrefix(String key) 
 public  void register(Region region,
    String prefix) 

    Registers a third party component with the NimbusLookAndFeel.

    Regions represent Components and areas within Components that act as independent painting areas. Once registered with the NimbusLookAndFeel, NimbusStyles for these Regions can be retrieved via the getStyle method.

    The NimbusLookAndFeel uses a standard naming scheme for entries in the UIDefaults table. The key for each property, state, painter, and other default registered in UIDefaults for a specific Region will begin with the specified prefix

    For example, suppose I had a component named JFoo. Suppose I then registered this component with the NimbusLookAndFeel in this manner:

    
        laf.register(NimbusFooUI.FOO_REGION, "Foo");
    

    In this case, I could then register properties for this component with UIDefaults in the following manner:

    
        UIManager.put("Foo.background", new ColorUIResource(Color.BLACK));
        UIManager.put("Foo.Enabled.backgroundPainter", new FooBackgroundPainter());
    

    It is also possible to register a named component with Nimbus. For example, suppose you wanted to style the background of a JPanel named "MyPanel" differently from other JPanels. You could accomplish this by doing the following:

    
        laf.register(Region.PANEL, "\"MyPanel\"");
        UIManager.put("\"MyPanel\".background", new ColorUIResource(Color.RED));
    
 static Object resolveToolbarConstraint(JToolBar toolbar) 
    Package private method which returns either BorderLayout.NORTH, BorderLayout.SOUTH, BorderLayout.EAST, or BorderLayout.WEST depending on the location of the toolbar in its parent. The toolbar might be in PAGE_START, PAGE_END, CENTER, or some other position, but will be resolved to either NORTH,SOUTH,EAST, or WEST based on where the toolbar actually IS, with CENTER being NORTH. This code is used to determine where the border line should be drawn by the custom toolbar states, and also used by NimbusIcon to determine whether the handle icon needs to be shifted to look correct. Toollbars are unfortunately odd in the way these things are handled, and so this code exists to unify the logic related to toolbars so it can be shared among the static files such as NimbusIcon and generated files such as the ToolBar state classes.
 public boolean shouldUpdateStyleOnAncestorChanged() 
 protected boolean shouldUpdateStyleOnEvent(PropertyChangeEvent ev) 
 public  void uninitialize() 
    Called by UIManager when this look and feel is uninstalled.