Package javax.swing

Examples of javax.swing.TransferHandler


    protected void startDragging(MouseEvent event) {
      isDragging = true;
      if (graph.isDragEnabled()) {
        int action = (event.isControlDown() && graph.isCloneable()) ? TransferHandler.COPY
            : TransferHandler.MOVE;
        TransferHandler th = graph.getTransferHandler();
        setInsertionLocation(event.getPoint());
        try {
          th.exportAsDrag(graph, event, action);
        } catch (Exception ex) {
          // Ignore
        }
      }
    }
View Full Code Here


   * Invoked as part from the boilerplate install block. This installs the
   * listeners from BasicGraphUI in the graph.
   */
  protected void installListeners() {
    // Install Local Handlers
    TransferHandler th = graph.getTransferHandler();
    if (th == null || th instanceof UIResource) {
      defaultTransferHandler = createTransferHandler();
      graph.setTransferHandler(defaultTransferHandler);
    }
    if (graphLayoutCache != null) {
View Full Code Here

    graphSelectionListener = null;
  }

  protected void uninstallListeners() {
    // Uninstall Handlers
    TransferHandler th = graph.getTransferHandler();
    if (th == defaultTransferHandler)
      graph.setTransferHandler(null);
    if (graphLayoutCacheListener != null)
      graphLayoutCache
          .removeGraphLayoutCacheListener(graphLayoutCacheListener);
View Full Code Here

    }
    return selfInstance;
  }
    public void mousePressed(MouseEvent e) {
        JComponent c = (JComponent)e.getSource();
        TransferHandler handler = c.getTransferHandler();
        handler.exportAsDrag(c, e, TransferHandler.COPY);
    }
View Full Code Here

    @Override
    public void dragEnter(DropTargetDragEvent e) {
        DataFlavor[] flavors = e.getCurrentDataFlavors();

        JComponent c = (JComponent)e.getDropTargetContext().getComponent();
        TransferHandler importer = c.getTransferHandler();

        if (importer != null && importer.canImport(c, flavors)) {
            canImport = true;
        } else {
            canImport = false;
        }
View Full Code Here

    @Override
    public void drop(DropTargetDropEvent e) {
        int dropAction = e.getDropAction();

        JComponent c = (JComponent)e.getDropTargetContext().getComponent();
        TransferHandler importer = c.getTransferHandler();

        if (canImport && importer != null && actionSupported(dropAction) && isDropable(e.getSource())) {
            e.acceptDrop(dropAction);

            try {
View Full Code Here

    }
    return selfInstance;
  }
    public void mousePressed(MouseEvent e) {
        JComponent c = (JComponent)e.getSource();
        TransferHandler handler = c.getTransferHandler();
        handler.exportAsDrag(c, e, TransferHandler.COPY);
    }
View Full Code Here

    @Override
    public void dragEnter(DropTargetDragEvent e) {
        DataFlavor[] flavors = e.getCurrentDataFlavors();

        JComponent c = (JComponent)e.getDropTargetContext().getComponent();
        TransferHandler importer = c.getTransferHandler();

        if (importer != null && importer.canImport(c, flavors)) {
            canImport = true;
        } else {
            canImport = false;
        }
View Full Code Here

    @Override
    public void drop(DropTargetDropEvent e) {
        int dropAction = e.getDropAction();

        JComponent c = (JComponent)e.getDropTargetContext().getComponent();
        TransferHandler importer = c.getTransferHandler();

        if (canImport && importer != null && actionSupported(dropAction) && isDropable(e.getSource())) {
            e.acceptDrop(dropAction);

            try {
View Full Code Here

    }
    return selfInstance;
  }
    public void mousePressed(MouseEvent e) {
        JComponent c = (JComponent)e.getSource();
        TransferHandler handler = c.getTransferHandler();
        handler.exportAsDrag(c, e, TransferHandler.COPY);
    }
View Full Code Here

TOP

Related Classes of javax.swing.TransferHandler

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.