ilog.views.util.swing.calendar.plaf
Class IlvLookAndFeelSupport

java.lang.Object
  extended by ilog.views.util.swing.calendar.plaf.IlvLookAndFeelSupport

public class IlvLookAndFeelSupport
extends Object

IlvLookAndFeelSupport provides two basic facilities that allow the Swing calendar components and their LAF implementations to integrate seamlessly into the Swing framework:

This provides the same public behavior for the calendar components as for the standard Swing components. The Swing LookAndFeel implementations handle this registration for the standard Swing components when the LAF is installed. However, the LookAndFeel implementations contain hard-coded lists of the standard Swing components, their UI delegate implementations, and their fonts and colors. Therefore, custom components cannot be simply added to the existing LookAndFeel implementations. Instead, this class listens for notification that a LookAndFeel has been installed and then supplements the initialization of the standard Swing components into the UIManager with initialization of the custom components.

Since:
JViews 5.5

Constructor Summary
protected IlvLookAndFeelSupport()
          Creates a new IlvLookAndFeelSupport.
 
Method Summary
protected  String getDefaultUIDelegate(String uiClassID, String lafID)
          Returns the UI delegate implementation for the specified component and the specified LAF.
static IlvLookAndFeelSupport getInstance()
          Returns the shared support instance that is handling the look and feel integration into Swing for the calendar components.
protected  List getUIClassIDs()
          Returns a list of the component UI class IDs that have been mapped to UI delegate implementations by the setDefaultUIDelegate(java.lang.String, java.lang.String, java.lang.String) method.
protected  void initComponentDefaults(UIDefaults defaults, LookAndFeel laf)
          Updates the specified defaults table with the default component properties for the specified look and feel.
protected  void initDefaultUIDelegates()
          Initializes the mapping between components and their UI delegate implementations for each LAF.
static void initialize()
          Initializes the shared support instance, if necessary, that will handle the look and feel integration into Swing for the calendar components.
protected  void setDefaultUIDelegate(String uiClassID, String lafID, String uiClassName)
          Sets the mapping between a component and its UI delegate implementation for a specific LAF.
static void setInstance(IlvLookAndFeelSupport lafManager)
          Sets the shared support instance that will handle the look and feel integration into Swing for the calendar components.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlvLookAndFeelSupport

protected IlvLookAndFeelSupport()
Creates a new IlvLookAndFeelSupport.

Method Detail

getInstance

public static final IlvLookAndFeelSupport getInstance()
Returns the shared support instance that is handling the look and feel integration into Swing for the calendar components.


setInstance

public static final void setInstance(IlvLookAndFeelSupport lafManager)
Sets the shared support instance that will handle the look and feel integration into Swing for the calendar components.

Parameters:
lafManager - The look and feel support manager.

initialize

public static final void initialize()
Initializes the shared support instance, if necessary, that will handle the look and feel integration into Swing for the calendar components. This method must be invoked from the updateUI method in every custom component class whose look and feel is being managed by this class:
 public void updateUI() {
   IlvLookAndFeelSupport.initialize();
   setUI((...)UIManager.getUI(this));
 }
 


getUIClassIDs

protected final List getUIClassIDs()
Returns a list of the component UI class IDs that have been mapped to UI delegate implementations by the setDefaultUIDelegate(java.lang.String, java.lang.String, java.lang.String) method.

Returns:
The list of registered UI class IDs.

setDefaultUIDelegate

protected final void setDefaultUIDelegate(String uiClassID,
                                          String lafID,
                                          String uiClassName)
Sets the mapping between a component and its UI delegate implementation for a specific LAF. The mapping you set for the Metal look and feel will provide the default UI implementation for LAFs on which you do not explicitly set a mapping. You should call this method from initDefaultUIDelegates() to initialize the mapping between components and their UI delegate implementations for each LAF.

Parameters:
uiClassID - The component's UI class ID. For example: "CalendarPanelUI".
lafID - The ID of the look and feel. The "Metal" ID sets the default for LAFs that you do not explicitly specify.
uiClassName - The fully qualified class name of the UI delegate.
See Also:
getDefaultUIDelegate(java.lang.String, java.lang.String)

getDefaultUIDelegate

protected final String getDefaultUIDelegate(String uiClassID,
                                            String lafID)
Returns the UI delegate implementation for the specified component and the specified LAF. If you have not explicitly specified a delegate for the LAF, the UI delegate implementation that you specified for the Metal look and feel will be returned.

Parameters:
uiClassID - The component's UI class ID. For example: "CalendarPanelUI".
lafID - The ID of the look and feel.
Returns:
The fully qualified class name of the UI delegate.
See Also:
setDefaultUIDelegate(java.lang.String, java.lang.String, java.lang.String)

initDefaultUIDelegates

protected void initDefaultUIDelegates()
Initializes the mapping between components and their UI delegate implementations for each LAF. This method calls the setDefaultUIDelegate(java.lang.String, java.lang.String, java.lang.String) method to establish the mappings.


initComponentDefaults

protected void initComponentDefaults(UIDefaults defaults,
                                     LookAndFeel laf)
Updates the specified defaults table with the default component properties for the specified look and feel.

Parameters:
defaults - The defaults table.
laf - The look and feel.


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.   . All Rights Reserved.