本文整理匯總了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 );
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
}
示例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;
}
}
示例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;
}
示例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 );
}
}
}
示例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 );
}
}
示例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;
}
示例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);
}
示例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;
}