本文整理汇总了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);
}
}
}
示例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;
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
}
示例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);
}
示例7: addAppState
import com.jme3.app.state.AppState; //导入依赖的package包/类
public void addAppState(AppState state) {
states.add(state);
if (stateManager != null) {
stateManager.attach(state);
}
}
示例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;
}
示例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);
}
}
示例10: removeAppState
import com.jme3.app.state.AppState; //导入依赖的package包/类
public void removeAppState(AppState state) {
if (stateManager != null) {
stateManager.detach(state);
}
states.remove(state);
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例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();
}
示例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;
}