当前位置: 首页>>代码示例>>Java>>正文


Java SettingsPanel类代码示例

本文整理汇总了Java中net.sourceforge.subsonic.booter.agent.SettingsPanel的典型用法代码示例。如果您正苦于以下问题:Java SettingsPanel类的具体用法?Java SettingsPanel怎么用?Java SettingsPanel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SettingsPanel类属于net.sourceforge.subsonic.booter.agent包,在下文中一共展示了SettingsPanel类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: Main

import net.sourceforge.subsonic.booter.agent.SettingsPanel; //导入依赖的package包/类
public Main(String contextName, List<String> args) {
    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("applicationContext" + contextName + ".xml");

    if ("-agent".equals(contextName)) {

        SubsonicAgent agent = (SubsonicAgent) context.getBean("agent");
        SettingsPanel settingsPanel = (SettingsPanel) context.getBean("settingsPanel");

        agent.setElevated(args.contains("-elevated"));

        if (args.contains("-balloon")) {
            agent.showTrayIconMessage();
        }

        if (args.contains("-stop")) {
            agent.startOrStopService(false);
            agent.showStatusPanel();
        } else if (args.contains("-start")) {
            agent.startOrStopService(true);
            agent.showStatusPanel();
        }

        if (args.contains("-settings")) {
            String[] settings = args.get(args.indexOf("-settings") + 1).split(",");
            try {
                agent.showSettingsPanel();
                settingsPanel.saveSettings(Integer.valueOf(settings[0]), Integer.valueOf(settings[1]), Integer.valueOf(settings[2]), settings[3]);
                settingsPanel.readValues();
            } catch (Exception x) {
                JOptionPane.showMessageDialog(settingsPanel, x.getMessage(), "Error", JOptionPane.WARNING_MESSAGE);
            }
        }
    }
}
 
开发者ID:sindremehus,项目名称:subsonic,代码行数:35,代码来源:Main.java

示例2: Main

import net.sourceforge.subsonic.booter.agent.SettingsPanel; //导入依赖的package包/类
public Main(String contextName, List<String> args) {
    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("applicationContext" + contextName + ".xml");

    if ("-agent".equals(contextName)) {

        SubsonicAgent agent = (SubsonicAgent) context.getBean("agent");
        SettingsPanel settingsPanel = (SettingsPanel) context.getBean("settingsPanel");

        agent.setElevated(args.contains("-elevated"));

        if (args.contains("-balloon")) {
            agent.showTrayIconMessage();
        }

        if (args.contains("-stop")) {
            agent.startOrStopService(false);
            agent.showStatusPanel();
        } else if (args.contains("-start")) {
            agent.startOrStopService(true);
            agent.showStatusPanel();
        }

        if (args.contains("-settings")) {
            String[] settings = args.get(args.indexOf("-settings") + 1).split(",");
            try {
                agent.showSettingsPanel();
                settingsPanel.saveSettings(Integer.valueOf(settings[0]), Integer.valueOf(settings[1]), Integer.valueOf(settings[2]), Integer.valueOf(settings[3]), settings[4]);
                settingsPanel.readValues();
            } catch (Exception x) {
                JOptionPane.showMessageDialog(settingsPanel, x.getMessage(), "Error", JOptionPane.WARNING_MESSAGE);
            }
        }
    }
}
 
开发者ID:FutureSonic,项目名称:FutureSonic-Server,代码行数:35,代码来源:Main.java


注:本文中的net.sourceforge.subsonic.booter.agent.SettingsPanel类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。