1 /* 2 * aTunes 3 * Copyright (C) Alex Aranda, Sylvain Gaudard and contributors 4 * 5 * See http://www.atunes.org/wiki/index.php?title=Contributing for information about contributors 6 * 7 * http://www.atunes.org 8 * http://sourceforge.net/projects/atunes 9 * 10 * This program is free software; you can redistribute it and/or 11 * modify it under the terms of the GNU General Public License 12 * as published by the Free Software Foundation; either version 2 13 * of the License, or (at your option) any later version. 14 * 15 * This program is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU General Public License for more details. 19 */ 20 21 package net.sourceforge.atunes.gui.views.controls; 22 23 import javax.swing.Action; 24 25 import net.sourceforge.atunes.model.IPlayerHandler; 26 import net.sourceforge.atunes.model.PlayerEngineCapability; 27 28 /** 29 * Secondary player control to manage equalizer 30 * 31 * @author alex 32 * 33 */ 34 public final class EqualizerButton extends SecondaryControl { 35 36 private static final long serialVersionUID = 6007885049773560874L; 37 38 private IPlayerHandler playerHandler; 39 40 /** 41 * @param playerHandler 42 */ setPlayerHandler(final IPlayerHandler playerHandler)43 public void setPlayerHandler(final IPlayerHandler playerHandler) { 44 this.playerHandler = playerHandler; 45 } 46 47 /** 48 * Instantiates a new equalizer button. 49 * 50 * @param a 51 */ EqualizerButton(final Action a)52 public EqualizerButton(final Action a) { 53 super(a); 54 } 55 56 /** 57 * Initializes control 58 */ initialize()59 public void initialize() { 60 if (!this.playerHandler 61 .supportsCapability(PlayerEngineCapability.EQUALIZER)) { 62 setVisible(false); 63 } 64 } 65 } 66