The look-and-feel packages
by, 04-26-2012 at 07:43 PM (607 Views)
Swing.plaf, ScrollBarUI, ButtonUI etc which are present in UI delegates defines the accurate API which can be used by a component for interaction with instance of UI delegate. It shall be noted that originally interfaces were used here but got replaced by abstract classes as it was being felt that API was immature to with-stand interface’s concrete casting. Implementation of look and feel’s root is plaf APIs.
Every implementation of look and feel gives abstract plaf classes’s concrete subclasses. All classes that are being defined by the specific implementation of look and feel are present in a package that is present in swing.plaf package. Following is present in a Look and feel package.
• LookAndFeel subclass, for example MetalLookAndFeel.
• All UI delegate classes of look-and-feel. For example, MetalTreeUI, MetalButtonUI & like).
• Any utility classes of look-and-feel. For example, MetalIconFactory, MetalGraphicsUtils & so on).
• Other resources associated linked to look-and-feel like image files.
Different Swing Look and feel implementations have so many things that were found common in them. It factored out that a common code was factored out into base look & feel implementation, which is known as basic, that makes plaf abstract classes to get extended & from which implementations of specific look and feel get extend. Basic package of Look and Feel provides support to build desktop leveled Look & feel, like CDE/Motif or Windows.