Package org.getspout.spoutapi.event.screen

Examples of org.getspout.spoutapi.event.screen.SliderDragEvent


            }
            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")) {
View Full Code Here

TOP

Related Classes of org.getspout.spoutapi.event.screen.SliderDragEvent

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.