Package org.buildndeploy.client.ui.file

Examples of org.buildndeploy.client.ui.file.IconPanel$ImageDragController


     
      @Override
      public void onMessage(String s, MessageType t) {
        System.out.println("got message " + s);
        Beanery factory = AppController.getBeanFactory();
        IconPanel iconPanel = mainPanel.draggablePanel;
        switch(t) {
        case AddEvent:
          JsArray<BlobInfoJS> c = JsonUtils.safeEval(s);
          for (int i = 0; i < c.length(); i++) {
            BlobInfoJS x = c.get(i);
            iconPanel.add(x);
          }
        break;
        case MoveEvent:
          AutoBean<MoveEvent> moveBean = AutoBeanCodex.decode(factory, MoveEvent.class, s);
          MoveEvent moveEvent = moveBean.as();
          moveIcon(moveEvent.getBlobKey(), moveEvent.getFrom(), moveEvent.getTo());
          break;
        case DeleteEvent:
          iconPanel.delete(s);
        break;
        default:
          // Ignore
        }
      }
View Full Code Here


      }
    });
  }
 
  private void moveIcon(String blobKey, int oldIndex, int newIndex) {
    IconPanel iconPanel = mainPanel.draggablePanel;
    List<BlobInfoJS> oldFiles = iconPanel.getFiles();
    BlobInfoJS toAdd = oldFiles.get(oldIndex);
    if (toAdd.getBlobKey().equals(blobKey)) {
      iconPanel.insert(toAdd, newIndex);
      // Increment to account for shift after insert
      if (oldIndex > newIndex)
        oldIndex++;
      iconPanel.delete(oldIndex, false);
    }
  }
View Full Code Here

  // ========================================================================= //
  //      PRIVATE METHODS                            //
  // ========================================================================= //
 
  private void populateFilePanel(JsArray<BlobInfoJS> c) {
    IconPanel iconPanel = mainPanel.draggablePanel;
   
    for (int i = 0; i < c.length(); i++) {
      BlobInfoJS x = c.get(i);
      iconPanel.add(x);
    }
  }
View Full Code Here

TOP

Related Classes of org.buildndeploy.client.ui.file.IconPanel$ImageDragController

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.