org.pietschy.command
Class MacFaceRenderer

java.lang.Object
  extended by org.pietschy.command.DefaultFaceRenderer
      extended by org.pietschy.command.MacFaceRenderer
All Implemented Interfaces:
FaceRenderer

public class MacFaceRenderer
extends DefaultFaceRenderer

The MacFaceRender extends DefaultFaceRenderer to provide Mac specific rendering of buttons and menus. In particular this renderer ensures.


Field Summary
 
Fields inherited from class org.pietschy.command.DefaultFaceRenderer
defaultGroupIcon
 
Constructor Summary
MacFaceRenderer()
           
 
Method Summary
 void configureButton(javax.swing.AbstractButton button, RenderContext buttonContext)
          Configures the specified button using the specified RenderContext.
protected  void configureIcons(javax.swing.AbstractButton button, Face face)
           
protected  void configureMnemonic(javax.swing.AbstractButton button, Face face)
           
static boolean isButtonMnemonicsEnabled()
          Checks if the renderer will be configuring mnemonics on buttons.
static boolean isMenuMnemonicsEnabled()
          Checks if the renderer will be configuring mnemonics on menu items.
 boolean isToolbar(RenderContext buttonContext)
          Checks the the current button context is rendering a toolbar.
static void setButtonMnemonicsEnabled(boolean buttonMnemonicsEnabled)
          Sets if the renderer will be configuring mnemonics on buttons.
static void setMenuMnemonicsEnabled(boolean menuMnemonicsEnabled)
          Sets if the renderer will be configuring mnemonics on menu items.
protected  boolean shouldDisplayMnemonic(javax.swing.AbstractButton button)
          Returns false.
 
Methods inherited from class org.pietschy.command.DefaultFaceRenderer
configureAccelerator, configureMenu, configureText, configureTextPosition, configureToolTip, getDefaultGroupIcon, getFace, setDefaultGroupIcon
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MacFaceRenderer

public MacFaceRenderer()
Method Detail

configureButton

public void configureButton(javax.swing.AbstractButton button,
                            RenderContext buttonContext)
Description copied from interface: FaceRenderer
Configures the specified button using the specified RenderContext.

Specified by:
configureButton in interface FaceRenderer
Overrides:
configureButton in class DefaultFaceRenderer
Parameters:
button - the button to configure.
buttonContext - the RenderContext of the button.

configureMnemonic

protected void configureMnemonic(javax.swing.AbstractButton button,
                                 Face face)
Overrides:
configureMnemonic in class DefaultFaceRenderer

configureIcons

protected void configureIcons(javax.swing.AbstractButton button,
                              Face face)
Overrides:
configureIcons in class DefaultFaceRenderer

shouldDisplayMnemonic

protected boolean shouldDisplayMnemonic(javax.swing.AbstractButton button)
Returns false.

Parameters:
button - the button to check.
Returns:
false.

isToolbar

public boolean isToolbar(RenderContext buttonContext)
Checks the the current button context is rendering a toolbar. This simply checks that the parent groups isn't null and that the button face is Face.TOOLBAR.

Parameters:
buttonContext - the RenderContext for the current button.
Returns:
true if the button has a toolbar face and is being rendered as part of a group.

isButtonMnemonicsEnabled

public static boolean isButtonMnemonicsEnabled()
Checks if the renderer will be configuring mnemonics on buttons.

Returns:
true if the buttons mnemonics are enabled, false otherwise.

setButtonMnemonicsEnabled

public static void setButtonMnemonicsEnabled(boolean buttonMnemonicsEnabled)
Sets if the renderer will be configuring mnemonics on buttons.

Parameters:
buttonMnemonicsEnabled - true if the buttons mnemonics are enabled, false otherwise.

isMenuMnemonicsEnabled

public static boolean isMenuMnemonicsEnabled()
Checks if the renderer will be configuring mnemonics on menu items.

Returns:
true if the menu mnemonics are enabled, false otherwise.

setMenuMnemonicsEnabled

public static void setMenuMnemonicsEnabled(boolean menuMnemonicsEnabled)
Sets if the renderer will be configuring mnemonics on menu items.

Parameters:
menuMnemonicsEnabled - true if the menu mnemonics are enabled, false otherwise.