本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
}
示例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;
}
}
示例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;
}
示例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);
}
示例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();
}
}
});
}
示例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;
}
示例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);
}
示例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);
}
示例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;
}