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


Java EventSubscriber类代码示例

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


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

示例1: subscribeStrongly

import org.bushe.swing.event.EventSubscriber; //导入依赖的package包/类
/**
 * {@inheritDoc}.
 * <p>
 * Overridden to check that the subscription corresponds to an allowed class.
 *
 * @param classe the observed class
 * @param es     the subscriber
 * @return true if the subscriber was subscribed successfully, false otherwise
 */
@Override
public boolean subscribeStrongly (Class classe,
                                  EventSubscriber es)
{
    if (isAllowed(classe)) {
        logger.debug(
                "{}: subscription on {} by {}@{}",
                this,
                classe.getSimpleName(),
                es,
                Integer.toHexString(es.hashCode()));

        return super.subscribeStrongly(classe, es);
    } else {
        logger.error("Event {} not available on {} service", classe, name);

        return false;
    }
}
 
开发者ID:Audiveris,项目名称:audiveris,代码行数:29,代码来源:SelectionService.java

示例2: unsubscribe

import org.bushe.swing.event.EventSubscriber; //导入依赖的package包/类
@Override
public boolean unsubscribe (Class classe,
                            EventSubscriber eh)
{
    boolean res = super.unsubscribe(classe, eh);
    logger.debug(
            "{}: unsubscription on {} by {}@{} res:{}",
            this,
            classe.getSimpleName(),
            eh,
            Integer.toHexString(eh.hashCode()),
            res);

    return res;
}
 
开发者ID:Audiveris,项目名称:audiveris,代码行数:16,代码来源:SelectionService.java

示例3: subscribeStrongly

import org.bushe.swing.event.EventSubscriber; //导入依赖的package包/类
/**
 * Overridden to check that the subscription corresponds to a
 * declared class.
 *
 * @param type the observed class
 * @param es   the subscriber
 * @return I don't know
 */
@Override
public boolean subscribeStrongly (Class type,
                                  EventSubscriber es)
{
    if (contains(allowedEvents, type)) {
        return super.subscribeStrongly(type, es);
    } else {
        logger.error("event class {} not available on {}", type, name);

        return false;
    }
}
 
开发者ID:jlpoolen,项目名称:libreveris,代码行数:21,代码来源:SelectionService.java

示例4: unsubscribe

import org.bushe.swing.event.EventSubscriber; //导入依赖的package包/类
@Override
public boolean unsubscribe (Class cl,
                            EventSubscriber eh)
{
    boolean res = super.unsubscribe(cl, eh);
    logger.debug(
            "{} unsubscribe {} subscriber:{}@{} res:{}",
            this,
            cl.getName(),
            eh,
            Integer.toHexString(eh.hashCode()),
            res);

    return res;
}
 
开发者ID:jlpoolen,项目名称:libreveris,代码行数:16,代码来源:SelectionService.java

示例5: subscribe

import org.bushe.swing.event.EventSubscriber; //导入依赖的package包/类
/**
 * Subscribe to the sheet event service (for the StubEvent class).
 *
 * @param subscriber The subscriber to accept the events when published.
 */
public void subscribe (EventSubscriber<StubEvent> subscriber)
{
    stubService.subscribeStrongly(StubEvent.class, subscriber);
}
 
开发者ID:Audiveris,项目名称:audiveris,代码行数:10,代码来源:StubsController.java

示例6: unsubscribe

import org.bushe.swing.event.EventSubscriber; //导入依赖的package包/类
/**
 * Un-subscribe to the sheet event service (for the StubEvent class).
 *
 * @param subscriber the entity to un-subscribe
 */
public void unsubscribe (EventSubscriber<StubEvent> subscriber)
{
    stubService.unsubscribe(StubEvent.class, subscriber);
}
 
开发者ID:Audiveris,项目名称:audiveris,代码行数:10,代码来源:StubsController.java

示例7: subscribe

import org.bushe.swing.event.EventSubscriber; //导入依赖的package包/类
/**
 * Subscribe to the sheet event service (for the SheetEvent class).
 *
 * @param subscriber The subscriber to accept the events when published.
 */
public void subscribe (EventSubscriber<SheetEvent> subscriber)
{
    sheetService.subscribeStrongly(SheetEvent.class, subscriber);
}
 
开发者ID:jlpoolen,项目名称:libreveris,代码行数:10,代码来源:SheetsController.java

示例8: unsubscribe

import org.bushe.swing.event.EventSubscriber; //导入依赖的package包/类
/**
 * Unsubscribe to the sheet event service (for the SheetEvent class).
 *
 * @param subscriber the entity to unsubscribe
 */
public void unsubscribe (EventSubscriber<SheetEvent> subscriber)
{
    sheetService.unsubscribe(SheetEvent.class, subscriber);
}
 
开发者ID:jlpoolen,项目名称:libreveris,代码行数:10,代码来源:SheetsController.java


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