Package de.lessvoid.nifty.elements

Examples of de.lessvoid.nifty.elements.Element$LocalEndNotify


    /**
     * {@inheritDoc}
     */
    @Override
    public final void display(final Element listBoxItem, final ChatEntryModelClass item) {
        final Element text = listBoxItem.findElementByName(CHAT_LINE_TEXT);
        final TextRenderer textRenderer = text.getRenderer(TextRenderer.class);
        final Element icon = listBoxItem.findElementByName(CHAT_LINE_ICON);
        final ImageRenderer iconRenderer = icon.getRenderer(ImageRenderer.class);
        if (item != null) {
            textRenderer.setText(item.toString());
            iconRenderer.setImage(item.getIcon());
        } else {
            textRenderer.setText("");
View Full Code Here


    /**
     * {@inheritDoc}
     */
    @Override
    public final int getWidth(final Element listBoxItem, final ChatEntryModelClass item) {
        final Element text = listBoxItem.findElementByName(CHAT_LINE_TEXT);
        final TextRenderer textRenderer = text.getRenderer(TextRenderer.class);
        final Element icon = listBoxItem.findElementByName(CHAT_LINE_ICON);
        final ImageRenderer iconRenderer = icon.getRenderer(ImageRenderer.class);
        return ((textRenderer.getFont() == null) ? 0 : textRenderer.getFont().getWidth(item.getLabel()))
                + ((item.getIcon() == null) ? 0 : item.getIcon().getWidth());
    }
View Full Code Here

  }

  public boolean inputEvent(final NiftyInputEvent inputEvent) {
    if (inputEvent == NiftyInputEvent.NextInputElement) {
      if (focusHandler != null) {
        Element nextElement = focusHandler.getNext(element);
        nextElement.setFocus();
        return true;
      }
    } else if (inputEvent == NiftyInputEvent.PrevInputElement) {
      if (focusHandler != null) {
        Element prevElement = focusHandler.getPrev(element);
        prevElement.setFocus();
        return true;
      }
    } else if (inputEvent == NiftyInputEvent.MoveCursorDown) {
      if (hasElements()) {
        int focusItemIndex = listBox.getFocusItemIndex();
View Full Code Here

public class CharacterListBoxViewConverter implements
    ListBoxViewConverter<net.cis.common.model.system.Character> {

  @Override
  public void display(Element listBoxItem, Character character) {
    final Element characterName = listBoxItem
        .findElementByName("#listbox.character.name");
    final TextRenderer characterNameRenderer = characterName
        .getRenderer(TextRenderer.class);

    final Element characterSpecies = listBoxItem
        .findElementByName("#listbox.character.species");
    final TextRenderer characterSpeciesRenderer = characterSpecies
        .getRenderer(TextRenderer.class);

    final Element icon = listBoxItem
        .findElementByName("#listbox.character.icon");
    final ImageRenderer iconRenderer = icon
        .getRenderer(ImageRenderer.class);

    if (character != null) {
      characterNameRenderer.setText(character.getName());
      characterSpeciesRenderer.setText(character.getSpecies());
View Full Code Here

    }
  }

  @Override
  public int getWidth(Element element, Character character) {
    final Element text = element
        .findElementByName("#listbox.character.name");
    final TextRenderer textRenderer = text.getRenderer(TextRenderer.class);
    return ((textRenderer.getFont() == null) ? 0 : textRenderer.getFont()
        .getWidth(character.getName()))
        + ((character.getIcon() == null) ? 0 : character.getIcon()
            .getWidth());
  }
View Full Code Here

    simpleApplication.getGuiViewPort().addProcessor(niftyDisplay);
  }
  protected void initInputTextField()
  {
    textfield = nifty.getScreen("debugGUI").findNiftyControl("txtInput", TextField.class);
    Element elem = textfield.getElement();
    elem.attachInputControl(new NiftyInputControl(elem.getAttachedInputControl().getController(), new TextFieldInputMappingAdv()));
    elem.getAttachedInputControl().addInputHandler(new KeyInputHandler() {
     
      @Override
      public boolean keyEvent(NiftyInputEvent inputEvent) {
        return onTextChanged(inputEvent);
      }
View Full Code Here

public class DebugEntryViewConverter implements ListBoxViewConverter<DebugEntry> {
  @Override
  public void display(final Element listBoxItem, final DebugEntry item)
  {
  Element textElement = listBoxItem.findElementByName("#lbTextElem");
  textElement.getRenderer(TextRenderer.class).setText(item.data);
  textElement.getRenderer(TextRenderer.class).setColor(item.color);
  }
View Full Code Here

   * @see de.lessvoid.nifty.controls.ListBox.ListBoxViewConverter#display(de.lessvoid.nifty.elements.Element,
   * java.lang.Object)
   */
  @Override
  public void display(Element listBoxItem, ListBoxEntryModel item) {
    final Element text = listBoxItem.findElementByName(LISTBOX_LINE_TEXT);
    final TextRenderer textRenderer = text.getRenderer(TextRenderer.class);
    final Element icon = listBoxItem.findElementByName(LISTBOX_LINE_ICON);
    final ImageRenderer iconRenderer = icon.getRenderer(ImageRenderer.class);
    if (item != null) {
      textRenderer.setText(item.getLabel());
      iconRenderer.setImage(item.getIcon());
    } else {
      textRenderer.setText("");
View Full Code Here

   * @see de.lessvoid.nifty.controls.ListBox.ListBoxViewConverter#getWidth(de.lessvoid.nifty.elements.Element,
   * java.lang.Object)
   */
  @Override
  public int getWidth(Element element, ListBoxEntryModel item) {
    final Element text = element.findElementByName(LISTBOX_LINE_TEXT);
    final TextRenderer textRenderer = text.getRenderer(TextRenderer.class);
    return ((textRenderer.getFont() == null) ? 0 : textRenderer.getFont().getWidth(item.getLabel()))
        + ((item.getIcon() == null) ? 0 : item.getIcon().getWidth());
  }
View Full Code Here

    // TODO Auto-generated method stub

  }

  public void showWindow(String id) {
    Element window = nifty.getCurrentScreen().findElementByName(
        "window." + id);
    if (window.isVisible()) {
      window.hide();
    } else {
      window.show();
    }
  }
View Full Code Here

TOP

Related Classes of de.lessvoid.nifty.elements.Element$LocalEndNotify

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.