-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Component styling support and UI class revamp #476
Comments
Split pane internal code have gone through a complete rework, so split pane now fully supports styling for all of its parts. Due to multiple limitations of `BasicSplitPaneUI` WebLaF now features its own basic UI in form of `WSplitPaneUI`. Also Swing divider component implementation was based on AWT `Component` which did not allow attaching WebLaF styling to it, so `BasicSplitPaneDivider` was also replaced with new `WebSplitPaneDivider` component (based on `JComponent`) which is fully supported by new styling system. SplitPane [ #476 ] - WSplitPaneUI.java - Now fully replaces `BasicSplitPaneUI` and has a few optimizations and adjustments - WSplitPaneUI.java - Added non-continuous divider placement adjustment according to decoration border insets - WSplitPaneUI.java - Now features a separate listener that updates divider visibility depending on the split pane sides availability - WSplitPaneListener.java - New class containing basic listeners from `BasicSplitPaneUI` for `WSplitPaneUI` - SplitPaneLayout.java - New basic layout for `WSplitPaneUI` - WebSplitPaneUI.java - Optimized for new basic `WSplitPaneUI` usage, removed some redundant code parts - WebSplitPaneDivider.java - New divider component that replaces `BasicSplitPaneDivider` and utilizes styling system - ComponentType.xsd - Added new divider component type constant - SplitPanePainter.java, SplitPaneDividerPainter.java - Added `JSplitPane` orientation -based states for styling convenience - splitpanedivider.xml, StyleId.java - New styling for `JSplitPane` divider component - splitpane.xml - Added `non-opaque`, `transparent`, `decorated` and `focusable` styles Button - WButtonListener.java - Reworked to separate instances of `Action` class for each of supported actions - WButtonListener.java - Replaced `LazyActionMap` with `UIActionMap` usage, it will slightly affect memory but improve code a lot - WButtonUI.java - Simplified `WButtonListener` usage ScrollPane - scrollpane.xml - Added `undecorated-buttonless` style to cover some additional use cases - scrollbar.xml - Adjusted margin setting for `buttonless` style ColorChooser - WebColorChooserUI.java, colorchooser.xml - Now uses a separate style identifier for `WebColorChooserPanel` - WebColorChooserPanel.java - Added constructors to allow providing custom style identifiers - colorchooserpanel.xml - Separate style file for `WebColorChooserPanel` - colorchooser.xml - Added separate dark style [ #54 ] Canvas - WebCanvas.java - States list now always exists for override convenience - WebCanvas.java - Returns a copy of states for method override convenience - WebCanvas.java - Added methods to add/remove `Collection` of states - WebCanvas.java - Updated JavaDoc Trees - TreePainter.java - Enhanced full-line nodes selection on mouse events - WebFileTree.java - Now shows root handles by default StyleManager - StyleData.java - Added install and uninstall methods to allow appropriate listeners handling - StyleData.java - Added some missing EDT checks - StyleManager.java, - Added separate `StyleData` install and uninstall calls for skin installation and uninstallation Painter - AbstractPainter.java - Separated `install` and `uninstall` methods into smaller pieces for override convenience - AbstractDecorationPainter.java - Fixed issue with border not being initialized properly when based on specific decoration state - Updated all painters related to `AbstractPainter` to use newly added methods instead of overriding `install` and `uninstall` Decoration - DecorationState.java - Added `one-touch` state and missing JavaDocs - CheckIcon.java, MixedIcon.java, RadioIcon.java - Updated identifiers to be unique and replaceable - AlignLayout.java - New `IContentLayout` implementation that copies `AlignLayout` behavior for contents - AlignLayout.xsd, IContent.xsd - New XSD for `AlignLayout` class - AlignLayout.java, BorderLayout.java, WebCanvas.java, AdaptiveCanvasPainter.java - Minor JavaDoc updates - AlphaLayerBackground.java - Added default values for settings for convenience IconManager - LazyIcon.java - Added better `toString` implementation Utilities - CollectionUtils.java - Fixed non-strict lists equality check for cases with duplicate entries in first list - CollectionUtils.java - Added method to remove `Collection` of elements from another `Collection` - CollectionUtils.java - Added method to sort `List` of elements using any `Comparator` - CollectionUtils.java - Renamed multiple methods for usage convenience - ColorUtils.java - Simplified method names for convenient, refactored code, updated JavaDoc - ColorUtils.java - Added color caching for methods with predictable outcome to optimize memory usage - ColorConverter.java - Slightly refactored code, removed unnecessary variables - AbstractUnits.java, ModifierType.java - Added `Locale.ROOT` usage to `toLowerCase` methods - ValuesTable.java, ValuesTableConverter.java - Removed `ValuesTable` as deprecated and redundant feature - DoubleMap.java, MapUtils.java - Removed `DoubleMap` as deprecated and redundant feature - IndexedSupplier.java, CollectionUtils.java - Replaced `IndexedSupplier` with simple `Function` usage - SelectorUtils.java - Separated from `LafUtils`, will be revamped later on - LoremIpsum.java - Made serializable for convenience - LafUtils.java - Cleared from deprecated methods LookAndFeel - UIAction.java - New custom `Action` for usage within `ActionMap`s in UI classes, unlike `sun.swing.UIAction` it is not designed to be used globally - UIActionMap.java - New custom `ActionMap` for usage in UI classes instead of `LazyActionMap` - LazyActionMap.java - Slightly updated code, marked as deprecated, added information on why usage will be halted in later updates - WebLookAndFeel.java - Added small default divider size value to ensure it can size properly based on its style size NinePatchEditor - NinePatchEditor.java, LafUtils.java - Replaced alpha background painting with `AlphaLayerBackground` usage - ninepatcheditor.xml - Added dark style, removed unnecessary default settings [ #54 ] DemoApplication - JSplitPaneExample.java, demo-language.xml, jsplitpane.png - Added `JSplitPane` examples - JScrollPaneExample.java - Added extra style example - AbstractExample.java - Adjusted example scroll pane to look better - JPanelExample.java - Minor code refactoring
|
|
|
Updated information in the main post. I plan to finish all stuff planned on this issue by the time I get to v1.3.0. Also some of the components might stay backed by Swing UI implementations until project is moved to newer JDK as rewriting the UI might be unnecessary for those components in the first place. |
- WInternalFrameUI.java, WInternalFrameInputListener.java - Added to replace `BasicInternalFrameUI` class and fix some of it's issues - WInternalFrameInputListener.java - Added `MouseEvent` filter for double-click on title pane for left mouse button only - InternalFrameInputListener.java - New interface for distinct internal frame UI input listeners - WDesktopPaneUI.java, WDesktopPaneInputListener.java - Added to replace `BasicDesktopPaneUI` class - DesktopPaneInputListener.java - New interface for distinct desktop pane UI input listener - WDesktopIconUI.java, WDesktopIconInputListener.java - Added to replace `BasicDesktopIconUI` class - DesktopIconInputListener.java - New interface for distinct desktop icon UI input listener - Updated all related painters and descriptors Button - ButtonInputListener.java - New interface for distinct button UI input listeners - AbstractButtonPainter.java - Fixed possible NPE Tree - TreePainter.java - Fixed possible NPE SplitPane - SplitPaneInputListener.java - New interface for distinct split pane UI input listeners LanguageManager - LanguageManager.java - Added methods for registering component-related listeners - Dictionary.java - Replaced junky part of the code that detected supported locales - Refactored some outdated classes and APIs, added missing JavaDoc and annotations NinePatchEditor - NinePatchEditorStyles.java - Moved editor-related styles here from `StyleId` - NinePatchEditorPanel.java - Replaced `StyleId` references with `NinePatchEditorStyles` ones - extension.xml - Removed unused style General - Added multiple `@NotNull` and `@Nullable` annotation across modified classes - Fixed multiple possible NPEs that could have been caused by incorrect API usage - Refactored multiple methods to have single exit point, including void methods Utilities - WeakComponentDataList.java - Removed unnecessary data list copy operations - WeakComponentData.java, WeakComponentDataList.java - Fixed multiple possible NPEs - PainterSupport.java - Passed `ComponentUI` as an additional parameter to avoid retrieving it through Reflection Project - CONTRIBUTING.md - Some guidelines for contributing to WebLaF project - intellij-idea-inspections.xml - Updated inspection settings - .gitignore - Added some ignores for local files
|
Added |
Having WebSpinner and WebSlider with UI customization would be really great ! |
@mokun |
|
Some of the existing components have to be "moved" to the new
Component
-UI
-Painter
structure with all classes (except base Swing components themselves likeJLabel
) having 100% WebLaF implementation. That is very important to avoid any unnecessary interference from Swing code, for instance from basic UI classes likeBasicButtonUI
and to allow multiple performance optimizations to be made (like removing unnecessary settings changes and/or listeners).Currently there only a few components left that haven't gone through major revamp and are still solely backed by UI class implementation:
JSlider
[ Slider styling support #493 ]JScrollBar
[ Proper styling support for JScrollBar component #555 ]JToolTip
[ Add an easy way to change style of Swing tooltip separately on specific components #695 ]JMenuBar
[ Some or all JMenuBar menus might be hidden #545 ]JTabbedPane
[ Tabbed pane rendering enhancements #35 ]JDesktopPane
[ JInternalFrame, JDesktopPane and JDesktopIcon UI revamp #523 ]JInternalFrame
[ JInternalFrame, JDesktopPane and JDesktopIcon UI revamp #523 ]JDesktopIcon
[ JInternalFrame, JDesktopPane and JDesktopIcon UI revamp #523 ]WebCollapsiblePane
+WebAccordion
[ Collapsible pane and Accordion styling support #494 ]JSplitPane
WebBreadcrumb
Some other components also still need major adjustments or even complete revamps:
WebComponentPane
[ WebComponentPane update #535 ]WebSwitch
[ WebSwitch rework for complete styling support #582 ]WebCustomTooltip
[ TooltipManager improvements #520 ]WebColorChooserField
[ WebColorChooserField revamp #586 ]WebPopOver
WebPathField
WebStepProgress
WebDecoratedImage
(possibly move functionality toWebImage
?)WebFileDrop
WebImageDrop
WebImageGallery
WebMemoryBar
[ WebMemoryBar revamp #589 ]WebOverlay
[ WebOverlay component revamp #568 ]There are also quite a few components that are still using basic Swing UI classes instead of fully-custom WebLaF implementations, but which were already switched to new styling system:
JRootPane
JSpinner
JMenu
JMenuItem
JCheckBoxMenuItem
JRadioButtonMenuItem
JPopupMenu
JList
JTable
JTree
JComboBox
JTextField
JPasswordField
JFormattedTextField
JTextArea
JEditorPane
JTextPane
JToolBar
JScrollPane
JOptionPane
JColorChooser
Just to emphasize - these are components that are already fully styleable and work 100% correctly in the new versions. The only downside is the UI implementation that partially uses basic Swing UI which is quite dirty and does some unnecessary operations upon installation that are later overwritten by WebLaF anyway. While I do want to eventually get rid of all Swing UI implementations completely - it is a lot of work and it is quite low on priority list, so I'll only do it once necessary for some particular feature or improvement.
Eventually I will move all components to new UI implementations but they are already reasonably stable at this point which is why that task is not critical and low on priority list.
The text was updated successfully, but these errors were encountered: