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