本文整理汇总了Java中codechicken.nei.LayoutManager类的典型用法代码示例。如果您正苦于以下问题:Java LayoutManager类的具体用法?Java LayoutManager怎么用?Java LayoutManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LayoutManager类属于codechicken.nei包,在下文中一共展示了LayoutManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: keyTyped
import codechicken.nei.LayoutManager; //导入依赖的package包/类
public boolean keyTyped(final GuiContainer guiContainer, final char c, final int i) {
final int keyBinding = NEIClientConfig.getKeyBinding("gui.xu_ping");
if (i != keyBinding) {
return false;
}
final LayoutManager layout = LayoutManager.instance();
if (layout == null || LayoutManager.itemPanel == null || NEIClientConfig.isHidden()) {
return false;
}
final ItemStack stackMouseOver = GuiContainerManager.getStackMouseOver(guiContainer);
if (stackMouseOver == null || stackMouseOver.getItem() == null) {
return false;
}
NetworkHandler.sendPacketToServer(new PacketNEIPing(stackMouseOver));
return true;
}
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:17,代码来源:NEIPing.java
示例2: drawIcons
import codechicken.nei.LayoutManager; //导入依赖的package包/类
@Override
public void drawIcons()
{
int x = buttonX();
LayoutManager.drawIcon(x+4, 4, new Image(120, 24, 12, 12)); x+=24;
LayoutManager.drawIcon(x+4, 4, new Image(120, 12, 12, 12)); x+=24;
LayoutManager.drawIcon(x+4, 4, new Image(168, 24, 12, 12)); x+=24;
LayoutManager.drawIcon(x+4, 4, new Image(144, 12, 12, 12)); x+=24;
LayoutManager.drawIcon(x+4, 4, new Image(180, 24, 12, 12)); x+=24;
LayoutManager.drawIcon(x+4, 4, new Image(132, 12, 12, 12)); x+=24;
RenderHelper.enableGUIStandardItemLighting();
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
ItemStack sword = new ItemStack(Items.diamond_sword);
sword.addEnchantment(Enchantment.sharpness, 1);
GuiContainerManager.drawItem(x+2, 2, sword); x+=24;
GuiContainerManager.drawItem(x+2, 2, new ItemStack(Items.potionitem)); x+=24;
GuiContainerManager.drawItem(x+2, 2, new ItemStack(Blocks.stone)); x+=24;
}
开发者ID:4Space,项目名称:4Space-5,代码行数:19,代码来源:OptionUtilities.java
示例3: drawIcons
import codechicken.nei.LayoutManager; //导入依赖的package包/类
@Override
public void drawIcons()
{
int x = buttonX();
LayoutManager.drawIcon(x+4, 4, new Image(120, 24, 12, 12)); x+=24;
LayoutManager.drawIcon(x+4, 4, new Image(120, 12, 12, 12)); x+=24;
LayoutManager.drawIcon(x+4, 4, new Image(168, 24, 12, 12)); x+=24;
LayoutManager.drawIcon(x+4, 4, new Image(144, 12, 12, 12)); x+=24;
LayoutManager.drawIcon(x+4, 4, new Image(180, 24, 12, 12)); x+=24;
LayoutManager.drawIcon(x+4, 4, new Image(132, 12, 12, 12)); x+=24;
RenderHelper.enableGUIStandardItemLighting();
GlStateManager.enableRescaleNormal();
ItemStack sword = new ItemStack(Items.diamond_sword);
sword.addEnchantment(Enchantment.sharpness, 1);
GuiContainerManager.drawItem(x+2, 2, sword); x+=24;
GuiContainerManager.drawItem(x+2, 2, new ItemStack(Items.potionitem)); x+=24;
GuiContainerManager.drawItem(x+2, 2, new ItemStack(Blocks.stone)); x+=24;
}
开发者ID:SneakyTactician,项目名称:BIGB,代码行数:19,代码来源:OptionUtilities.java
示例4: onGuiMouseEventpre
import codechicken.nei.LayoutManager; //导入依赖的package包/类
@SubscribeEvent (priority = EventPriority.LOWEST, receiveCanceled = true)//We need to be called before JEI.
public void onGuiMouseEventpre(MouseInputEvent.Pre event) {
if (Mouse.getEventButton() == -1 || event.getGui() == null || !Mouse.getEventButtonState()) {
return;
}
Point mouse = GuiDraw.getMousePosition();
int eventButton = Mouse.getEventButton();
if (JEIIntegrationManager.searchBoxOwner == EnumItemBrowser.JEI) {
GuiTextFieldFilter fieldFilter = JEIIntegrationManager.getTextFieldFilter();
if (fieldFilter != null && fieldFilter.isMouseOver(mouse.x, mouse.y)) {
if (eventButton == 0) {
if (fieldFilter.isFocused() && (System.currentTimeMillis() - lastSearchBoxClickTime < 500)) {//double click
NEIClientConfig.world.nbt.setBoolean("searchinventories", !SearchField.searchInventories());
NEIClientConfig.world.saveNBT();
lastSearchBoxClickTime = 0L;
} else {
lastSearchBoxClickTime = System.currentTimeMillis();
}
} else if (eventButton == 1) {
NEIClientConfig.setSearchExpression("", false);
LayoutManager.searchField.setText("", false);
}
}
}
}
开发者ID:TheCBProject,项目名称:NotEnoughItems,代码行数:26,代码来源:ContainerEventHandler.java
示例5: drawIcons
import codechicken.nei.LayoutManager; //导入依赖的package包/类
@Override
public void drawIcons() {
int x = buttonX();
LayoutManager.drawIcon(x + 4, 4, new Rectangle4i(120, 24, 12, 12));
x += 24;
LayoutManager.drawIcon(x + 4, 4, new Rectangle4i(120, 12, 12, 12));
x += 24;
LayoutManager.drawIcon(x + 4, 4, new Rectangle4i(168, 24, 12, 12));
x += 24;
LayoutManager.drawIcon(x + 4, 4, new Rectangle4i(144, 12, 12, 12));
x += 24;
LayoutManager.drawIcon(x + 4, 4, new Rectangle4i(180, 24, 12, 12));
x += 24;
LayoutManager.drawIcon(x + 4, 4, new Rectangle4i(132, 12, 12, 12));
x += 24;
RenderHelper.enableGUIStandardItemLighting();
GlStateManager.enableRescaleNormal();
ItemStack sword = new ItemStack(Items.DIAMOND_SWORD);
sword.addEnchantment(Enchantment.getEnchantmentByLocation("sharpness"), 1);
GuiHelper.drawItem(x + 2, 2, sword);
x += 24;
GuiHelper.drawItem(x + 2, 2, new ItemStack(Items.POTIONITEM));
x += 24;
GuiHelper.drawItem(x + 2, 2, new ItemStack(Blocks.STONE));
x += 24;
}
开发者ID:TheCBProject,项目名称:NotEnoughItems,代码行数:27,代码来源:OptionUtilities.java
示例6: initGui
import codechicken.nei.LayoutManager; //导入依赖的package包/类
@Override
public void initGui()
{
super.initGui();
int xPos = (width - xSize) / 2;
int yPos = (height - ySize) / 2;
textField = new GuiTextField(fontRendererObj, xPos + 25, yPos + 9, 128, 12);
textField.setFocused(true);
textField.setCanLoseFocus(false);
textField.setText(LayoutManager.searchField.text());
CategoryHandler.INSTANCE.updateProjectListFromText(textField.getText());
scrollBarXPos = xPos + SCROLLBAR_X_START_POS;
scrollBarYPos = yPos + SCROLLBAR_Y_START_POS;
}
开发者ID:Dynious,项目名称:ProjectPlanner,代码行数:18,代码来源:GuiProjectPlanner.java
示例7: overlayRecipe
import codechicken.nei.LayoutManager; //导入依赖的package包/类
private void overlayRecipe(int recipe) {
IRecipeOverlayRenderer renderer = currenthandlers.get(recipetype).getOverlayRenderer(firstGui, recipe);
IOverlayHandler handler = currenthandlers.get(recipetype).getOverlayHandler(firstGui, recipe);
boolean shift = NEIClientUtils.shiftKey();
if (handler != null && (renderer == null || shift)) {
mc.displayGuiScreen(firstGui);
handler.overlayRecipe(firstGui, currenthandlers.get(recipetype), recipe, shift);
} else if (renderer != null) {
mc.displayGuiScreen(firstGui);
LayoutManager.overlayRenderer = renderer;
}
}
开发者ID:4Space,项目名称:4Space-5,代码行数:14,代码来源:GuiRecipe.java
示例8: drawModeButton
import codechicken.nei.LayoutManager; //导入依赖的package包/类
public void drawModeButton(int mousex, int mousey) {
GL11.glColor4f(1, 1, 1, 1);
Rectangle4i b = modeButtonSize();
boolean hover = b.contains(mousex, mousey);
LayoutManager.drawButtonBackground(b.x, b.y, b.w, b.h, true, getButtonTex(hover));
drawStringC(modeButtonText(), b.x, b.y, b.w, b.h, getTextColour(hover));
}
开发者ID:4Space,项目名称:4Space-5,代码行数:8,代码来源:DataDumper.java
示例9: drawDumpButton
import codechicken.nei.LayoutManager; //导入依赖的package包/类
public void drawDumpButton(int mousex, int mousey) {
GL11.glColor4f(1, 1, 1, 1);
Rectangle4i b = dumpButtonSize();
boolean hover = b.contains(mousex, mousey);
LayoutManager.drawButtonBackground(b.x, b.y, b.w, b.h, true, getButtonTex(hover));
drawStringC(dumpButtonText(), b.x, b.y, b.w, b.h, getTextColour(hover));
}
开发者ID:4Space,项目名称:4Space-5,代码行数:8,代码来源:DataDumper.java
示例10: drawItem
import codechicken.nei.LayoutManager; //导入依赖的package包/类
public void drawItem(Rectangle w, SortItem item, int mx, int my, float frame) {
double y = MathHelper.interpolate(item.ya, item.y, frame);
GL11.glTranslated(0, y, 0);
Rectangle b = new Rectangle(w.x, w.y, w.width, 20);
boolean mouseOver = itemAt(w.x+mx, w.y+my) == item;
GL11.glColor4f(1, 1, 1, 1);
LayoutManager.drawButtonBackground(b.x, b.y, b.width, b.height, true, mouseOver ? 2 : 1);
drawStringC(item.e.getLocalisedName(), b.x, b.y, b.width, b.height, mouseOver ? 0xFFFFFFA0 : 0xFFE0E0E0);
GL11.glTranslated(0, -y, 0);
}
开发者ID:4Space,项目名称:4Space-5,代码行数:13,代码来源:GuiItemSorter.java
示例11: drawButtons
import codechicken.nei.LayoutManager; //导入依赖的package包/类
public void drawButtons() {
int x = buttonX();
List<String> values = values();
for (String option : options) {
LayoutManager.drawButtonBackground(x, 0, 20, 20, true, values.contains(option) ? 1 : 0);
x += 24;
}
}
开发者ID:4Space,项目名称:4Space-5,代码行数:9,代码来源:OptionStringSet.java
示例12: drawIcons
import codechicken.nei.LayoutManager; //导入依赖的package包/类
@Override
public void drawIcons()
{
int x = buttonX();
LayoutManager.drawIcon(x+4, 4, new Image(132, 12, 12, 12)); x+=24;
LayoutManager.drawIcon(x+4, 4, new Image(156, 12, 12, 12)); x+=24;
LayoutManager.drawIcon(x+4, 4, new Image(168, 12, 12, 12)); x+=24;
}
开发者ID:4Space,项目名称:4Space-5,代码行数:9,代码来源:OptionGamemodes.java
示例13: drawWorldSelector
import codechicken.nei.LayoutManager; //导入依赖的package包/类
private void drawWorldSelector(Option o, int mousex, int mousey) {
Rectangle4i b = worldButtonSize();
boolean set = o.hasWorldOverride();
boolean mouseover = b.contains(mousex, mousey);
GL11.glColor4f(1, 1, 1, 1);
LayoutManager.drawButtonBackground(b.x, b.y, b.w, b.h, true, !set ? 0 : mouseover ? 2 : 1);
drawStringC("W", b.x, b.y, b.w, b.h, -1);
}
开发者ID:4Space,项目名称:4Space-5,代码行数:9,代码来源:GuiOptionList.java
示例14: drawItem
import codechicken.nei.LayoutManager; //导入依赖的package包/类
public void drawItem(Rectangle w, SortItem item, int mx, int my, float frame) {
double y = MathHelper.interpolate(item.ya, item.y, frame);
GlStateManager.translate(0, y, 0);
Rectangle b = new Rectangle(w.x, w.y, w.width, 20);
boolean mouseOver = itemAt(w.x+mx, w.y+my) == item;
GlStateManager.color(1, 1, 1, 1);
LayoutManager.drawButtonBackground(b.x, b.y, b.width, b.height, true, mouseOver ? 2 : 1);
drawStringC(item.e.getLocalisedName(), b.x, b.y, b.width, b.height, mouseOver ? 0xFFFFFFA0 : 0xFFE0E0E0);
GlStateManager.translate(0, -y, 0);
}
开发者ID:SneakyTactician,项目名称:BIGB,代码行数:13,代码来源:GuiItemSorter.java
示例15: drawWorldSelector
import codechicken.nei.LayoutManager; //导入依赖的package包/类
private void drawWorldSelector(Option o, int mousex, int mousey) {
Rectangle4i b = worldButtonSize();
boolean set = o.hasWorldOverride();
boolean mouseover = b.contains(mousex, mousey);
GlStateManager.color(1, 1, 1, 1);
LayoutManager.drawButtonBackground(b.x, b.y, b.w, b.h, true, !set ? 0 : mouseover ? 2 : 1);
drawStringC("W", b.x, b.y, b.w, b.h, -1);
}
开发者ID:SneakyTactician,项目名称:BIGB,代码行数:9,代码来源:GuiOptionList.java
示例16: onKeyTypedPost
import codechicken.nei.LayoutManager; //导入依赖的package包/类
@SubscribeEvent (priority = EventPriority.LOWEST, receiveCanceled = true)//we need to be called after JEI has registered the key press and updated the search box.
public void onKeyTypedPost(KeyboardInputEvent.Post event) {
GuiTextFieldFilter fieldFilter = JEIIntegrationManager.getTextFieldFilter();
if (fieldFilter != null && JEIIntegrationManager.searchBoxOwner == EnumItemBrowser.JEI && isNEIInWorld() && fieldFilter.isFocused()) {
NEIClientConfig.setSearchExpression(fieldFilter.getText(), false);
LayoutManager.searchField.setText(fieldFilter.getText(), false);
}
}
开发者ID:TheCBProject,项目名称:NotEnoughItems,代码行数:9,代码来源:ContainerEventHandler.java
示例17: handleLoginState
import codechicken.nei.LayoutManager; //导入依赖的package包/类
/**
* Handles the LoginState sent by the server.
* Resets and loads from the packet the following things:
* Permissible actions.
* Disabled actions.
* Enabled actions.
* Banned items.
*
* @param packet Packet to handle.
*/
private void handleLoginState(PacketCustom packet) {
NEIClientConfig.permissibleActions.clear();
int num = packet.readUByte();
for (int i = 0; i < num; i++) {
NEIClientConfig.permissibleActions.add(packet.readString());
}
NEIClientConfig.disabledActions.clear();
num = packet.readUByte();
for (int i = 0; i < num; i++) {
NEIClientConfig.disabledActions.add(packet.readString());
}
NEIClientConfig.enabledActions.clear();
num = packet.readUByte();
for (int i = 0; i < num; i++) {
NEIClientConfig.enabledActions.add(packet.readString());
}
NEIClientConfig.bannedItems.clear();
num = packet.readInt();
for (int i = 0; i < num; i++) {
NEIClientConfig.bannedItems.add(packet.readItemStack());
}
if (NEIClientUtils.getGuiContainer() != null) {
LayoutManager.instance().refresh(NEIClientUtils.getGuiContainer());
}
}
开发者ID:TheCBProject,项目名称:NotEnoughItems,代码行数:40,代码来源:NEIClientPacketHandler.java
示例18: drawItem
import codechicken.nei.LayoutManager; //导入依赖的package包/类
public void drawItem(Rectangle w, SortItem item, int mx, int my, float frame) {
double y = MathHelper.interpolate(item.ya, item.y, frame);
GlStateManager.translate(0, y, 0);
Rectangle b = new Rectangle(w.x, w.y, w.width, 20);
boolean mouseOver = itemAt(w.x + mx, w.y + my) == item;
GlStateManager.color(1, 1, 1, 1);
LayoutManager.drawButtonBackground(b.x, b.y, b.width, b.height, true, mouseOver ? 2 : 1);
drawStringC(item.e.getLocalisedName(), b.x, b.y, b.width, b.height, mouseOver ? 0xFFFFFFA0 : 0xFFE0E0E0);
GlStateManager.translate(0, -y, 0);
}
开发者ID:TheCBProject,项目名称:NotEnoughItems,代码行数:13,代码来源:GuiItemSorter.java
示例19: drawIcons
import codechicken.nei.LayoutManager; //导入依赖的package包/类
@Override
public void drawIcons() {
int x = buttonX();
LayoutManager.drawIcon(x + 4, 4, new Rectangle4i(132, 12, 12, 12));
x += 24;
LayoutManager.drawIcon(x + 4, 4, new Rectangle4i(156, 12, 12, 12));
x += 24;
LayoutManager.drawIcon(x + 4, 4, new Rectangle4i(168, 12, 12, 12));
x += 24;
}
开发者ID:TheCBProject,项目名称:NotEnoughItems,代码行数:11,代码来源:OptionGamemodes.java
示例20: setFocus
import codechicken.nei.LayoutManager; //导入依赖的package包/类
public void setFocus(boolean focus) {
if (focus) {
LayoutManager.setInputFocused(this);
} else if (focused()) {
LayoutManager.setInputFocused(null);
}
}
开发者ID:TheCBProject,项目名称:NotEnoughItems,代码行数:8,代码来源:TextField.java
注:本文中的codechicken.nei.LayoutManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论