当前位置: 首页>>代码示例>>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;未经允许,请勿转载。