本文整理汇总了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);
}
}
}
}
示例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);
}
}
}
}