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


Java AppState类代码示例

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


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

示例1: showWizard

import com.jme3.app.state.AppState; //导入依赖的package包/类
protected void showWizard() {
    WizardDescriptor wizardDescriptor = new WizardDescriptor(getPanels());
    // {0} will be replaced by WizardDesriptor.Panel.getComponent().getName()
    wizardDescriptor.setTitleFormat(new MessageFormat("{0}"));
    wizardDescriptor.setTitle("Add New AppState");
    wizardDescriptor.putProperty("asset_manager", mgr);
    wizardDescriptor.putProperty("fake_app", fakeApp);
    wizardDescriptor.putProperty("project", mgr.getProject());
    Dialog dialog = DialogDisplayer.getDefault().createDialog(wizardDescriptor);
    dialog.setVisible(true);
    dialog.toFront();
    boolean cancelled = wizardDescriptor.getValue() != WizardDescriptor.FINISH_OPTION;
    if (!cancelled) {
        AppState state = doCreateAppState(wizardDescriptor);
        if (state != null) {
            fakeApp.getStateManager().attach(state);
        }
    }
}
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:20,代码来源:NewAppStateWizardAction.java

示例2: changeState

import com.jme3.app.state.AppState; //导入依赖的package包/类
public void changeState(AppState appState) {
    if (appState == null || appState == currentState) {
        return;
    }
    
    // check to display ad
    checkToDisplayAd(currentState, appState);
    
    // 移除当前的state
    if (currentState != null) {
        preDetach();
        this.stateManager.detach(currentState);
    }
    
    // 切换到新的state.
    preStartState();
    stateManager.attach(appState);
    currentState = appState;
}
 
开发者ID:huliqing,项目名称:LuoYing,代码行数:20,代码来源:Start.java

示例3: checkToDisplayAd

import com.jme3.app.state.AppState; //导入依赖的package包/类
private void checkToDisplayAd(AppState current, AppState next) {
    // 首次进入
    if (current == null) {
        AdUtils.showAd(AdType.banner); 
        return;
    }
    
    // 退回到startState时
    if ((current instanceof GameAppState) && (next instanceof StartState)) {
        
        AdUtils.showAd(AdType.banner);

    } else {
        
        AdUtils.hideAd(AdType.banner, AdType.insert);
        
    }
}
 
开发者ID:huliqing,项目名称:LuoYing,代码行数:19,代码来源:Start.java

示例4: cleanup

import com.jme3.app.state.AppState; //导入依赖的package包/类
void cleanup() {
    app.getInputManager().deleteMapping("selectionGrp");
    app.getInputManager().removeListener(keyListener);
    app.getInputManager().removeListener(mouseListener);
    /**
     * Unregister listener.
     */
    AppState state =  app.getStateManager().getState(GridMouseControlAppState.class);
    if(state != null) {
        app.getStateManager().getState(GridMouseControlAppState.class).unregister(this);
    }
    HexGrid hexGrid = app.getStateManager().getState(AbstractHexGridAppState.class);
    if(hexGrid != null) {
        hexGrid.getMapData().unregister(dataListener);
        hexGrid.getGridNode().detachChild(selectionRootNode);
    }
}
 
开发者ID:MultiverseKing,项目名称:HexGrid_JME,代码行数:18,代码来源:TileSelectionControl.java

示例5: loadDependency

import com.jme3.app.state.AppState; //导入依赖的package包/类
private void loadDependency(boolean isLoad) {
    AppState state;
    Class<? extends AppState>[] states = new Class[]{
        CollisionSystem.class,
        AnimationSystem.class,
        HexMovementSystem.class,
        //            MonsterNest.class,
        CameraControlSystem.class
    };
    for (Class c : states) {
        state = getState(isLoad, c);
        if (isLoad && state != null) {
            app.getStateManager().attach(state);
        } else if (!isLoad && state != null) {
            app.getStateManager().detach(state);
        }
    }
}
 
开发者ID:MultiverseKing,项目名称:MultiverseKing_JME,代码行数:19,代码来源:ExplorationSystem.java

示例6: HexScapeJme3Application

import com.jme3.app.state.AppState; //导入依赖的package包/类
public HexScapeJme3Application() {
	super(new AppState[] {});
	
	//stateManager.attach(new StatsAppState());
	stateManager.attach(rotatingAroundCameraAppState);
	stateManager.attach(pieceControlerAppState);
	stateManager.attach(titleMenuButtonsAppState);
	stateManager.attach(pointOfViewCameraAppState);
	stateManager.attach(selectMarkerAppState);
	stateManager.attach(flyByCameraAppState);
	
	pieceControlerAppState.setEnabled(false);
	rotatingAroundCameraAppState.setEnabled(false);
	pointOfViewCameraAppState.setEnabled(false);
	selectMarkerAppState.setEnabled(false);
	flyByCameraAppState.setEnabled(false);
}
 
开发者ID:lyrgard,项目名称:HexScape,代码行数:18,代码来源:HexScapeJme3Application.java

示例7: addAppState

import com.jme3.app.state.AppState; //导入依赖的package包/类
public void addAppState(AppState state) {
	states.add(state);
	
	if (stateManager != null) {
		stateManager.attach(state);
	}
}
 
开发者ID:quadracoatl,项目名称:quadracoatl,代码行数:8,代码来源:AbstractManagingAppState.java

示例8: cleanup

import com.jme3.app.state.AppState; //导入依赖的package包/类
@Override
public void cleanup() {
	super.cleanup();
	
	for (AppState state : states) {
		stateManager.detach(state);
	}
	
	app = null;
	stateManager = null;
}
 
开发者ID:quadracoatl,项目名称:quadracoatl,代码行数:12,代码来源:AbstractManagingAppState.java

示例9: initialize

import com.jme3.app.state.AppState; //导入依赖的package包/类
@Override
public void initialize(AppStateManager stateManager, Application app) {
	super.initialize(stateManager, app);
	
	this.stateManager = stateManager;
	this.app = app;
	
	for (AppState state : states) {
		stateManager.attach(state);
	}
}
 
开发者ID:quadracoatl,项目名称:quadracoatl,代码行数:12,代码来源:AbstractManagingAppState.java

示例10: removeAppState

import com.jme3.app.state.AppState; //导入依赖的package包/类
public void removeAppState(AppState state) {
	if (stateManager != null) {
		stateManager.detach(state);
	}
	
	states.remove(state);
}
 
开发者ID:quadracoatl,项目名称:quadracoatl,代码行数:8,代码来源:AbstractManagingAppState.java

示例11: addAppState

import com.jme3.app.state.AppState; //导入依赖的package包/类
@Override
public void addAppState(AppState state) {
	super.addAppState(state);
	
	if (state instanceof EntityChangeProcessor) {
		entityChangeProcessors.add((EntityChangeProcessor)state);
	}
}
 
开发者ID:quadracoatl,项目名称:quadracoatl,代码行数:9,代码来源:GameState.java

示例12: removeAppState

import com.jme3.app.state.AppState; //导入依赖的package包/类
@Override
public void removeAppState(AppState state) {
	if (state instanceof EntityChangeProcessor) {
		entityChangeProcessors.remove(state);
	}
	
	super.removeAppState(state);
}
 
开发者ID:quadracoatl,项目名称:quadracoatl,代码行数:9,代码来源:GameState.java

示例13: toggle

import com.jme3.app.state.AppState; //导入依赖的package包/类
public void toggle(Class<? extends AppState> appState) {
	AppState currentState = stateManager.getState(appState);
	if (currentState == null) {
		try {
			final AppState state = appState.newInstance();
			stateManager.attach(state);
			hudStates.add(appState);
		} catch (Exception ex) {
			throw new RuntimeException(ex);
		}
	} else {
		hudStates.remove(appState);
		stateManager.detach(currentState);
	}
}
 
开发者ID:rockfireredmoon,项目名称:iceclient,代码行数:16,代码来源:HUDAppState.java

示例14: onCleanup

import com.jme3.app.state.AppState; //导入依赖的package包/类
@Override
protected final void onCleanup() {
	if (network.getClient() != null) {
		network.getClient().removeListener(listener);
	}
	if (exitOptionsWindow != null) {
		screen.removeElement(exitOptionsWindow);
	}
	for (Class<? extends AppState> st : hudStates) {
		stateManager.detach(stateManager.getState(st));
	}
	hudStates.clear();
}
 
开发者ID:rockfireredmoon,项目名称:iceclient,代码行数:14,代码来源:HUDAppState.java

示例15: attach

import com.jme3.app.state.AppState; //导入依赖的package包/类
@Override
public boolean attach(AppState state) {
    boolean ret = super.attach(state);
    if (ret) {
        states.add(state);
    }
    if (node != null) {
        node.refresh();
    }
    return ret;
}
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:12,代码来源:FakeApplication.java


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