本文整理汇总了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);
}
示例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));
}
示例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);
}
示例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());
}
示例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));
}
示例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"));
}
示例7: deactivate
import com.enderio.core.client.gui.button.IconButton; //导入依赖的package包/类
@Override
public void deactivate() {
for (IconButton but : deleteButs) {
but.detach();
}
whiteListB.detach();
}
示例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"));
}
}
示例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();
}
}
示例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);
}
示例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);
}
示例12: actionPerformedButton
import com.enderio.core.client.gui.button.IconButton; //导入依赖的package包/类
protected void actionPerformedButton(IconButton btn, int mouseButton) {
actionPerformed(btn);
}
示例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));
}
示例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);
}
示例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);
}