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


Java Subscribe类代码示例

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


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

示例1: distanceChanged

import net.mostlyoriginal.api.event.common.Subscribe; //导入依赖的package包/类
@Subscribe
protected void distanceChanged( EditEvent event )
{
	if ( mDistanceIndicator.has(event.entity) && mLabel.has(event.entity))
	{
		Label label = mLabel.get(event.entity);
		DistanceIndicator distanceIndicator = mDistanceIndicator.get(event.entity);

		try {
			int distanceTraveled = Integer.valueOf(label.text);

			if ( distanceIndicator.travelTime > 0 && distanceTraveled > 0 ) {
				float scale = distanceTraveled / distanceIndicator.travelTime;
				if ( scale != 1) {
					MapMetadata metadata = mapMetadataManager.getMetadata();
					metadata.unitsPerPixel = MathUtils.clamp(metadata.unitsPerPixel*scale,0.01f,10f);
					refreshHandlerSystem.restart();
				}
			}
		} catch ( NumberFormatException e ) {
		}
	}
}
 
开发者ID:DaanVanYperen,项目名称:ns2-scc-profiler,代码行数:24,代码来源:MilestoneHandlerSystem.java

示例2: handleConstruction

import net.mostlyoriginal.api.event.common.Subscribe; //导入依赖的package包/类
/** Construction started on parts. */
@Subscribe
public void handleConstruction( StartConstructionEvent event )
{
	switch ( event.type ) {
		case ENGINE : complete(TutorialSystem.Step.PLACE_ENGINE);
		case STORAGEPOD : complete(TutorialSystem.Step.PLACE_STORAGEPOD);
	}
}
 
开发者ID:DaanVanYperen,项目名称:arktrail,代码行数:10,代码来源:TutorialSystem.java

示例3: handleConstructableSelection

import net.mostlyoriginal.api.event.common.Subscribe; //导入依赖的package包/类
/** Constructable selected in UI. */
@Subscribe
public void handleConstructableSelection ( SelectConstructionEvent event )
{
	switch ( event.type ) {
		case ENGINE : complete(TutorialSystem.Step.SELECT_ENGINE);
		case STORAGEPOD : complete(TutorialSystem.Step.SELECT_STORAGEPOD);
	}
}
 
开发者ID:DaanVanYperen,项目名称:arktrail,代码行数:10,代码来源:TutorialSystem.java

示例4: listenerMoved

import net.mostlyoriginal.api.event.common.Subscribe; //导入依赖的package包/类
@Subscribe
public void listenerMoved(DragEvent event) {
	delayedRestart();
}
 
开发者ID:DaanVanYperen,项目名称:ns2-scc-profiler,代码行数:5,代码来源:RefreshHandlerSystem.java

示例5: testListener

import net.mostlyoriginal.api.event.common.Subscribe; //导入依赖的package包/类
@Subscribe
public void testListener(BasicEvent event) { }
 
开发者ID:DaanVanYperen,项目名称:artemis-odb-contrib,代码行数:3,代码来源:SubscribeAnnotationFinderTest.java

示例6: testListener2

import net.mostlyoriginal.api.event.common.Subscribe; //导入依赖的package包/类
@Subscribe
public void testListener2(Event2 event) { }
 
开发者ID:DaanVanYperen,项目名称:artemis-odb-contrib,代码行数:3,代码来源:SubscribeAnnotationFinderTest.java

示例7: testEvent

import net.mostlyoriginal.api.event.common.Subscribe; //导入依赖的package包/类
@Subscribe
public void testEvent(BasicTestEvent event) {
    count++;
}
 
开发者ID:DaanVanYperen,项目名称:artemis-odb-contrib,代码行数:5,代码来源:ReceiveTestSystem.java

示例8: testEvent

import net.mostlyoriginal.api.event.common.Subscribe; //导入依赖的package包/类
@Subscribe
public void testEvent(BasicTestEvent event) {
	count++;
}
 
开发者ID:DaanVanYperen,项目名称:artemis-odb-contrib,代码行数:5,代码来源:ReceiveTestSystem2.java

示例9: testListener

import net.mostlyoriginal.api.event.common.Subscribe; //导入依赖的package包/类
@Subscribe
public void testListener(ExtendedBasicTestEvent event) { }
 
开发者ID:DaanVanYperen,项目名称:artemis-odb-contrib,代码行数:3,代码来源:SubscribeAnnotationTestSystem.java

示例10: testListener2

import net.mostlyoriginal.api.event.common.Subscribe; //导入依赖的package包/类
@Subscribe
public void testListener2(BasicTestEvent event) { }
 
开发者ID:DaanVanYperen,项目名称:artemis-odb-contrib,代码行数:3,代码来源:SubscribeAnnotationTestSystem.java

示例11: testListener

import net.mostlyoriginal.api.event.common.Subscribe; //导入依赖的package包/类
@Subscribe(priority = 5, ignoreCancelledEvents = true)
public void testListener(ExtendedBasicTestEvent event) { }
 
开发者ID:DaanVanYperen,项目名称:artemis-odb-contrib,代码行数:3,代码来源:SubscribeAnnotationParameterTestSystem.java


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