Package org.spoutcraft.api.gui

Examples of org.spoutcraft.api.gui.ListWidget


            handled = true;
            break;
          }
        }
        if (widget instanceof ListWidget) {
          ListWidget lw = (ListWidget) widget;
          if (lw.isEnabled() && lw.isFocus()) {
            PacketControlAction action = null;
            if (Keyboard.getEventKey() == Keyboard.KEY_DOWN && Keyboard.getEventKeyState()) {
              handled = true;
              lw.shiftSelection(1);
              lw.onSelected(lw.getSelectedRow(), false);
              lw.getSelectedItem().onClick(-1, -1, false);
              action = new PacketControlAction(lw.getScreen() != null ? lw.getScreen() : getScreen(), lw, "selected", lw.getSelectedRow());
            }
            if (Keyboard.getEventKey() == Keyboard.KEY_UP && Keyboard.getEventKeyState()) {
              handled = true;
              lw.shiftSelection(-1);
              lw.onSelected(lw.getSelectedRow(), false);
              lw.getSelectedItem().onClick(-1, -1, false);
              action = new PacketControlAction(lw.getScreen() != null ? lw.getScreen() : getScreen(), lw, "selected", lw.getSelectedRow());
            }
            if (Keyboard.getEventKey() == Keyboard.KEY_RETURN && Keyboard.getEventKeyState()) {
              handled = true;
              if (lw.getSelectedRow() != -1) {
                lw.onSelected(lw.getSelectedRow(), true);
                lw.getSelectedItem().onClick(-1, -1, true);
                action = new PacketControlAction(lw.getScreen() != null ? lw.getScreen() : getScreen(), lw, "doubleclick", lw.getSelectedRow());
              }
            }
            if (action != null) {
              SpoutClient.getInstance().getPacketManager().sendSpoutPacket(action);
              break;
View Full Code Here

TOP

Related Classes of org.spoutcraft.api.gui.ListWidget

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.