Package javax.swing

Examples of javax.swing.TransferHandler$SwingDragGestureRecognizer


   * 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();
      // Not supported in headless environment
      try {
        graph.setTransferHandler(defaultTransferHandler);
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

        viewersList.setDropMode(DropMode.INSERT);
        viewersList.enableInputMethods(true);
        viewersList.setDragEnabled(true);
        viewersList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        viewersList.getSelectionModel().addListSelectionListener(this);
        viewersList.setTransferHandler(new TransferHandler() {

            @Override
            public boolean canImport(TransferHandler.TransferSupport info) {
                // we only import NodeViewers
                if (!info
View Full Code Here

    /**
     * Copies selected rows to the system clipboard.
     */
    public void copySelectedToClipboard() {
        final TransferHandler handler = resultsOutline.getTransferHandler();
        final Toolkit tk = Toolkit.getDefaultToolkit();
        final Clipboard clipboard = tk.getSystemClipboard();
        handler.exportToClipboard(resultsOutline, clipboard, TransferHandler.COPY);
    }
View Full Code Here

      }

    });

    // Shows a nice icon for drag and drop but doesn't import anything
    setTransferHandler(new TransferHandler()
    {
      public boolean canImport(JComponent comp, DataFlavor[] flavors)
      {
        return true;
      }
View Full Code Here

    {
      public void dragGestureRecognized(DragGestureEvent e)
      {
        if (graphComponent.isDragEnabled() && first != null)
        {
          final TransferHandler th = graphComponent
              .getTransferHandler();

          if (th instanceof mxGraphTransferHandler)
          {
            final mxGraphTransferable t = (mxGraphTransferable) ((mxGraphTransferHandler) th)
View Full Code Here

       *
       */
      public Object getCell(MouseEvent e)
      {
        mxIGraphModel model = graphComponent.getGraph().getModel();
        TransferHandler th = graphComponent.getTransferHandler();
        boolean isLocal = th instanceof mxGraphTransferHandler
            && ((mxGraphTransferHandler) th).isLocalDrag();

        mxGraph graph = graphComponent.getGraph();
        Object cell = super.getCell(e);
View Full Code Here

   *
   */
  public void dragEnter(DropTargetDragEvent e)
  {
    JComponent component = getDropTarget(e);
    TransferHandler th = component.getTransferHandler();
    boolean isLocal = th instanceof mxGraphTransferHandler
        && ((mxGraphTransferHandler) th).isLocalDrag();

    if (isLocal)
    {
      canImport = true;
    }
    else
    {
      canImport = graphComponent.isImportEnabled()
          && th.canImport(component, e.getCurrentDataFlavors());
    }

    if (canImport)
    {
      transferBounds = null;
View Full Code Here

   */
  protected static final mxGraphTransferHandler getGraphTransferHandler(
      DropTargetEvent e)
  {
    JComponent component = getDropTarget(e);
    TransferHandler transferHandler = component.getTransferHandler();

    if (transferHandler instanceof mxGraphTransferHandler)
    {
      return (mxGraphTransferHandler) transferHandler;
    }
View Full Code Here

      column = getColumnModel().getColumn(3);
      column.setMaxWidth(12);
      column = getColumnModel().getColumn(4);
      column.setMaxWidth(12);

      setTransferHandler(new TransferHandler()
      {

        /* (non-Javadoc)
         * @see javax.swing.TransferHandler#getSourceActions(javax.swing.JComponent)
         */
 
View Full Code Here

TOP

Related Classes of javax.swing.TransferHandler$SwingDragGestureRecognizer

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.