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


Java EventServiceLocator类代码示例

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


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

示例1: getGlobalContext

import org.bushe.swing.event.EventServiceLocator; //导入依赖的package包/类
public static GlobalContext getGlobalContext() {
	if (_gctx == null) {
		_gctx = new GlobalContext();
		try {
			EventServiceLocator.setEventService(EventServiceLocator.SERVICE_NAME_EVENT_BUS, eventService);
		} catch (EventServiceExistsException e) {
			logger.error("Error setting event service, likely something using the event bus before GlobalContext is instantiated",e);
		}
	}
	return _gctx;
}
 
开发者ID:drftpd-ng,项目名称:drftpd3,代码行数:12,代码来源:GlobalContext.java

示例2: EvolvedReservoir

import org.bushe.swing.event.EventServiceLocator; //导入依赖的package包/类
public EvolvedReservoir(){
	
	int samples = 300;  
	//Create input samples
	this.analog = SignalGenerator.sine(300, samples, (1.0/2.0), (1.0/4.0), 0, (1.0/2.0));
	//Convert to spike trains
	this.hsa = new HSA(analog);
	hsa.optimize(10, .1, 0, 1, .2);
	this.dataset = hsa.encode();
	

		/*
		 * Lower number increase frequency..but not amplitude
		 */
		IFSpikingNeuron.MEMORY_CAPACITY_COEF = 3.2;
		/*
		 * Having a 0 refactory period causes an extremely slow system
		 */
		IFSpikingNeuron.REFACTORY_PEROID = 0;
		
	
		System.setProperty("org.bushe.swing.event.eventBusClass", "org.bushe.swing.event.DiscreteTimeThreadSafeEventService");
		try {
			EventServiceLocator.setEventService("DiscreteTimeThreadSafeEventService", new DiscreteTimeThreadSafeEventService());
		} catch (EventServiceExistsException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

}
 
开发者ID:wil3,项目名称:lacus,代码行数:31,代码来源:EvolvedReservoir.java


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