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 ); }
@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; }
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; }
@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; }
@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; }
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; } }
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; }
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 ); } } }
public void unregister(Component c) { synchronized( recognizers ) { DragGestureRecognizer dgr = recognizers.get(c); if( null != dgr ) { dgr.setComponent(null); } recognizers.remove( c ); } }
/** * 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; }
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); }
@Override public <T extends DragGestureRecognizer> T createDragGestureRecognizer(Class<T> abstractRecognizerClass, DragSource ds, Component c, int srcActions, DragGestureListener dgl) { return null; }