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


Java Menu类代码示例

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


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

示例1: SingleplayerSaveDeleteMenu

import ethanjones.cubes.graphics.menu.Menu; //导入依赖的package包/类
public SingleplayerSaveDeleteMenu(final Save save) {
	title = new Label(Localization.get("menu.singleplayer.delete.title"),
			skin.get("title", Label.LabelStyle.class));
	text = new Label(Localization.get("menu.singleplayer.delete.text", save.name), skin);
	delete = new TextButton(Localization.get("menu.singleplayer.delete.delete", save.name), skin);
	back = MenuTools.getBackButton(this);

	text.setAlignment(Align.center);

	delete.addListener(new ChangeListener() {
		@Override
		public void changed(ChangeEvent event, Actor actor) {
			ClientSaveManager.deleteSave(save);
			Menu prev = MenuManager.getPrevious(SingleplayerSaveDeleteMenu.this);
			if (!(prev instanceof SingleplayerSavesMenu))
				return;
			((SingleplayerSavesMenu) prev).updateSavesList();
			Adapter.setMenu(prev);
		}
	});

	stage.addActor(title);
	stage.addActor(text);
	stage.addActor(delete);
	stage.addActor(back);
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:27,代码来源:SingleplayerSaveDeleteMenu.java

示例2: setMenu

import ethanjones.cubes.graphics.menu.Menu; //导入依赖的package包/类
@Override
public void setMenu(Menu menu) {
	// CubesSecurity.checkSetMenu();
	Menu old = this.menu;
	if (old != null) {
		old.save();
		InputChain.hideMenu(old);
	}
	this.menu = menu;
	if (menu != null) {
		Log.debug("Menu set to " + menu.getClass().getSimpleName());
		MenuManager.setMenu(menu);
		setupMenu.set(true);
	} else {
		Log.debug("Menu set to null");
		setupMenu.set(false);
	}
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:19,代码来源:ClientAdapter.java

示例3: dispose

import ethanjones.cubes.graphics.menu.Menu; //导入依赖的package包/类
public static void dispose() {
	Log.debug("Disposing adapter");
	Gdx.app.postRunnable(new Runnable() {
		@Override
		public void run() {
			Gdx.app.exit();
		}
	});
	final Menu menu = adapter.getMenu();
	try {
		if (menu != null) {
			menu.save();
			InputChain.hideMenu(menu);
		}
	} catch (Exception e) {
		Debug.crash(e);
	}
	stop();
	stopBackground();
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:21,代码来源:Adapter.java

示例4: gotoMenu

import ethanjones.cubes.graphics.menu.Menu; //导入依赖的package包/类
/**
 * Will exit if server
 */
public static void gotoMenu(final Menu menu) {
	if (isDedicatedServer())
		quit();
	if (menu == null || adapter.getMenu() instanceof RunnableMenu || menu.getClass().isInstance(adapter.getMenu()))
		return;

	adapter.setMenu(new RunnableMenu(new Runnable() {
		@Override
		public void run() {
			if (adapter.getClient() == null && adapter.getServer() == null) {
				adapter.setMenu(menu);
			}
		}
	}));
	stop();
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:20,代码来源:Adapter.java

示例5: update

import ethanjones.cubes.graphics.menu.Menu; //导入依赖的package包/类
@Override
public void update() {
  if (back) {
    back = false;
    Menu current = Adapter.getMenu();

    if (current instanceof MainMenu) {
      Adapter.quit();
      return;
    }

    if (current instanceof PauseMenu) {
      Adapter.gotoMainMenu();
      return;
    }

    if (Cubes.getClient() != null || Cubes.getServer() != null || current == null) {
      Adapter.setMenu(new PauseMenu());
      return;
    }

    Menu prev = MenuManager.getPrevious(current);
    if (prev == null) return;
    Adapter.setMenu(prev);
  }
}
 
开发者ID:RedTroop,项目名称:Cubes,代码行数:27,代码来源:AndroidCompatibility.java

示例6: SingleplayerSaveDeleteMenu

import ethanjones.cubes.graphics.menu.Menu; //导入依赖的package包/类
public SingleplayerSaveDeleteMenu(final Save save) {
  title = new Label(Localization.get("menu.singleplayer.delete.title"), skin.get("title", Label.LabelStyle.class));
  text = new Label(Localization.get("menu.singleplayer.delete.text", save.name), skin);
  delete = new TextButton(Localization.get("menu.singleplayer.delete.delete", save.name), skin);
  back = MenuTools.getBackButton(this);

  text.setAlignment(Align.center);

  delete.addListener(new ChangeListener() {
    @Override
    public void changed(ChangeEvent event, Actor actor) {
      ClientSaveManager.deleteSave(save);
      Menu prev = MenuManager.getPrevious(SingleplayerSaveDeleteMenu.this);
      if (!(prev instanceof SingleplayerSavesMenu)) return;
      ((SingleplayerSavesMenu) prev).updateSavesList();
      Adapter.setMenu(prev);
    }
  });

  stage.addActor(title);
  stage.addActor(text);
  stage.addActor(delete);
  stage.addActor(back);
}
 
开发者ID:RedTroop,项目名称:Cubes,代码行数:25,代码来源:SingleplayerSaveDeleteMenu.java

示例7: setMenu

import ethanjones.cubes.graphics.menu.Menu; //导入依赖的package包/类
@Override
public void setMenu(Menu menu) {
  //CubesSecurity.checkSetMenu();
  Menu old = this.menu;
  if (old != null) {
    old.save();
    InputChain.hideMenu(old);
  }
  this.menu = menu;
  if (menu != null) {
    Log.debug("Menu set to " + menu.getClass().getSimpleName());
    MenuManager.setMenu(menu);
    setupMenu.set(true);
  } else {
    Log.debug("Menu set to null");
    setupMenu.set(false);
  }
}
 
开发者ID:RedTroop,项目名称:Cubes,代码行数:19,代码来源:ClientAdapter.java

示例8: dispose

import ethanjones.cubes.graphics.menu.Menu; //导入依赖的package包/类
public static void dispose() {
  Log.debug("Disposing adapter");
  Gdx.app.postRunnable(new Runnable() {
    @Override
    public void run() {
      Gdx.app.exit();
    }
  });
  final Menu menu = adapter.getMenu();
  try {
    if (menu != null) {
      menu.save();
      InputChain.hideMenu(menu);
    }
  } catch (Exception e) {
    Debug.crash(e);
  }
  stop();
  stopBackground();
}
 
开发者ID:RedTroop,项目名称:Cubes,代码行数:21,代码来源:Adapter.java

示例9: update

import ethanjones.cubes.graphics.menu.Menu; //导入依赖的package包/类
@Override
public void update() {
	if (back) {
		back = false;
		Menu current = Adapter.getMenu();

		if (current instanceof MainMenu) {
			Adapter.quit();
			return;
		}

		if (current instanceof PauseMenu) {
			Adapter.gotoMainMenu();
			return;
		}

		if (Cubes.getClient() != null || Cubes.getServer() != null || current == null) {
			Adapter.setMenu(new PauseMenu());
			return;
		}

		Menu prev = MenuManager.getPrevious(current);
		if (prev == null)
			return;
		Adapter.setMenu(prev);
	}
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:28,代码来源:AndroidCompatibility.java

示例10: gotoMenu

import ethanjones.cubes.graphics.menu.Menu; //导入依赖的package包/类
/**
 * Will exit if server
 */
public static void gotoMenu(final Menu menu) {
  if (isDedicatedServer()) quit();
  if (menu == null || adapter.getMenu() instanceof RunnableMenu || menu.getClass().isInstance(adapter.getMenu())) return;

  adapter.setMenu(new RunnableMenu(new Runnable() {
    @Override
    public void run() {
      if (adapter.getClient() == null && adapter.getServer() == null) {
        adapter.setMenu(menu);
      }
    }
  }));
  stop();
}
 
开发者ID:RedTroop,项目名称:Cubes,代码行数:18,代码来源:Adapter.java

示例11: getSkin

import ethanjones.cubes.graphics.menu.Menu; //导入依赖的package包/类
@Override
public Skin getSkin() {
  return Menu.skin;
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:5,代码来源:SettingsMenu.java

示例12: showMenu

import ethanjones.cubes.graphics.menu.Menu; //导入依赖的package包/类
public static void showMenu(Menu menu) {
	inputMultiplexer.addProcessor(0, menu.stage);
	if (menu.blockClientInput())
		InputBlocker.BLOCK_INPUT = true;
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:6,代码来源:InputChain.java

示例13: hideMenu

import ethanjones.cubes.graphics.menu.Menu; //导入依赖的package包/类
public static void hideMenu(Menu menu) {
	inputMultiplexer.removeProcessor(menu.stage);
	InputBlocker.BLOCK_INPUT = false;
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:5,代码来源:InputChain.java

示例14: setMenu

import ethanjones.cubes.graphics.menu.Menu; //导入依赖的package包/类
@Override
public void setMenu(Menu menu) throws UnsupportedOperationException {
  //throw new UnsupportedOperationException("Cannot set menu");
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:5,代码来源:ServerAdapter.java

示例15: getMenu

import ethanjones.cubes.graphics.menu.Menu; //导入依赖的package包/类
@Override
public Menu getMenu() {
  return null;
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:5,代码来源:ServerAdapter.java


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