Package de.lessvoid.nifty

Examples of de.lessvoid.nifty.EndNotify


    nifty.closePopup(creditsPopup.getId());
  }

  @NiftyEventSubscriber(id="resetScreenButton")
  public void onTestButtonClick(final String id, final ButtonClickedEvent clickedEvent) {
    screen.findElementByName(buttonToDialogMap.get(currentMenuButtonId)).hide(new EndNotify() {
      @Override
      public void perform() {
        nifty.gotoScreen("demo");
      }
    });
View Full Code Here


    System.out.println(executeCommandEvent.getCommandLine());
  }

  @NiftyEventSubscriber(id="resolutions")
  public void onResolution(final String id, final DropDownSelectionChangedEvent<DisplayMode> event) {
    screen.findElementByName("whiteOverlay").startEffect(EffectEventId.onCustom, new EndNotify() {
      @Override
      public void perform() {
        DisplayMode displayMode = event.getSelection();
        try {
          Display.setDisplayMode(displayMode);
View Full Code Here

  @NiftyEventSubscriber(id="chest")
  public void onDrop(final String id, final DroppableDroppedEvent event) {
    if ("key".equals(event.getDraggable().getId())) {
      event.getDraggable().getElement().markForRemoval();
      chestOpenElement.startEffect(EffectEventId.onCustom, new EndNotify() {
        @Override
        public void perform() {
          chestOpenElement.hide();
          dragAndDropDescription.setText("Well Done!");
          resetButton.enable();
View Full Code Here

    if (isEffectActive(EffectEventId.onShow)) {
      resetSingleEffect(EffectEventId.onShow);
    }

    // start effect and shizzle
    startEffect(EffectEventId.onHide, new EndNotify() {
      public void perform() {
        resetForHide();
        internalHide();
        if (perform != null) {
          perform.perform();
View Full Code Here

    final Element hintLayer = nifty.getCurrentScreen().findElementByName(hintLayerId);
    if (hintLayer == null) {
      return;
    }
    if (hintLayer.isVisible()) {
      hintLayer.startEffect(EffectEventId.onCustom, new EndNotify() {
        @Override
        public void perform() {
          hintLayer.markForRemoval();
        }
      });
View Full Code Here

    // else although I'm currently not sure what that might be :)
    //
    // nifty.resetEvents();

    // create the callback
    EndNotify localEndNotify = new EndNotify() {
      public final void perform() {
        for (int i=0; i<layerElements.size(); i++) {
          Element w = layerElements.get(i);
          if (w.isEffectActive(EffectEventId.onStartScreen)) {
            return;
View Full Code Here

    ListBoxControl listBoxControl = (ListBoxControl) listBox;
    listBoxControl.getViewConverter().display(dropDown.getElement().findElementByName("#text"), selectedItem);

    final int selectedItemIndex = getSelectedIndex(data);
    if (screen.isActivePopup(popupInstance)) {
      dropDown.getElement().getControl(DropDownControl.class).close(new EndNotify() {
        @Override
        public void perform() {
          nifty.publishEvent(dropDown.getId(), new DropDownSelectionChangedEvent(dropDown, selectedItem, selectedItemIndex));
        }
      });
View Full Code Here

    closeInternal(endNotify);
  }

  private void closeInternal(final EndNotify endNotify) {
    alreadyOpen = false;
    nifty.closePopup(popup.getId(), new EndNotify() {
      @Override
      public void perform() {
        // this really feels like a hack but I don't have another idea right now:
        //
        // when the popup is closed Nifty will automatically remove all subscribers for all controls in the popup.
View Full Code Here

  }

  // interact callbacks

  public boolean activateItem(final String menuItemId) {
    nifty.closePopup(element.getParent().getId(), new EndNotify() {
      @Override
      public void perform() {
        nifty.publishEvent(element.getId(), new MenuItemActivatedEvent<T>(MenuControl.this, items.get(menuItemId)));
      }
    });
View Full Code Here

  }

  private void moveDraggableToPopup() {
    popup = nifty.createPopup(POPUP);

    draggable.markForMove(popup, new EndNotify() {
      @Override
      public void perform() {
        draggable.setConstraintX(new SizeValue(originalPositionX + "px"));
        draggable.setConstraintY(new SizeValue(originalPositionY + "px"));
        nifty.showPopup(screen, popup.getId(), null);
View Full Code Here

TOP

Related Classes of de.lessvoid.nifty.EndNotify

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.