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().
| Modifier and Type | Class and Description |
|---|---|
| protected static class | DropTarget.
this protected nested class implements autoscrolling |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv int | actions
Default permissible actions supported by this DropTarget. |
| pack-priv boolean | active
|
| private transient DropTarget. | |
| private Component | component
The Component associated with this DropTarget. |
| private transient ComponentPeer | |
| private DropTargetContext | dropTargetContext
The DropTargetContext associated with this DropTarget. |
| private transient DropTargetListener | |
| private transient FlavorMap | |
| private transient boolean | |
| private transient DropTargetPeer | |
| private static final long | serialVersionUID
Use serialVersionUID from JDK 1.4 for interoperability. |
| Access | Constructor and Description |
|---|---|
| public | DropTarget(Component
The c, int Component with which this DropTarget is associatedThe default acceptable actions for this ops, DropTargetListener DropTargetThe dtl, boolean DropTargetListener for this DropTargetIs the act, FlavorMap DropTarget accepting drops.The fm)FlavorMap to use, or null for the default FlavorMapCreates a new DropTarget given the |
| public | DropTarget(Component
The c, int Component with which this DropTarget is associatedThe default acceptable actions for this ops, DropTargetListener DropTargetThe dtl, boolean DropTargetListener for this DropTargetIs the act)DropTarget accepting drops.Creates a |
| public | |
| public | DropTarget(Component
The c, DropTargetListener Component with which this DropTarget is associatedThe dtl)DropTargetListener for this DropTargetCreates a |
| public | DropTarget(Component
The c, int Component with which this DropTarget is associatedThe default acceptable actions for this ops, DropTargetListener DropTargetThe dtl)DropTargetListener for this DropTargetCreates a |
| Modifier and Type | Method and Description |
|---|---|
| public synchronized void | addDropTargetListener(DropTargetListener
The new dtl)DropTargetListenerAdds a new |
| public void | addNotify()
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 void | |
| protected DropTarget. | Returns: an embedded autoscrollerthe c, Point Componentthe p)Pointcreate an embedded autoscroller |
| protected DropTargetContext | Returns: the DropTargetContext associated with this DropTargetCreates the DropTargetContext associated with this DropTarget. |
| pack-priv void | |
| public synchronized void | dragEnter(DropTargetDragEvent
the dtde)DropTargetDragEventImplements java. Calls |
| public synchronized void | dragExit(DropTargetEvent
the dte)DropTargetEventImplements java. Calls |
| public synchronized void | dragOver(DropTargetDragEvent
the dtde)DropTargetDragEventImplements java. Calls |
| public synchronized void | drop(DropTargetDropEvent
the dtde)DropTargetDropEventImplements java. Calls |
| public synchronized void | dropActionChanged(DropTargetDragEvent
the dtde)DropTargetDragEventImplements java. Calls |
| public synchronized Component | |
| public int | Returns: the current default actionsGets an |
| public DropTargetContext | Returns: theDropTargetContext associated with this DropTarget.Gets the |
| public FlavorMap | Returns: the FlavorMap for this DropTargetGets the |
| protected void | |
| public boolean | Returns: true if active, false if notReports whether or not
this |
| private void | |
| public synchronized void | removeDropTargetListener(DropTargetListener
the DropTargetListener to deregister. dtl)Removes the current |
| public void | removeNotify()
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 void | setActive(boolean
sets the isActive)DropTarget (in)active.Sets the DropTarget active if |
| public synchronized void | setComponent(Component
The new c)Component this DropTarget
is to be associated with.The Component will receive drops only if it is enabled. |
| public void | setDefaultActions(int
the default actions ops)Sets the default acceptable actions for this |
| public void | setFlavorMap(FlavorMap
the new fm)FlavorMap, or null to
associate the default FlavorMap with this DropTarget.Sets the |
| protected void | |
| private void |
| actions | back to summary |
|---|---|
| pack-priv int actions Default permissible actions supported by this DropTarget.
| |
| active | back to summary |
|---|---|
| pack-priv boolean active
| |
| autoScroller | back to summary |
|---|---|
| private transient DropTarget. | |
| component | back to summary |
|---|---|
| private Component component The Component associated with this DropTarget. | |
| componentPeer | back to summary |
|---|---|
| private transient ComponentPeer componentPeer | |
| dropTargetContext | back to summary |
|---|---|
| private DropTargetContext dropTargetContext The DropTargetContext associated with this DropTarget. | |
| dtListener | back to summary |
|---|---|
| private transient DropTargetListener dtListener | |
| flavorMap | back to summary |
|---|---|
| private transient FlavorMap flavorMap | |
| isDraggingInside | back to summary |
|---|---|
| private transient boolean isDraggingInside | |
| nativePeer | back to summary |
|---|---|
| private transient DropTargetPeer nativePeer | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Use serialVersionUID from JDK 1.4 for interoperability. | |
| DropTarget | back to summary |
|---|---|
| public DropTarget(Component c, int ops, DropTargetListener dtl, boolean act, FlavorMap fm) throws HeadlessException Creates a new DropTarget given the The Component will receive drops only if it is enabled.
| |
| DropTarget | back to summary |
|---|---|
| public DropTarget(Component c, int ops, DropTargetListener dtl, boolean act) throws HeadlessException Creates a The Component will receive drops only if it is enabled.
| |
| DropTarget | back to summary |
|---|---|
| public DropTarget() throws HeadlessException Creates a
| |
| DropTarget | back to summary |
|---|---|
| public DropTarget(Component c, DropTargetListener dtl) throws HeadlessException Creates a The Component will receive drops only if it is enabled.
| |
| DropTarget | back to summary |
|---|---|
| public DropTarget(Component c, int ops, DropTargetListener dtl) throws HeadlessException Creates a The Component will receive drops only if it is enabled.
| |
| addDropTargetListener | back to summary |
|---|---|
| public synchronized void addDropTargetListener(DropTargetListener dtl) throws TooManyListenersException Adds a new
| |
| addNotify | back to summary |
|---|---|
| public void addNotify() 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. | |
| clearAutoscroll | back to summary |
|---|---|
| protected void clearAutoscroll() clear autoscrolling | |
| createDropTargetAutoScroller | back to summary |
|---|---|
| protected DropTarget. create an embedded autoscroller
| |
| createDropTargetContext | back to summary |
|---|---|
| protected DropTargetContext createDropTargetContext() 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 | back to summary |
|---|---|
| pack-priv void doSetDefaultActions(int ops) | |
| dragEnter | back to summary |
|---|---|
| public synchronized void dragEnter(DropTargetDragEvent dtde) Implements java. Calls
| |
| dragExit | back to summary |
|---|---|
| public synchronized void dragExit(DropTargetEvent dte) Implements java. Calls This method itself does not throw any exception for null parameter but for exceptions thrown by the respective method of the listener.
| |
| dragOver | back to summary |
|---|---|
| public synchronized void dragOver(DropTargetDragEvent dtde) Implements java. Calls
| |
| drop | back to summary |
|---|---|
| public synchronized void drop(DropTargetDropEvent dtde) Implements java. Calls
| |
| dropActionChanged | back to summary |
|---|---|
| public synchronized void dropActionChanged(DropTargetDragEvent dtde) Implements java. Calls
| |
| getComponent | back to summary |
|---|---|
| public synchronized Component getComponent() Gets the
| |
| getDefaultActions | back to summary |
|---|---|
| public int getDefaultActions() Gets an
| |
| getDropTargetContext | back to summary |
|---|---|
| public DropTargetContext getDropTargetContext() Gets the
| |
| getFlavorMap | back to summary |
|---|---|
| public FlavorMap getFlavorMap() Gets the
| |
| initializeAutoscrolling | back to summary |
|---|---|
| protected void initializeAutoscrolling(Point p) initialize autoscrolling
| |
| isActive | back to summary |
|---|---|
| public boolean isActive() Reports whether or not
this
| |
| readObject | back to summary |
|---|---|
| private void readObject(ObjectInputStream s) throws ClassNotFoundException, IOException Deserializes this
| |
| removeDropTargetListener | back to summary |
|---|---|
| public synchronized void removeDropTargetListener(DropTargetListener dtl) Removes the current
| |
| removeNotify | back to summary |
|---|---|
| public void removeNotify() 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. | |
| setActive | back to summary |
|---|---|
| public synchronized void setActive(boolean isActive) Sets the DropTarget active if
| |
| setComponent | back to summary |
|---|---|
| public synchronized void setComponent(Component c) Note this interface is required to permit the safe association
of a DropTarget with a Component in one of two ways, either:
The Component will receive drops only if it is enabled.
| |
| setDefaultActions | back to summary |
|---|---|
| public void setDefaultActions(int ops) Sets the default acceptable actions for this
| |
| setFlavorMap | back to summary |
|---|---|
| public void setFlavorMap(FlavorMap fm) Sets the
| |
| updateAutoscroll | back to summary |
|---|---|
| protected void updateAutoscroll(Point dragCursorLocn) update autoscrolling with current cursor location
| |
| writeObject | back to summary |
|---|---|
| private void writeObject(ObjectOutputStream s) throws IOException Serializes this
| |
| Modifier and Type | Field and Description |
|---|---|
| private Autoscroll | |
| private Component | |
| private int | |
| private Rectangle | |
| private Point | |
| private Rectangle | |
| private Point | |
| private Timer |
| Access | Constructor and Description |
|---|---|
| protected | DropTargetAutoScroller(Component
the c, Point Componentthe p)Pointconstruct a DropTargetAutoScroller |
| Modifier and Type | Method and Description |
|---|---|
| public synchronized void | actionPerformed(ActionEvent
the e)ActionEventImplements java. cause autoscroll to occur |
| protected void | |
| protected synchronized void | |
| private void |
| autoScroll | back to summary |
|---|---|
| private Autoscroll autoScroll | |
| component | back to summary |
|---|---|
| private Component component | |
| hysteresis | back to summary |
|---|---|
| private int hysteresis | |
| inner | back to summary |
|---|---|
| private Rectangle inner | |
| locn | back to summary |
|---|---|
| private Point locn | |
| outer | back to summary |
|---|---|
| private Rectangle outer | |
| prev | back to summary |
|---|---|
| private Point prev | |
| timer | back to summary |
|---|---|
| private Timer timer | |
| DropTargetAutoScroller | back to summary |
|---|---|
| protected DropTargetAutoScroller(Component c, Point p) construct a DropTargetAutoScroller | |
| actionPerformed | back to summary |
|---|---|
| public synchronized void actionPerformed(ActionEvent e) Implements java. cause autoscroll to occur
| |
| stop | back to summary |
|---|---|
| protected void stop() cause autoscrolling to stop | |
| updateLocation | back to summary |
|---|---|
| protected synchronized void updateLocation(Point newLocn) cause autoscroll to occur
| |
| updateRegion | back to summary |
|---|---|
| private void updateRegion() update the geometry of the autoscroll region
| |