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


Java IconNotification类代码示例

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


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

示例1: buildNotification

import com.notification.types.IconNotification; //导入依赖的package包/类
@Override
public IconNotification buildNotification(ThemePackage pack, Object... args) {
	if (args.length != 4)
		throw new NotificationException("IconNotifications need three arguments: title, subtitle, icon!");

	IconNotification note = new IconNotification();
	note.setWindowTheme(pack.getTheme(WindowTheme.class));
	note.setTextTheme(pack.getTheme(TextTheme.class));
	note.setFrom((String) args[0]);
	note.setTitle((String) args[1]);
	note.setSubtitle((String) args[2]);
	note.setIcon((Icon) args[3]);
	return note;
}
 
开发者ID:OwaNotifier,项目名称:owa-notifier,代码行数:15,代码来源:NotificationFactory.java

示例2: buildNotification

import com.notification.types.IconNotification; //导入依赖的package包/类
@Override
public IconNotification buildNotification(ThemePackage pack, Object... args) {
	if (args.length != 3)
		throw new NotificationException("IconNotifications need three arguments: title, subtitle, icon!");

	IconNotification note = new IconNotification();
	note.setWindowTheme(pack.getTheme(WindowTheme.class));
	note.setTextTheme(pack.getTheme(TextTheme.class));
	note.setTitle((String) args[0]);
	note.setSubtitle((String) args[1]);
	note.setIcon((Icon) args[2]);
	return note;
}
 
开发者ID:cowthan,项目名称:JavaAyo,代码行数:14,代码来源:NotificationFactory.java

示例3: testIconNotification

import com.notification.types.IconNotification; //导入依赖的package包/类
@Test
public void testIconNotification() {
	NotificationFactory factory = new NotificationFactory(s_pack);
	IconNotification note = factory.buildIconNotification(TITLE, SUBTITLE, ICON);
	assertEquals("IconNotification should have the same title", TITLE, note.getTitle());
	assertEquals("IconNotification should have the same subtitle", SUBTITLE, note.getSubtitle());
	assertEquals("IconNotification should have the same icon", ICON, note.getIcon());
}
 
开发者ID:spfrommer,项目名称:JCommunique,代码行数:9,代码来源:NotificationFactoryTest.java

示例4: getNotification

import com.notification.types.IconNotification; //导入依赖的package包/类
/**
 * @return the notification
 */
public IconNotification getNotification() {
	return notification;
}
 
开发者ID:OwaNotifier,项目名称:owa-notifier,代码行数:7,代码来源:SwingDesktopProxy.java

示例5: setNotification

import com.notification.types.IconNotification; //导入依赖的package包/类
/**
 * @param notification the notification to set
 */
public void setNotification(IconNotification notification) {
	this.notification = notification;
}
 
开发者ID:OwaNotifier,项目名称:owa-notifier,代码行数:7,代码来源:SwingDesktopProxy.java

示例6: main

import com.notification.types.IconNotification; //导入依赖的package包/类
public static void main(String[] args) throws InterruptedException {
	// this will make the Notifications match the limits of the platform
	// this will mean no fading on unix machines (since it doesn't look too good)
	// Platform.instance().setAdjustForPlatform(true);

	// makes a factory with the built-in clean dark theme
	NotificationFactory factory = new NotificationFactory(ThemePackagePresets.cleanDark());
	// a normal manager that just pops up the notification
	NotificationManager plain = new SimpleManager(Location.NORTHWEST);
	// a fade manager that will make the window fade in and out over a two second period
	SimpleManager fade = new SimpleManager(Location.SOUTHWEST);
	fade.setFadeEnabled(true);
	fade.setFadeTime(Time.seconds(2));

	// adds a text notification to the first manager
	TextNotification notification = factory.buildTextNotification("This is the dark theme", "No fade");
	notification.setCloseOnClick(true);
	// the notification will stay there forever until you click it to exit
	plain.addNotification(notification, Time.infinite());

	Thread.sleep(2000);
	// adds an icon notification that should fade in - note that results may vary depending on the platform
	IconNotification icon = factory.buildIconNotification("This is a really really really long title", "See the cutoff?",
			IconUtils.createIcon("/com/demo/exclamation.png", 50, 50));
	fade.addNotification(icon, Time.seconds(2));

	Thread.sleep(6000);
	AcceptNotification accept = factory.buildAcceptNotification("Do you accept?", "This is a fading notification.");
	fade.addNotification(accept, Time.infinite());

	boolean didAccept = accept.blockUntilReply();
	ProgressBarNotification reply = null;
	if (didAccept) {
		reply = factory.buildProgressBarNotification("You accepted");
	} else {
		reply = factory.buildProgressBarNotification("You did not accept");
	}
	reply.setCloseOnClick(true);
	fade.addNotification(reply, Time.infinite());

	for (int i = 0; i < 100; i++) {
		reply.setProgress(i);
		Thread.sleep(100);
	}
	fade.removeNotification(reply);
}
 
开发者ID:cowthan,项目名称:JavaAyo,代码行数:47,代码来源:SimpleManagerDemo.java

示例7: main

import com.notification.types.IconNotification; //导入依赖的package包/类
public static void main(String[] args) throws InterruptedException {
	// this will make the Notifications match the limits of the platform
	// this will mean no fading on unix machines (since it doesn't look too good)
	// Platform.instance().setAdjustForPlatform(true);

	// makes a factory with the built-in clean dark theme
	NotificationFactory factory = new NotificationFactory(ThemePackagePresets.cleanDark());
	// a normal manager that just pops up the notification
	NotificationManager plain = new SimpleManager(Location.NORTHWEST);
	// a fade manager that will make the window fade in and out over a two second period
	SimpleManager fade = new SimpleManager(Location.SOUTHWEST);
	fade.setFadeEnabled(true);
	fade.setFadeTime(Time.seconds(2));

	// adds a text notification to the first manager
	TextNotification notification = factory.buildTextNotification("This is the dark theme",
			"You can have multiple lines\nOf subtitle text as well\nLine 3");
	notification.setCloseOnClick(true);
	// the notification will stay there forever until you click it to exit
	plain.addNotification(notification, Time.infinite());

	Thread.sleep(2000);
	// adds an icon notification that should fade in - note that results may vary depending on the platform
	IconNotification icon = factory.buildIconNotification("This is a really really really long title", "See the cutoff?",
			IconUtils.createIcon("/com/demo/exclamation.png", 50, 50));
	fade.addNotification(icon, Time.seconds(2));

	Thread.sleep(6000);
	AcceptNotification accept = factory.buildAcceptNotification("Do you accept?", "This is a fading notification.");
	fade.addNotification(accept, Time.infinite());

	boolean didAccept = accept.blockUntilReply();
	ProgressBarNotification reply = null;
	if (didAccept) {
		reply = factory.buildProgressBarNotification("You accepted");
	} else {
		reply = factory.buildProgressBarNotification("You did not accept");
	}
	reply.setCloseOnClick(true);
	fade.addNotification(reply, Time.infinite());

	for (int i = 0; i < 100; i++) {
		reply.setProgress(i);
		Thread.sleep(100);
	}
	fade.removeNotification(reply);
}
 
开发者ID:spfrommer,项目名称:JCommunique,代码行数:48,代码来源:SimpleManagerDemo.java

示例8: buildIconNotification

import com.notification.types.IconNotification; //导入依赖的package包/类
/**
 * Builds an IconNotification.
 *
 * @param from
 * 			  the from field to display
 * @param title
 *            the title to display on the IconNotification
 * @param subtitle
 *            the subtitle to display on the IconNotification
 * @param icon
 *            the icon on the IconNotification
 * @return the built IconNotification
 */
public IconNotification buildIconNotification(String from, String title, String subtitle, ImageIcon icon) {
	return build(IconNotification.class, from, title, subtitle, icon);
}
 
开发者ID:OwaNotifier,项目名称:owa-notifier,代码行数:17,代码来源:NotificationFactory.java

示例9: buildIconNotification

import com.notification.types.IconNotification; //导入依赖的package包/类
/**
 * Builds an IconNotification.
 *
 * @param title
 *            the title to display on the IconNotification
 * @param subtitle
 *            the subtitle to display on the IconNotification
 * @param icon
 *            the icon on the IconNotification
 * @return the built IconNotification
 */
public IconNotification buildIconNotification(String title, String subtitle, ImageIcon icon) {
	return build(IconNotification.class, title, subtitle, icon);
}
 
开发者ID:cowthan,项目名称:JavaAyo,代码行数:15,代码来源:NotificationFactory.java


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