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


Java TextFieldEnder.setText方法代碼示例

本文整理匯總了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);
    
}
 
開發者ID:SleepyTrousers,項目名稱:EnderIO,代碼行數:27,代碼來源:GuiSensor.java

示例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);
}
 
開發者ID:SleepyTrousers,項目名稱:EnderCore,代碼行數:6,代碼來源:GuiContainerBase.java

示例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());
}
 
開發者ID:SleepyTrousers,項目名稱:EnderIO,代碼行數:59,代碼來源:GuiTelePad.java


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