當前位置: 首頁>>代碼示例>>Java>>正文


Java DragGestureListener類代碼示例

本文整理匯總了Java中java.awt.dnd.DragGestureListener的典型用法代碼示例。如果您正苦於以下問題:Java DragGestureListener類的具體用法?Java DragGestureListener怎麽用?Java DragGestureListener使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


DragGestureListener類屬於java.awt.dnd包,在下文中一共展示了DragGestureListener類的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createDragGestureRecognizer

import java.awt.dnd.DragGestureListener; //導入依賴的package包/類
@Override
public <T extends DragGestureRecognizer> T
    createDragGestureRecognizer(Class<T> abstractRecognizerClass,
                                DragSource ds, Component c, int srcActions,
                                DragGestureListener dgl)
{
    final LightweightFrame f = SunToolkit.getLightweightFrame(c);
    if (f != null) {
        return f.createDragGestureRecognizer(abstractRecognizerClass, ds, c, srcActions, dgl);
    }

    if (MouseDragGestureRecognizer.class.equals(abstractRecognizerClass))
        return (T)new WMouseDragGestureRecognizer(ds, c, srcActions, dgl);
    else
        return null;
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:17,代碼來源:WToolkit.java

示例2: createDragGestureRecognizer

import java.awt.dnd.DragGestureListener; //導入依賴的package包/類
public <T extends DragGestureRecognizer> T
createDragGestureRecognizer(Class<T> recognizerClass,
                DragSource ds,
                Component c,
                int srcActions,
                DragGestureListener dgl)
{
    final LightweightFrame f = SunToolkit.getLightweightFrame(c);
    if (f != null) {
        return f.createDragGestureRecognizer(recognizerClass, ds, c, srcActions, dgl);
    }

    if (MouseDragGestureRecognizer.class.equals(recognizerClass))
        return (T)new XMouseDragGestureRecognizer(ds, c, srcActions, dgl);
    else
        return null;
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:18,代碼來源:XToolkit.java

示例3: createDragGestureRecognizer

import java.awt.dnd.DragGestureListener; //導入依賴的package包/類
@Override
@SuppressWarnings("unchecked")
public <T extends DragGestureRecognizer> T
createDragGestureRecognizer(Class<T> recognizerClass,
                DragSource ds,
                Component c,
                int srcActions,
                DragGestureListener dgl)
{
    final LightweightFrame f = SunToolkit.getLightweightFrame(c);
    if (f != null) {
        return f.createDragGestureRecognizer(recognizerClass, ds, c, srcActions, dgl);
    }

    if (MouseDragGestureRecognizer.class.equals(recognizerClass))
        return (T)new XMouseDragGestureRecognizer(ds, c, srcActions, dgl);
    else
        return null;
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:20,代碼來源:XToolkit.java

示例4: createDragGestureRecognizer

import java.awt.dnd.DragGestureListener; //導入依賴的package包/類
@Override
@SuppressWarnings("unchecked")
public <T extends DragGestureRecognizer> T
    createDragGestureRecognizer(Class<T> abstractRecognizerClass,
                                DragSource ds, Component c, int srcActions,
                                DragGestureListener dgl)
{
    final LightweightFrame f = SunToolkit.getLightweightFrame(c);
    if (f != null) {
        return f.createDragGestureRecognizer(abstractRecognizerClass, ds, c, srcActions, dgl);
    }

    if (MouseDragGestureRecognizer.class.equals(abstractRecognizerClass))
        return (T)new WMouseDragGestureRecognizer(ds, c, srcActions, dgl);
    else
        return null;
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:18,代碼來源:WToolkit.java

示例5: createDragGestureRecognizer

import java.awt.dnd.DragGestureListener; //導入依賴的package包/類
public <T extends DragGestureRecognizer> T
createDragGestureRecognizer(Class<T> recognizer, DragSource ds,
                            Component comp, int actions,
                            DragGestureListener l)
{
  if (recognizer.getName().equals("java.awt.dnd.MouseDragGestureRecognizer")
      && ! GraphicsEnvironment.isHeadless())
    {
      GtkMouseDragGestureRecognizer gestureRecognizer
        = new GtkMouseDragGestureRecognizer(ds, comp, actions, l);
      gestureRecognizer.registerListeners();
      return recognizer.cast(gestureRecognizer);
    }
  else
    {
      return null;
    }
}
 
開發者ID:vilie,項目名稱:javify,代碼行數:19,代碼來源:GtkToolkit.java

示例6: createDragGestureRecognizer

import java.awt.dnd.DragGestureListener; //導入依賴的package包/類
public <T extends DragGestureRecognizer> T
createDragGestureRecognizer(Class<T> recognizer, DragSource ds, 
                            Component comp, int actions,
                            DragGestureListener l)
{
  if (recognizer.getName().equals("java.awt.dnd.MouseDragGestureRecognizer")
      && ! GraphicsEnvironment.isHeadless())
    {
      GtkMouseDragGestureRecognizer gestureRecognizer
        = new GtkMouseDragGestureRecognizer(ds, comp, actions, l);
      gestureRecognizer.registerListeners();
      return recognizer.cast(gestureRecognizer);
    }
  else
    {
      return null;
    }
}
 
開發者ID:nmldiegues,項目名稱:jvm-stm,代碼行數:19,代碼來源:GtkToolkit.java

示例7: createMapView

import java.awt.dnd.DragGestureListener; //導入依賴的package包/類
protected MapView createMapView(Controller controller, MindMapMapModel model) {
	MapView mapView = new MapView(model, controller) {
		DragGestureListener getNodeDragListener() {
			return null;
		}

		DropTargetListener getNodeDropListener() {
			return null;
		}

		public void selectAsTheOnlyOneSelected(NodeView pNewSelected,
				boolean pRequestFocus) {
		}

	};
	return mapView;
}
 
開發者ID:iwabuchiken,項目名稱:freemind_1.0.0_20140624_214725,代碼行數:18,代碼來源:IndependantMapViewCreator.java

示例8: addTo

import java.awt.dnd.DragGestureListener; //導入依賴的package包/類
public void addTo(Buildable parent) {
  panel.setDropTarget(AbstractDragHandler.makeDropTarget(panel, DnDConstants.ACTION_MOVE, null));

  DragGestureListener dragGestureListener = new DragGestureListener() {
    public void dragGestureRecognized(DragGestureEvent dge) {
      startDrag();
      AbstractDragHandler.getTheDragHandler().dragGestureRecognized(dge);
    }
  };
  DragSource.getDefaultDragSource().createDefaultDragGestureRecognizer(panel, DnDConstants.ACTION_MOVE, dragGestureListener);
}
 
開發者ID:ajmath,項目名稱:VASSAL-src,代碼行數:12,代碼來源:PieceSlot.java

示例9: registerDndHandlers

import java.awt.dnd.DragGestureListener; //導入依賴的package包/類
private void registerDndHandlers()
{
	new DragSource().createDefaultDragGestureRecognizer(list, DnDConstants.ACTION_COPY, new DragGestureListener()
	{
		@Override
		public void dragGestureRecognized(DragGestureEvent dge)
		{
			Transferable t = new FileInfoTransferable(getSelectedFile());
			dge.startDrag(DragSource.DefaultMoveDrop, t);
		}
	});

	DnDUtils.registerDropHandler(this, dropHandlers, new HoverHandler()
	{
		@Override
		public void hovering(DropTargetDragEvent e)
		{
			FileInfo fi = getFileUnderMouseCursor();
			if( fi == null )
			{
				int i = getListIndexUnderPoint(e.getLocation());
				if( i >= 0 )
				{
					fi = model.get(i);
				}
			}

			if( fi != null && fi.isDirectory() )
			{
				list.setSelectedValue(fi, true);
			}
			else
			{
				list.getSelectionModel().clearSelection();
			}
		}
	});
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:39,代碼來源:FileListPanel.java

示例10: createDragGestureRecognizer

import java.awt.dnd.DragGestureListener; //導入依賴的package包/類
/**
 * Create a drag gesture recognizer for the lightweight frame.
 */
default public <T extends DragGestureRecognizer> T createDragGestureRecognizer(
        Class<T> abstractRecognizerClass,
        DragSource ds, Component c, int srcActions,
        DragGestureListener dgl)
{
    return null;
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:11,代碼來源:LightweightContent.java

示例11: createDragGestureRecognizer

import java.awt.dnd.DragGestureListener; //導入依賴的package包/類
public <T extends DragGestureRecognizer> T createDragGestureRecognizer(
        Class<T> abstractRecognizerClass,
        DragSource ds, Component c, int srcActions,
        DragGestureListener dgl)
{
    return content == null ? null : content.createDragGestureRecognizer(
            abstractRecognizerClass, ds, c, srcActions, dgl);
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:9,代碼來源:JLightweightFrame.java

示例12: installDragGestureHandler

import java.awt.dnd.DragGestureListener; //導入依賴的package包/類
/**
 * 
 */
protected void installDragGestureHandler() {
  DragGestureListener dragGestureListener = new DragGestureListener() {
    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)
              .createTransferable(graphComponent);

          if (t != null) {
            e.startDrag(null, mxSwingConstants.EMPTY_IMAGE, new Point(), t,
                new DragSourceAdapter() {

                  /**
                   * 
                   */
                  public void dragDropEnd(DragSourceDropEvent dsde) {
                    ((mxGraphTransferHandler) th).exportDone(graphComponent, t,
                        TransferHandler.NONE);
                    first = null;
                  }
                });
          }
        }
      }
    }
  };

  DragSource dragSource = new DragSource();
  dragSource.createDefaultDragGestureRecognizer(graphComponent.getGraphControl(),
      (isCloneEnabled()) ? DnDConstants.ACTION_COPY_OR_MOVE : DnDConstants.ACTION_MOVE,
      dragGestureListener);
}
 
開發者ID:ModelWriter,項目名稱:Tarski,代碼行數:38,代碼來源:mxGraphHandler.java

示例13: createDragGestureRecognizer

import java.awt.dnd.DragGestureListener; //導入依賴的package包/類
@Override
public <T extends DragGestureRecognizer> T
    createDragGestureRecognizer(Class<T> abstractRecognizerClass,
                                DragSource ds, Component c,
                                int srcActions, DragGestureListener dgl)
{
    return null;
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:9,代碼來源:HeadlessToolkit.java


注:本文中的java.awt.dnd.DragGestureListener類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。