downloadeventlistener.java

来自「peeranha42是jxta的 p2p程序核心」· Java 代码 · 共 46 行

JAVA
46
字号
package de.uni_bremen.informatik.p2p.plugins.filesharing.gui.event;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import de.uni_bremen.informatik.p2p.plugins.filesharing.control.UserInputManager;


/**
 * This class is the buttonlistener of all buttons of the download panel.
 * Therefor it implements functions of ActionListener.
 *
 * @author Philipp Hoheisel, Cecile Prigge, Lars Kordes
 */
public class DownloadEventListener
    implements ActionListener {
    /**
     * Method for incoming actionevents.
     *
     * @param arg0 Incoming actionevent.
     *
     * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
     */
    public void actionPerformed(ActionEvent arg0) {
        if (arg0.getActionCommand()
                    .equals("Remove")) {
            UserInputManager.clearDownloadList();
        } else if (arg0.getActionCommand()
                           .equals("Clear")) {
            UserInputManager.clearAllDownloadList();
        } else if (arg0.getActionCommand()
                           .equals("Start")) {
            UserInputManager.startDownload();
        } else if (arg0.getActionCommand()
                           .equals("Stop")) {
            UserInputManager.stopDownload();
        } else if (arg0.getActionCommand()
                           .equals("Cancel")) {
            UserInputManager.cancelDownload();
        } /*else if (arg0.getActionCommand()
                .equals("Directory")) {
            UserInputManager.chooseDownloadDirectory();
        }*/
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?