本文整理汇总了Java中com.enderio.core.client.gui.widget.TextFieldEnder.setText方法的典型用法代码示例。如果您正苦于以下问题:Java TextFieldEnder.setText方法的具体用法?Java TextFieldEnder.setText怎么用?Java TextFieldEnder.setText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.enderio.core.client.gui.widget.TextFieldEnder
的用法示例。
在下文中一共展示了TextFieldEnder.setText方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: GuiSensor
import com.enderio.core.client.gui.widget.TextFieldEnder; //导入方法依赖的package包/类
public GuiSensor(InventoryPlayer par1InventoryPlayer, TileInventoryPanelSensor te) {
super(te, new ContainerSensor(par1InventoryPlayer, te), "invPanelSensor");
recipeButton.setYOrigin(recipeButton.getBounds().y + 19);
redstoneButton.setIsVisible(false);
configB.setYOrigin(5);
int tfWidth = 42;
int tfHeight = 14;
int tfX = xSize - tfWidth - 6 - 20;
int tfY = 34;
startTF = new TextFieldEnder(getFontRenderer(), tfX, tfY, tfWidth, tfHeight);
startTF.setCanLoseFocus(true);
startTF.setMaxStringLength(6);
startTF.setText(te.getStartCount() + "");
startTF.setCharFilter(TextFieldEnder.FILTER_NUMERIC);
textFields.add(startTF);
stopTF = new TextFieldEnder(getFontRenderer(), tfX, tfY + tfHeight + 4, tfWidth, tfHeight);
stopTF.setCanLoseFocus(true);
stopTF.setMaxStringLength(6);
stopTF.setText(te.getStopCount() + "");
stopTF.setCharFilter(TextFieldEnder.FILTER_NUMERIC);
textFields.add(stopTF);
}
示例2: setText
import com.enderio.core.client.gui.widget.TextFieldEnder; //导入方法依赖的package包/类
protected final void setText(TextFieldEnder tf, String newText) {
String old = tf.getText();
tf.setText(newText);
onTextFieldChanged(tf, old);
}
示例3: GuiTelePad
import com.enderio.core.client.gui.widget.TextFieldEnder; //导入方法依赖的package包/类
public GuiTelePad(@Nonnull InventoryPlayer playerInv, final @Nonnull TileTelePad te) {
super(new ContainerTelePad(playerInv, te), "tele_pad");
this.te = te;
ySize = 220;
addToolTip(new GuiToolTip(new Rectangle(powerX, powerY, 10, powerScale), "") {
@Override
protected void updateText() {
text.clear();
updatePowerBarTooltip(text);
}
});
addToolTip(new GuiToolTip(new Rectangle(progressX, progressY, progressScale, 10), "") {
@Override
protected void updateText() {
text.clear();
text.add(Math.round(GuiTelePad.this.te.getProgress() * 100) + "%");
}
});
if (TelePadConfig.telepadFluidUse.get() > 0) {
addToolTip(new GuiToolTip(RECTANGLE_TANK, "") {
@Override
protected void updateText() {
text.clear();
text.add(Lang.GUI_TELEPAD_TANK.get());
text.add(LangFluid.MB(te.getTank()));
}
});
}
FontRenderer fr = Minecraft.getMinecraft().fontRenderer;
int x = 48;
int y = 24;
int tfHeight = 12;
int tfWidth = xSize - x * 2;
xTF = new TextFieldEnder(fr, x, y, tfWidth, tfHeight, TextFieldEnder.FILTER_NUMERIC);
yTF = new TextFieldEnder(fr, x, y + xTF.height + 2, tfWidth, tfHeight, TextFieldEnder.FILTER_NUMERIC);
zTF = new TextFieldEnder(fr, x, y + (xTF.height * 2) + 4, tfWidth, tfHeight, TextFieldEnder.FILTER_NUMERIC);
dimTF = new TextFieldEnder(fr, x, y + (xTF.height * 3) + 6, tfWidth, tfHeight, TextFieldEnder.FILTER_NUMERIC);
xTF.setText(Integer.toString(te.getX()));
yTF.setText(Integer.toString(te.getY()));
zTF.setText(Integer.toString(te.getZ()));
dimTF.setText(Integer.toString(te.getTargetDim()));
xTF.setCanLoseFocus(!TelePadConfig.telepadLockCoords.get());
yTF.setCanLoseFocus(!TelePadConfig.telepadLockCoords.get());
zTF.setCanLoseFocus(!TelePadConfig.telepadLockCoords.get());
dimTF.setCanLoseFocus(!TelePadConfig.telepadLockDimension.get());
textFields.addAll(Lists.newArrayList(xTF, yTF, zTF, dimTF));
switchButton = new ToggleTravelButton(this, ID_SWITCH_BUTTON, SWITCH_X, SWITCH_Y, IconEIO.IO_WHATSIT);
switchButton.setToolTip(Lang.GUI_TELEPAD_TO_TRAVEL.get());
}