Java Doc for DropTarget.java in  » 6.0-JDK-Core » AWT » java » awt » dnd » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » AWT » java.awt.dnd 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.awt.dnd.DropTarget

DropTarget
public class DropTarget implements DropTargetListener,Serializable(Code)
The DropTarget is associated with a Component when that Component wishes to accept drops during Drag and Drop operations.

Each DropTarget is associated with a FlavorMap. The default FlavorMap hereafter designates the FlavorMap returned by SystemFlavorMap.getDefaultFlavorMap().
version:
   1.59, 06/05/07
since:
   1.2


Inner Class :protected static class DropTargetAutoScroller implements ActionListener

Field Summary
 intactions
     Default permissible actions supported by this DropTarget.
 booleanactive
     true if the DropTarget is accepting Drag & Drop operations.

Constructor Summary
public  DropTarget(Component c, int ops, DropTargetListener dtl, boolean act, FlavorMap fm)
     Creates a new DropTarget given the Component to associate itself with, an int representing the default acceptable action(s) to support, a DropTargetListener to handle event processing, a boolean indicating if the DropTarget is currently accepting drops, and a FlavorMap to use (or null for the default FlavorMap).
public  DropTarget(Component c, int ops, DropTargetListener dtl, boolean act)
     Creates a DropTarget given the Component to associate itself with, an int representing the default acceptable action(s) to support, a DropTargetListener to handle event processing, and a boolean indicating if the DropTarget is currently accepting drops.
public  DropTarget()
     Creates a DropTarget.
public  DropTarget(Component c, DropTargetListener dtl)
     Creates a DropTarget given the Component to associate itself with, and the DropTargetListener to handle event processing.
public  DropTarget(Component c, int ops, DropTargetListener dtl)
     Creates a DropTarget given the Component to associate itself with, an int representing the default acceptable action(s) to support, and a DropTargetListener to handle event processing.

Method Summary
public synchronized  voidaddDropTargetListener(DropTargetListener dtl)
     Adds a new DropTargetListener (UNICAST SOURCE).
public  voidaddNotify(ComponentPeer peer)
     Notify the DropTarget that it has been associated with a Component This method is usually called from java.awt.Component.addNotify() of the Component associated with this DropTarget to notify the DropTarget that a ComponentPeer has been associated with that Component.
protected  voidclearAutoscroll()
    
protected  DropTargetAutoScrollercreateDropTargetAutoScroller(Component c, Point p)
    
protected  DropTargetContextcreateDropTargetContext()
     Creates the DropTargetContext associated with this DropTarget. Subclasses may override this method to instantiate their own DropTargetContext subclass. This call is typically *only* called by the platform's DropTargetContextPeer as a drag operation encounters this DropTarget.
 voiddoSetDefaultActions(int ops)
    
public synchronized  voiddragEnter(DropTargetDragEvent dtde)
     Calls dragEnter on the registered DropTargetListener and passes it the specified DropTargetDragEvent.
public synchronized  voiddragExit(DropTargetEvent dte)
     Calls dragExit on the registered DropTargetListener and passes it the specified DropTargetEvent.
public synchronized  voiddragOver(DropTargetDragEvent dtde)
     Calls dragOver on the registered DropTargetListener and passes it the specified DropTargetDragEvent.
public synchronized  voiddrop(DropTargetDropEvent dtde)
     Calls drop on the registered DropTargetListener and passes it the specified DropTargetDropEvent if this DropTarget is active.
public synchronized  voiddropActionChanged(DropTargetDragEvent dtde)
     Calls dropActionChanged on the registered DropTargetListener and passes it the specified DropTargetDragEvent.
public synchronized  ComponentgetComponent()
     Gets the Component associated with this DropTarget.
public  intgetDefaultActions()
     Gets an int representing the current action(s) supported by this DropTarget.
public  DropTargetContextgetDropTargetContext()
     Gets the DropTargetContext associated with this DropTarget.
public  FlavorMapgetFlavorMap()
     Gets the FlavorMap associated with this DropTarget.
protected  voidinitializeAutoscrolling(Point p)
    
public  booleanisActive()
     Reports whether or not this DropTarget is currently active (ready to accept drops).
public synchronized  voidremoveDropTargetListener(DropTargetListener dtl)
     Removes the current DropTargetListener (UNICAST SOURCE).
public  voidremoveNotify(ComponentPeer peer)
     Notify the DropTarget that it has been disassociated from a Component This method is usually called from java.awt.Component.removeNotify() of the Component associated with this DropTarget to notify the DropTarget that a ComponentPeer has been disassociated with that Component.
public synchronized  voidsetActive(boolean isActive)
     Sets the DropTarget active if true, inactive if false.
public synchronized  voidsetComponent(Component c)
     Note: this interface is required to permit the safe association of a DropTarget with a Component in one of two ways, either: component.setDropTarget(droptarget); or droptarget.setComponent(component);

The Component will receive drops only if it is enabled.

public  voidsetDefaultActions(int ops)
    
public  voidsetFlavorMap(FlavorMap fm)
     Sets the FlavorMap associated with this DropTarget.
protected  voidupdateAutoscroll(Point dragCursorLocn)
    

Field Detail
actions
int actions(Code)
Default permissible actions supported by this DropTarget.
See Also:   DropTarget.setDefaultActions
See Also:   DropTarget.getDefaultActions



active
boolean active(Code)
true if the DropTarget is accepting Drag & Drop operations.




Constructor Detail
DropTarget
public DropTarget(Component c, int ops, DropTargetListener dtl, boolean act, FlavorMap fm) throws HeadlessException(Code)
Creates a new DropTarget given the Component to associate itself with, an int representing the default acceptable action(s) to support, a DropTargetListener to handle event processing, a boolean indicating if the DropTarget is currently accepting drops, and a FlavorMap to use (or null for the default FlavorMap).

The Component will receive drops only if it is enabled.
Parameters:
  c - The Component with which this DropTarget is associated
Parameters:
  ops - The default acceptable actions for this DropTarget
Parameters:
  dtl - The DropTargetListener for this DropTarget
Parameters:
  act - Is the DropTarget accepting drops.
Parameters:
  fm - The FlavorMap to use, or null for the default FlavorMap
exception:
  HeadlessException - if GraphicsEnvironment.isHeadless()returns true
See Also:   java.awt.GraphicsEnvironment.isHeadless




DropTarget
public DropTarget(Component c, int ops, DropTargetListener dtl, boolean act) throws HeadlessException(Code)
Creates a DropTarget given the Component to associate itself with, an int representing the default acceptable action(s) to support, a DropTargetListener to handle event processing, and a boolean indicating if the DropTarget is currently accepting drops.

The Component will receive drops only if it is enabled.
Parameters:
  c - The Component with which this DropTarget is associated
Parameters:
  ops - The default acceptable actions for this DropTarget
Parameters:
  dtl - The DropTargetListener for this DropTarget
Parameters:
  act - Is the DropTarget accepting drops.
exception:
  HeadlessException - if GraphicsEnvironment.isHeadless()returns true
See Also:   java.awt.GraphicsEnvironment.isHeadless




DropTarget
public DropTarget() throws HeadlessException(Code)
Creates a DropTarget.
exception:
  HeadlessException - if GraphicsEnvironment.isHeadless()returns true
See Also:   java.awt.GraphicsEnvironment.isHeadless



DropTarget
public DropTarget(Component c, DropTargetListener dtl) throws HeadlessException(Code)
Creates a DropTarget given the Component to associate itself with, and the DropTargetListener to handle event processing.

The Component will receive drops only if it is enabled.
Parameters:
  c - The Component with which this DropTarget is associated
Parameters:
  dtl - The DropTargetListener for this DropTarget
exception:
  HeadlessException - if GraphicsEnvironment.isHeadless()returns true
See Also:   java.awt.GraphicsEnvironment.isHeadless




DropTarget
public DropTarget(Component c, int ops, DropTargetListener dtl) throws HeadlessException(Code)
Creates a DropTarget given the Component to associate itself with, an int representing the default acceptable action(s) to support, and a DropTargetListener to handle event processing.

The Component will receive drops only if it is enabled.
Parameters:
  c - The Component with which this DropTarget is associated
Parameters:
  ops - The default acceptable actions for this DropTarget
Parameters:
  dtl - The DropTargetListener for this DropTarget
exception:
  HeadlessException - if GraphicsEnvironment.isHeadless()returns true
See Also:   java.awt.GraphicsEnvironment.isHeadless





Method Detail
addDropTargetListener
public synchronized void addDropTargetListener(DropTargetListener dtl) throws TooManyListenersException(Code)
Adds a new DropTargetListener (UNICAST SOURCE).


Parameters:
  dtl - The new DropTargetListener

TooManyListenersException if a DropTargetListener is already added to thisDropTarget.




addNotify
public void addNotify(ComponentPeer peer)(Code)
Notify the DropTarget that it has been associated with a Component This method is usually called from java.awt.Component.addNotify() of the Component associated with this DropTarget to notify the DropTarget that a ComponentPeer has been associated with that Component. Calling this method, other than to notify this DropTarget of the association of the ComponentPeer with the Component may result in a malfunction of the DnD system.


Parameters:
  peer - The Peer of the Component we are associated with!




clearAutoscroll
protected void clearAutoscroll()(Code)
clear autoscrolling



createDropTargetAutoScroller
protected DropTargetAutoScroller createDropTargetAutoScroller(Component c, Point p)(Code)
create an embedded autoscroller


Parameters:
  c - the Component
Parameters:
  p - the Point




createDropTargetContext
protected DropTargetContext createDropTargetContext()(Code)
Creates the DropTargetContext associated with this DropTarget. Subclasses may override this method to instantiate their own DropTargetContext subclass. This call is typically *only* called by the platform's DropTargetContextPeer as a drag operation encounters this DropTarget. Accessing the Context while no Drag is current has undefined results.



doSetDefaultActions
void doSetDefaultActions(int ops)(Code)



dragEnter
public synchronized void dragEnter(DropTargetDragEvent dtde)(Code)
Calls dragEnter on the registered DropTargetListener and passes it the specified DropTargetDragEvent. Has no effect if this DropTarget is not active.
Parameters:
  dtde - the DropTargetDragEvent
throws:
  NullPointerException - if this DropTargetis active and dtde is null
See Also:   DropTarget.isActive



dragExit
public synchronized void dragExit(DropTargetEvent dte)(Code)
Calls dragExit on the registered DropTargetListener and passes it the specified DropTargetEvent. Has no effect if this DropTarget is not active.

This method itself does not throw any exception for null parameter but for exceptions thrown by the respective method of the listener.
Parameters:
  dte - the DropTargetEvent
See Also:   DropTarget.isActive




dragOver
public synchronized void dragOver(DropTargetDragEvent dtde)(Code)
Calls dragOver on the registered DropTargetListener and passes it the specified DropTargetDragEvent. Has no effect if this DropTarget is not active.
Parameters:
  dtde - the DropTargetDragEvent
throws:
  NullPointerException - if this DropTargetis active and dtde is null
See Also:   DropTarget.isActive



drop
public synchronized void drop(DropTargetDropEvent dtde)(Code)
Calls drop on the registered DropTargetListener and passes it the specified DropTargetDropEvent if this DropTarget is active.
Parameters:
  dtde - the DropTargetDropEvent
throws:
  NullPointerException - if dtde is nulland at least one of the following is true: thisDropTarget is not active, or there isno a DropTargetListener registered.
See Also:   DropTarget.isActive



dropActionChanged
public synchronized void dropActionChanged(DropTargetDragEvent dtde)(Code)
Calls dropActionChanged on the registered DropTargetListener and passes it the specified DropTargetDragEvent. Has no effect if this DropTarget is not active.
Parameters:
  dtde - the DropTargetDragEvent
throws:
  NullPointerException - if this DropTargetis active and dtde is null
See Also:   DropTarget.isActive



getComponent
public synchronized Component getComponent()(Code)
Gets the Component associated with this DropTarget.

the current Component




getDefaultActions
public int getDefaultActions()(Code)
Gets an int representing the current action(s) supported by this DropTarget.

the current default actions




getDropTargetContext
public DropTargetContext getDropTargetContext()(Code)
Gets the DropTargetContext associated with this DropTarget.

the DropTargetContext associated with this DropTarget.




getFlavorMap
public FlavorMap getFlavorMap()(Code)
Gets the FlavorMap associated with this DropTarget. If no FlavorMap has been set for this DropTarget, it is associated with the default FlavorMap.

the FlavorMap for this DropTarget




initializeAutoscrolling
protected void initializeAutoscrolling(Point p)(Code)
initialize autoscrolling


Parameters:
  p - the Point




isActive
public boolean isActive()(Code)
Reports whether or not this DropTarget is currently active (ready to accept drops).

true if active, false if not




removeDropTargetListener
public synchronized void removeDropTargetListener(DropTargetListener dtl)(Code)
Removes the current DropTargetListener (UNICAST SOURCE).


Parameters:
  dtl - the DropTargetListener to deregister.




removeNotify
public void removeNotify(ComponentPeer peer)(Code)
Notify the DropTarget that it has been disassociated from a Component This method is usually called from java.awt.Component.removeNotify() of the Component associated with this DropTarget to notify the DropTarget that a ComponentPeer has been disassociated with that Component. Calling this method, other than to notify this DropTarget of the disassociation of the ComponentPeer from the Component may result in a malfunction of the DnD system.


Parameters:
  peer - The Peer of the Component we are being disassociated from!




setActive
public synchronized void setActive(boolean isActive)(Code)
Sets the DropTarget active if true, inactive if false.


Parameters:
  isActive - sets the DropTarget (in)active.




setComponent
public synchronized void setComponent(Component c)(Code)
Note: this interface is required to permit the safe association of a DropTarget with a Component in one of two ways, either: component.setDropTarget(droptarget); or droptarget.setComponent(component);

The Component will receive drops only if it is enabled.
Parameters:
  c - The new Component this DropTarget is to be associated with.




setDefaultActions
public void setDefaultActions(int ops)(Code)
Sets the default acceptable actions for this DropTarget


Parameters:
  ops - the default actions


See Also:   java.awt.dnd.DnDConstants




setFlavorMap
public void setFlavorMap(FlavorMap fm)(Code)
Sets the FlavorMap associated with this DropTarget.


Parameters:
  fm - the new FlavorMap, or null to associate the default FlavorMap with this DropTarget.




updateAutoscroll
protected void updateAutoscroll(Point dragCursorLocn)(Code)
update autoscrolling with current cursor locn


Parameters:
  dragCursorLocn - the Point




Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.