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


Java QueueManager类代码示例

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


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

示例1: main

import com.notification.manager.QueueManager; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
	Platform.instance().setAdjustForPlatform(true);

	NotificationFactory factory = new NotificationFactory(ThemePackagePresets.cleanLight());
	QueueManager manager = new QueueManager(Location.NORTHWEST);
	// sets how quickly old notifications should move out of the way for new ones
	manager.setSnapFactor(0.23);

	for (int i = 0; i < 10; i++) {
		int type = i % 3;
		WindowNotification note = null;
		switch (type) {
		case 0:
			note = factory.buildIconNotification("IconNotification", "Subtitle",
					IconUtils.createIcon("/com/demo/exclamation.png", 50, 50));
			break;
		case 1:
			note = factory.buildTextNotification("TextNotification", "Subtitle");
			break;
		case 2:
			note = factory.buildAcceptNotification("AcceptNotification", "Do you accept?");
			break;
		}
		// when the notification is clicked, it should hide itself
		note.setCloseOnClick(true);
		// make it show in the queue for five seconds
		manager.addNotification(note, Time.seconds(10));
		// one second delay between creations
		Thread.sleep(1000);
	}
}
 
开发者ID:cowthan,项目名称:JavaAyo,代码行数:32,代码来源:QueueManagerDemo.java

示例2: buildManager

import com.notification.manager.QueueManager; //导入依赖的package包/类
protected NotificationManager buildManager() {
		QueueManager manager = new QueueManager(Location.NORTHEAST);
//		manager.setFadeEnabled(true);	// this is a feature under testing - it doesn't look good across all platforms
		return manager;
	}
 
开发者ID:spookygames,项目名称:gdx-notifications,代码行数:6,代码来源:DesktopNotificationHandler.java


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