當前位置: 首頁>>代碼示例>>Java>>正文


Java IconButton類代碼示例

本文整理匯總了Java中com.enderio.core.client.gui.button.IconButton的典型用法代碼示例。如果您正苦於以下問題:Java IconButton類的具體用法?Java IconButton怎麽用?Java IconButton使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


IconButton類屬於com.enderio.core.client.gui.button包,在下文中一共展示了IconButton類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: GuiMachineBase

import com.enderio.core.client.gui.button.IconButton; //導入依賴的package包/類
protected GuiMachineBase(@Nonnull T machine, @Nonnull Container par1Container, String... guiTexture) {
  super(par1Container, guiTexture);
  tileEntity = machine;

  xSize = getXSize();
  ySize = getYSize();
  int x = getXSize() - 5 - BUTTON_SIZE;
  int y = 5;
  redstoneButton = new RedstoneModeButton<T>(this, -1, x, y, tileEntity);

  configOverlay = new GuiOverlayIoConfig<T>(machine);
  addOverlay(configOverlay);

  y += 19;
  configB = new GuiButtonIoConfig<T>(this, CONFIG_ID, x, y, machine, configOverlay);

  y += 19;
  recipeButton = new IconButton(this, RECIPE_ID, x, y, IconEIO.RECIPE);
  recipeButton.visible = false;
  recipeButton.setIconMargin(1, 1);
}
 
開發者ID:SleepyTrousers,項目名稱:EnderIO,代碼行數:22,代碼來源:GuiMachineBase.java

示例2: GuiVat

import com.enderio.core.client.gui.button.IconButton; //導入依賴的package包/類
public GuiVat(@Nonnull InventoryPlayer inventory, @Nonnull TileVat te) {
  super(te, new ContainerVat(inventory, te), GUI_TEXTURE);

  addToolTip(new GuiToolTip(RECTANGLE_INPUT_TANK, "") {

    @Override
    protected void updateText() {
      text.clear();
      text.add(Lang.GUI_VAT_ITANK.get());
      text.add(LangFluid.MB(getTileEntity().inputTank));
    }

  });

  addToolTip(new GuiToolTip(RECTANGLE_OUTPUT_TANK, "") {

    @Override
    protected void updateText() {
      text.clear();
      text.add(Lang.GUI_VAT_OTANK.get());
      text.add(LangFluid.MB(getTileEntity().outputTank));
    }

  });

  dump1 = new IconButton(this, 1, 29, 62, IconEIO.DUMP_LIQUID);
  dump1.setToolTip(Lang.GUI_VAT_DUMP.get());
  dump2 = new IconButton(this, 2, 131, 62, IconEIO.VOID_LIQUID);
  dump2.setToolTip(Lang.GUI_VAT_VOID.get());

  addProgressTooltip(81, 63, 14, 14);

  addDrawingElement(new PowerBar<>(te, this, 11, 11, 43));
}
 
開發者ID:SleepyTrousers,項目名稱:EnderIO,代碼行數:35,代碼來源:GuiVat.java

示例3: GuiEnchanter

import com.enderio.core.client.gui.button.IconButton; //導入依賴的package包/類
public GuiEnchanter(EntityPlayer player, @Nonnull InventoryPlayer inventory, @Nonnull TileEnchanter te) {
  super(new ContainerEnchanter(player, inventory, te), "enchanter");
  container = (ContainerEnchanter) inventorySlots;
  this.te = te;

  recipeButton = new IconButton(this, 100, 154, 8, IconEIO.RECIPE);
  recipeButton.visible = false;
  recipeButton.setIconMargin(1, 1);
}
 
開發者ID:SleepyTrousers,項目名稱:EnderIO,代碼行數:10,代碼來源:GuiEnchanter.java

示例4: initGui

import com.enderio.core.client.gui.button.IconButton; //導入依賴的package包/類
@Override
public void initGui() {
  super.initGui();

  int x = (xSize / 2) - (BUTTON_SIZE / 2);
  int y = 58;

  addButton(buttonStart = new IconButton(this, 0, x, y, IconEIO.TICK));
  buttonStart.onGuiInit();

  refreshButtons();
  ((ContainerWeatherObelisk) inventorySlots).createGhostSlots(getGhostSlotHandler().getGhostSlots());
}
 
開發者ID:SleepyTrousers,項目名稱:EnderIO,代碼行數:14,代碼來源:GuiWeatherObelisk.java

示例5: GuiSoulBinder

import com.enderio.core.client.gui.button.IconButton; //導入依賴的package包/類
public GuiSoulBinder(@Nonnull InventoryPlayer par1InventoryPlayer, @Nonnull TileSoulBinder te) {
  super(te, new ContainerSoulBinder(par1InventoryPlayer, te), "soul_fuser");
  usePlayerXP = new IconButton(this, PLAYER_XP_ID, 125, 57, IconEIO.XP);
  usePlayerXP.visible = false;
  usePlayerXP.setToolTip(Lang.GUI_SOUL_USEPLAYERXP.get());

  addProgressTooltip(80, 34, 24, 16);

  addDrawingElement(new PowerBar<>(te, this));
}
 
開發者ID:SleepyTrousers,項目名稱:EnderIO,代碼行數:11,代碼來源:GuiSoulBinder.java

示例6: ModItemFilterGui

import com.enderio.core.client.gui.button.IconButton; //導入依賴的package包/類
public ModItemFilterGui(@Nonnull GuiContainerBaseEIO gui, @Nonnull IItemFilterContainer filterContainer, boolean isInput) {
  this.gui = gui;
  this.isInput = isInput;
  this.filterContainer = filterContainer;

  if (isInput) {
    filter = (ModItemFilter) filterContainer.getItemFilter();
    inputOffsetX = 50;
    tfWidth = 96;
    tfTextureX = 120;
    tfTextureY = 214;
  } else {
    filter = (ModItemFilter) filterContainer.getItemFilter();
    inputOffsetX = 32;
    tfWidth = 114;
    tfTextureX = 120;
    tfTextureY = 238;
  }

  inputBounds = new Rectangle[] { new Rectangle(inputOffsetX, 47, 16, 16), new Rectangle(inputOffsetX, 68, 16, 16), new Rectangle(inputOffsetX, 89, 16, 16) };

  deleteButs = new IconButton[inputBounds.length];
  for (int i = 0; i < deleteButs.length; i++) {
    Rectangle r = inputBounds[i];
    IconButton but = new IconButton(gui, FilterGuiUtil.nextButtonId(), r.x + 19, r.y, IconEIO.MINUS);
    deleteButs[i] = but;
  }

  whiteListB = new IconButton(gui, -1, inputOffsetX - 19, 89, IconEIO.FILTER_WHITELIST);
  whiteListB.setToolTip(EnderIO.lang.localize("gui.conduit.item.whitelist"));
}
 
開發者ID:SleepyTrousers,項目名稱:EnderIO,代碼行數:32,代碼來源:ModItemFilterGui.java

示例7: deactivate

import com.enderio.core.client.gui.button.IconButton; //導入依賴的package包/類
@Override
public void deactivate() {
  for (IconButton but : deleteButs) {
    but.detach();
  }
  whiteListB.detach();
}
 
開發者ID:SleepyTrousers,項目名稱:EnderIO,代碼行數:8,代碼來源:ModItemFilterGui.java

示例8: updateButtons

import com.enderio.core.client.gui.button.IconButton; //導入依賴的package包/類
@Override
public void updateButtons() {
  for (IconButton but : deleteButs) {
    but.onGuiInit();
  }

  whiteListB.onGuiInit();
  if (filter.isBlacklist()) {
    whiteListB.setIcon(IconEIO.FILTER_BLACKLIST);
    whiteListB.setToolTip(EnderIO.lang.localize("gui.conduit.item.blacklist"));
  } else {
    whiteListB.setIcon(IconEIO.FILTER_WHITELIST);
    whiteListB.setToolTip(EnderIO.lang.localize("gui.conduit.item.whitelist"));
  }
}
 
開發者ID:SleepyTrousers,項目名稱:EnderIO,代碼行數:16,代碼來源:ModItemFilterGui.java

示例9: actionPerformed

import com.enderio.core.client.gui.button.IconButton; //導入依賴的package包/類
@Override
public void actionPerformed(@Nonnull GuiButton guiButton) {
  for (int i = 0; i < deleteButs.length; i++) {
    IconButton but = deleteButs[i];
    if (but.id == guiButton.id) {
      setMod(i, null);
      return;
    }
  }
  if (guiButton == whiteListB) {
    toggleBlacklist();
  }
}
 
開發者ID:SleepyTrousers,項目名稱:EnderIO,代碼行數:14,代碼來源:ModItemFilterGui.java

示例10: SpeciesItemFilterGui

import com.enderio.core.client.gui.button.IconButton; //導入依賴的package包/類
public SpeciesItemFilterGui(@Nonnull GuiContainerBaseEIO gui, @Nonnull IItemFilterContainer filterContainer, boolean isStickyModeAvailable,
                            int xOffset, int yOffset,
                            int buttonIdOffset) {
  this.gui = gui;
  this.isStickyModeAvailable = isStickyModeAvailable;
  this.filterContainer = filterContainer;
  this.xOffset = xOffset;
  this.yOffset = yOffset;
  this.buttonIdOffset = buttonIdOffset;

  filter = (SpeciesItemFilter) filterContainer.getItemFilter();

  int butLeft = xOffset + 92;
  int x = butLeft;
  int y = yOffset + 1;
  whiteListB = new IconButton(gui, ID_WHITELIST + buttonIdOffset, x, y, IconEIO.FILTER_WHITELIST);
  whiteListB.setToolTip(EnderIO.lang.localize("gui.conduit.item.whitelist"));

  x += 20;
  stickyB = new ToggleButton(gui, ID_STICKY + buttonIdOffset, x, y, IconEIO.FILTER_STICKY_OFF, IconEIO.FILTER_STICKY);
  stickyB.setSelectedToolTip(EnderIO.lang.localizeList("gui.conduit.item.stickyEnabled"));
  stickyB.setUnselectedToolTip(EnderIO.lang.localize("gui.conduit.item.stickyDisbaled"));
  stickyB.setPaintSelectedBorder(false);

  y += 20;
  x = butLeft;

  speciesModeB = new CycleButton<SpeciesMode.IconHolder>(gui, ID_SPECIES_MODE + buttonIdOffset, x, y, SpeciesMode.IconHolder.class);
}
 
開發者ID:SleepyTrousers,項目名稱:EnderIO,代碼行數:30,代碼來源:SpeciesItemFilterGui.java

示例11: mouseClicked

import com.enderio.core.client.gui.button.IconButton; //導入依賴的package包/類
@Override
protected void mouseClicked(int x, int y, int button) {
  for (GuiTextField f : textFields) {
    f.mouseClicked(x, y, button);
  }
  if (!scrollbars.isEmpty()) {
    if (draggingScrollbar != null) {
      draggingScrollbar.mouseClicked(x, y, button);
      return;
    }
    for (VScrollbar vs : scrollbars) {
      if (vs.mouseClicked(x, y, button)) {
        draggingScrollbar = vs;
        return;
      }
    }
  }
  if (!ghostSlotHandler.getGhostSlots().isEmpty()) {
    GhostSlot slot = getGhostSlot(x, y);
    if (slot != null) {
      ghostSlotClicked(slot, x, y, button);
      return;
    }
  }
  // Right click field clearing
  if (button == 1) {
    for (TextFieldEnder tf : textFields) {
      if (tf.contains(x, y)) {
        setText(tf, "");
      }
    }
  }
  // Button events for non-left-clicks
  if (button >= 1) {
    for (Object obj : buttonList) {
      if (obj instanceof IconButton) {
        IconButton btn = (IconButton) obj;
        if (btn.mousePressedButton(mc, x, y, button)) {
          btn.func_146113_a(this.mc.getSoundHandler());
          actionPerformedButton(btn, button);
        }
      }
    }
  }
  super.mouseClicked(x, y, button);
}
 
開發者ID:SleepyTrousers,項目名稱:EnderCore,代碼行數:47,代碼來源:GuiContainerBase.java

示例12: actionPerformedButton

import com.enderio.core.client.gui.button.IconButton; //導入依賴的package包/類
protected void actionPerformedButton(IconButton btn, int mouseButton) {
  actionPerformed(btn);
}
 
開發者ID:SleepyTrousers,項目名稱:EnderCore,代碼行數:4,代碼來源:GuiContainerBase.java

示例13: createLockButton

import com.enderio.core.client.gui.button.IconButton; //導入依賴的package包/類
private IconButton createLockButton(int slot, int x, int y) {
  return new ToggleButton(this, LOCK_ID + slot, x, y, IconEIO.LOCK_UNLOCKED, IconEIO.LOCK_LOCKED).setSelected(getTileEntity().isSlotLocked(slot));
}
 
開發者ID:SleepyTrousers,項目名稱:EnderIO,代碼行數:4,代碼來源:GuiFarmStation.java

示例14: ExistingItemFilterGui

import com.enderio.core.client.gui.button.IconButton; //導入依賴的package包/類
public ExistingItemFilterGui(@Nonnull GuiContainerBaseEIO gui, @Nonnull IItemFilterContainer filterContainer, boolean isInput) {
  this.gui = gui;
  this.filterContainer = filterContainer;
  this.isInput = isInput;

  filter = (ExistingItemFilter) filterContainer.getItemFilter();

  int butLeft = 37;
  int x = butLeft;
  int y = 68;

  useMetaB = new ToggleButton(gui, ID_META, x, y, IconEIO.FILTER_META_OFF, IconEIO.FILTER_META);
  useMetaB.setSelectedToolTip(EnderIO.lang.localize("gui.conduit.item.matchMetaData"));
  useMetaB.setUnselectedToolTip(EnderIO.lang.localize("gui.conduit.item.ignoreMetaData"));
  useMetaB.setPaintSelectedBorder(false);

  x += 20;
  stickyB = new ToggleButton(gui, ID_STICKY, x, y, IconEIO.FILTER_STICKY_OFF, IconEIO.FILTER_STICKY);
  String[] lines = EnderIO.lang.localizeList("gui.conduit.item.stickyEnabled");
  stickyB.setSelectedToolTip(lines);
  stickyB.setUnselectedToolTip(EnderIO.lang.localize("gui.conduit.item.stickyDisbaled"));
  stickyB.setPaintSelectedBorder(false);

  y += 20;
  x = butLeft;

  x += 20;
  useNbtB = new ToggleButton(gui, ID_NBT, x, y, IconEIO.FILTER_NBT_OFF, IconEIO.FILTER_NBT);
  useNbtB.setSelectedToolTip(EnderIO.lang.localize("gui.conduit.item.matchNBT"));
  useNbtB.setUnselectedToolTip(EnderIO.lang.localize("gui.conduit.item.ignoreNBT"));
  useNbtB.setPaintSelectedBorder(false);

  x = butLeft;
  useOreDictB = new ToggleButton(gui, ID_ORE_DICT, x, y, IconEIO.FILTER_ORE_DICT_OFF, IconEIO.FILTER_ORE_DICT);
  useOreDictB.setSelectedToolTip(EnderIO.lang.localize("gui.conduit.item.oreDicEnabled"));
  useOreDictB.setUnselectedToolTip(EnderIO.lang.localize("gui.conduit.item.oreDicDisabled"));
  useOreDictB.setPaintSelectedBorder(false);

  snapshotB = new TooltipButton(gui, ID_SNAPSHOT, 80, 65, 60, 20, EnderIO.lang.localize("gui.conduit.button.snap"));
  mergeB = new GuiButton(ID_MERGE, 0, 0, 40, 20, EnderIO.lang.localize("gui.conduit.button.merge"));
  clearB = new GuiButton(ID_CLEAR, 0, 0, 60, 20, EnderIO.lang.localize("gui.conduit.button.clear"));
  showB = new GuiButton(ID_SHOW, 0, 0, 40, 20, EnderIO.lang.localize("gui.conduit.button.show"));

  snapshotB.setToolTip(EnderIO.lang.localizeList("gui.conduit.button.snap.tooltip"));

  x -= 20;
  whiteListB = new IconButton(gui, -1, x, y, IconEIO.FILTER_WHITELIST);
  whiteListB.setToolTip(EnderIO.lang.localize("gui.conduit.item.whitelist"));

  snapshotOverlay = new SnapshotOverlay();
  gui.addOverlay(snapshotOverlay);

}
 
開發者ID:SleepyTrousers,項目名稱:EnderIO,代碼行數:54,代碼來源:ExistingItemFilterGui.java

示例15: BasicItemFilterGui

import com.enderio.core.client.gui.button.IconButton; //導入依賴的package包/類
public BasicItemFilterGui(@Nonnull GuiContainerBaseEIO gui, @Nonnull IItemFilterContainer filterContainer, boolean isStickyModeAvailable,
    int xOffset, int yOffset,
    int buttonIdOffset) {
  this.gui = gui;
  this.isStickyModeAvailable = isStickyModeAvailable;
  this.filterContainer = filterContainer;
  this.xOffset = xOffset;
  this.yOffset = yOffset;
  this.buttonIdOffset = buttonIdOffset;

  filter = (ItemFilter) filterContainer.getItemFilter();
  
  isAdvanced = filter.isAdvanced();
  isLimited = filter.isLimited();
  
  int butLeft = xOffset + 92;
  int x = butLeft;
  int y = yOffset + 1;
  whiteListB = new IconButton(gui, ID_WHITELIST + buttonIdOffset, x, y, IconEIO.FILTER_WHITELIST);
  whiteListB.setToolTip(EnderIO.lang.localize("gui.conduit.item.whitelist"));

  x += 20;
  useMetaB = new ToggleButton(gui, ID_META + buttonIdOffset, x, y, IconEIO.FILTER_META_OFF, IconEIO.FILTER_META);
  useMetaB.setSelectedToolTip(EnderIO.lang.localize("gui.conduit.item.matchMetaData"));
  useMetaB.setUnselectedToolTip(EnderIO.lang.localize("gui.conduit.item.ignoreMetaData"));
  useMetaB.setPaintSelectedBorder(false);

  x += 20;
  stickyB = new ToggleButton(gui, ID_STICKY + buttonIdOffset, x, y, IconEIO.FILTER_STICKY_OFF, IconEIO.FILTER_STICKY);
  stickyB.setSelectedToolTip(EnderIO.lang.localizeList("gui.conduit.item.stickyEnabled"));
  stickyB.setUnselectedToolTip(EnderIO.lang.localize("gui.conduit.item.stickyDisbaled"));
  stickyB.setPaintSelectedBorder(false);

  y += 20;
  x = butLeft;

  useOreDictB = new ToggleButton(gui, ID_ORE_DICT + buttonIdOffset, x, y, IconEIO.FILTER_ORE_DICT_OFF, IconEIO.FILTER_ORE_DICT);
  useOreDictB.setSelectedToolTip(EnderIO.lang.localize("gui.conduit.item.oreDicEnabled"));
  useOreDictB.setUnselectedToolTip(EnderIO.lang.localize("gui.conduit.item.oreDicDisabled"));
  useOreDictB.setPaintSelectedBorder(false);

  x += 20;
  useNbtB = new ToggleButton(gui, ID_NBT + buttonIdOffset, x, y, IconEIO.FILTER_NBT_OFF, IconEIO.FILTER_NBT);
  useNbtB.setSelectedToolTip(EnderIO.lang.localize("gui.conduit.item.matchNBT"));
  useNbtB.setUnselectedToolTip(EnderIO.lang.localize("gui.conduit.item.ignoreNBT"));
  useNbtB.setPaintSelectedBorder(false);

  x += 20;
  damageB = new CycleButton<DamageModeIconHolder>(gui, ID_DAMAGE + buttonIdOffset, x, y, DamageModeIconHolder.class);
}
 
開發者ID:SleepyTrousers,項目名稱:EnderIO,代碼行數:51,代碼來源:BasicItemFilterGui.java


注:本文中的com.enderio.core.client.gui.button.IconButton類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。