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