📄 abstractgaincontrol.java
字号:
package net.sf.fmj.ejmf.toolkit.gui.controls;import javax.media.Controller;import javax.media.GainControl;import javax.media.Player;/*** Abstract class from which AbstractListenerControls that depend* on a GainControl should extend. Upon construction it properly* set the operational state of the Control.* */public abstract class AbstractGainControl extends ActionListenerControl { private GainControl gc; /** * Create an AbstractGainControl and associate with * controller. * @param controller Controller with which this control is associated. */ protected AbstractGainControl(Skin skin, Controller controller) { super(skin, controller); } /** * Create an AbstractGainControl. Controller will be assigned * later. */ protected AbstractGainControl(Skin skin) { super(skin); } /** * Invoked when Controller is associated with Control. * Properly sets operational state and initializes * initializes private reference to GainControl if * Controller is a Player and it has a one. * @param controller Controller with which this control is associated. */ protected void setControllerHook(Controller controller) { if (controller instanceof Player) { gc = ((Player)controller).getGainControl(); setOperational(gc != null); } else { setOperational(false); } } /** * @return GainControl associated with this AbstractGainControl. */ protected GainControl getGainControl() { return gc; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -