當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。