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


Java DragGestureRecognizer類代碼示例

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


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

示例1: remove

import java.awt.dnd.DragGestureRecognizer; //導入依賴的package包/類
void remove( CategoryDescriptor descriptor ) {
    ArrayList<DragGestureRecognizer> recognizersToRemove = new ArrayList<DragGestureRecognizer>( 2 );
    for( Iterator<DragGestureRecognizer> i=recognizers.iterator(); i.hasNext(); ) {
        DragGestureRecognizer dgr = i.next();
        if( dgr.getComponent() == descriptor.getButton()
            || dgr.getComponent() == descriptor.getList() ) {
            recognizersToRemove.add( dgr );
            dgr.removeDragGestureListener( this );
        }
    }
    recognizers.removeAll( recognizersToRemove );
    
    ArrayList<DropTarget> dropTargetsToRemove = new ArrayList<DropTarget>( 2 );
    for( Iterator<DropTarget> i=dropTargets.iterator(); i.hasNext(); ) {
        DropTarget dt = i.next();
        if( dt.getComponent() == descriptor.getButton()
            || dt.getComponent() == descriptor.getList() ) {
            dropTargetsToRemove.add( dt );
            dt.removeDropTargetListener( this );
        }
    }
    dropTargets.removeAll( dropTargetsToRemove );
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:24,代碼來源:DnDSupport.java

示例2: createDragGestureRecognizer

import java.awt.dnd.DragGestureRecognizer; //導入依賴的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

示例3: createDragGestureRecognizer

import java.awt.dnd.DragGestureRecognizer; //導入依賴的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

示例4: createDragGestureRecognizer

import java.awt.dnd.DragGestureRecognizer; //導入依賴的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

示例5: createDragGestureRecognizer

import java.awt.dnd.DragGestureRecognizer; //導入依賴的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

示例6: createDragGestureRecognizer

import java.awt.dnd.DragGestureRecognizer; //導入依賴的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

示例7: createDragGestureRecognizer

import java.awt.dnd.DragGestureRecognizer; //導入依賴的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

示例8: dispose

import java.awt.dnd.DragGestureRecognizer; //導入依賴的package包/類
public void dispose()
{
	try
	{
		DragGestureRecognizer recognizer =
				(DragGestureRecognizer) FieldUtils.readStaticField
				(
					TransferHandler.class,
					"recognizer",
					true
				);
		if(recognizer != null && recognizer.getComponent() == installedOn)
		{
			recognizer.setComponent(null);
		}
	}
	catch(IllegalAccessException e)
	{
		e.printStackTrace();
	}

	installedOn = null;
	folderModel = null;
}
 
開發者ID:justin-espedal,項目名稱:polydes,代碼行數:25,代碼來源:LeafTransferHandler.java

示例9: register

import java.awt.dnd.DragGestureRecognizer; //導入依賴的package包/類
public void register(Component c) {
    synchronized( recognizers ) {
        DragGestureRecognizer dgr = recognizers.get( c );
        if( null == dgr ) {
            dgr = dragSource.createDefaultDragGestureRecognizer(c, DnDConstants.ACTION_MOVE, this);
            recognizers.put( c, dgr );
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:10,代碼來源:DnDSupport.java

示例10: unregister

import java.awt.dnd.DragGestureRecognizer; //導入依賴的package包/類
public void unregister(Component c) {
    synchronized( recognizers ) {
        DragGestureRecognizer dgr = recognizers.get(c);
        if( null != dgr ) {
            dgr.setComponent(null);
        }
        recognizers.remove( c );
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:10,代碼來源:DnDSupport.java

示例11: createDragGestureRecognizer

import java.awt.dnd.DragGestureRecognizer; //導入依賴的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

示例12: createDragGestureRecognizer

import java.awt.dnd.DragGestureRecognizer; //導入依賴的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

示例13: createDragGestureRecognizer

import java.awt.dnd.DragGestureRecognizer; //導入依賴的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.DragGestureRecognizer類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。