net.sourceforge.mlf.metouia
Class MetouiaLookAndFeel

java.lang.Object
  extended byjavax.swing.LookAndFeel
      extended byjavax.swing.plaf.basic.BasicLookAndFeel
          extended byjavax.swing.plaf.metal.MetalLookAndFeel
              extended bynet.sourceforge.mlf.metouia.MetouiaLookAndFeel
All Implemented Interfaces:
java.io.Serializable

public class MetouiaLookAndFeel
extends javax.swing.plaf.metal.MetalLookAndFeel

This is the main class of the Metouia Look and Feel. It registers the UI delegates for all swing widgets and installs the default color theme.

See Also:
Serialized Form

Field Summary
protected static MetouiaDefaultTheme metouiaTheme
          The current Metouia compatible theme.
 
Constructor Summary
MetouiaLookAndFeel()
          This constructor installs the Metouia Look and Feel with the default color theme.
 
Method Summary
protected  void createDefaultTheme()
          Creates the default theme and installs it.
 java.lang.String getDescription()
          Return a one line description of this look and feel implementation, e.g.
static java.awt.Color getGradientReflection()
          Gets the upper gradient color for components like JButton, JMenuBar and JProgressBar.
static java.awt.Color getGradientShadow()
          Gets the lower gradient color for components like JButton, JMenuBar and JProgressBar.
static java.awt.Color getGradientTranslucentReflection()
          Gets the transluscent variation of the upper gradient color for components like JButton, JMenuBar and JProgressBar.
static java.awt.Color getGradientTranslucentShadow()
          Gets the transluscent variation of the lower gradient color for components like JButton, JMenuBar and JProgressBar.
 java.lang.String getID()
          Return a string that identifies this look and feel.
 java.lang.String getName()
          Return a short string that identifies this look and feel, e.g.
protected  void initClassDefaults(javax.swing.UIDefaults table)
          Initializes the uiClassID to BasicComponentUI mapping.
protected  void initComponentDefaults(javax.swing.UIDefaults table)
          Initializes the default values for many ui widgets and puts them in the given ui defaults table.
protected  void initSystemColorDefaults(javax.swing.UIDefaults table)
          Initializes the system colors.
 boolean isNativeLookAndFeel()
          If the underlying platform has a "native" look and feel, and this is an implementation of it, return true.
 boolean isSupportedLookAndFeel()
          Return true if the underlying platform supports and or permits this look and feel.
static void setCurrentTheme(javax.swing.plaf.metal.MetalTheme theme)
          Sets the current color theme.
 
Methods inherited from class javax.swing.plaf.metal.MetalLookAndFeel
getAcceleratorForeground, getAcceleratorSelectedForeground, getBlack, getControl, getControlDarkShadow, getControlDisabled, getControlHighlight, getControlInfo, getControlShadow, getControlTextColor, getControlTextFont, getDefaults, getDesktopColor, getFocusColor, getHighlightedTextColor, getInactiveControlTextColor, getInactiveSystemTextColor, getMenuBackground, getMenuDisabledForeground, getMenuForeground, getMenuSelectedBackground, getMenuSelectedForeground, getMenuTextFont, getPrimaryControl, getPrimaryControlDarkShadow, getPrimaryControlHighlight, getPrimaryControlInfo, getPrimaryControlShadow, getSeparatorBackground, getSeparatorForeground, getSubTextFont, getSupportsWindowDecorations, getSystemTextColor, getSystemTextFont, getTextHighlightColor, getUserTextColor, getUserTextFont, getWhite, getWindowBackground, getWindowTitleBackground, getWindowTitleFont, getWindowTitleForeground, getWindowTitleInactiveBackground, getWindowTitleInactiveForeground, provideErrorFeedback
 
Methods inherited from class javax.swing.plaf.basic.BasicLookAndFeel
createAudioAction, getAudioActionMap, loadSystemColors, playSound
 
Methods inherited from class javax.swing.LookAndFeel
getDesktopPropertyValue, initialize, installBorder, installColors, installColorsAndFont, loadKeyBindings, makeComponentInputMap, makeIcon, makeInputMap, makeKeyBindings, toString, uninitialize, uninstallBorder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

metouiaTheme

protected static MetouiaDefaultTheme metouiaTheme
The current Metouia compatible theme.

Constructor Detail

MetouiaLookAndFeel

public MetouiaLookAndFeel()
This constructor installs the Metouia Look and Feel with the default color theme.

Method Detail

getID

public java.lang.String getID()
Return a string that identifies this look and feel. This string will be used by applications/services that want to recognize well known look and feel implementations. Presently the well known names are "Motif", "Windows", "Mac", "Metal". Note that a LookAndFeel derived from a well known superclass that doesn't make any fundamental changes to the look or feel shouldn't override this method.

Returns:
The Metouia Look and Feel identifier.

getName

public java.lang.String getName()
Return a short string that identifies this look and feel, e.g. "CDE/Motif". This string should be appropriate for a menu item. Distinct look and feels should have different names, e.g. a subclass of MotifLookAndFeel that changes the way a few components are rendered should be called "CDE/Motif My Way"; something that would be useful to a user trying to select a L&F from a list of names.

Returns:
The look and feel short name.

getDescription

public java.lang.String getDescription()
Return a one line description of this look and feel implementation, e.g. "The CDE/Motif Look and Feel". This string is intended for the user, e.g. in the title of a window or in a ToolTip message.

Returns:
The look and feel short description.

isNativeLookAndFeel

public boolean isNativeLookAndFeel()
If the underlying platform has a "native" look and feel, and this is an implementation of it, return true. For example a CDE/Motif look and implementation would return true when the underlying platform was Solaris.


isSupportedLookAndFeel

public boolean isSupportedLookAndFeel()
Return true if the underlying platform supports and or permits this look and feel. This method returns false if the look and feel depends on special resources or legal agreements that aren't defined for the current platform.


initClassDefaults

protected void initClassDefaults(javax.swing.UIDefaults table)
Initializes the uiClassID to BasicComponentUI mapping. The JComponent classes define their own uiClassID constants. This table must map those constants to a BasicComponentUI class of the appropriate type.

Parameters:
table - The ui defaults table.

createDefaultTheme

protected void createDefaultTheme()
Creates the default theme and installs it. The MetouiaDefaultTheme is used as default.


setCurrentTheme

public static void setCurrentTheme(javax.swing.plaf.metal.MetalTheme theme)
Sets the current color theme. Warning: The them must be an instance of MetouiaDefaultTheme!

Parameters:
theme - The theme to install.

initSystemColorDefaults

protected void initSystemColorDefaults(javax.swing.UIDefaults table)
Initializes the system colors.

Parameters:
table - The ui defaults table.

initComponentDefaults

protected void initComponentDefaults(javax.swing.UIDefaults table)
Initializes the default values for many ui widgets and puts them in the given ui defaults table. Here is the place where borders can be changed.

Parameters:
table - The ui defaults table.

getGradientReflection

public static java.awt.Color getGradientReflection()
Gets the upper gradient color for components like JButton, JMenuBar and JProgressBar.

Returns:
The gradient reflection color.

getGradientShadow

public static java.awt.Color getGradientShadow()
Gets the lower gradient color for components like JButton, JMenuBar and JProgressBar.

Returns:
The gradient shadow color.

getGradientTranslucentReflection

public static java.awt.Color getGradientTranslucentReflection()
Gets the transluscent variation of the upper gradient color for components like JButton, JMenuBar and JProgressBar.

Returns:
The transluscent gradient reflection color.

getGradientTranslucentShadow

public static java.awt.Color getGradientTranslucentShadow()
Gets the transluscent variation of the lower gradient color for components like JButton, JMenuBar and JProgressBar.

Returns:
The transluscent gradient shadow color.