Package org.getspout.spoutapi.gui

Examples of org.getspout.spoutapi.gui.Widget


    @Override
    public Screen removeWidgets(Plugin p) {
        Iterator<Widget> it = wigs.values().iterator();
        while(it.hasNext())
        {
            Widget next = it.next();
            if(next.getPlugin() == p)
                it.remove();
        }
        return super.removeWidgets(p);
    }
View Full Code Here


      }
      if (player.getCurrentScreen() != null && player.getCurrentScreen().getId().equals(this.screen)) {
        screen = player.getCurrentScreen();
      }
      if (screen != null) {
        Widget control = screen.getWidget(widget);
        if (control != null) {
          if (control instanceof Button) {
            if (control instanceof CheckBox) {
              ((CheckBox) control).setChecked(!((CheckBox) control).isChecked());
            }
            if (control instanceof RadioButton) {
              ((RadioButton) control).setSelected(true);
            }
            ButtonClickEvent event = new ButtonClickEvent(player, screen, (Button) control);
            ((Button) control).onButtonClick(event);
            Bukkit.getServer().getPluginManager().callEvent(event);
          } else if (control instanceof Slider) {
            SliderDragEvent event = new SliderDragEvent(player, screen, (Slider) control, state);
            ((Slider) control).onSliderDrag(event);
            Bukkit.getServer().getPluginManager().callEvent(event);
            if (event.isCancelled()) {
              ((Slider) control).setSliderPosition(event.getOldPosition());
              control.setDirty(true);
            } else if (event.getNewPosition() != state) {
              ((Slider) control).setSliderPosition(event.getNewPosition());
              control.setDirty(true);
            } else {
              ((Slider) control).setSliderPosition(event.getNewPosition());
            }
          } else if (control instanceof TextField) {
            TextFieldChangeEvent event = new TextFieldChangeEvent(player, screen, (TextField) control, data);
            ((TextField) control).onTextFieldChange(event);
            Bukkit.getServer().getPluginManager().callEvent(event);
            if (event.isCancelled()) {
              ((TextField) control).setText(event.getOldText());
              control.setDirty(true);
            } else if (!event.getNewText().equals(data)) {
              ((TextField) control).setText(event.getNewText());
              control.setDirty(true);
            } else {
              ((TextField) control).setText(event.getNewText());
              ((TextField) control).setCursorPosition((int) state);
              control.setDirty(false);
            }
          } else if (control instanceof Scrollable) {
            if (data.equals("HORIZONTAL") || data.equals("VERTICAL")) {
              Orientation axis = Orientation.valueOf(data);
              Scrollable scroll = (Scrollable) control;
View Full Code Here

  public void run(int playerId) {
    SpoutPlayer player = SpoutManager.getPlayerFromId(playerId);
    if (player != null) {
      PopupScreen popup = player.getMainScreen().getActivePopup();
      if (popup != null) {
        Widget w = popup.getWidget(widgetId);
        if (w != null && w instanceof Control) {
          ((Control) w).setFocus(focus);
        }
      }
    }
View Full Code Here

  @Override
  public void run(int playerId) {
    SpoutPlayer player = SpoutManager.getPlayerFromId(playerId);

    Widget w = null;
    if (player.getCurrentScreen() != null) {
      w = player.getCurrentScreen().getWidget(uuid);
    }
    if (w == null) {
      w = player.getMainScreen().getWidget(uuid);
View Full Code Here

TOP

Related Classes of org.getspout.spoutapi.gui.Widget

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.