< prev index next >

src/java.desktop/share/classes/javax/swing/plaf/nimbus/NimbusLookAndFeel.java

Print this page

        

*** 305,335 **** * <p>Registers a third party component with the NimbusLookAndFeel.</p> * * <p>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 ! * <code>getStyle</code> method.</p> * * <p>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 <code>prefix</code></p> * * <p>For example, suppose I had a component named JFoo. Suppose I then registered * this component with the NimbusLookAndFeel in this manner:</p> * ! * <pre><code> * laf.register(NimbusFooUI.FOO_REGION, "Foo"); ! * </code></pre> * * <p>In this case, I could then register properties for this component with * UIDefaults in the following manner:</p> * ! * <pre><code> * UIManager.put("Foo.background", new ColorUIResource(Color.BLACK)); * UIManager.put("Foo.Enabled.backgroundPainter", new FooBackgroundPainter()); ! * </code></pre> * * <p>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:</p> --- 305,335 ---- * <p>Registers a third party component with the NimbusLookAndFeel.</p> * * <p>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 ! * {@code getStyle} method.</p> * * <p>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 {@code prefix}</p> * * <p>For example, suppose I had a component named JFoo. Suppose I then registered * this component with the NimbusLookAndFeel in this manner:</p> * ! * <pre>{@code * laf.register(NimbusFooUI.FOO_REGION, "Foo"); ! * }</pre> * * <p>In this case, I could then register properties for this component with * UIDefaults in the following manner:</p> * ! * <pre>{@code * UIManager.put("Foo.background", new ColorUIResource(Color.BLACK)); * UIManager.put("Foo.Enabled.backgroundPainter", new FooBackgroundPainter()); ! * }</pre> * * <p>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:</p>
*** 527,541 **** this(prefix,suffix); this.state = state; } /** ! * Creates the value retrieved from the <code>UIDefaults</code> table. * The object is created each time it is accessed. * ! * @param table a <code>UIDefaults</code> table ! * @return the created <code>Object</code> */ @Override public Object createValue(UIDefaults table) { Object obj = null; // check specified state --- 527,541 ---- this(prefix,suffix); this.state = state; } /** ! * Creates the value retrieved from the {@code UIDefaults} table. * The object is created each time it is accessed. * ! * @param table a {@code UIDefaults} table ! * @return the created {@code Object} */ @Override public Object createValue(UIDefaults table) { Object obj = null; // check specified state
< prev index next >