/*
   * (non-Javadoc)
   *
   * @see org.jvnet.flamingo.ribbon.ui.BasiccommandButtonUI#installListeners()
   */
  @Override
  protected void installListeners() {
    super.installListeners();

    this.substanceVisualStateTracker.installListeners(this.commandButton);

    this.substancePropertyListener =
        new PropertyChangeListener() {
          @Override
          public void propertyChange(PropertyChangeEvent evt) {
            if ("actionModel".equals(evt.getPropertyName())) {
              if (substanceModelChangeListener != null)
                substanceModelChangeListener.unregisterListeners();
              substanceModelChangeListener =
                  new GhostingListener(commandButton, commandButton.getActionModel());
              substanceModelChangeListener.registerListeners();
            }
            if ("enabled".equals(evt.getPropertyName())) {
              overallRolloverModel.setEnabled(commandButton.isEnabled());
            }
          }
        };
    this.commandButton.addPropertyChangeListener(this.substancePropertyListener);

    this.substanceModelChangeListener =
        new GhostingListener(this.commandButton, this.commandButton.getActionModel());
    this.substanceModelChangeListener.registerListeners();

    this.substanceOverallRolloverListener =
        new RolloverControlListener(this, this.overallRolloverModel);
    this.commandButton.addMouseListener(this.substanceOverallRolloverListener);
    this.commandButton.addMouseMotionListener(this.substanceOverallRolloverListener);

    this.overallStateTransitionTracker.registerModelListeners();
  }
  /*
   * (non-Javadoc)
   *
   * @see org.jvnet.flamingo.ribbon.ui.BasiccommandButtonUI#installDefaults()
   */
  @Override
  protected void installDefaults() {
    super.installDefaults();
    this.commandButton.putClientProperty(
        SubstanceLookAndFeel.BUTTON_SHAPER_PROPERTY, ClassicButtonShaper.INSTANCE);

    this.commandButton.setOpaque(false);
  }
  /*
   * (non-Javadoc)
   *
   * @see
   * org.jvnet.flamingo.ribbon.ui.BasiccommandButtonUI#uninstallListeners()
   */
  @Override
  protected void uninstallListeners() {
    this.substanceVisualStateTracker.uninstallListeners(this.commandButton);
    this.substanceVisualStateTracker = null;

    this.commandButton.removePropertyChangeListener(this.substancePropertyListener);
    this.substancePropertyListener = null;

    this.substanceModelChangeListener.unregisterListeners();
    this.substanceModelChangeListener = null;

    this.commandButton.removeMouseListener(this.substanceOverallRolloverListener);
    this.commandButton.removeMouseMotionListener(this.substanceOverallRolloverListener);
    this.substanceOverallRolloverListener = null;

    this.overallStateTransitionTracker.unregisterModelListeners();

    super.uninstallListeners();
  }