kirill-grouchnikov / substance

A modern and high-performant Swing look-and-feel library
163 stars 110 forks source link

Migration guide to v8 #90

Closed IvanRF closed 6 years ago

IvanRF commented 6 years ago

There are many changes that are straightforward and easy to find in the new code. However, it took me some time to find old constants that now have new names.

It would be nice to start a Migration guide in the docs with some general changes or tips. For example:

Before 8.0 Starting with 8.0
SubstanceLookAndFeel.FLAT_PROPERTY SubstanceSynapse.FLAT_LOOK
comp.putClientProperty(SubstanceLookAndFeel.FLAT_PROPERTY, Boolean.TRUE) SubstanceCortex.ComponentOrParentScope.setFlatBackground(comp, true)
SubstanceLookAndFeel.WINDOW_MODIFIED SubstanceSynapse.CONTENTS_MODIFIED
getRootPane().putClientProperty(SubstanceLookAndFeel.WINDOW_MODIFIED, modified) SubstanceCortex.RootPaneScope.setContentsModified(getRootPane(), modified)
LafWidget.TEXT_EDIT_CONTEXT_MENU SubstanceSynapse.TEXT_EDIT_CONTEXT_MENU
JComponent.putClientProperty(LafWidget.TEXT_EDIT_CONTEXT_MENU, Boolean.TRUE) SubstanceCortex.GlobalScope.setTextEditContextMenuPresence(true)
SubstanceLookAndFeel.setDecorationType(panel, DecorationAreaType.GENERAL) SubstanceCortex.ComponentOrParentChainScope.setDecorationType.setDecorationType(panel, DecorationAreaType.GENERAL)
UIManager.put(SubstanceLookAndFeel.SHOW_EXTRA_WIDGETS, Boolean.TRUE) SubstanceCortex.GlobalScope.setExtraWidgetsPresence(true)
SubstanceLookAndFeel functions like setSkin, getCurrentSkin, registerSkinChangeListener, setFontPolicy, etc. All these functions are in SubstanceCortex.GlobalScope class
kirill-grouchnikov commented 6 years ago

DecorationPainterUtils is an internal class.

SubstanceCortex is the main entry point to customize Substance behavior, along with additional APIs in org.pushingpixels.substance.api and its subpackages.

At the present moment the consolidation of older APIs under the SubstanceCortex roof is the new world, and a complete migration guide beyond this will not happen.

IvanRF commented 6 years ago

DecorationPainterUtils is an internal class.

Sorry, I just saw the correct function: SubstanceCortex.ComponentOrParentChainScope.setDecorationType.

At the present moment the consolidation of older APIs under the SubstanceCortex roof is the new world

OK, I like that, now that I think about it everything I used is in that class, it will make the transition easier.