Examples of Transferable


Examples of ae.java.awt.datatransfer.Transferable

        }

        initContext();

        final ClipboardOwner oldOwner = this.owner;
        final Transferable oldContents = this.contents;

        try {
            this.owner = owner;
            this.contents = new TransferableProxy(contents, true);
View Full Code Here

Examples of com.inspiresoftware.lib.dto.geda.annotations.Transferable

    private static Map<Occurrence, AdviceConfig> resolveConfiguration(final Method method,
                                                                      final Class<?> targetClass,
                                                                      final boolean trySpecific) {

        Method specificMethod = method;
        Transferable annotation = specificMethod.getAnnotation(Transferable.class);

        if (annotation == null && trySpecific) {

            specificMethod = AopUtils.getMostSpecificMethod(method, targetClass);
            annotation = specificMethod.getAnnotation(Transferable.class);
View Full Code Here

Examples of com.vaadin.event.Transferable

            return new Not(SourceIsTarget.get());
        }

        @Override
        public void drop(final DragAndDropEvent dropEvent) {
            final Transferable transferable = dropEvent.getTransferable();
            final Component sourceComponent = transferable.getSourceComponent();
            if (sourceComponent instanceof WrappedComponent) {
                final TargetDetails dropTargetData = dropEvent
                        .getTargetDetails();
                final DropTarget target = dropTargetData.getTarget();
View Full Code Here

Examples of java.awt.datatransfer.Transferable

  }

  public void drop(DropTargetDropEvent e) {
    e.acceptDrop(e.getDropAction());
    this.paintImmediately(mCueLine.getBounds());
    Transferable transfer = e.getTransferable();

    if(transfer.isDataFlavorSupported(new DataFlavor(TreePath.class, "FavoriteNodeExport"))) {
      try {
        FavoriteNode node = mTransferNode;
        FavoriteNode parent = (FavoriteNode)node.getParent();

        int row = getClosestRowForLocation(e.getLocation().x, e.getLocation().y);
View Full Code Here

Examples of java.awt.datatransfer.Transferable

  public void drop(DropTargetDropEvent e) {

    // Drop the TransferAction
    e.acceptDrop(e.getDropAction());
    Transferable tr = e.getTransferable();
    DataFlavor[] flavors = tr.getTransferDataFlavors();
    try {
      String name = (String) tr.getTransferData(flavors[0]);
      int index = ((Integer) tr.getTransferData(flavors[1])).intValue();
      Action separator = DefaultToolBarModel.getInstance().getSeparatorAction();
      Action glue = DefaultToolBarModel.getInstance().getGlueAction();
      Action space = DefaultToolBarModel.getInstance().getSpaceAction();

      JComponent target = (JComponent) ((DropTarget) e.getSource())
View Full Code Here

Examples of java.awt.datatransfer.Transferable

    clip.setContents(new Data(data), this);
  }
 
  public boolean canPaste() {
    Clipboard clip = editor.getToolkit().getSystemClipboard();
    Transferable xfer = clip.getContents(this);
    return xfer.isDataFlavorSupported(binaryFlavor);
  }
View Full Code Here

Examples of java.awt.datatransfer.Transferable

    return xfer.isDataFlavorSupported(binaryFlavor);
  }
 
  public void paste() {
    Clipboard clip = editor.getToolkit().getSystemClipboard();
    Transferable xfer = clip.getContents(this);
    int[] data;
    if (xfer.isDataFlavorSupported(binaryFlavor)) {
      try {
        data = (int[]) xfer.getTransferData(binaryFlavor);
      } catch (UnsupportedFlavorException e) {
        return;
      } catch (IOException e) {
        return;
      }
    } else if (xfer.isDataFlavorSupported(DataFlavor.stringFlavor)) {
      String buf;
      try {
        buf = (String) xfer.getTransferData(DataFlavor.stringFlavor);
      } catch (UnsupportedFlavorException e) {
        return;
      } catch (IOException e) {
        return;
      }
View Full Code Here

Examples of java.awt.datatransfer.Transferable

      try {
        if (drawImage) {
          clearImage();
        }
        int action = dtde.getDropAction();
        Transferable transferable = dtde.getTransferable();
        Point pt = dtde.getLocation();
        if (transferable
            .isDataFlavorSupported(NODE_FLAVOR)
            && controller.canPerformAction(tree, draggedNode, action, pt)) {
          TreePath pathTarget = tree.getPathForLocation(pt.x, pt.y);
          Object node = transferable.getTransferData(NODE_FLAVOR);
          Object newParentNode = pathTarget.getLastPathComponent();
          if (controller.executeDrop(tree, node, newParentNode, action)) {
            dtde.acceptDrop(action);
            dtde.dropComplete(true);
            return;
View Full Code Here

Examples of java.awt.datatransfer.Transferable

      comp.paste();
    }

    public boolean isEnabled() {
      if (comp.isEditable() && comp.isEnabled()) {
        Transferable contents = Toolkit.getDefaultToolkit().getSystemClipboard().getContents(this);
        return contents.isDataFlavorSupported(DataFlavor.stringFlavor);
      } else {
        return false;
      }
    }
View Full Code Here

Examples of java.awt.datatransfer.Transferable

    }
  }

  public void drop(DropTargetDropEvent e) {
    e.acceptDrop(e.getDropAction());
    Transferable tr = e.getTransferable();
     
    DataFlavor[] flavors = tr.getTransferDataFlavors();
   
    // If theTransferable is a TransferEntries drop it
    if(flavors != null && flavors.length == 2 &&
        flavors[0].getHumanPresentableName().equals("Indices") &&
        flavors[1].getHumanPresentableName().equals("Source")) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.