
APPENDIX ■ ■ ■ UI Manager Properties Throughout this book are tables that list the property names and data types for all the UIResource elements of specific Swing components. Although these tables show all the information about a specific component, it is handy to have the information about property names for all of the components in one place. With that in mind, this appendix provides a complete, alphabetical list of properties used by the predefined look and feel classes—Motif, Metal/Ocean, Windows, GTK, and Synth— provided with the Swing release for the Java 2 Platform Standard Edition, version 5.0 (J2SE 5.0). The table indicates with an X which of the five look and feel classes uses a particular property. For properties defined within the base Basic look and feel, these are assumed to be used by all the look and feel types, since all of the system-defined look and feel classes extend from BasicLookAndFeel. It is possible that a subclass masks the use of a property defined for the Basic look and feel, and in fact doesn’t physically use one flagged as such in the table. Also, since the GTK look and feel is a subclass of Synth, a similar situation arises with GTK, too. To change the default setting for any of these properties, you need to notify the UIManager by storing a new setting in the lookup table of the UIManager. For instance, to change the default text for the Yes button in a JOptionPane, you need to replace the OptionPane.yesButtonText property with the new setting (Si, in this example): UIManager.put("OptionPane.yesButtonText", "Si"); Then any component created after the setting change will get the new value: Si. If you want a displayed component to get the new setting, you must call its updateUI() method after changing the setting. When you change the current look and feel, any custom settings you install may be lost. If the class of the property value setting implements the UIResource interface (an empty marker interface such as Serializable), the setting will be replaced by the default setting of the look and feel. For example, the following setting would be saved when the look and feel changes: UIManager.put("OptionPane.background", Color.RED); Conversely, the following setting would not be saved when the look and feel changes: UIManager.put("OptionPane.background", new ColorUIResource(Color.RED)); If the property value setting does not implement the UIResource interface, the property setting is retained when the look and feel changes. 813 814 APPENDIX ■ UI MANAGER PROPERTIES ■Note The specific set of available properties changes with each JFC/Project Swing release. The listing here reflects the current settings for J2SE 5.0. Some properties did not exist in earlier versions, and others may get replaced in later versions. The changes tend to be minor, but they do exist. UIResource Elements for the Predefined Look and Feel Classes Property String Object Type CDE/Motif Metal Windows GTK Synth AbstractButton.clickText String XXXXX AbstractDocument.additionText String XXXXX AbstractDocument.deletionText String XXXXX AbstractDocument.redoText String XXXXX AbstractDocument.styleChangeText String XXXXX AbstractDocument.undoText String XXXXX AbstractUndoableEdit.redoText String XXXXX AbstractUndoableEdit.undoText String XXXXX activeCaption Color XXXXX activeCaptionBorder Color XXXXX activeCaptionText Color XXXXX Application.useSystemFontSettings Boolean X X ArrowButton.size Integer X X ArrowButtonUI String X X AuditoryCues.allAuditoryCues String[ ] XXXXX AuditoryCues.cueList String[ ] XXXXX AuditoryCues.defaultCueList String[ ] X AuditoryCues.noAuditoryCues String[ ] XXXXX AuditoryCues.playList String[ ] XXXXX black Color X Button.actionMap ActionMap XXXXX Button.background Color XXXXX Button.border Border XXXXX Button.contentAreaFilled Boolean X X Button.darkShadow Color XXXXX Button.dashedRectGapHeight Integer X Button.dashedRectGapWidth Integer X APPENDIX ■ UI MANAGER PROPERTIES 815 UIResource Elements for the Predefined Look and Feel Classes (Continued) Property String Object Type CDE/Motif Metal Windows GTK Synth Button.dashedRectGapX Integer X Button.dashedRectGapY Integer X Button.defaultButtonFollowsFocus Boolean XXXXX Button.disabledForeground Color X Button.disabledGrayRange Integer[ ] X Button.disabledShadow Color X Button.disabledText Color X Button.disabledToolBarBorder➥ Color X Background Button.focus Color X X Button.focusInputMap InputMap XXXXX Button.font Font XXXXX Button.foreground Color XXXXX Button.gradient List X Button.highlight Color XXXXX Button.icon Icon X X Button.iconTextGap Integer X X Button.light Color XXXXX Button.margin Insets XXXXX Button.rollover Boolean XXXXX Button.rolloverIconType String X Button.select Color X X Button.shadow Color XXXXX Button.showMnemonics Boolean X Button.textIconGap Integer XXXXX Button.textShiftOffset Integer XXXXX Button.toolBarBorderBackground Color X ButtonUI String XXXXX caretColor Color X CheckBox.background Color XXXXX CheckBox.border Border XXXXX CheckBox.darkShadow Color X 816 APPENDIX ■ UI MANAGER PROPERTIES UIResource Elements for the Predefined Look and Feel Classes (Continued) Property String Object Type CDE/Motif Metal Windows GTK Synth CheckBox.disabledText Color X CheckBox.focus Color XXX CheckBox.focusInputMap InputMap XXXXX CheckBox.font Font XXXXX CheckBox.foreground Color XXXXX CheckBox.gradient List X CheckBox.highlight Color X CheckBox.icon Icon XXXXX CheckBox.interiorBackground Color X CheckBox.light Color X CheckBox.margin Insets XXXXX CheckBox.rollover Boolean X Checkbox.selecta Color X CheckBox.shadow Color X CheckBox.textIconGap Integer XXXXX CheckBox.textShiftOffset Integer XXXXX CheckBoxMenuItem.acceleratorFont Font XXXXX CheckBoxMenuItem.accelerator➥ Color XXXXX Foreground CheckBoxMenuItem.accelerator➥ Color XXXXX SelectionForeground CheckBoxMenuItem.actionMap ActionMap XXXXX CheckBoxMenuItem.arrowIcon Icon XXXXX CheckBoxMenuItem.background Color XXXXX CheckBoxMenuItem.border Border XXXXX CheckBoxMenuItem.borderPainted Boolean XXXXX CheckBoxMenuItem.checkIcon Icon XXXXX CheckBoxMenuItem.commandSound String XXXXX CheckBoxMenuItem.disabled➥ Color XXXXX Foreground CheckBoxMenuItem.font Font XXXXX CheckBoxMenuItem.foreground Color XXXXX CheckBoxMenuItem.gradient List X APPENDIX ■ UI MANAGER PROPERTIES 817 UIResource Elements for the Predefined Look and Feel Classes (Continued) Property String Object Type CDE/Motif Metal Windows GTK Synth CheckBoxMenuItem.margin Insets XXXXX CheckBoxMenuItem.opaque Boolean XXXXX CheckBoxMenuItem.selection➥ Color XXXXX Background CheckBoxMenuItem.selection➥ Color XXXXX Foreground CheckBoxMenuItemUI String XXXXX CheckBoxUI String XXXXX ColorChooser.background Color XXXXX ColorChooser.cancelText String XXXXX ColorChooser.font Font XXXXX ColorChooser.foreground Color XXXXX ColorChooser.hsbBlueText String XXXXX ColorChooser.hsbBrightnessText String XXXXX ColorChooser.hsbDisplayed➥ Integer XXXXX MnemonicIndex ColorChooser.hsbGreenText String XXXXX ColorChooser.hsbHueText String XXXXX ColorChooser.hsbMnemonic Integer XXXXX ColorChooser.hsbNameText String XXXXX ColorChooser.hsbRedText String XXXXX ColorChooser.hsbSaturationText String XXXXX ColorChooser.okText String XXXXX ColorChooser.panels AbstractColor➥ X X ChooserPanel[ ] ColorChooser.previewText String XXXXX ColorChooser.resetMnemonic Integer XXXXX ColorChooser.resetText String XXXXX ColorChooser.rgbBlueDisplayed➥ Integer XXXXX MnemonicIndex ColorChooser.rgbBlueMnemonic Integer XXXXX ColorChooser.rgbBlueText String XXXXX ColorChooser.rgbDisplayed➥ Integer XXXXX MnemonicIndex 818 APPENDIX ■ UI MANAGER PROPERTIES UIResource Elements for the Predefined Look and Feel Classes (Continued) Property String Object Type CDE/Motif Metal Windows GTK Synth ColorChooser.rgbGreenDisplayed➥ Integer XXXXX MnemonicIndex ColorChooser.rgbGreenMnemonic Integer XXXXX ColorChooser.rgbGreenText String XXXXX ColorChooser.rgbMnemonic Integer XXXXX ColorChooser.rgbNameText String XXXXX ColorChooser.rgbRedDisplayed➥ Integer XXXXX MnemonicIndex ColorChooser.rgbRedMnemonic Integer XXXXX ColorChooser.rgbRedText String XXXXX ColorChooser.sampleText String XXXXX ColorChooser.showPreviewPanelText Boolean XXXXX ColorChooser.swatchesDefault➥ Color XXXXX RecentColor ColorChooser.swatchesDisplayed➥ Integer XXXXX MnemonicIndex ColorChooser.swatchesMnemonic Integer XXXXX ColorChooser.swatchesNameText String XXXXX ColorChooser.swatchesRecent➥ Dimension XXXXX SwatchSize ColorChooser.swatchesRecentText String XXXXX ColorChooser.swatchesSwatchSize Dimension XXXXX ColorChooserUI String XXXXX ComboBox.actionMap ActionMap XXXXX ComboBox.ancestorInputMap InputMap XXXXX ComboBox.background Color XXXXX ComboBox.border Border XXXXX ComboBox.buttonBackground Color XXXXX ComboBox.buttonDarkShadow Color XXXXX ComboBox.buttonHighlight Color XXXXX ComboBox.buttonShadow Color XXXXX ComboBox.control Color X ComboBox.controlForeground Color X ComboBox.disabledBackground Color XXXXX APPENDIX ■ UI MANAGER PROPERTIES 819 UIResource Elements for the Predefined Look and Feel Classes (Continued) Property String Object Type CDE/Motif Metal Windows GTK Synth ComboBox.disabledForeground Color XXXXX ComboBox.font Font XXXXX ComboBox.foreground Color XXXXX ComboBox.rendererUseListColors Boolean X X ComboBox.selectionBackground Color XXXXX ComboBox.selectionForeground Color XXXXX ComboBox.showPopupOnNavigation Boolean XXXXX ComboBox.timeFactor Long XXXXX ComboBox.togglePopupText String XXXXX ComboBoxUI String XXXXX ComponentUI String XXXXX control Color XXXXX controlDkShadow Color XXXXX controlHighlight Color XXXXX
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages87 Page
-
File Size-