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


Java AbstractListDialogBuilder类代码示例

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


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

示例1:

import net.gtaun.shoebill.common.dialog.ListDialog.AbstractListDialogBuilder; //导入依赖的package包/类
public static WlListDialog create
(Player player, EventManager eventManager, AbstractDialog parent, Vehicle vehicle, VehicleManagerServiceImpl service, VehicleComponentSlot slot)
{
	PlayerStringSet stringSet = service.getLocalizedStringSet().getStringSet(player);

	int modelId = vehicle.getModelId();
	String name = VehicleModel.getName(modelId);
	
	Set<Integer> components = VehicleComponentModel.getSlotSupportedComponents(modelId, slot);
	String slotName = VehicleTextUtils.getComponentSlotName(stringSet, slot);
	
	return WlListDialog.create(player, eventManager)
		.parentDialog(parent)
		.caption(stringSet.format("Dialog.VehicleComponentAddDialog.Caption", name, slotName))
		.execute((b) ->
		{
			for (int cid : components)
			{
				String componentName = VehicleComponentModel.getName(cid);
				String itemText = stringSet.format("Dialog.VehicleComponentAddDialog.Item", slotName, componentName);

				// XXX: Buggy Eclipse JDT Compiler
				((AbstractListDialogBuilder<?,?>) b).item(itemText, (i) ->
				{
					stringSet.sendMessage(Color.LIGHTBLUE, "Dialog.VehicleComponentAddDialog.AddMessage", name, slotName, componentName);
					vehicle.getComponent().add(cid);
				});
			}
		})
		.onClickOk((d, i) ->
		{
			player.playSound(1133);
			d.showParentDialog();
		})
		.build();
}
 
开发者ID:GTAUN,项目名称:wl-vehicle-manager,代码行数:37,代码来源:VehicleComponentAddDialog.java

示例2: NullPointerException

import net.gtaun.shoebill.common.dialog.ListDialog.AbstractListDialogBuilder; //导入依赖的package包/类
public static WlListDialog create
(Player player, EventManager eventManager, AbstractDialog parent, Vehicle vehicle, VehicleManagerServiceImpl service, int color1)
{
	if (vehicle == null) throw new NullPointerException();
	
	PlayerStringSet stringSet = service.getLocalizedStringSet().getStringSet(player);

	String type = stringSet.get("Component.Color.Primary");
	if (color1 != -1) type = stringSet.get("Component.Color.Secondary");
	
	int modelId = vehicle.getModelId();
	String name = VehicleModel.getName(modelId);
	
	String colorBlock = stringSet.get("Dialog.VehicleResprayGroupDialog.ColorBlockText");
	
	return WlListDialog.create(player, eventManager)
		.parentDialog(parent)
		.caption(stringSet.format("Dialog.VehicleResprayGroupDialog.Caption", name, type, modelId, vehicle.getHealth()/10))
		.execute((b) ->
		{
			for (int i=0; i<VEHICLE_COLOR_TABLE_RGBA.length; i+=10)
			{
				int index = i;
				int max = i+10 > VEHICLE_COLOR_TABLE_RGBA.length ? VEHICLE_COLOR_TABLE_RGBA.length : i+10;
				
				String item = stringSet.get("Dialog.VehicleResprayGroupDialog.Item");
				for (int j=i; j<max; j++)
				{
					item += new Color(VEHICLE_COLOR_TABLE_RGBA[j]).toEmbeddingString() + colorBlock;
					if (j != max-1) item += " ";
				}

				// XXX: Buggy Eclipse JDT Compiler
				((AbstractListDialogBuilder<?, ?>) b).item(item, (listItem) -> VehicleResprayDialog.create(player, eventManager, listItem.getCurrentDialog(), vehicle, service, index, max, color1).show());
			}
		})
		.onClickOk((d, i) -> player.playSound(1083))
		.build();
}
 
开发者ID:GTAUN,项目名称:wl-vehicle-manager,代码行数:40,代码来源:VehicleResprayGroupDialog.java

示例3: Color

import net.gtaun.shoebill.common.dialog.ListDialog.AbstractListDialogBuilder; //导入依赖的package包/类
public static WlListDialog create
(Player player, EventManager eventManager, AbstractDialog parent, Vehicle vehicle, VehicleManagerServiceImpl service, int start, int end, int color1)
{
	if (vehicle == null) return null;
	
	PlayerStringSet stringSet = service.getLocalizedStringSet().getStringSet(player);
	
	int modelId = vehicle.getModelId();
	String name = VehicleModel.getName(modelId);
	
	String type = stringSet.get("Component.Color.Primary");
	if (color1 != -1) type = stringSet.get("Component.Color.Secondary");
	
	return WlListDialog.create(player, eventManager)
		.parentDialog(parent)
		.caption(stringSet.format("Dialog.VehicleResprayDialog.Caption", name, type, modelId, vehicle.getHealth()/10))
		.execute((b) ->
		{
			for (int i=start; i<end; i++)
			{
				final int idx = i;
				
				String item = stringSet.format("Dialog.VehicleResprayDialog.Item", new Color(VehicleResprayGroupDialog.VEHICLE_COLOR_TABLE_RGBA[idx]).toEmbeddingString(), idx);

				// XXX: Buggy Eclipse JDT Compiler
				((AbstractListDialogBuilder<?, ?>) b).item(item, (listItem) ->
				{
					if (color1 == -1) VehicleResprayGroupDialog.create(player, eventManager, listItem.getCurrentDialog(), vehicle, service, idx).show();
					else player.getVehicle().setColor(color1, idx);
				});
			}
		})
		.onClickOk((d, i) -> player.playSound(1083))
		.build();
}
 
开发者ID:GTAUN,项目名称:wl-vehicle-manager,代码行数:36,代码来源:VehicleResprayDialog.java

示例4: create

import net.gtaun.shoebill.common.dialog.ListDialog.AbstractListDialogBuilder; //导入依赖的package包/类
public static WlListDialog create(Player player, EventManager eventManager, AbstractDialog parent, Vehicle vehicle, VehicleManagerServiceImpl service)
{
	PlayerStringSet stringSet = service.getLocalizedStringSet().getStringSet(player);
	
	int modelId = vehicle.getModelId();
	String name = VehicleModel.getName(modelId);
	
	return WlListDialog.create(player, eventManager)
		.parentDialog(parent)
		.caption((d) -> stringSet.format("Dialog.VehicleComponentDialog.Caption", name, modelId, vehicle.getHealth()/10))
		.execute((b) ->
		{
			String paintjobItem = stringSet.get("Component.Paintjob");
			
			// XXX: Buggy Eclipse JDT Compiler
			if (VehicleModel.isPaintjobSupported(modelId)) ((AbstractListDialogBuilder<?, ?>) b).item(paintjobItem, (i) ->
			{
				new VehicleComponentPaintjobDialog(player, eventManager, i.getCurrentDialog(), vehicle, service).show();
			});
			
			for (VehicleComponentSlot slot : VehicleComponentModel.getVehicleSupportedSlots(modelId))
			{
				Set<Integer> components = VehicleComponentModel.getSlotSupportedComponents(modelId, slot);
				String slotName = VehicleTextUtils.getComponentSlotName(stringSet, slot);
				String curName = VehicleComponentModel.getName(vehicle.getComponent().get(slot));
				
				String itemText = stringSet.format("Dialog.VehicleComponentDialog.Item", slotName, curName, components.size());
				
				// XXX: Buggy Eclipse JDT Compiler
				((AbstractListDialogBuilder<?, ?>) b).item(itemText, (i) ->
				{
					VehicleComponentAddDialog.create(player, eventManager, i.getCurrentDialog(), vehicle, service, slot).show();
				});
			}
		})
		.onClickOk((d, i) ->
		{
			player.playSound(1083);
		})
		.onShow((d) ->
		{
			if (player.getVehicle() == vehicle) return;
			
			Location loc = vehicle.getLocation();
			player.setCameraLookAt(loc);
			loc.setZ(loc.getZ() + 10.0f);
			player.setCameraPosition(loc);
		})
		.onClose((d, t) ->
		{
			if (player.getVehicle() == vehicle) return;
			player.setCameraBehind();
		})
		.build();
}
 
开发者ID:GTAUN,项目名称:wl-vehicle-manager,代码行数:56,代码来源:VehicleComponentDialog.java


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